Ajax Search Lite - Version 4.6.0

Version Description

  • Core reworked to a much better structure
  • Visual Composer bugfix
  • Better shortcode stripping algo
  • More performant context finder
  • imagecache.class.php file removal
  • Animations have been replaced with CSS3 animations
  • Primary and Secondary ordering implemented
  • Placeholder WPML string translation ready
  • Private custom fields are displayed on the back-end now
  • Option saving returns to the parent tab
  • Search box and results override
  • Ajax detection initializer
  • Javascript sources & initialization switch
  • Width and Margin option
  • Results position and width fix for low bar widths
Download this release

Release Info

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

Code changes from version 4.5.5 to 4.6.0

Files changed (123) hide show
  1. ajax-search-lite.php +37 -66
  2. ajax_search.php +2 -10
  3. backend/analytics.php +1 -1
  4. backend/compatibility.php +91 -49
  5. backend/performance_options.php +6 -1
  6. backend/settings.php +13 -23
  7. backend/settings/assets/search_instance.js +25 -0
  8. backend/settings/assets/style.css +40 -1
  9. backend/settings/class/customfields.class.php +0 -1
  10. backend/settings/class/customfselect.class.php +1 -1
  11. backend/settings/class/customposttypeseditable.class.php +0 -1
  12. backend/settings/default_options.php +228 -243
  13. backend/settings/functions.php +0 -325
  14. backend/settings/types.inc.php +2 -1
  15. backend/tabs/instance/advanced_options.php +21 -15
  16. backend/tabs/instance/frontend_options.php +16 -16
  17. backend/tabs/instance/general/autocomplete.php +6 -6
  18. backend/tabs/instance/general/behavior.php +81 -10
  19. backend/tabs/instance/general/ordering.php +32 -0
  20. backend/tabs/instance/general/sources.php +18 -19
  21. backend/tabs/instance/general_options.php +9 -2
  22. backend/tabs/instance/image_options.php +15 -15
  23. backend/tabs/instance/layout/box_layout.php +20 -0
  24. backend/tabs/instance/layout/results_behaviour.php +6 -6
  25. backend/tabs/instance/layout/results_layout.php +16 -7
  26. backend/tabs/instance/layout_options.php +10 -3
  27. backend/tabs/instance/theme/custom_css.php +0 -12
  28. backend/tabs/instance/theme/horizontal_res.php +0 -98
  29. backend/tabs/instance/theme/input_field.php +0 -21
  30. backend/tabs/instance/theme/isotopic_nav.php +0 -43
  31. backend/tabs/instance/theme/isotopic_res.php +0 -92
  32. backend/tabs/instance/theme/magn_load.php +0 -57
  33. backend/tabs/instance/theme/overall_box.php +0 -39
  34. backend/tabs/instance/theme/polaroid_res.php +0 -84
  35. backend/tabs/instance/theme/sett_dropdown.php +0 -74
  36. backend/tabs/instance/theme/typography.php +0 -43
  37. backend/tabs/instance/theme/vertical_res.php +0 -49
  38. css/style-classic-blue.css +2 -2
  39. css/style-curvy-black.css +2 -2
  40. css/style-curvy-blue.css +2 -2
  41. css/style-curvy-red.css +2 -2
  42. css/style-simple-blue.css +0 -4
  43. css/style-simple-grey.css +0 -4
  44. css/style-simple-red.css +0 -4
  45. css/style-underline.css +2 -2
  46. css/style.basic.css +118 -22
  47. functions.php +0 -345
  48. includes/asl_init.class.php +0 -112
  49. includes/cache/index.html +0 -0
  50. includes/cache/timthumb_cacheLastCleanTime.touch +0 -0
  51. includes/classes/actions/actions.inc.php +7 -0
  52. includes/classes/actions/class-asl-abstract.php +57 -0
  53. includes/classes/actions/class-asl-admin-notices.php +47 -0
  54. includes/classes/actions/class-asl-customfonts.php +38 -0
  55. includes/classes/actions/class-asl-stylesheets.php +92 -0
  56. includes/classes/ajax/ajax.inc.php +5 -0
  57. includes/classes/ajax/class-asl-abstract.php +57 -0
  58. includes/classes/ajax/class-asl-search.php +82 -0
  59. includes/{bfi_thumb.php → classes/cache/bfi_thumb.php} +1 -75
  60. includes/classes/cache/cache.inc.php +4 -0
  61. includes/classes/core/class-asl-actions.php +138 -0
  62. includes/classes/core/class-asl-ajax.php +165 -0
  63. includes/classes/core/class-asl-dbman.php +95 -0
  64. includes/classes/core/class-asl-filters.php +139 -0
  65. includes/classes/core/class-asl-globals.php +84 -0
  66. includes/classes/core/class-asl-init.php +186 -0
  67. includes/classes/core/class-asl-instances.php +180 -0
  68. includes/classes/core/class-asl-manager.php +297 -0
  69. includes/classes/core/class-asl-menu.php +101 -0
  70. includes/classes/core/class-asl-shortcodes.php +109 -0
  71. includes/classes/core/core.inc.php +14 -0
  72. includes/classes/etc/class.asl-mb.php +50 -0
  73. includes/{debug_data.class.php → classes/etc/debug_data.class.php} +0 -0
  74. includes/classes/filters/class-asl-abstract.php +57 -0
  75. includes/classes/filters/class-asl-etc_fixes.php +46 -0
  76. includes/classes/filters/class-asl-formoverride.php +38 -0
  77. includes/classes/filters/class-asl-searchoverride.php +119 -0
  78. includes/classes/filters/filters.inc.php +7 -0
  79. includes/{search.class.php → classes/search/search.class.php} +32 -32
  80. includes/classes/search/search.controller.class.php +171 -0
  81. includes/classes/search/search.inc.php +7 -0
  82. includes/{search_content.class.php → classes/search/search_content.class.php} +102 -94
  83. includes/classes/session/includes/class-recursive-arrayaccess.php +213 -0
  84. includes/classes/session/includes/class-wp-session-utils.php +135 -0
  85. includes/classes/session/includes/class-wp-session.php +227 -0
  86. includes/classes/session/includes/wp-cli.php +158 -0
  87. includes/classes/session/includes/wp-session.php +159 -0
  88. includes/classes/session/wp-session.inc.php +34 -0
  89. includes/classes/shortcodes/class-asl-abstract.php +57 -0
  90. includes/classes/shortcodes/class-asl-search.php +125 -0
  91. includes/classes/shortcodes/shortcodes.inc.php +5 -0
  92. includes/{suggest → classes/suggest}/google_suggest.class.php +3 -3
  93. includes/{suggest → classes/suggest}/suggest-abstract.class.php +4 -4
  94. includes/{suggest → classes/suggest}/suggest-wrapper.class.php +1 -1
  95. includes/classes/suggest/suggest.inc.php +10 -0
  96. includes/classes/widgets/class-search-widget.php +37 -0
  97. includes/classes/widgets/widgets.inc.php +6 -0
  98. includes/functions/functions.php +835 -0
  99. includes/hooks.php +0 -15
  100. includes/imagecache.class.php +0 -241
  101. includes/search_demo.class.php +0 -43
  102. includes/shortcodes.php +0 -48
  103. includes/suggest.class.php +0 -67
  104. includes/suggest/suggest.inc.php +0 -8
  105. includes/views/asl.shortcode.php +59 -19
  106. includes/widgets.php +0 -44
  107. js/min-scoped/jquery.ajaxsearchlite.min.js +16 -0
  108. js/min/jquery.ajaxsearchlite.min.js +15 -0
  109. js/nomin-scoped/asl_wrapper.js +63 -36
  110. js/nomin-scoped/asljquery.js +1 -1
  111. js/nomin-scoped/jquery.ajaxsearchlite.js +245 -732
  112. js/nomin-scoped/jquery.easing.compatibility.js +0 -60
  113. js/nomin-scoped/jquery.easing.js +0 -174
  114. js/nomin-scoped/jquery.gestures.js +2 -1534
  115. js/nomin-scoped/jquery.highlight.js +2 -3
  116. js/nomin/asl_wrapper.js +84 -0
  117. js/nomin/jquery.ajaxsearchlite.js +1039 -0
  118. js/nomin/jquery.gestures.js +1 -0
  119. js/nomin/jquery.highlight.js +106 -0
  120. js/nomin/jquery.mCustomScrollbar.js +946 -0
  121. js/nomin/jquery.mousewheel.js +84 -0
  122. readme.txt +25 -7
  123. search.php +0 -147
ajax-search-lite.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ajax Search Lite
4
  Plugin URI: http://wp-dreams.com
5
  Description: The lite version of the most powerful ajax powered search engine for WordPress.
6
- Version: 4.5.5
7
  Author: Ernest Marcinko
8
  Author URI: http://wp-dreams.com
9
  Text Domain: ajax-search-lite
@@ -11,81 +11,52 @@ Domain Path: /languages/
11
  */
12
  ?>
13
  <?php
 
 
14
 
15
  define('ASL_PATH', plugin_dir_path(__FILE__));
 
16
  define('ASL_CSS_PATH', plugin_dir_path(__FILE__)."/css/");
17
  define('ASL_CACHE_PATH', plugin_dir_path(__FILE__)."/cache/");
18
  define('ASL_INCLUDES_PATH', plugin_dir_path(__FILE__)."/includes/");
 
 
19
  define('ASL_TT_CACHE_PATH', plugin_dir_path(__FILE__)."/includes/cache/");
20
  define('ASL_DIR', 'ajax-search-lite');
21
  define('ASL_URL', plugin_dir_url(__FILE__));
22
- define('ASL_CURRENT_VERSION', 4550);
23
- define('ASL_CURR_VER_STRING', "4.5.5");
24
  define('ASL_DEBUG', 0);
25
  define('ASL_DEMO', get_option('wd_asl_demo', 0) );
26
 
27
- global $asl_admin_pages;
28
- global $asl_debug_data;
29
-
30
- $asl_admin_pages = array(
31
- "ajax-search-lite/backend/settings.php",
32
- "ajax-search-lite/backend/analytics.php",
33
- "ajax-search-lite/backend/compatibility.php",
34
- "ajax-search-lite/backend/performance_options.php",
35
- "ajax-search-lite/backend/help_and_support.php"
36
- );
37
-
38
- require_once(ASL_PATH . "/includes/asl_init.class.php");
39
- require_once(ASL_PATH . "/includes/debug_data.class.php");
40
- require_once(ASL_PATH . "/functions.php");
41
- require_once(ASL_PATH . "/backend/settings/functions.php");
42
-
43
- $asl_debug_data = new wdDebugData( 'asl_debug_data' );
44
-
45
- /* Includes only on ASP ajax requests */
46
- if (isset($_POST) && isset($_POST['action']) &&
47
- (
48
- $_POST['action'] == 'ajaxsearchlite_search' ||
49
- $_POST['action'] == 'ajaxsearchlite_preview'
50
- )
51
- ) {
52
- require_once(ASL_PATH . "/search.php");
53
- return;
54
- }
55
-
56
- $funcs = new aslInit();
57
-
58
- add_action('init', array($funcs, 'asl_init') );
59
-
60
- /* Includes only on ASP admin pages */
61
- if (wpdreams_on_backend_page($asl_admin_pages) == true) {
62
- require_once(ASL_PATH . "/backend/settings/types.inc.php");
63
- add_action('admin_enqueue_scripts', array($funcs, 'scripts'));
64
  }
65
 
66
- /* Includes only on full backend, frontend, non-ajax requests */
67
- if (is_admin() || (!is_admin() && !isset($_POST['action_']))) {
68
- require_once(ASL_PATH . "/backend/settings/default_options.php");
69
- require_once(ASL_PATH . "/includes/shortcodes.php");
70
- require_once(ASL_PATH . "/includes/hooks.php");
71
-
72
-
73
- add_action('admin_menu', array($funcs, 'navigation_menu'));
74
- register_activation_hook(__FILE__, array($funcs, 'ajaxsearchlite_activate'));
75
- add_action('wp_print_styles', array($funcs, 'styles'));
76
- add_action('wp_enqueue_scripts', array($funcs, 'scripts'));
77
- add_action('wp_footer', array($funcs, 'footer'));
78
- }
79
-
80
- /* Includes on Post/Page/Custom post type edit pages */
81
-
82
- require_once(ASL_PATH . "/includes/widgets.php");
83
-
84
- // Non-forcefully push the instance data
85
- $asl_debug_data->pushData(
86
- get_option('asl_options'),
87
- 'asl_options'
88
- );
89
-
90
- // Save everything we did
91
- $asl_debug_data->save();
3
  Plugin Name: Ajax Search Lite
4
  Plugin URI: http://wp-dreams.com
5
  Description: The lite version of the most powerful ajax powered search engine for WordPress.
6
+ Version: 4.6.0
7
  Author: Ernest Marcinko
8
  Author URI: http://wp-dreams.com
9
  Text Domain: ajax-search-lite
11
  */
12
  ?>
13
  <?php
14
+ /* Prevent direct access */
15
+ defined('ABSPATH') or die("You can't access this file directly.");
16
 
17
  define('ASL_PATH', plugin_dir_path(__FILE__));
18
+ define('ASL_FILE', __FILE__);
19
  define('ASL_CSS_PATH', plugin_dir_path(__FILE__)."/css/");
20
  define('ASL_CACHE_PATH', plugin_dir_path(__FILE__)."/cache/");
21
  define('ASL_INCLUDES_PATH', plugin_dir_path(__FILE__)."/includes/");
22
+ define('ASL_CLASSES_PATH', plugin_dir_path(__FILE__)."/includes/classes/");
23
+ define('ASL_FUNCTIONS_PATH', plugin_dir_path(__FILE__)."/includes/functions/");
24
  define('ASL_TT_CACHE_PATH', plugin_dir_path(__FILE__)."/includes/cache/");
25
  define('ASL_DIR', 'ajax-search-lite');
26
  define('ASL_URL', plugin_dir_url(__FILE__));
27
+ define('ASL_CURRENT_VERSION', 4600);
28
+ define('ASL_CURR_VER_STRING', "4.6.0");
29
  define('ASL_DEBUG', 0);
30
  define('ASL_DEMO', get_option('wd_asl_demo', 0) );
31
 
32
+ // The one and most important global
33
+ global $wd_asl;
34
+
35
+ require_once(ASL_CLASSES_PATH . "core/core.inc.php");
36
+ /**
37
+ * wd_asl()->_prefix => correct DB prefix for ASP databases
38
+ * wd_asl()->tables => table names
39
+ * wd_asl()->db => DB manager
40
+ * wd_asl()->options => array of default option arrays
41
+ * wd_asl()->o => alias of wd_asl()->options
42
+ * wd_asl()->instances => array of search instances and data
43
+ * wd_asl()->init => initialization object
44
+ * wd_asl()->manager => main manager object
45
+ * wd_asl()->session => the WP_Session object (shared)
46
+ */
47
+ $wd_asl = new WD_ASL_Globals();
48
+
49
+ if ( !function_exists("wd_asl") ) {
50
+ /**
51
+ * Easy access of the global variable reference
52
+ *
53
+ * @return WD_ASL_Globals
54
+ */
55
+ function wd_asl() {
56
+ global $wd_asl;
57
+ return $wd_asl;
58
+ }
 
 
 
 
 
 
 
 
 
 
59
  }
60
 
61
+ // Initialize the plugin
62
+ $wd_asl->manager = WD_ASL_Manager::getInstance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ajax_search.php CHANGED
@@ -19,19 +19,11 @@ send_nosniff_header();
19
  header('Cache-Control: no-cache');
20
  header('Pragma: no-cache');
21
 
22
-
23
  $action = esc_attr(trim($_POST['action']));
24
 
25
  //A bit of security
26
- $allowed_actions = array(
27
- 'ajaxsearchlite_search'
28
- );
29
-
30
- //$action_name = "ajaxsearchpro_search";
31
- //For logged in users
32
-
33
- add_action('ASL_ajaxsearchlite_search', 'ajaxsearchlite_search');
34
- add_action('ASL_nopriv_ajaxsearchlite_search', 'ajaxsearchlite_search');
35
 
36
 
37
  if(in_array($action, $allowed_actions)) {
19
  header('Cache-Control: no-cache');
20
  header('Pragma: no-cache');
21
 
 
22
  $action = esc_attr(trim($_POST['action']));
23
 
24
  //A bit of security
25
+ $allowed_actions = WD_ASL_Ajax::getAll();
26
+ WD_ASL_Ajax::registerAll(true);
 
 
 
 
 
 
 
27
 
28
 
29
  if(in_array($action, $allowed_actions)) {
backend/analytics.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php $ana_options = get_option('asl_analytics'); ?>
2
 
3
  <div id="wpdreams" class='wpdreams wrap'>
4
  <div class="wpdreams-box">
1
+ <?php $ana_options = wd_asl()->o['asl_analytics']; ?>
2
 
3
  <div id="wpdreams" class='wpdreams wrap'>
4
  <div class="wpdreams-box">
backend/compatibility.php CHANGED
@@ -2,7 +2,7 @@
2
  /* Prevent direct access */
3
  defined('ABSPATH') or die("You can't access this file directly.");
4
 
5
- $com_options = get_option('asl_compatibility');
6
 
7
  if (ASL_DEMO) $_POST = null;
8
  ?>
@@ -12,44 +12,94 @@ if (ASL_DEMO) $_POST = null;
12
 
13
  <?php ob_start(); ?>
14
 
15
- <div tabid="1">
16
- <fieldset>
17
- <legend>Database Compatibility</legend>
18
 
19
- <p class='infoMsg'>
20
- If you are experiencing issues with accent(diacritic) or case sensitiveness, you can force the search to try these tweaks.<br>
21
- <i>The search works according to your database collation settings</i>, so please be aware that <b>this is not an effective way</b> of fixing database collation issues.<br>
22
- If you have case/diacritic issues then please read the <a href="http://dev.mysql.com/doc/refman/5.0/en/charset-syntax.html" target="_blank">MySql manual on collations</a> or consult a <b>database expert</b> - those issues should be treated on database level!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </p>
24
- <div class="item">
25
- <?php
26
- $o = new wpdreamsCustomSelect("db_force_case", "Force case", array(
27
- 'selects'=> array(
28
- array('option' => 'None', 'value' => 'none'),
29
- array('option' => 'Sensitivity', 'value' => 'sensitivity'),
30
- array('option' => 'InSensitivity', 'value' => 'insensitivity')
31
- ),
32
- 'value'=>wpdreams_setval_or_getoption($com_options, 'db_force_case', 'asl_compatibility_def')
33
- )
34
- );
35
- $params[$o->getName()] = $o->getData();
36
- ?>
37
- </div>
38
- <div class="item">
39
- <?php $o = new wpdreamsYesNo("db_force_unicode", "Force unicode search",
40
- wpdreams_setval_or_getoption($com_options, 'db_force_unicode', 'asl_compatibility_def')
41
- ); ?>
42
- <p class='descMsg'>Will try to force unicode character conversion on the search phrase.</p>
43
- </div>
44
- <div class="item">
45
- <?php $o = new wpdreamsYesNo("db_force_utf8_like", "Force utf8 on LIKE operations",
46
- wpdreams_setval_or_getoption($com_options, 'db_force_utf8_like', 'asl_compatibility_def')
47
- ); ?>
48
- <p class='descMsg'>Will try to force utf8 conversion on all LIKE operations in the WHERE and HAVING clauses.</p>
49
- </div>
50
-
51
- </fieldset>
52
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  <?php $_r = ob_get_clean(); ?>
55
 
@@ -61,6 +111,9 @@ if (ASL_DEMO) $_POST = null;
61
  if ( isset($_POST) && isset($_POST['asl_compatibility']) ) {
62
  $values = array(
63
  // CSS and JS
 
 
 
64
  // Query options
65
  "db_force_case" => $_POST['db_force_case'],
66
  "db_force_unicode" => $_POST['db_force_unicode'],
@@ -81,10 +134,6 @@ if (ASL_DEMO) $_POST = null;
81
  <p class="infoMsg">DEMO MODE ENABLED - Please note, that these options are read-only</p>
82
  <?php endif; ?>
83
 
84
- <ul id="tabs" class='tabs'>
85
- <li><a tabid="1" class='current multisite'>Database compatibility</a></li>
86
- </ul>
87
-
88
  <div id="content" class='tabscontent'>
89
 
90
  <!-- Compatibility form -->
@@ -101,11 +150,4 @@ if (ASL_DEMO) $_POST = null;
101
  </div>
102
  </div>
103
  </div>
104
- </div>
105
- <script>
106
- // Simulate a click on the first element to initialize the tabs
107
- jQuery(function ($) {
108
- $('.tabs a[tabid=1]').click();
109
- });
110
-
111
- </script>
2
  /* Prevent direct access */
3
  defined('ABSPATH') or die("You can't access this file directly.");
4
 
5
+ $com_options = wd_asl()->o['asl_compatibility'];
6
 
7
  if (ASL_DEMO) $_POST = null;
8
  ?>
12
 
13
  <?php ob_start(); ?>
14
 
 
 
 
15
 
16
+ <fieldset>
17
+ <legend>CSS and JS compatibility</legend>
18
+
19
+ <div class="item">
20
+ <?php
21
+ $o = new wpdreamsCustomSelect("js_source", "Javascript source", array(
22
+ 'selects' => array(
23
+ array('option' => 'Non minified', 'value' => 'nomin'),
24
+ array('option' => 'Minified', 'value' => 'min'),
25
+ array('option' => 'Non-minified scoped', 'value' => 'nomin-scoped'),
26
+ array('option' => 'Minified scoped', 'value' => 'min-scoped'),
27
+ ),
28
+ 'value' => $com_options['js_source']
29
+ )
30
+ );
31
+ $params[$o->getName()] = $o->getData();
32
+ ?>
33
+ <p class="descMsg">
34
+ <ul style="float:right;text-align:left;width:50%;">
35
+ <li><b>Non minified</b> - Low Compatibility, Medium space</li>
36
+ <li><b>Minified</b> - Low Compatibility, Low space</li>
37
+ <li><b>Non minified Scoped</b> - High Compatibility, High space</li>
38
+ <li><b>Minified Scoped</b> - High Compatibility, Medium space</li>
39
+ </ul>
40
+ <div class="clear"></div>
41
  </p>
42
+ </div>
43
+ <div class="item">
44
+ <?php
45
+ $o = new wpdreamsCustomSelect("js_init", "Javascript init method", array(
46
+ 'selects'=>array(
47
+ array('option'=>'Dynamic (default)', 'value'=>'dynamic'),
48
+ array('option'=>'Blocking', 'value'=>'blocking')
49
+ ),
50
+ 'value'=>$com_options['js_init']
51
+ )
52
+ );
53
+ $params[$o->getName()] = $o->getData();
54
+ ?>
55
+ <p class="descMsg">
56
+ Try to choose <strong>Blocking</strong> if the search bar is not responding to anything.
57
+ </p>
58
+ </div>
59
+ <div class="item">
60
+ <?php $o = new wpdreamsYesNo("detect_ajax", "Try to re-initialize if the page was loaded via ajax?",
61
+ $com_options['detect_ajax']
62
+ ); ?>
63
+ <p class='descMsg'>Will try to re-initialize the plugin in case an AJAX page loader is used, like Polylang language switcher etc..</p>
64
+ </div>
65
+
66
+ </fieldset>
67
+ <fieldset>
68
+ <legend>Database Compatibility</legend>
69
+
70
+ <p class='infoMsg'>
71
+ If you are experiencing issues with accent(diacritic) or case sensitiveness, you can force the search to try these tweaks.<br>
72
+ <i>The search works according to your database collation settings</i>, so please be aware that <b>this is not an effective way</b> of fixing database collation issues.<br>
73
+ If you have case/diacritic issues then please read the <a href="http://dev.mysql.com/doc/refman/5.0/en/charset-syntax.html" target="_blank">MySql manual on collations</a> or consult a <b>database expert</b> - those issues should be treated on database level!
74
+ </p>
75
+ <div class="item">
76
+ <?php
77
+ $o = new wpdreamsCustomSelect("db_force_case", "Force case", array(
78
+ 'selects'=> array(
79
+ array('option' => 'None', 'value' => 'none'),
80
+ array('option' => 'Sensitivity', 'value' => 'sensitivity'),
81
+ array('option' => 'InSensitivity', 'value' => 'insensitivity')
82
+ ),
83
+ 'value'=>$com_options['db_force_case']
84
+ )
85
+ );
86
+ $params[$o->getName()] = $o->getData();
87
+ ?>
88
+ </div>
89
+ <div class="item">
90
+ <?php $o = new wpdreamsYesNo("db_force_unicode", "Force unicode search",
91
+ $com_options['db_force_unicode']
92
+ ); ?>
93
+ <p class='descMsg'>Will try to force unicode character conversion on the search phrase.</p>
94
+ </div>
95
+ <div class="item">
96
+ <?php $o = new wpdreamsYesNo("db_force_utf8_like", "Force utf8 on LIKE operations",
97
+ $com_options['db_force_utf8_like']
98
+ ); ?>
99
+ <p class='descMsg'>Will try to force utf8 conversion on all LIKE operations in the WHERE and HAVING clauses.</p>
100
+ </div>
101
+
102
+ </fieldset>
103
 
104
  <?php $_r = ob_get_clean(); ?>
105
 
111
  if ( isset($_POST) && isset($_POST['asl_compatibility']) ) {
112
  $values = array(
113
  // CSS and JS
114
+ "js_source" => $_POST['js_source'],
115
+ "js_init" => $_POST['js_init'],
116
+ "detect_ajax" => $_POST['detect_ajax'],
117
  // Query options
118
  "db_force_case" => $_POST['db_force_case'],
119
  "db_force_unicode" => $_POST['db_force_unicode'],
134
  <p class="infoMsg">DEMO MODE ENABLED - Please note, that these options are read-only</p>
135
  <?php endif; ?>
136
 
 
 
 
 
137
  <div id="content" class='tabscontent'>
138
 
139
  <!-- Compatibility form -->
150
  </div>
151
  </div>
152
  </div>
153
+ </div>
 
 
 
 
 
 
 
backend/performance_options.php CHANGED
@@ -2,9 +2,14 @@
2
  /* Prevent direct access */
3
  defined( 'ABSPATH' ) or die( "You can't access this file directly." );
4
 
5
- $cache_options = get_option( 'asl_performance' );
6
  ?>
7
  <div id="wpdreams" class='wpdreams wrap'>
 
 
 
 
 
8
  <div class="wpdreams-box">
9
  <?php ob_start(); ?>
10
  <div class="item">
2
  /* Prevent direct access */
3
  defined( 'ABSPATH' ) or die( "You can't access this file directly." );
4
 
5
+ $cache_options = wd_asl()->o['asl_performance'];
6
  ?>
7
  <div id="wpdreams" class='wpdreams wrap'>
8
+ <?php if (wd_asl()->o['asl_performance']['use_custom_ajax_handler'] == 1): ?>
9
+ <p class='noticeMsgBox'>AJAX SEARCH LITE NOTICE: The custom ajax handler is enabled. In case you experience issues, please
10
+ <a href='<?php echo get_admin_url() . "admin.php?page=ajax-search-lite/backend/performance_options.php"; ?>'>turn it off.</a></p>
11
+ <?php endif; ?>
12
+
13
  <div class="wpdreams-box">
14
  <?php ob_start(); ?>
15
  <div class="item">
backend/settings.php CHANGED
@@ -2,7 +2,8 @@
2
  $params = array();
3
  $messages = "";
4
 
5
- $sd = get_option('asl_options');
 
6
  //var_dump($_sd);
7
  $_def = get_option('asl_defaults');
8
  $_dk = 'asl_defaults';
@@ -16,26 +17,16 @@ $_dk = 'asl_defaults';
16
  fjs.parentNode.insertBefore(js, fjs);
17
  }(document, 'script', 'facebook-jssdk'));</script>
18
 
19
- <script>
20
- jQuery(function ($) {
21
- $('.tabs a[tabid=1]').click(function () {
22
- $('.tabs a[tabid=101]').click();
23
- });
24
-
25
- $('.tabs a[tabid=4]').click(function () {
26
- $('.tabs a[tabid=401]').click();
27
- });
28
-
29
- $('.tabs a[tabid=1]').trigger('click');
30
-
31
- });
32
- </script>
33
-
34
  <div id="wpdreams" class='wpdreams wrap'>
35
  <?php if (ASL_DEBUG == 1): ?>
36
  <p class='infoMsg'>Debug mode is on!</p>
37
  <?php endif; ?>
38
 
 
 
 
 
 
39
  <div class="wpdreams-box" style='vertical-align: middle;'>
40
  <a class='gopro' href='http://demo.wp-dreams.com/?product=ajax_search_pro' target='_blank'>Get the pro version!</a>
41
  or leave a like :)
@@ -110,6 +101,7 @@ $_dk = 'asl_defaults';
110
  </fieldset>
111
  </div>
112
  </div>
 
113
  </form>
114
  </div>
115
  <?php $output = ob_get_clean(); ?>
@@ -117,14 +109,11 @@ $_dk = 'asl_defaults';
117
  if (isset($_POST['submit_asl'])) {
118
 
119
  $params = wpdreams_parse_params($_POST);
 
120
 
121
- $_asl_options = get_option('asl_options');
122
- $_asl_options = array_merge($_asl_options, $params);
123
-
124
- update_option('asl_options', $_asl_options);
125
-
126
  // Force instance data to the debug storage
127
- $asl_debug_data->pushData(
128
  $_asl_options,
129
  'asl_options', true
130
  );
@@ -135,4 +124,5 @@ $_dk = 'asl_defaults';
135
  echo str_replace("{--messages--}", $messages, $output);
136
 
137
  ?>
138
- </div>
 
2
  $params = array();
3
  $messages = "";
4
 
5
+ $inst = wd_asl()->instances->get(0);
6
+ $sd = &$inst['data'];
7
  //var_dump($_sd);
8
  $_def = get_option('asl_defaults');
9
  $_dk = 'asl_defaults';
17
  fjs.parentNode.insertBefore(js, fjs);
18
  }(document, 'script', 'facebook-jssdk'));</script>
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  <div id="wpdreams" class='wpdreams wrap'>
21
  <?php if (ASL_DEBUG == 1): ?>
22
  <p class='infoMsg'>Debug mode is on!</p>
23
  <?php endif; ?>
24
 
25
+ <?php if (wd_asl()->o['asl_performance']['use_custom_ajax_handler'] == 1): ?>
26
+ <p class='noticeMsgBox'>AJAX SEARCH LITE NOTICE: The custom ajax handler is enabled. In case you experience issues, please
27
+ <a href='<?php echo get_admin_url() . "admin.php?page=ajax-search-lite/backend/performance_options.php"; ?>'>turn it off.</a></p>
28
+ <?php endif; ?>
29
+
30
  <div class="wpdreams-box" style='vertical-align: middle;'>
31
  <a class='gopro' href='http://demo.wp-dreams.com/?product=ajax_search_pro' target='_blank'>Get the pro version!</a>
32
  or leave a like :)
101
  </fieldset>
102
  </div>
103
  </div>
104
+ <input type="hidden" name="sett_tabid" id="sett_tabid" value="1" />
105
  </form>
106
  </div>
107
  <?php $output = ob_get_clean(); ?>
109
  if (isset($_POST['submit_asl'])) {
110
 
111
  $params = wpdreams_parse_params($_POST);
112
+ $_asl_options = array_merge($sd, $params);
113
 
114
+ wd_asl()->instances->update(0, $_asl_options);
 
 
 
 
115
  // Force instance data to the debug storage
116
+ wd_asl()->debug->pushData(
117
  $_asl_options,
118
  'asl_options', true
119
  );
124
  echo str_replace("{--messages--}", $messages, $output);
125
 
126
  ?>
127
+ </div>
128
+ <script src="<?php echo plugin_dir_url(__FILE__) . 'settings/assets/search_instance.js?v='.ASL_CURR_VER_STRING; ?>"></script>
backend/settings/assets/search_instance.js ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function ($) {
2
+ $('.tabs a[tabid=1]').click(function () {
3
+ $('.tabs a[tabid=101]').click();
4
+ });
5
+
6
+ $('.tabs a[tabid=4]').click(function () {
7
+ $('.tabs a[tabid=401]').click();
8
+ });
9
+
10
+ $('.tabs a').on('click', function(){
11
+ $('#sett_tabid').val($(this).attr('tabid'));
12
+ location.hash = $(this).attr('tabid');
13
+ });
14
+
15
+ // Remove the # from the hash, as different browsers may or may not include it
16
+ var hash = location.hash.replace('#','');
17
+
18
+ if(hash != ''){
19
+ hash = parseInt(hash);
20
+ $('.tabs a[tabid=' + Math.floor( hash / 100 ) + ']').click();
21
+ $('.tabs a[tabid=' + hash + ']').click();
22
+ } else {
23
+ $('.tabs a[tabid=1]').click();
24
+ }
25
+ });
backend/settings/assets/style.css CHANGED
@@ -478,6 +478,22 @@
478
  /* background: #EFEFEF; */
479
  }
480
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
  #wpdreams fieldset fieldset .item {
482
  border-bottom: 1px dashed #e7e7e7;
483
  background: transparent !important;
@@ -595,7 +611,12 @@
595
  padding: 7px;
596
  text-align: left;
597
  }*/
598
- #wpdreams .infoMsg {
 
 
 
 
 
599
  margin: 5px 6px 15px;
600
  border-left: 4px solid #43DD36;
601
  background: #fff;
@@ -604,6 +625,24 @@
604
  padding: 6px 13px;
605
  }
606
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
  #wpdreams .errorMsg {
608
  margin: 5px 6px 15px;
609
  border-left: 4px solid #DD3636;
478
  /* background: #EFEFEF; */
479
  }
480
 
481
+ #wpdreams .item.item-flex,
482
+ #wpdreams .item.item-flex-nogrow {
483
+ display: flex;
484
+ flex-direction: row;
485
+ flex-grow: 0;
486
+ flex-shrink: 0;
487
+ }
488
+
489
+ #wpdreams .item.item-flex-nogrow > div {
490
+ flex-grow: 0;
491
+ }
492
+
493
+ #wpdreams .item.item-flex-nogrow > div:first-child {
494
+ flex-grow: 1;
495
+ }
496
+
497
  #wpdreams fieldset fieldset .item {
498
  border-bottom: 1px dashed #e7e7e7;
499
  background: transparent !important;
611
  padding: 7px;
612
  text-align: left;
613
  }*/
614
+ #wpdreams .infoMsg,
615
+ #wpdreams .infoMsgBox,
616
+ #wpdreams .errorMsg,
617
+ #wpdreams .errorMsgBox,
618
+ #wpdreams .noticeMsg,
619
+ #wpdreams .noticeMsgBox {
620
  margin: 5px 6px 15px;
621
  border-left: 4px solid #43DD36;
622
  background: #fff;
625
  padding: 6px 13px;
626
  }
627
 
628
+ #wpdreams .errorMsg,
629
+ #wpdreams .errorMsgBox {
630
+ border-left: 4px solid #DD3636;
631
+ }
632
+
633
+ #wpdreams .noticeMsg,
634
+ #wpdreams .noticeMsgBox {
635
+ border-left: 4px solid #DD8B36;
636
+ }
637
+
638
+ #wpdreams .infoMsgBox,
639
+ #wpdreams .errorMsgBox,
640
+ #wpdreams .noticeMsgBox{
641
+ padding: 10px;
642
+ margin: 10px;
643
+ width: 790px;
644
+ }
645
+
646
  #wpdreams .errorMsg {
647
  margin: 5px 6px 15px;
648
  border-left: 4px solid #DD3636;
backend/settings/class/customfields.class.php CHANGED
@@ -53,7 +53,6 @@ if (!class_exists("wpdreamsCustomFields")) {
53
  }
54
  var items = $('ul[id*=sortable_conn] li', parent);
55
  var hidden = $('input[name=<?php echo $this->name; ?>]', parent);
56
- console.log(items, hidden);
57
  var val = "";
58
  items.each(function () {
59
  val += "|" + $(this).html();
53
  }
54
  var items = $('ul[id*=sortable_conn] li', parent);
55
  var hidden = $('input[name=<?php echo $this->name; ?>]', parent);
 
56
  var val = "";
57
  items.each(function () {
58
  val += "|" + $(this).html();
backend/settings/class/customfselect.class.php CHANGED
@@ -54,7 +54,7 @@ if (!class_exists("wpdreamsCustomFSelect")) {
54
  final function get_custom_fields_list() {
55
  global $wpdb;
56
  $ret = array();
57
- $types = $wpdb->get_results("SELECT * FROM " . $wpdb->postmeta . " WHERE substring(meta_key,1,1)<>'_' GROUP BY meta_key", ARRAY_A);
58
  if ($types != null && is_array($types)) {
59
  foreach ($types as $k => $v) {
60
  $_t = array();
54
  final function get_custom_fields_list() {
55
  global $wpdb;
56
  $ret = array();
57
+ $types = $wpdb->get_results("SELECT * FROM " . $wpdb->postmeta . " GROUP BY meta_key", ARRAY_A);
58
  if ($types != null && is_array($types)) {
59
  foreach ($types as $k => $v) {
60
  $_t = array();
backend/settings/class/customposttypeseditable.class.php CHANGED
@@ -76,7 +76,6 @@ if (!class_exists("wpdreamsCustomPostTypesEditable")) {
76
  var items = $('ul[id*=sortable_conn] li', parent);
77
  var hidden = $('input[name=<?php echo $this->name; ?>]', parent);
78
  var val = "";
79
- console.log(val);
80
  items.each(function () {
81
  val += "|" + $('label', this).html() + ";" + $('input', this).val();
82
  });
76
  var items = $('ul[id*=sortable_conn] li', parent);
77
  var hidden = $('input[name=<?php echo $this->name; ?>]', parent);
78
  var val = "";
 
79
  items.each(function () {
80
  val += "|" + $('label', this).html() + ";" + $('input', this).val();
81
  });
backend/settings/default_options.php CHANGED
@@ -1,253 +1,238 @@
1
  <?php
2
- /**
3
- * Default option store
4
- *
5
- * The $options variable stores all the default values
6
- * for a new Ajax Search lite instance and for all the option pages.
7
- *
8
- * @author Ernest Marcinko <ernest.marcinko@wp-dreams.com>
9
- * @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio
10
- * @copyright Copyright (c) 2012, Ernest Marcinko
11
- */
12
 
13
- /* Default caching options */
14
- $options = array();
 
 
 
 
15
 
 
 
16
 
17
- $options['asl_analytics_def']['analytics'] = 0;
18
- $options['asl_analytics_def']['analytics_string'] = "ajax_search-{asl_term}";
 
 
19
 
20
- $options['asl_performance_def']['use_custom_ajax_handler'] = 0;
21
- $options['asl_performance_def']['image_cropping'] = 0;
22
- $options['asl_performance_def']['load_in_footer'] = 1;
 
 
23
 
24
- /* Compatibility defaults */
25
- $options['asl_compatibility_def']['db_force_case'] = 'none';
26
- $options['asl_compatibility_def']['db_force_unicode'] = 0;
27
- $options['asl_compatibility_def']['db_force_utf8_like'] = 0;
 
 
 
 
 
 
 
28
 
29
 
30
- /* Default new search options */
31
 
32
  // General options
33
- $options['asl_defaults']['theme'] = 'simple-red';
34
- $options['asl_defaults']['triggeronclick'] = 1;
35
- $options['asl_defaults']['trigger_on_facet_change'] = 0;
36
- $options['asl_defaults']['redirectonclick'] = 0;
37
- $options['asl_defaults']['triggerontype'] = 1;
38
- $options['asl_defaults']['searchinposts'] = 1;
39
- $options['asl_defaults']['searchinpages'] = 1;
40
- $options['asl_defaults']['customtypes'] = "";
41
- $options['asl_defaults']['searchintitle'] = 1;
42
- $options['asl_defaults']['searchincontent'] = 1;
43
- $options['asl_defaults']['searchinexcerpt'] = 1;
44
- $options['asl_defaults']['customfields'] = "";
45
-
46
- $options['asl_defaults']['exactonly'] = 0;
47
- $options['asl_defaults']['searchinterms'] = 0;
48
-
49
- $options['asl_defaults']['charcount'] = 3;
50
- $options['asl_defaults']['maxresults'] = 10;
51
- $options['asl_defaults']['itemscount'] = 4;
52
- $options['asl_defaults']['resultitemheight'] = "70px";
53
-
54
- $options['asl_defaults']['orderby_def'] = array(
55
- array('option'=>'Title descending', 'value'=>'post_title DESC'),
56
- array('option'=>'Title ascending', 'value'=>'post_title ASC'),
57
- array('option'=>'Date descending', 'value'=>'post_date DESC'),
58
- array('option'=>'Date ascending', 'value'=>'post_date ASC')
59
- );
60
- $options['asl_defaults']['orderby'] = 'post_date DESC';
61
-
62
- // General/Autocomplete/KW suggestions
63
- $options['asl_defaults']['autocomplete'] = 1;
64
- $options['asl_defaults']['kw_suggestions'] = 1;
65
- $options['asl_defaults']['kw_length'] = 60;
66
- $options['asl_defaults']['kw_count'] = 10;
67
- $options['asl_defaults']['kw_google_lang'] = "en";
68
- $options['asl_defaults']['kw_exceptions'] = "";
69
-
70
- // General/Image
71
- $options['asl_defaults']['show_images'] = 1;
72
- $options['asl_defaults']['image_transparency'] = 1;
73
- $options['asl_defaults']['image_bg_color'] = "#FFFFFF";
74
- $options['asl_defaults']['image_width'] = 70;
75
- $options['asl_defaults']['image_height'] = 70;
76
-
77
- $options['asl_defaults']['image_crop_location'] = 'c';
78
- $options['asl_defaults']['image_crop_location_selects'] = array(
79
- array('option'=>'In the center', 'value'=>'c'),
80
- array('option'=>'Align top', 'value'=>'t'),
81
- array('option'=>'Align top right', 'value'=>'tr'),
82
- array('option'=>'Align top left', 'value'=>'tl'),
83
- array('option'=>'Align bottom', 'value'=>'b'),
84
- array('option'=>'Align bottom right', 'value'=>'br'),
85
- array('option'=>'Align bottom left', 'value'=>'bl'),
86
- array('option'=>'Align left', 'value'=>'l'),
87
- array('option'=>'Align right', 'value'=>'r')
88
- );
89
-
90
- $options['asl_defaults']['image_sources'] = array(
91
- array('option'=>'Featured image', 'value'=>'featured'),
92
- array('option'=>'Post Content', 'value'=>'content'),
93
- array('option'=>'Post Excerpt', 'value'=>'excerpt'),
94
- array('option'=>'Custom field', 'value'=>'custom'),
95
- array('option'=>'Page Screenshot', 'value'=>'screenshot'),
96
- array('option'=>'Default image', 'value'=>'default'),
97
- array('option'=>'Disabled', 'value'=>'disabled')
98
- );
99
-
100
- $options['asl_defaults']['image_source1'] = 'featured';
101
- $options['asl_defaults']['image_source2'] = 'content';
102
- $options['asl_defaults']['image_source3'] = 'excerpt';
103
- $options['asl_defaults']['image_source4'] = 'custom';
104
- $options['asl_defaults']['image_source5'] = 'default';
105
-
106
- $options['asl_defaults']['image_default'] = ASL_URL."img/default.jpg";
107
- $options['asl_defaults']['image_custom_field'] = '';
108
- $options['asl_defaults']['use_timthumb'] = 1;
109
-
110
-
111
- /* Frontend search settings Options */
112
- $options['asl_defaults']['show_frontend_search_settings'] = 1;
113
- $options['asl_defaults']['showexactmatches'] = 1;
114
- $options['asl_defaults']['showsearchinposts'] = 1;
115
- $options['asl_defaults']['showsearchinpages'] = 1;
116
- $options['asl_defaults']['showsearchintitle'] = 1;
117
- $options['asl_defaults']['showsearchincontent'] = 1;
118
- $options['asl_defaults']['showcustomtypes'] = '';
119
- $options['asl_defaults']['showsearchincomments'] = 1;
120
- $options['asl_defaults']['showsearchinexcerpt'] = 1;
121
- $options['asl_defaults']['showsearchinbpusers'] = 0;
122
- $options['asl_defaults']['showsearchinbpgroups'] = 0;
123
- $options['asl_defaults']['showsearchinbpforums'] = 0;
124
-
125
- $options['asl_defaults']['exactmatchestext'] = "Exact matches only";
126
- $options['asl_defaults']['searchinpoststext'] = "Search in posts";
127
- $options['asl_defaults']['searchinpagestext'] = "Search in pages";
128
- $options['asl_defaults']['searchintitletext'] = "Search in title";
129
- $options['asl_defaults']['searchincontenttext'] = "Search in content";
130
- $options['asl_defaults']['searchincommentstext'] = "Search in comments";
131
- $options['asl_defaults']['searchinexcerpttext'] = "Search in excerpt";
132
- $options['asl_defaults']['searchinbpuserstext'] = "Search in users";
133
- $options['asl_defaults']['searchinbpgroupstext'] = "Search in groups";
134
- $options['asl_defaults']['searchinbpforumstext'] = "Search in forums";
135
-
136
- $options['asl_defaults']['showsearchincategories'] = 1;
137
- $options['asl_defaults']['showuncategorised'] = 1;
138
- $options['asl_defaults']['exsearchincategories'] = "";
139
- $options['asl_defaults']['exsearchincategoriesheight'] = 200;
140
- $options['asl_defaults']['showsearchintaxonomies'] = 1;
141
- $options['asl_defaults']['showterms'] = "";
142
- $options['asl_defaults']['showseparatefilterboxes'] = 1;
143
- $options['asl_defaults']['exsearchintaxonomiestext'] = "Filter by";
144
- $options['asl_defaults']['exsearchincategoriestext'] = "Filter by Categories";
145
- $options['asl_defaults']['exsearchincategoriestextfont'] = 'font-weight:bold;font-family:--g--Open Sans;color:rgb(26, 71, 98);font-size:13px;line-height:15px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);';
146
-
147
- /* Layout Options */
148
- $options['asl_defaults']['resultstype_def'] = array(
149
- array('option'=>'Vertical Results', 'value'=>'vertical'),
150
- array('option'=>'Horizontal Results', 'value'=>'horizontal'),
151
- array('option'=>'Isotopic Results', 'value'=>'isotopic'),
152
- array('option'=>'Polaroid style Results', 'value'=>'polaroid')
153
- );
154
- $options['asl_defaults']['resultstype'] = 'vertical';
155
- $options['asl_defaults']['resultsposition_def'] = array(
156
- array('option'=>'Hover - over content', 'value'=>'hover'),
157
- array('option'=>'Block - pushes content', 'value'=>'block')
158
- );
159
- $options['asl_defaults']['resultsposition'] = 'hover';
160
- $options['asl_defaults']['resultsmargintop'] = '12px';
161
-
162
- $options['asl_defaults']['defaultsearchtext'] = '';
163
- $options['asl_defaults']['showmoreresults'] = 0;
164
- $options['asl_defaults']['showmoreresultstext'] = 'More results...';
165
- $options['asl_defaults']['showmorefont'] = 'font-weight:normal;font-family:--g--Open Sans;color:rgba(5, 94, 148, 1);font-size:12px;line-height:15px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);';
166
- $options['asl_defaults']['scroll_to_results'] = 0;
167
- $options['asl_defaults']['resultareaclickable'] = 1;
168
- $options['asl_defaults']['close_on_document_click'] = 1;
169
- $options['asl_defaults']['show_close_icon'] = 1;
170
- $options['asl_defaults']['showauthor'] = 0;
171
- $options['asl_defaults']['showdate'] = 0;
172
- $options['asl_defaults']['showdescription'] = 1;
173
- $options['asl_defaults']['descriptionlength'] = 100;
174
- $options['asl_defaults']['description_context'] = 1;
175
- $options['asl_defaults']['noresultstext'] = "No results!";
176
- $options['asl_defaults']['didyoumeantext'] = "Did you mean:";
177
- $options['asl_defaults']['highlight'] = 0;
178
- $options['asl_defaults']['highlightwholewords'] = 1;
179
- $options['asl_defaults']['highlightcolor'] = "#d9312b";
180
- $options['asl_defaults']['highlightbgcolor'] = "#eee";
181
-
182
- /* Autocomplete options */
183
- $options['asl_defaults']['autocomplete'] = 1;
184
- $options['asl_defaults']['autocompleteexceptions'] = '';
185
- $options['asl_defaults']['autocompletesource_def'] = array(
186
- array('option'=>'Search Statistics', 'value'=>0),
187
- array('option'=>'Google Keywords', 'value'=>1)
188
- );
189
- $options['asl_defaults']['autocompletesource'] = 1;
190
-
191
-
192
- /* Advanced Options */
193
- $options['asl_defaults']['strip_shortcodes'] = 0;
194
- $options['asl_defaults']['striptagsexclude'] = '';
195
- $options['asl_defaults']['runshortcode'] = 1;
196
- $options['asl_defaults']['stripshortcode'] = 0;
197
- $options['asl_defaults']['pageswithcategories'] = 0;
198
-
199
- $options['asl_defaults']['titlefield_def'] = array(
200
- array('option'=>'Post Title', 'value'=>0),
201
- array('option'=>'Post Excerpt', 'value'=>1)
202
- );
203
- $options['asl_defaults']['titlefield'] = 0;
204
-
205
- $options['asl_defaults']['descriptionfield_def'] = array(
206
- array('option'=>'Post Description', 'value'=>0),
207
- array('option'=>'Post Excerpt', 'value'=>1),
208
- array('option'=>'Post Title', 'value'=>2)
209
- );
210
- $options['asl_defaults']['descriptionfield'] = 0;
211
-
212
-
213
- $options['asl_defaults']['excludecategories'] = '';
214
- $options['asl_defaults']['excludeposts'] = '';
215
- $options['asl_defaults']['exclude_term_ids'] = '';
216
-
217
- $options['asl_defaults']['wpml_compatibility'] = 1;
218
-
219
-
220
- /* Save the defaul options if not exist */
221
- $_asl_ver = get_option('asl_version');
222
-
223
- // Is this after an update?
224
- if ($_asl_ver != ASL_CURRENT_VERSION) {
225
-
226
- // Reset the debug data
227
- $asl_debug_data->destroy();
228
-
229
- // Compatibility options set?
230
- if ( get_option('asl_compatibility')===false || ASL_DEBUG == 1 )
231
- update_option('asl_compatibility', $options['asl_compatibility_def']);
232
-
233
- // Analytics options set?
234
- if ( get_option('asl_analytics')===false || ASL_DEBUG == 1 )
235
- update_option('asl_analytics', $options['asl_analytics_def']);
236
-
237
- // Performance options set?
238
- if ( get_option('asl_performance')===false || ASL_DEBUG == 1 )
239
- update_option('asl_performance', $options['asl_performance_def']);
240
-
241
- }
242
-
243
- // Update the default options if not exist/newer version available/debug mode is on
244
- foreach($options as $key=>$value) {
245
- if (get_option($key) === false || $_asl_ver != ASL_CURRENT_VERSION || ASL_DEBUG == 1) {
246
- update_option($key, $value);
247
- }
248
- }
249
-
250
- if (get_option('asl_options')===false || ASL_DEBUG == 1)
251
- update_option('asl_options', $options['asl_defaults']);
252
-
253
- update_option('asl_version', ASL_CURRENT_VERSION);
1
  <?php
 
 
 
 
 
 
 
 
 
 
2
 
3
+ function asl_do_init_options() {
4
+ global $wd_asl;
5
+
6
+ $wd_asl->options = array();
7
+ $options = &$wd_asl->options;
8
+ $wd_asl->o = &$wd_asl->options;
9
 
10
+ /* Default caching options */
11
+ $options = array();
12
 
13
+ $options['asl_analytics_def'] = array(
14
+ 'analytics' => 0,
15
+ 'analytics_string' => "?ajax_search={asl_term}"
16
+ );
17
 
18
+ $options['asl_performance_def'] = array(
19
+ 'use_custom_ajax_handler' => 0,
20
+ 'image_cropping' => 0,
21
+ 'load_in_footer' => 1
22
+ );
23
 
24
+ /* Compatibility defaults */
25
+ $options['asl_compatibility_def'] = array(
26
+ // CSS JS
27
+ 'js_source' => "nomin",
28
+ 'js_init' => "dynamic",
29
+ "detect_ajax" => 0,
30
+ // DB
31
+ 'db_force_case' => 'none',
32
+ 'db_force_unicode' => 0,
33
+ 'db_force_utf8_like' => 0
34
+ );
35
 
36
 
37
+ /* Default new search options */
38
 
39
  // General options
40
+ $options['asl_defaults'] = array(
41
+ 'theme' => 'simple-red',
42
+ 'override_search_form' => 0,
43
+ 'triggeronclick' => 1,
44
+ 'trigger_on_facet_change' => 1,
45
+ 'redirectonclick' => 0,
46
+ 'redirect_click_to' => 'results_page',
47
+ 'redirect_on_enter' => 0,
48
+ 'redirect_enter_to' => 'results_page',
49
+ 'triggerontype' => 1,
50
+ 'searchinposts' => 1,
51
+ 'searchinpages' => 1,
52
+ 'customtypes' => "",
53
+ 'searchintitle' => 1,
54
+ 'searchincontent' => 1,
55
+ 'searchinexcerpt' => 1,
56
+ 'customfields' => "",
57
+ 'override_default_results' => 0,
58
+
59
+ 'exactonly' => 0,
60
+ 'searchinterms' => 0,
61
+
62
+ 'charcount' => 3,
63
+ 'maxresults' => 10,
64
+ 'itemscount' => 4,
65
+ 'resultitemheight' => "70px",
66
+
67
+ 'orderby_primary' => 'relevance DESC',
68
+ 'orderby_secondary' => 'date DESC',
69
+
70
+ // General/Image
71
+ 'show_images' => 1,
72
+ 'image_transparency' => 1,
73
+ 'image_bg_color' => "#FFFFFF",
74
+ 'image_width' => 70,
75
+ 'image_height' => 70,
76
+
77
+ 'image_crop_location' => 'c',
78
+ 'image_crop_location_selects' => array(
79
+ array('option' => 'In the center', 'value' => 'c'),
80
+ array('option' => 'Align top', 'value' => 't'),
81
+ array('option' => 'Align top right', 'value' => 'tr'),
82
+ array('option' => 'Align top left', 'value' => 'tl'),
83
+ array('option' => 'Align bottom', 'value' => 'b'),
84
+ array('option' => 'Align bottom right', 'value' => 'br'),
85
+ array('option' => 'Align bottom left', 'value' => 'bl'),
86
+ array('option' => 'Align left', 'value' => 'l'),
87
+ array('option' => 'Align right', 'value' => 'r')
88
+ ),
89
+
90
+ 'image_sources' => array(
91
+ array('option' => 'Featured image', 'value' => 'featured'),
92
+ array('option' => 'Post Content', 'value' => 'content'),
93
+ array('option' => 'Post Excerpt', 'value' => 'excerpt'),
94
+ array('option' => 'Custom field', 'value' => 'custom'),
95
+ array('option' => 'Page Screenshot', 'value' => 'screenshot'),
96
+ array('option' => 'Default image', 'value' => 'default'),
97
+ array('option' => 'Disabled', 'value' => 'disabled')
98
+ ),
99
+
100
+ 'image_source1' => 'featured',
101
+ 'image_source2' => 'content',
102
+ 'image_source3' => 'excerpt',
103
+ 'image_source4' => 'custom',
104
+ 'image_source5' => 'default',
105
+
106
+ 'image_default' => ASL_URL . "img/default.jpg",
107
+ 'image_custom_field' => '',
108
+ 'use_timthumb' => 1,
109
+
110
+
111
+ /* Frontend search settings Options */
112
+ 'show_frontend_search_settings' => 1,
113
+ 'showexactmatches' => 1,
114
+ 'showsearchinposts' => 1,
115
+ 'showsearchinpages' => 1,
116
+ 'showsearchintitle' => 1,
117
+ 'showsearchincontent' => 1,
118
+ 'showcustomtypes' => '',
119
+ 'showsearchincomments' => 1,
120
+ 'showsearchinexcerpt' => 1,
121
+ 'showsearchinbpusers' => 0,
122
+ 'showsearchinbpgroups' => 0,
123
+ 'showsearchinbpforums' => 0,
124
+
125
+ 'exactmatchestext' => "Exact matches only",
126
+ 'searchinpoststext' => "Search in posts",
127
+ 'searchinpagestext' => "Search in pages",
128
+ 'searchintitletext' => "Search in title",
129
+ 'searchincontenttext' => "Search in content",
130
+ 'searchincommentstext' => "Search in comments",
131
+ 'searchinexcerpttext' => "Search in excerpt",
132
+ 'searchinbpuserstext' => "Search in users",
133
+ 'searchinbpgroupstext' => "Search in groups",
134
+ 'searchinbpforumstext' => "Search in forums",
135
+
136
+ 'showsearchincategories' => 1,
137
+ 'showuncategorised' => 1,
138
+ 'exsearchincategories' => "",
139
+ 'exsearchincategoriesheight' => 200,
140
+ 'showsearchintaxonomies' => 1,
141
+ 'showterms' => "",
142
+ 'showseparatefilterboxes' => 1,
143
+ 'exsearchintaxonomiestext' => "Filter by",
144
+ 'exsearchincategoriestext' => "Filter by Categories",
145
+
146
+ /* Layout Options */
147
+ // Box layout
148
+ 'box_width' => "100%",
149
+ 'box_margin' => "||0px||0px||0px||0px||",
150
+ // Results Layout
151
+ 'resultstype_def' => array(
152
+ array('option' => 'Vertical Results', 'value' => 'vertical'),
153
+ array('option' => 'Horizontal Results', 'value' => 'horizontal'),
154
+ array('option' => 'Isotopic Results', 'value' => 'isotopic'),
155
+ array('option' => 'Polaroid style Results', 'value' => 'polaroid')
156
+ ),
157
+ 'resultstype' => 'vertical',
158
+ 'resultsposition_def' => array(
159
+ array('option' => 'Hover - over content', 'value' => 'hover'),
160
+ array('option' => 'Block - pushes content', 'value' => 'block')
161
+ ),
162
+ 'resultsposition' => 'hover',
163
+ 'resultsmargintop' => '12px',
164
+
165
+ 'defaultsearchtext' => 'Search here..',
166
+ 'showmoreresults' => 0,
167
+ 'showmoreresultstext' => 'More results...',
168
+ 'showmorefont' => 'font-weight:normal;font-family:--g--Open Sans;color:rgba(5, 94, 148, 1);font-size:12px;line-height:15px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',
169
+ 'scroll_to_results' => 0,
170
+ 'resultareaclickable' => 1,
171
+ 'close_on_document_click' => 1,
172
+ 'show_close_icon' => 1,
173
+ 'showauthor' => 0,
174
+ 'showdate' => 0,
175
+ 'showdescription' => 1,
176
+ 'descriptionlength' => 100,
177
+ 'description_context' => 0,
178
+ 'noresultstext' => "No results!",
179
+ 'didyoumeantext' => "Did you mean:",
180
+ 'highlight' => 0,
181
+ 'highlightwholewords' => 1,
182
+ 'highlightcolor' => "#d9312b",
183
+ 'highlightbgcolor' => "#eee",
184
+
185
+ // General/Autocomplete/KW suggestions
186
+ 'autocomplete' => 1,
187
+
188
+ 'kw_suggestions' => 1,
189
+ 'kw_length' => 60,
190
+ 'kw_count' => 10,
191
+ 'kw_google_lang' => "en",
192
+ 'kw_exceptions' => "",
193
+
194
+ /* Advanced Options */
195
+ 'shortcode_op' => 'remove',
196
+ 'striptagsexclude' => '',
197
+ 'runshortcode' => 1,
198
+ 'stripshortcode' => 0,
199
+ 'pageswithcategories' => 0,
200
+
201
+ 'titlefield_def' => array(
202
+ array('option' => 'Post Title', 'value' => 0),
203
+ array('option' => 'Post Excerpt', 'value' => 1)
204
+ ),
205
+ 'titlefield' => 0,
206
+
207
+ 'descriptionfield_def' => array(
208
+ array('option' => 'Post Description', 'value' => 0),
209
+ array('option' => 'Post Excerpt', 'value' => 1),
210
+ array('option' => 'Post Title', 'value' => 2)
211
+ ),
212
+ 'descriptionfield' => 0,
213
+
214
+
215
+ 'excludecategories' => '',
216
+ 'excludeposts' => '',
217
+ 'exclude_term_ids' => '',
218
+
219
+ 'wpml_compatibility' => 1
220
+ );
221
+ }
222
+
223
+ /**
224
+ * Merge the default options with the stored options.
225
+ */
226
+ function asl_parse_options() {
227
+ foreach ( wd_asl()->o as $def_k => $o ) {
228
+ if ( preg_match("/\_def$/", $def_k) ) {
229
+ $ok = preg_replace("/\_def$/", '', $def_k);
230
+
231
+ wd_asl()->o[$ok] = get_option($ok, wd_asl()->o[$def_k]);
232
+ wd_asl()->o[$ok] = array_merge(wd_asl()->o[$def_k], wd_asl()->o[$ok]);
233
+ }
234
+ }
235
+ }
236
+
237
+ asl_do_init_options();
238
+ asl_parse_options();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/settings/functions.php DELETED
@@ -1,325 +0,0 @@
1
- <?php
2
-
3
- if (!function_exists("w_isset_def")) {
4
- function w_isset_def(&$v, $d)
5
- {
6
- if (isset($v)) return $v;
7
- return $d;
8
- }
9
- }
10
-
11
- if (!function_exists("wpdreams_setval_or_getoption")) {
12
- function wpdreams_setval_or_getoption($options, $key, $def_key)
13
- {
14
- if (isset($options) && isset($options[$key]))
15
- return $options[$key];
16
- $def_options = get_option($def_key);
17
- return $def_options[$key];
18
- }
19
- }
20
-
21
- if (!function_exists("wpdreams_get_selected")) {
22
- function wpdreams_get_selected($option, $key) {
23
- return isset($option['selected-'.$key])?$option['selected-'.$key]:array();
24
- }
25
- }
26
-
27
- if (!function_exists("wpdreams_keyword_count_sort")) {
28
- function wpdreams_keyword_count_sort($first, $sec) {
29
- return $sec[1] - $first[1];
30
- }
31
- }
32
-
33
- if (!function_exists("wpdreams_get_stylesheet")) {
34
- function wpdreams_get_stylesheet($dir, $id, $style) {
35
- ob_start();
36
- include($dir."style.css.php");
37
- $out = ob_get_contents();
38
- ob_end_clean();
39
- if (isset($style['custom_css_special']) && isset($style['custom_css_selector'])
40
- && $style['custom_css_special'] != "") {
41
- $out.= " ".stripcslashes(str_replace('[instance]',
42
- str_replace('THEID', $id, $style['custom_css_selector']),
43
- $style['custom_css_special']));
44
- }
45
- return $out;
46
- }
47
- }
48
-
49
- if (!function_exists("wpdreams_update_stylesheet")) {
50
- function wpdreams_update_stylesheet($dir, $id, $style) {
51
- $out = wpdreams_get_stylesheet($dir, $id, $style);
52
- if (isset($style['css_compress']) && $style['css_compress'] == true)
53
- $out = wpdreams_css_compress($out);
54
- return @file_put_contents($dir."style".$id.".css", $out, FILE_TEXT);
55
- }
56
- }
57
-
58
- if (!function_exists("wpdreams_parse_params")) {
59
- function wpdreams_parse_params($params) {
60
- foreach ($params as $k=>$v) {
61
- $_tmp = explode('classname-', $k);
62
- if ($_tmp!=null && count($_tmp)>1) {
63
- ob_start();
64
- $c = new $v('0', '0', $params[$_tmp[1]]);
65
- $out = ob_get_clean();
66
- $params['selected-'.$_tmp[1]] = $c->getSelected();
67
- }
68
- $_tmp = null;
69
- $_tmp = explode('wpdfont-', $k);
70
- if ($_tmp!=null && count($_tmp)>1) {
71
- ob_start();
72
- $c = new $v('0', '0', $params[$_tmp[1]]);
73
- $out = ob_get_clean();
74
- $params['import-'.$_tmp[1]] = $c->getImport();
75
- }
76
- }
77
- return $params;
78
- }
79
- }
80
-
81
- if (!function_exists("wpdreams_admin_hex2rgb")) {
82
- function wpdreams_admin_hex2rgb($color)
83
- {
84
- if (strlen($color)>7) return $color;
85
- if (strlen($color)<3) return "rgba(0, 0, 0, 1)";
86
- if ($color[0] == '#')
87
- $color = substr($color, 1);
88
- if (strlen($color) == 6)
89
- list($r, $g, $b) = array($color[0].$color[1],
90
- $color[2].$color[3],
91
- $color[4].$color[5]);
92
- elseif (strlen($color) == 3)
93
- list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
94
- else
95
- return false;
96
- $r = hexdec($r); $g = hexdec($g); $b = hexdec($b);
97
- return "rgba(".$r.", ".$g.", ".$b.", 1)";
98
- }
99
- }
100
- if (!function_exists("wpdreams_four_to_string")) {
101
- function wpdreams_four_to_string($data) {
102
- // 1.Top 2.Bottom 3.Right 4.Left
103
- preg_match("/\|\|(.*?)\|\|(.*?)\|\|(.*?)\|\|(.*?)\|\|/", $data, $matches);
104
- // 1.Top 3.Right 2.Bottom 4.Left
105
- return $matches[1]." ".$matches[3]." ".$matches[2]." ".$matches[4];
106
- }
107
- }
108
-
109
-
110
- if (!function_exists("wpdreams_box_shadow_css")) {
111
- function wpdreams_box_shadow_css($css) {
112
- $css = str_replace("\n", "", $css);
113
- preg_match("/box-shadow:(.*?)px (.*?)px (.*?)px (.*?)px (.*?);/", $css, $matches);
114
- $ci = $matches[5];
115
- $hlength = $matches[1];
116
- $vlength = $matches[2];
117
- $blurradius = $matches[3];
118
- $spread = $matches[4];
119
- $moz_blur = ($blurradius>2)?$blurradius - 2:0;
120
- if ($hlength==0 && $vlength==0 && $blurradius==0 && $spread==0) {
121
- echo "box-shadow: none;";
122
- } else {
123
- echo "box-shadow:".$hlength."px ".$vlength."px ".$moz_blur."px ".$spread."px ".$ci.";";
124
- echo "-webkit-box-shadow:".$hlength."px ".$vlength."px ".$blurradius."px ".$spread."px ".$ci.";";
125
- echo "-ms-box-shadow:".$hlength."px ".$vlength."px ".$blurradius."px ".$spread."px ".$ci.";";
126
- }
127
- }
128
- }
129
-
130
- if (!function_exists("wpdreams_gradient_css")) {
131
- function wpdreams_gradient_css($data, $print=true)
132
- {
133
-
134
- $data = str_replace("\n", "", $data);
135
- preg_match("/(.*?)-(.*?)-(.*?)-(.*)/", $data, $matches);
136
-
137
- if (!isset($matches[1]) || !isset($matches[2]) || !isset($matches[3])) {
138
- // Probably only 1 color..
139
- if ($print) echo "background: ".$data.";";
140
- return "background: ".$data.";";
141
- }
142
-
143
- $type = $matches[1];
144
- $deg = $matches[2];
145
- $color1 = wpdreams_admin_hex2rgb($matches[3]);
146
- $color2 = wpdreams_admin_hex2rgb($matches[4]);
147
-
148
- // Check for full transparency
149
- preg_match("/rgba\(.*?,.*?,.*?,[\s]*(.*?)\)/", $color1, $opacity1);
150
- preg_match("/rgba\(.*?,.*?,.*?,[\s]*(.*?)\)/", $color2, $opacity2);
151
- if (isset($opacity1[1]) && $opacity1[1] == "0" && isset($opacity2[1]) && $opacity2[1] == "0") {
152
- if ($print) echo "background: transparent;";
153
- return "background: transparent;";
154
- }
155
-
156
- ob_start();
157
- //compatibility
158
- /*if (strlen($color1)>7) {
159
- preg_match("/\((.*?)\)/", $color1, $matches);
160
- $colors = explode(',', $matches[1]);
161
- echo "background: rgb($colors[0], $colors[1], $colors[2]);";
162
- } else {
163
- echo "background: ".$color1.";";
164
- } */
165
- //linear
166
-
167
- if ($type!='0' || $type!=0) {
168
- ?>
169
- background-image: linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>);
170
- background-image: -webkit-linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>);
171
- background-image: -moz-linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>);
172
- background-image: -o-linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>);
173
- background-image: -ms-linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>);
174
- <?php
175
- } else {
176
- //radial
177
- ?>
178
- background-image: -moz-radial-gradient(center, ellipse cover, <?php echo $color1; ?>, <?php echo $color2; ?>);
179
- background-image: -webkit-gradient(radial, center center, 0px, center center, 100%, <?php echo $color1; ?>, <?php echo $color2; ?>);
180
- background-image: -webkit-radial-gradient(center, ellipse cover, <?php echo $color1; ?>, <?php echo $color2; ?>);
181
- background-image: -o-radial-gradient(center, ellipse cover, <?php echo $color1; ?>, <?php echo $color2; ?>);
182
- background-image: -ms-radial-gradient(center, ellipse cover, <?php echo $color1; ?>, <?php echo $color2; ?>);
183
- background-image: radial-gradient(ellipse at center, <?php echo $color1; ?>, <?php echo $color2; ?>);
184
- <?php
185
- }
186
- $out = ob_get_clean();
187
- if ($print) echo $out;
188
- return $out;
189
- }
190
- }
191
-
192
- if (!function_exists("wpdreams_gradient_css_rgba")) {
193
- function wpdreams_gradient_css_rgba($data, $print=true)
194
- {
195
-
196
- $data = str_replace("\n", "", $data);
197
- preg_match("/(.*?)-(.*?)-(.*?)-(.*)/", $data, $matches);
198
-
199
- if (!isset($matches[1]) || !isset($matches[2]) || !isset($matches[3])) {
200
- // Probably only 1 color..
201
- echo "background: ".$data.";";
202
- return;
203
- }
204
-
205
- $type = $matches[1];
206
- $deg = $matches[2];
207
- $color1 = wpdreams_admin_hex2rgb($matches[3]);
208
- $color2 = wpdreams_admin_hex2rgb($matches[4]);
209
-
210
- ob_start();
211
- //compatibility
212
-
213
-
214
- if ($type!='0' || $type!=0) {
215
- ?>linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>)<?php
216
- } else {
217
- //radial
218
- ?>radial-gradient(ellipse at center, <?php echo $color1; ?>, <?php echo $color2; ?>)<?php
219
- }
220
- $out = ob_get_clean();
221
- if ($print) echo $out;
222
- return $out;
223
- }
224
- }
225
-
226
-
227
- if (!function_exists("wpdreams_border_width")) {
228
- function wpdreams_border_width($css)
229
- {
230
- $css = str_replace("\n", "", $css);
231
-
232
- preg_match("/border:(.*?)px (.*?) (.*?);/", $css, $matches);
233
-
234
- return $matches[1];
235
-
236
- }
237
- }
238
-
239
- if (!function_exists("wpdreams_width_from_px")) {
240
- function wpdreams_width_from_px($css)
241
- {
242
- $css = str_replace("\n", "", $css);
243
-
244
- preg_match("/(.*?)px/", $css, $matches);
245
-
246
- return $matches[1];
247
-
248
- }
249
- }
250
-
251
- if (!function_exists("wpdreams_x2")) {
252
- function wpdreams_x2($url)
253
- {
254
- $ext = pathinfo($url, PATHINFO_EXTENSION);
255
- return str_replace('.'.$ext, 'x2.'.$ext, $url);
256
- }
257
- }
258
-
259
- if (!function_exists("wpdreams_in_array_r")) {
260
- function wpdreams_in_array_r($needle, $haystack, $strict = false) {
261
- foreach ($haystack as $item) {
262
- if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && wpdreams_in_array_r($needle, $item, $strict))) {
263
- return true;
264
- }
265
- }
266
-
267
- return false;
268
- }
269
- }
270
-
271
- if (!function_exists("wpdreams_css_compress")) {
272
- function wpdreams_css_compress ($code) {
273
- $code = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $code);
274
- $code = str_replace(array("\r\n", "\r", "\n", "\t", ' '), '', $code);
275
- $code = str_replace('{ ', '{', $code);
276
- $code = str_replace(' }', '}', $code);
277
- $code = str_replace('; ', ';', $code);
278
- return $code;
279
- }
280
- }
281
-
282
- if (!function_exists("wpdreams_get_all_taxonomies")) {
283
- function wpdreams_get_all_taxonomies() {
284
- $args = array(
285
- 'public' => true,
286
- '_builtin' => false
287
-
288
- );
289
- $output = 'names'; // or objects
290
- $operator = 'and'; // 'and' or 'or'
291
- $taxonomies = get_taxonomies( $args, $output, $operator );
292
- return $taxonomies;
293
- }
294
- }
295
-
296
- if (!function_exists("wpdreams_get_all_terms")) {
297
- function wpdreams_get_all_terms() {
298
- $taxonomies = wpdreams_get_all_taxonomies();
299
- $terms = array();
300
- $_terms = array();
301
- foreach ($taxonomies as $taxonomy) {
302
- $_temp = get_terms($taxonomy, 'orderby=name');
303
- foreach ($_temp as $k=>$v)
304
- $terms[] = $v;
305
- }
306
- foreach ($terms as $k=>$v) {
307
- $_terms[$v->term_id] = $v;
308
- }
309
- return $_terms;
310
- }
311
- }
312
-
313
- if (!function_exists("wpdreams_get_all_term_ids")) {
314
- function wpdreams_get_all_term_ids() {
315
- $taxonomies = wpdreams_get_all_taxonomies();
316
- $terms = array();
317
- foreach ($taxonomies as $taxonomy) {
318
- $_temp = get_terms($taxonomy, 'orderby=name');
319
- foreach ($_temp as $k=>$v)
320
- $terms[] = $v->term_id;
321
- }
322
- return $terms;
323
- }
324
- }
325
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/settings/types.inc.php CHANGED
@@ -8,7 +8,8 @@
8
  * @copyright Copyright (c) 2012, Ernest Marcinko
9
  */
10
 
11
- include(ASL_PATH."/backend/settings/functions.php");
 
12
 
13
  // Include the types
14
  include('class/type.class.php');
8
  * @copyright Copyright (c) 2012, Ernest Marcinko
9
  */
10
 
11
+ /* Prevent direct access */
12
+ defined('ABSPATH') or die("You can't access this file directly.");
13
 
14
  // Include the types
15
  include('class/type.class.php');
backend/tabs/instance/advanced_options.php CHANGED
@@ -1,17 +1,23 @@
1
  <div class="item">
2
- <?php
3
- $o = new wpdreamsYesNo("strip_shortcodes", __("Strip shortcodes from the content?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'strip_shortcodes', $_dk));
4
- $params[$o->getName()] = $o->getData();
5
- ?>
6
- <p class="descMsg">
7
- <?php echo __("When enabled, the shortcodes from the content will be removed instead of executed.", "ajax-search-lite"); ?>
8
- </p>
 
 
 
 
 
 
9
  </div>
10
  <div class="item">
11
  <?php
12
  $o = new wpdreamsCustomFSelect("titlefield", __("Title Field", "ajax-search-lite"), array(
13
- 'selects'=>wpdreams_setval_or_getoption($sd, 'titlefield_def', $_dk),
14
- 'value'=>wpdreams_setval_or_getoption($sd, 'titlefield', $_dk)
15
  ));
16
  $params[$o->getName()] = $o->getData();
17
  ?>
@@ -19,28 +25,28 @@
19
  <div class="item">
20
  <?php
21
  $o = new wpdreamsCustomFSelect("descriptionfield", __("Description Field", "ajax-search-lite"), array(
22
- 'selects'=>wpdreams_setval_or_getoption($sd, 'descriptionfield_def', $_dk),
23
- 'value'=>wpdreams_setval_or_getoption($sd, 'descriptionfield', $_dk)
24
  ));
25
  $params[$o->getName()] = $o->getData();
26
  ?>
27
  </div>
28
  <div class="item">
29
  <?php
30
- $o = new wpdreamsCategories("excludecategories", __("Exclude categories", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'excludecategories', $_dk));
31
  $params[$o->getName()] = $o->getData();
32
  $params['selected-'.$o->getName()] = $o->getSelected();
33
  ?>
34
  </div>
35
  <div class="item">
36
  <?php
37
- $o = new wpdreamsTextarea("excludeposts", __("Exclude Posts by ID's (comma separated post ID-s)", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'excludeposts', $_dk));
38
  $params[$o->getName()] = $o->getData();
39
  ?>
40
  </div>
41
  <div class="item">
42
  <?php
43
- $o = new wpdreamsTextarea("exclude_term_ids", __("Exclude Terms by ID (comma separated term ID-s)", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'exclude_term_ids', $_dk));
44
  $params[$o->getName()] = $o->getData();
45
  ?>
46
  <p class="descMsg">
@@ -49,7 +55,7 @@
49
  </div>
50
  <div class="item">
51
  <?php
52
- $o = new wpdreamsYesNo("wpml_compatibility", __("WPML compatibility", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'wpml_compatibility', $_dk));
53
  $params[$o->getName()] = $o->getData();
54
  ?>
55
  </div>
1
  <div class="item">
2
+ <?php
3
+ $o = new wpdreamsCustomSelect("shortcode_op", __("What to do with shortcodes in results content?", "ajax-search-lite"), array(
4
+ 'selects'=>array(
5
+ array("option"=>"Remove them, keep the content", "value" => "remove"),
6
+ array("option"=>"Execute them (can by really slow)", "value" => "execute")
7
+ ),
8
+ 'value'=>$sd['shortcode_op']
9
+ ));
10
+ $params[$o->getName()] = $o->getData();
11
+ ?>
12
+ <p class="descMsg">
13
+ <?php echo __("Removing shortcode is usually much faster, especially if you have many of them within posts.", "ajax-search-lite"); ?>
14
+ </p>
15
  </div>
16
  <div class="item">
17
  <?php
18
  $o = new wpdreamsCustomFSelect("titlefield", __("Title Field", "ajax-search-lite"), array(
19
+ 'selects'=>$sd['titlefield_def'],
20
+ 'value'=>$sd['titlefield']
21
  ));
22
  $params[$o->getName()] = $o->getData();
23
  ?>
25
  <div class="item">
26
  <?php
27
  $o = new wpdreamsCustomFSelect("descriptionfield", __("Description Field", "ajax-search-lite"), array(
28
+ 'selects'=>$sd['descriptionfield_def'],
29
+ 'value'=>$sd['descriptionfield']
30
  ));
31
  $params[$o->getName()] = $o->getData();
32
  ?>
33
  </div>
34
  <div class="item">
35
  <?php
36
+ $o = new wpdreamsCategories("excludecategories", __("Exclude categories", "ajax-search-lite"), $sd['excludecategories']);
37
  $params[$o->getName()] = $o->getData();
38
  $params['selected-'.$o->getName()] = $o->getSelected();
39
  ?>
40
  </div>
41
  <div class="item">
42
  <?php
43
+ $o = new wpdreamsTextarea("excludeposts", __("Exclude Posts by ID's (comma separated post ID-s)", "ajax-search-lite"), $sd['excludeposts']);
44
  $params[$o->getName()] = $o->getData();
45
  ?>
46
  </div>
47
  <div class="item">
48
  <?php
49
+ $o = new wpdreamsTextarea("exclude_term_ids", __("Exclude Terms by ID (comma separated term ID-s)", "ajax-search-lite"), $sd['exclude_term_ids']);
50
  $params[$o->getName()] = $o->getData();
51
  ?>
52
  <p class="descMsg">
55
  </div>
56
  <div class="item">
57
  <?php
58
+ $o = new wpdreamsYesNo("wpml_compatibility", __("WPML compatibility", "ajax-search-lite"), $sd['wpml_compatibility']);
59
  $params[$o->getName()] = $o->getData();
60
  ?>
61
  </div>
backend/tabs/instance/frontend_options.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class="item">
2
  <?php
3
- $o = new wpdreamsYesNo("show_frontend_search_settings", __("Show search settings on the frontend?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'show_frontend_search_settings', $_dk));
4
  $params[$o->getName()] = $o->getData();
5
  ?>
6
  </div>
@@ -9,65 +9,65 @@
9
  </div>
10
  <div class="item">
11
  <?php
12
- $o = new wpdreamsYesNo("showexactmatches", __("Show exact matches selector?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showexactmatches', $_dk));
13
  $params[$o->getName()] = $o->getData();
14
- $o = new wpdreamsText("exactmatchestext", "Text", wpdreams_setval_or_getoption($sd, 'exactmatchestext', $_dk));
15
  $params[$o->getName()] = $o->getData();
16
  ?>
17
  </div>
18
  <div class="item">
19
  <?php
20
- $o = new wpdreamsYesNo("showsearchinposts", __("Show search in posts selector?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showsearchinposts', $_dk));
21
  $params[$o->getName()] = $o->getData();
22
- $o = new wpdreamsText("searchinpoststext", "Text", wpdreams_setval_or_getoption($sd, 'searchinpoststext', $_dk));
23
  $params[$o->getName()] = $o->getData();
24
  ?></div>
25
  <div class="item">
26
  <?php
27
- $o = new wpdreamsYesNo("showsearchinpages", __("Show search in pages selector?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showsearchinpages', $_dk));
28
  $params[$o->getName()] = $o->getData();
29
- $o = new wpdreamsText("searchinpagestext", "Text", wpdreams_setval_or_getoption($sd, 'searchinpagestext', $_dk));
30
  $params[$o->getName()] = $o->getData();
31
  ?></div>
32
  <div class="item">
33
  <?php
34
- $o = new wpdreamsYesNo("showsearchintitle", __("Show search in title selector?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showsearchintitle', $_dk));
35
  $params[$o->getName()] = $o->getData();
36
- $o = new wpdreamsText("searchintitletext", "Text", wpdreams_setval_or_getoption($sd, 'searchintitletext', $_dk));
37
  $params[$o->getName()] = $o->getData();
38
  ?></div>
39
  <div class="item">
40
  <?php
41
- $o = new wpdreamsYesNo("showsearchincontent", __("Show search in content selector?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showsearchincontent', $_dk));
42
  $params[$o->getName()] = $o->getData();
43
- $o = new wpdreamsText("searchincontenttext", "Text", wpdreams_setval_or_getoption($sd, 'searchincontenttext', $_dk));
44
  $params[$o->getName()] = $o->getData();
45
  ?></div>
46
  <div class="item"><?php
47
- $o = new wpdreamsCustomPostTypesEditable("showcustomtypes", __("Show search in custom post types selectors", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showcustomtypes', $_dk));
48
  $params[$o->getName()] = $o->getData();
49
  $params['selected-'.$o->getName()] = $o->getSelected();
50
  ?></div>
51
  <div class="item">
52
  <p class='infoMsg'><?php _e("Nor recommended if you have more than 500 categories! (the HTML output will get too big)", "ajax-search-lite"); ?></p>
53
  <?php
54
- $o = new wpdreamsYesNo("showsearchincategories", __("Show the categories selectors?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showsearchincategories', $_dk));
55
  $params[$o->getName()] = $o->getData();
56
  ?></div>
57
  <div class="item">
58
  <?php
59
- $o = new wpdreamsYesNo("showuncategorised", __("Show the uncategorised category?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showuncategorised', $_dk));
60
  $params[$o->getName()] = $o->getData();
61
  ?></div>
62
  <div class="item"><?php
63
- $o = new wpdreamsCategories("exsearchincategories", __("Select which categories exclude", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'exsearchincategories', $_dk));
64
  $params[$o->getName()] = $o->getData();
65
  $params['selected-'.$o->getName()] = $o->getSelected();
66
  ?>
67
  </div>
68
  <div class="item">
69
  <?php
70
- $o = new wpdreamsText("exsearchincategoriestext", __("Categories filter box header text", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'exsearchincategoriestext', $_dk));
71
  $params[$o->getName()] = $o->getData();
72
  ?>
73
  </div>
1
  <div class="item">
2
  <?php
3
+ $o = new wpdreamsYesNo("show_frontend_search_settings", __("Show search settings on the frontend?", "ajax-search-lite"), $sd['show_frontend_search_settings']);
4
  $params[$o->getName()] = $o->getData();
5
  ?>
6
  </div>
9
  </div>
10
  <div class="item">
11
  <?php
12
+ $o = new wpdreamsYesNo("showexactmatches", __("Show exact matches selector?", "ajax-search-lite"), $sd['showexactmatches']);
13
  $params[$o->getName()] = $o->getData();
14
+ $o = new wpdreamsText("exactmatchestext", "Text", $sd['exactmatchestext']);
15
  $params[$o->getName()] = $o->getData();
16
  ?>
17
  </div>
18
  <div class="item">
19
  <?php
20
+ $o = new wpdreamsYesNo("showsearchinposts", __("Show search in posts selector?", "ajax-search-lite"), $sd['showsearchinposts']);
21
  $params[$o->getName()] = $o->getData();
22
+ $o = new wpdreamsText("searchinpoststext", "Text", $sd['searchinpoststext']);
23
  $params[$o->getName()] = $o->getData();
24
  ?></div>
25
  <div class="item">
26
  <?php
27
+ $o = new wpdreamsYesNo("showsearchinpages", __("Show search in pages selector?", "ajax-search-lite"), $sd['showsearchinpages']);
28
  $params[$o->getName()] = $o->getData();
29
+ $o = new wpdreamsText("searchinpagestext", "Text", $sd['searchinpagestext']);
30
  $params[$o->getName()] = $o->getData();
31
  ?></div>
32
  <div class="item">
33
  <?php
34
+ $o = new wpdreamsYesNo("showsearchintitle", __("Show search in title selector?", "ajax-search-lite"), $sd['showsearchintitle']);
35
  $params[$o->getName()] = $o->getData();
36
+ $o = new wpdreamsText("searchintitletext", "Text", $sd['searchintitletext']);
37
  $params[$o->getName()] = $o->getData();
38
  ?></div>
39
  <div class="item">
40
  <?php
41
+ $o = new wpdreamsYesNo("showsearchincontent", __("Show search in content selector?", "ajax-search-lite"), $sd['showsearchincontent']);
42
  $params[$o->getName()] = $o->getData();
43
+ $o = new wpdreamsText("searchincontenttext", "Text", $sd['searchincontenttext']);
44
  $params[$o->getName()] = $o->getData();
45
  ?></div>
46
  <div class="item"><?php
47
+ $o = new wpdreamsCustomPostTypesEditable("showcustomtypes", __("Show search in custom post types selectors", "ajax-search-lite"), $sd['showcustomtypes']);
48
  $params[$o->getName()] = $o->getData();
49
  $params['selected-'.$o->getName()] = $o->getSelected();
50
  ?></div>
51
  <div class="item">
52
  <p class='infoMsg'><?php _e("Nor recommended if you have more than 500 categories! (the HTML output will get too big)", "ajax-search-lite"); ?></p>
53
  <?php
54
+ $o = new wpdreamsYesNo("showsearchincategories", __("Show the categories selectors?", "ajax-search-lite"), $sd['showsearchincategories']);
55
  $params[$o->getName()] = $o->getData();
56
  ?></div>
57
  <div class="item">
58
  <?php
59
+ $o = new wpdreamsYesNo("showuncategorised", __("Show the uncategorised category?", "ajax-search-lite"), $sd['showuncategorised']);
60
  $params[$o->getName()] = $o->getData();
61
  ?></div>
62
  <div class="item"><?php
63
+ $o = new wpdreamsCategories("exsearchincategories", __("Select which categories exclude", "ajax-search-lite"), $sd['exsearchincategories']);
64
  $params[$o->getName()] = $o->getData();
65
  $params['selected-'.$o->getName()] = $o->getSelected();
66
  ?>
67
  </div>
68
  <div class="item">
69
  <?php
70
+ $o = new wpdreamsText("exsearchincategoriestext", __("Categories filter box header text", "ajax-search-lite"), $sd['exsearchincategoriestext']);
71
  $params[$o->getName()] = $o->getData();
72
  ?>
73
  </div>
backend/tabs/instance/general/autocomplete.php CHANGED
@@ -1,37 +1,37 @@
1
  <div class="item"><?php
2
- $o = new wpdreamsYesNo("autocomplete", "Turn on google search autocomplete?", setval_or_getoption($sd, 'autocomplete', $_dk));
3
  $params[$o->getName()] = $o->getData();
4
  ?>
5
  <p class="descMsg">Autocomplete feature will try to help the user finish what is being typed into the search box.</p>
6
  </div>
7
  <div class="item"><?php
8
- $o = new wpdreamsYesNo("kw_suggestions", "Turn on google search keyword suggestions?", setval_or_getoption($sd, 'kw_suggestions', $_dk));
9
  $params[$o->getName()] = $o->getData();
10
  ?>
11
  <p class="descMsg">Keyword suggestions appear when no results match the keyword.</p>
12
  </div>
13
  <div class="item"><?php
14
  $o = new wpdreamsTextSmall("kw_length", "Max. keyword length",
15
- wpdreams_setval_or_getoption($sd, 'kw_length', $_dk));
16
  $params[$o->getName()] = $o->getData();
17
  ?>
18
  <p class="descMsg">The length of each suggestion in characters. 30-60 is a good number to avoid too long suggestions.</p>
19
  </div>
20
  <div class="item"><?php
21
  $o = new wpdreamsTextSmall("kw_count", "Max. keywords count",
22
- wpdreams_setval_or_getoption($sd, 'kw_count', $_dk));
23
  $params[$o->getName()] = $o->getData();
24
  ?>
25
  </div>
26
  <div class="item"><?php
27
  $o = new wpdreamsLanguageSelect("kw_google_lang", "Google suggestions language",
28
- wpdreams_setval_or_getoption($sd, 'kw_google_lang', $_dk));
29
  $params[$o->getName()] = $o->getData();
30
  ?>
31
  </div>
32
  <div class="item">
33
  <?php
34
- $o = new wpdreamsTextarea("kw_exceptions", "Keyword exceptions (comma separated)", wpdreams_setval_or_getoption($sd, 'kw_exceptions', $_dk));
35
  $params[$o->getName()] = $o->getData();
36
  ?>
37
  </div>
1
  <div class="item"><?php
2
+ $o = new wpdreamsYesNo("autocomplete", "Turn on google search autocomplete?", $sd['autocomplete']);
3
  $params[$o->getName()] = $o->getData();
4
  ?>
5
  <p class="descMsg">Autocomplete feature will try to help the user finish what is being typed into the search box.</p>
6
  </div>
7
  <div class="item"><?php
8
+ $o = new wpdreamsYesNo("kw_suggestions", "Turn on google search keyword suggestions?", $sd['kw_suggestions']);
9
  $params[$o->getName()] = $o->getData();
10
  ?>
11
  <p class="descMsg">Keyword suggestions appear when no results match the keyword.</p>
12
  </div>
13
  <div class="item"><?php
14
  $o = new wpdreamsTextSmall("kw_length", "Max. keyword length",
15
+ $sd['kw_length']);
16
  $params[$o->getName()] = $o->getData();
17
  ?>
18
  <p class="descMsg">The length of each suggestion in characters. 30-60 is a good number to avoid too long suggestions.</p>
19
  </div>
20
  <div class="item"><?php
21
  $o = new wpdreamsTextSmall("kw_count", "Max. keywords count",
22
+ $sd['kw_count']);
23
  $params[$o->getName()] = $o->getData();
24
  ?>
25
  </div>
26
  <div class="item"><?php
27
  $o = new wpdreamsLanguageSelect("kw_google_lang", "Google suggestions language",
28
+ $sd['kw_google_lang']);
29
  $params[$o->getName()] = $o->getData();
30
  ?>
31
  </div>
32
  <div class="item">
33
  <?php
34
+ $o = new wpdreamsTextarea("kw_exceptions", "Keyword exceptions (comma separated)", $sd['kw_exceptions']);
35
  $params[$o->getName()] = $o->getData();
36
  ?>
37
  </div>
backend/tabs/instance/general/behavior.php CHANGED
@@ -1,55 +1,126 @@
1
  <div class="item">
2
  <?php
3
  $o = new wpdreamsYesNo("triggeronclick", __("Trigger search when clicking on search icon?", "ajax-search-lite"),
4
- wpdreams_setval_or_getoption($sd, 'triggeronclick', $_dk));
5
  $params[$o->getName()] = $o->getData();
6
  ?>
7
  </div>
8
  <div class="item">
9
  <?php
10
  $o = new wpdreamsYesNo("trigger_on_facet_change", __("Trigger search on facet change?", "ajax-search-lite"),
11
- wpdreams_setval_or_getoption($sd, 'trigger_on_facet_change', $_dk));
12
  $params[$o->getName()] = $o->getData();
13
  ?>
14
- <p class="descMsg">Will trigger a search when the user clicks on a checkbox on the front-end.</p>
15
  </div>
16
  <div class="item">
17
  <?php
18
  $o = new wpdreamsYesNo("redirectonclick", __("Redirect to search results page when clicking on search icon?", "ajax-search-lite"),
19
- wpdreams_setval_or_getoption($sd, 'redirectonclick', $_dk));
20
  $params[$o->getName()] = $o->getData();
21
  ?>
22
  </div>
23
  <div class="item">
24
  <?php
25
  $o = new wpdreamsYesNo("triggerontype", __("Trigger search when typing?", "ajax-search-lite"),
26
- wpdreams_setval_or_getoption($sd, 'triggerontype', $_dk));
27
  $params[$o->getName()] = $o->getData();
28
  ?>
29
  </div>
30
  <div class="item">
31
  <?php
32
  $o = new wpdreamsTextSmall("charcount", __("Minimal character count to trigger search", "ajax-search-lite"),
33
- wpdreams_setval_or_getoption($sd, 'charcount', $_dk), array(array("func" => "ctype_digit", "op" => "eq", "val" => true)));
34
  $params[$o->getName()] = $o->getData();
35
  ?>
36
  </div>
37
  <div class="item">
38
  <?php
39
- $o = new wpdreamsTextSmall("maxresults", __("Max. results", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'maxresults', $_dk), array(array("func" => "ctype_digit", "op" => "eq", "val" => true)));
40
  $params[$o->getName()] = $o->getData();
41
  ?>
42
  </div>
43
  <div class="item">
44
  <?php
45
  $o = new wpdreamsYesNo("description_context", __("Display the description context?", "ajax-search-lite"),
46
- wpdreams_setval_or_getoption($sd, 'description_context', $_dk));
47
  $params[$o->getName()] = $o->getData();
48
  ?>
49
  <p class="descMsg"><?php __("Will display the description from around the search phrase, not from the beginning.", "ajax-search-lite"); ?></p>
50
  </div>
51
  <div class="item"><?php
52
- $o = new wpdreamsTextSmall("itemscount", __("Results box viewport (in item numbers)", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'itemscount', $_dk), array(array("func" => "ctype_digit", "op" => "eq", "val" => true)));
53
  $params[$o->getName()] = $o->getData();
54
  ?>
55
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <div class="item">
2
  <?php
3
  $o = new wpdreamsYesNo("triggeronclick", __("Trigger search when clicking on search icon?", "ajax-search-lite"),
4
+ $sd['triggeronclick']);
5
  $params[$o->getName()] = $o->getData();
6
  ?>
7
  </div>
8
  <div class="item">
9
  <?php
10
  $o = new wpdreamsYesNo("trigger_on_facet_change", __("Trigger search on facet change?", "ajax-search-lite"),
11
+ $sd['trigger_on_facet_change']);
12
  $params[$o->getName()] = $o->getData();
13
  ?>
14
+ <p class="descMsg"><?php echo __("Will trigger a search when the user clicks on a checkbox on the front-end.", "ajax-search-lite"); ?></p>
15
  </div>
16
  <div class="item">
17
  <?php
18
  $o = new wpdreamsYesNo("redirectonclick", __("Redirect to search results page when clicking on search icon?", "ajax-search-lite"),
19
+ $sd['redirectonclick']);
20
  $params[$o->getName()] = $o->getData();
21
  ?>
22
  </div>
23
  <div class="item">
24
  <?php
25
  $o = new wpdreamsYesNo("triggerontype", __("Trigger search when typing?", "ajax-search-lite"),
26
+ $sd['triggerontype']);
27
  $params[$o->getName()] = $o->getData();
28
  ?>
29
  </div>
30
  <div class="item">
31
  <?php
32
  $o = new wpdreamsTextSmall("charcount", __("Minimal character count to trigger search", "ajax-search-lite"),
33
+ $sd['charcount'], array(array("func" => "ctype_digit", "op" => "eq", "val" => true)));
34
  $params[$o->getName()] = $o->getData();
35
  ?>
36
  </div>
37
  <div class="item">
38
  <?php
39
+ $o = new wpdreamsTextSmall("maxresults", __("Max. results", "ajax-search-lite"), $sd['maxresults'], array(array("func" => "ctype_digit", "op" => "eq", "val" => true)));
40
  $params[$o->getName()] = $o->getData();
41
  ?>
42
  </div>
43
  <div class="item">
44
  <?php
45
  $o = new wpdreamsYesNo("description_context", __("Display the description context?", "ajax-search-lite"),
46
+ $sd['description_context']);
47
  $params[$o->getName()] = $o->getData();
48
  ?>
49
  <p class="descMsg"><?php __("Will display the description from around the search phrase, not from the beginning.", "ajax-search-lite"); ?></p>
50
  </div>
51
  <div class="item"><?php
52
+ $o = new wpdreamsTextSmall("itemscount", __("Results box viewport (in item numbers)", "ajax-search-lite"), $sd['itemscount'], array(array("func" => "ctype_digit", "op" => "eq", "val" => true)));
53
  $params[$o->getName()] = $o->getData();
54
  ?>
55
+ </div>
56
+ <div class="item item-flex-nogrow">
57
+ <?php
58
+ $o = new wpdreamsYesNo("redirectonclick", __("Redirect when clicking on search icon?", "ajax-search-lite"),
59
+ $sd['redirectonclick']);
60
+ $params[$o->getName()] = $o->getData();
61
+ ?>
62
+ <?php
63
+ $o = new wpdreamsCustomSelect("redirect_click_to", __(" and redirect to", "ajax-search-lite"),
64
+ array(
65
+ 'selects' => array(
66
+ array("option" => __("Results page", "ajax-search-lite"), "value" => "results_page"),
67
+ array("option" => __("First matching result", "ajax-search-lite"), "value" => "first_result")
68
+ ),
69
+ 'value' => $sd['redirect_click_to']
70
+ ));
71
+ $params[$o->getName()] = $o->getData();
72
+ ?>
73
+ </div>
74
+ <div class="item item-flex-nogrow item-conditional">
75
+ <?php
76
+ $o = new wpdreamsYesNo("redirect_on_enter", __("Redirect when hitting the return key?", "ajax-search-lite"),
77
+ $sd['redirect_on_enter']);
78
+ $params[$o->getName()] = $o->getData();
79
+ ?>
80
+ <?php
81
+ $o = new wpdreamsCustomSelect("redirect_enter_to", __(" and redirect to", "ajax-search-lite"),
82
+ array(
83
+ 'selects' => array(
84
+ array("option" => __("Results page", "ajax-search-lite"), "value" => "results_page"),
85
+ array("option" => __("First matching result", "ajax-search-lite"), "value" => "first_result")
86
+ ),
87
+ 'value' => $sd['redirect_enter_to']
88
+ ));
89
+ $params[$o->getName()] = $o->getData();
90
+ ?>
91
+ </div>
92
+ <div class="item">
93
+ <?php
94
+ $o = new wpdreamsYesNo("override_default_results", __("Override the default WordPress search results?", "ajax-search-lite"),
95
+ $sd['override_default_results']);
96
+ $params[$o->getName()] = $o->getData();
97
+ ?>
98
+ <p class="descMsg"><?php echo __("Might not work with some Themes.", "ajax-search-lite"); ?></p>
99
+ </div>
100
+ <script>
101
+ jQuery(function($) {
102
+ $('input[name="redirectonclick"] + .wpdreamsYesNoInner').click(function(){
103
+ if ($(this).prev().val() == 0)
104
+ $('select[name="redirect_click_to"]').parent().addClass('disabled');
105
+ else
106
+ $('select[name="redirect_click_to"]').parent().removeClass('disabled');
107
+ });
108
+ $('input[name="redirect_on_enter"] + .wpdreamsYesNoInner').click(function(){
109
+ if ($(this).prev().val() == 0)
110
+ $('select[name="redirect_enter_to"]').parent().addClass('disabled');
111
+ else
112
+ $('select[name="redirect_enter_to"]').parent().removeClass('disabled');
113
+ });
114
+
115
+ if ( $('input[name="redirectonclick"]').val() == 0 )
116
+ $('select[name="redirect_click_to"]').parent().addClass('disabled');
117
+ else
118
+ $('select[name="redirect_click_to"]').parent().removeClass('disabled');
119
+
120
+ if ( $('input[name="redirect_on_enter"]').val() == 0 )
121
+ $('select[name="redirect_enter_to"]').parent().addClass('disabled');
122
+ else
123
+ $('select[name="redirect_enter_to"]').parent().removeClass('disabled');
124
+
125
+ });
126
+ </script>
backend/tabs/instance/general/ordering.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="item"><?php
2
+ $o = new wpdreamsCustomSelect("orderby_primary", __("Primary result ordering", "ajax-search-lite"),
3
+ array(
4
+ 'selects' => array(
5
+ array('option' => 'Relevance', 'value' => 'relevance DESC'),
6
+ array('option' => 'Title descending', 'value' => 'title DESC'),
7
+ array('option' => 'Title ascending', 'value' => 'title ASC'),
8
+ array('option' => 'Date descending', 'value' => 'date DESC'),
9
+ array('option' => 'Date ascending', 'value' => 'date ASC')
10
+ ),
11
+ 'value' => $sd['orderby_primary']
12
+ ));
13
+ $params[$o->getName()] = $o->getData();
14
+ ?>
15
+ <p class="descMsg"><?php __("This is the primary ordering. If two elements match the primary ordering criteria, the Secondary ordering is used below.", "ajax-search-lite"); ?></p>
16
+ </div>
17
+ <div class="item"><?php
18
+ $o = new wpdreamsCustomSelect("orderby_secondary", __("Secondary result ordering", "ajax-search-lite"),
19
+ array(
20
+ 'selects' => array(
21
+ array('option' => 'Relevance', 'value' => 'relevance DESC'),
22
+ array('option' => 'Title descending', 'value' => 'title DESC'),
23
+ array('option' => 'Title ascending', 'value' => 'title ASC'),
24
+ array('option' => 'Date descending', 'value' => 'date DESC'),
25
+ array('option' => 'Date ascending', 'value' => 'date ASC')
26
+ ),
27
+ 'value' => $sd['orderby_secondary']
28
+ ));
29
+ $params[$o->getName()] = $o->getData();
30
+ ?>
31
+ <p class="descMsg"><?php __("For matching elements by primary ordering, this ordering is used.", "ajax-search-lite"); ?></p>
32
+ </div>
backend/tabs/instance/general/sources.php CHANGED
@@ -14,55 +14,63 @@ $themes = array(
14
  <?php
15
  $o = new wpdreamsCustomSelect("theme", __("Theme", "ajax-search-lite"), array(
16
  'selects'=>$themes,
17
- 'value'=>wpdreams_setval_or_getoption($sd, 'theme', $_dk)
18
  ));
19
  $params[$o->getName()] = $o->getData();
20
  ?>
21
  </div>
 
 
 
 
 
 
 
 
22
  <div class="item">
23
  <?php
24
  $o = new wpdreamsYesNo("searchinposts", __("Search in posts?", "ajax-search-lite"),
25
- wpdreams_setval_or_getoption($sd, "searchinposts", $_dk));
26
  $params[$o->getName()] = $o->getData();
27
  ?>
28
  </div>
29
  <div class="item">
30
  <?php
31
  $o = new wpdreamsYesNo("searchinpages", __("Search in pages?", "ajax-search-lite"),
32
- wpdreams_setval_or_getoption($sd, 'searchinpages', $_dk));
33
  $params[$o->getName()] = $o->getData();
34
  ?>
35
  </div>
36
  <div class="item"><?php
37
  $o = new wpdreamsCustomPostTypes("customtypes", __("Search in custom post types", "ajax-search-lite"),
38
- wpdreams_setval_or_getoption($sd, 'customtypes', $_dk));
39
  $params[$o->getName()] = $o->getData();
40
  $params['selected-'.$o->getName()] = $o->getSelected();
41
  ?></div>
42
  <div class="item">
43
  <?php
44
  $o = new wpdreamsYesNo("searchintitle", __("Search in title?", "ajax-search-lite"),
45
- wpdreams_setval_or_getoption($sd, 'searchintitle', $_dk));
46
  $params[$o->getName()] = $o->getData();
47
  ?>
48
  </div>
49
  <div class="item">
50
  <?php
51
  $o = new wpdreamsYesNo("searchincontent", __("Search in content?", "ajax-search-lite"),
52
- wpdreams_setval_or_getoption($sd, 'searchincontent', $_dk));
53
  $params[$o->getName()] = $o->getData();
54
  ?>
55
  </div>
56
  <div class="item">
57
  <?php
58
  $o = new wpdreamsYesNo("searchinexcerpt", __("Search in post excerpts?", "ajax-search-lite"),
59
- wpdreams_setval_or_getoption($sd, 'searchinexcerpt', $_dk));
60
  $params[$o->getName()] = $o->getData();
61
  ?>
62
  </div>
63
  <div class="item"><?php
64
  $o = new wpdreamsCustomFields("customfields", __("Search in custom fields", "ajax-search-lite"),
65
- wpdreams_setval_or_getoption($sd, 'customfields', $_dk));
66
  $params[$o->getName()] = $o->getData();
67
  $params['selected-'.$o->getName()] = $o->getSelected();
68
  ?>
@@ -70,23 +78,14 @@ $themes = array(
70
  <div class="item">
71
  <?php
72
  $o = new wpdreamsYesNo("exactonly", __("Show exact matches only?", "ajax-search-lite"),
73
- wpdreams_setval_or_getoption($sd, 'exactonly', $_dk));
74
  $params[$o->getName()] = $o->getData();
75
  ?>
76
  </div>
77
  <div class="item">
78
  <?php
79
  $o = new wpdreamsYesNo("searchinterms", __("Search in terms? (categories, tags)", "ajax-search-lite"),
80
- wpdreams_setval_or_getoption($sd, 'searchinterms', $_dk));
81
- $params[$o->getName()] = $o->getData();
82
- ?>
83
- </div>
84
- <div class="item"><?php
85
- $o = new wpdreamsCustomSelect("orderby", __("Result ordering", "ajax-search-lite"),
86
- array(
87
- 'selects' => wpdreams_setval_or_getoption($sd, 'orderby_def', $_dk),
88
- 'value' => wpdreams_setval_or_getoption($sd, 'orderby', $_dk)
89
- ));
90
  $params[$o->getName()] = $o->getData();
91
  ?>
92
  </div>
14
  <?php
15
  $o = new wpdreamsCustomSelect("theme", __("Theme", "ajax-search-lite"), array(
16
  'selects'=>$themes,
17
+ 'value'=>$sd['theme']
18
  ));
19
  $params[$o->getName()] = $o->getData();
20
  ?>
21
  </div>
22
+ <div class="item">
23
+ <?php
24
+ $o = new wpdreamsYesNo("override_search_form", __("Try to replace the theme search with Ajax Search Lite form?", "ajax-search-lite"),
25
+ $sd["override_search_form"]);
26
+ $params[$o->getName()] = $o->getData();
27
+ ?>
28
+ <p class="descMsg"><?php echo __("Works with most themes, which use the searchform.php theme file to display their search forms.", "ajax-search-lite"); ?></p>
29
+ </div>
30
  <div class="item">
31
  <?php
32
  $o = new wpdreamsYesNo("searchinposts", __("Search in posts?", "ajax-search-lite"),
33
+ $sd["searchinposts"]);
34
  $params[$o->getName()] = $o->getData();
35
  ?>
36
  </div>
37
  <div class="item">
38
  <?php
39
  $o = new wpdreamsYesNo("searchinpages", __("Search in pages?", "ajax-search-lite"),
40
+ $sd['searchinpages']);
41
  $params[$o->getName()] = $o->getData();
42
  ?>
43
  </div>
44
  <div class="item"><?php
45
  $o = new wpdreamsCustomPostTypes("customtypes", __("Search in custom post types", "ajax-search-lite"),
46
+ $sd['customtypes']);
47
  $params[$o->getName()] = $o->getData();
48
  $params['selected-'.$o->getName()] = $o->getSelected();
49
  ?></div>
50
  <div class="item">
51
  <?php
52
  $o = new wpdreamsYesNo("searchintitle", __("Search in title?", "ajax-search-lite"),
53
+ $sd['searchintitle']);
54
  $params[$o->getName()] = $o->getData();
55
  ?>
56
  </div>
57
  <div class="item">
58
  <?php
59
  $o = new wpdreamsYesNo("searchincontent", __("Search in content?", "ajax-search-lite"),
60
+ $sd['searchincontent']);
61
  $params[$o->getName()] = $o->getData();
62
  ?>
63
  </div>
64
  <div class="item">
65
  <?php
66
  $o = new wpdreamsYesNo("searchinexcerpt", __("Search in post excerpts?", "ajax-search-lite"),
67
+ $sd['searchinexcerpt']);
68
  $params[$o->getName()] = $o->getData();
69
  ?>
70
  </div>
71
  <div class="item"><?php
72
  $o = new wpdreamsCustomFields("customfields", __("Search in custom fields", "ajax-search-lite"),
73
+ $sd['customfields']);
74
  $params[$o->getName()] = $o->getData();
75
  $params['selected-'.$o->getName()] = $o->getSelected();
76
  ?>
78
  <div class="item">
79
  <?php
80
  $o = new wpdreamsYesNo("exactonly", __("Show exact matches only?", "ajax-search-lite"),
81
+ $sd['exactonly']);
82
  $params[$o->getName()] = $o->getData();
83
  ?>
84
  </div>
85
  <div class="item">
86
  <?php
87
  $o = new wpdreamsYesNo("searchinterms", __("Search in terms? (categories, tags)", "ajax-search-lite"),
88
+ $sd['searchinterms']);
 
 
 
 
 
 
 
 
 
89
  $params[$o->getName()] = $o->getData();
90
  ?>
91
  </div>
backend/tabs/instance/general_options.php CHANGED
@@ -1,12 +1,13 @@
1
  <ul id="subtabs" class='tabs'>
2
- <li><a tabid="101" class='subtheme current'>Sources</a></li>
3
  <li><a tabid="102" class='subtheme'>Behavior</a></li>
 
4
  <li><a tabid="103" class='subtheme'>Autocomplete & Suggestions</a></li>
5
  </ul>
6
  <div class='tabscontent'>
7
  <div tabid="101">
8
  <fieldset>
9
- <legend>Sources</legend>
10
  <?php include(ASL_PATH."backend/tabs/instance/general/sources.php"); ?>
11
  </fieldset>
12
  </div>
@@ -16,6 +17,12 @@
16
  <?php include(ASL_PATH."backend/tabs/instance/general/behavior.php"); ?>
17
  </fieldset>
18
  </div>
 
 
 
 
 
 
19
  <div tabid="103">
20
  <fieldset>
21
  <legend>Autocomplete & Suggestions</legend>
1
  <ul id="subtabs" class='tabs'>
2
+ <li><a tabid="101" class='subtheme current'>Sources & Basics</a></li>
3
  <li><a tabid="102" class='subtheme'>Behavior</a></li>
4
+ <li><a tabid="104" class='subtheme'>Ordering</a></li>
5
  <li><a tabid="103" class='subtheme'>Autocomplete & Suggestions</a></li>
6
  </ul>
7
  <div class='tabscontent'>
8
  <div tabid="101">
9
  <fieldset>
10
+ <legend>Sources & Basics</legend>
11
  <?php include(ASL_PATH."backend/tabs/instance/general/sources.php"); ?>
12
  </fieldset>
13
  </div>
17
  <?php include(ASL_PATH."backend/tabs/instance/general/behavior.php"); ?>
18
  </fieldset>
19
  </div>
20
+ <div tabid="104">
21
+ <fieldset>
22
+ <legend>Ordering</legend>
23
+ <?php include(ASL_PATH."backend/tabs/instance/general/ordering.php"); ?>
24
+ </fieldset>
25
+ </div>
26
  <div tabid="103">
27
  <fieldset>
28
  <legend>Autocomplete & Suggestions</legend>
backend/tabs/instance/image_options.php CHANGED
@@ -3,7 +3,7 @@
3
  $option_name = "show_images";
4
  $option_desc = __("Show images in results?", "ajax-search-lite");
5
  $o = new wpdreamsYesNo($option_name, $option_desc,
6
- wpdreams_setval_or_getoption($sd, $option_name, $_dk));
7
  $params[$o->getName()] = $o->getData();
8
  ?>
9
  </div>
@@ -12,7 +12,7 @@
12
  $option_name = "image_width";
13
  $option_desc = __("Image width", "ajax-search-lite");
14
  $o = new wpdreamsTextSmall($option_name, $option_desc,
15
- wpdreams_setval_or_getoption($sd, $option_name, $_dk));
16
  $params[$o->getName()] = $o->getData();
17
  ?>
18
  </div>
@@ -21,7 +21,7 @@
21
  $option_name = "image_height";
22
  $option_desc = __("Image height", "ajax-search-lite");
23
  $o = new wpdreamsTextSmall($option_name, $option_desc,
24
- wpdreams_setval_or_getoption($sd, $option_name, $_dk));
25
  $params[$o->getName()] = $o->getData();
26
  ?>
27
  </div>
@@ -32,8 +32,8 @@
32
  $option_name = "image_source1";
33
  $option_desc = __("Primary image source", "ajax-search-lite");
34
  $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
35
- 'selects'=>wpdreams_setval_or_getoption($sd, 'image_sources', $_dk),
36
- 'value'=>wpdreams_setval_or_getoption($sd, $option_name, $_dk)
37
  ));
38
  $params[$o->getName()] = $o->getData();
39
  ?>
@@ -43,8 +43,8 @@
43
  $option_name = "image_source2";
44
  $option_desc = __("Alternative image source 1", "ajax-search-lite");
45
  $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
46
- 'selects'=>wpdreams_setval_or_getoption($sd, 'image_sources', $_dk),
47
- 'value'=>wpdreams_setval_or_getoption($sd, $option_name, $_dk)
48
  ));
49
  $params[$o->getName()] = $o->getData();
50
  ?>
@@ -54,8 +54,8 @@
54
  $option_name = "image_source3";
55
  $option_desc = __("Alternative image source 2", "ajax-search-lite");
56
  $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
57
- 'selects'=>wpdreams_setval_or_getoption($sd, 'image_sources', $_dk),
58
- 'value'=>wpdreams_setval_or_getoption($sd, $option_name, $_dk)
59
  ));
60
  $params[$o->getName()] = $o->getData();
61
  ?>
@@ -65,8 +65,8 @@
65
  $option_name = "image_source4";
66
  $option_desc = __("Alternative image source 3", "ajax-search-lite");
67
  $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
68
- 'selects'=>wpdreams_setval_or_getoption($sd, 'image_sources', $_dk),
69
- 'value'=>wpdreams_setval_or_getoption($sd, $option_name, $_dk)
70
  ));
71
  $params[$o->getName()] = $o->getData();
72
  ?>
@@ -76,8 +76,8 @@
76
  $option_name = "image_source5";
77
  $option_desc = __("Alternative image source 4", "ajax-search-lite");
78
  $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
79
- 'selects'=>wpdreams_setval_or_getoption($sd, 'image_sources', $_dk),
80
- 'value'=>wpdreams_setval_or_getoption($sd, $option_name, $_dk)
81
  ));
82
  $params[$o->getName()] = $o->getData();
83
  ?>
@@ -87,7 +87,7 @@
87
  $option_name = "image_default";
88
  $option_desc = __("Default image url", "ajax-search-lite");
89
  $o = new wpdreamsUpload($option_name, $option_desc,
90
- wpdreams_setval_or_getoption($sd, $option_name, $_dk));
91
  $params[$o->getName()] = $o->getData();
92
  ?>
93
  </div>
@@ -96,7 +96,7 @@
96
  $option_name = "image_custom_field";
97
  $option_desc = __("Custom field containing the image", "ajax-search-lite");
98
  $o = new wpdreamsText($option_name, $option_desc,
99
- wpdreams_setval_or_getoption($sd, $option_name, $_dk));
100
  $params[$o->getName()] = $o->getData();
101
  ?>
102
  </div>
3
  $option_name = "show_images";
4
  $option_desc = __("Show images in results?", "ajax-search-lite");
5
  $o = new wpdreamsYesNo($option_name, $option_desc,
6
+ $sd[$option_name]);
7
  $params[$o->getName()] = $o->getData();
8
  ?>
9
  </div>
12
  $option_name = "image_width";
13
  $option_desc = __("Image width", "ajax-search-lite");
14
  $o = new wpdreamsTextSmall($option_name, $option_desc,
15
+ $sd[$option_name]);
16
  $params[$o->getName()] = $o->getData();
17
  ?>
18
  </div>
21
  $option_name = "image_height";
22
  $option_desc = __("Image height", "ajax-search-lite");
23
  $o = new wpdreamsTextSmall($option_name, $option_desc,
24
+ $sd[$option_name]);
25
  $params[$o->getName()] = $o->getData();
26
  ?>
27
  </div>
32
  $option_name = "image_source1";
33
  $option_desc = __("Primary image source", "ajax-search-lite");
34
  $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
35
+ 'selects'=>$sd['image_sources'],
36
+ 'value'=>$sd[$option_name]
37
  ));
38
  $params[$o->getName()] = $o->getData();
39
  ?>
43
  $option_name = "image_source2";
44
  $option_desc = __("Alternative image source 1", "ajax-search-lite");
45
  $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
46
+ 'selects'=>$sd['image_sources'],
47
+ 'value'=>$sd[$option_name]
48
  ));
49
  $params[$o->getName()] = $o->getData();
50
  ?>
54
  $option_name = "image_source3";
55
  $option_desc = __("Alternative image source 2", "ajax-search-lite");
56
  $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
57
+ 'selects'=>$sd['image_sources'],
58
+ 'value'=>$sd[$option_name]
59
  ));
60
  $params[$o->getName()] = $o->getData();
61
  ?>
65
  $option_name = "image_source4";
66
  $option_desc = __("Alternative image source 3", "ajax-search-lite");
67
  $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
68
+ 'selects'=>$sd['image_sources'],
69
+ 'value'=>$sd[$option_name]
70
  ));
71
  $params[$o->getName()] = $o->getData();
72
  ?>
76
  $option_name = "image_source5";
77
  $option_desc = __("Alternative image source 4", "ajax-search-lite");
78
  $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
79
+ 'selects'=>$sd['image_sources'],
80
+ 'value'=>$sd[$option_name]
81
  ));
82
  $params[$o->getName()] = $o->getData();
83
  ?>
87
  $option_name = "image_default";
88
  $option_desc = __("Default image url", "ajax-search-lite");
89
  $o = new wpdreamsUpload($option_name, $option_desc,
90
+ $sd[$option_name]);
91
  $params[$o->getName()] = $o->getData();
92
  ?>
93
  </div>
96
  $option_name = "image_custom_field";
97
  $option_desc = __("Custom field containing the image", "ajax-search-lite");
98
  $o = new wpdreamsText($option_name, $option_desc,
99
+ $sd[$option_name]);
100
  $params[$o->getName()] = $o->getData();
101
  ?>
102
  </div>
backend/tabs/instance/layout/box_layout.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="item"><?php
2
+ $o = new wpdreamsTextSmall("box_width", __("Search Box width", "ajax-search-lite"), $sd['box_width']);
3
+ $params[$o->getName()] = $o->getData();
4
+ ?>
5
+ <p class="descMsg"><?php echo __("Include the unit as well, example: 10px or 1em or 90%", "ajax-search-lite"); ?></p>
6
+ </div>
7
+ <div class="item">
8
+ <?php
9
+ $option_name = "box_margin";
10
+ $option_desc = __("Search box margin", "ajax-search-lite");
11
+ $option_expl = __("Include the unit as well, example: 10px or 1em or 90%", "ajax-search-lite");
12
+ $o = new wpdreamsFour($option_name, $option_desc,
13
+ array(
14
+ "desc" => $option_expl,
15
+ "value" => $sd[$option_name]
16
+ )
17
+ );
18
+ $params[$o->getName()] = $o->getData();
19
+ ?>
20
+ </div>
backend/tabs/instance/layout/results_behaviour.php CHANGED
@@ -1,32 +1,32 @@
1
  <div class="item">
2
  <?php
3
- $o = new wpdreamsYesNo("scroll_to_results", __("Sroll the window to the result list?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'scroll_to_results', $_dk));
4
  $params[$o->getName()] = $o->getData();
5
  ?>
6
  </div>
7
  <div class="item">
8
  <?php
9
- $o = new wpdreamsYesNo("resultareaclickable", __("Make the whole result area clickable?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'resultareaclickable', $_dk));
10
  $params[$o->getName()] = $o->getData();
11
  ?>
12
  </div>
13
  <div class="item">
14
  <?php
15
- $o = new wpdreamsYesNo("close_on_document_click", __("Close result list on document click?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'close_on_document_click', $_dk));
16
  $params[$o->getName()] = $o->getData();
17
  ?>
18
  </div>
19
  <div class="item">
20
  <?php
21
- $o = new wpdreamsYesNo("show_close_icon", __("Show the close icon?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'show_close_icon', $_dk));
22
  $params[$o->getName()] = $o->getData();
23
  ?>
24
  </div>
25
  <div class="item"><?php
26
- $o = new wpdreamsText("noresultstext", __("No results text", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'noresultstext', $_dk));
27
  $params[$o->getName()] = $o->getData();
28
  ?></div>
29
  <div class="item"><?php
30
- $o = new wpdreamsText("didyoumeantext", __("Did you mean text", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'didyoumeantext', $_dk));
31
  $params[$o->getName()] = $o->getData();
32
  ?></div>
1
  <div class="item">
2
  <?php
3
+ $o = new wpdreamsYesNo("scroll_to_results", __("Sroll the window to the result list?", "ajax-search-lite"), $sd['scroll_to_results']);
4
  $params[$o->getName()] = $o->getData();
5
  ?>
6
  </div>
7
  <div class="item">
8
  <?php
9
+ $o = new wpdreamsYesNo("resultareaclickable", __("Make the whole result area clickable?", "ajax-search-lite"), $sd['resultareaclickable']);
10
  $params[$o->getName()] = $o->getData();
11
  ?>
12
  </div>
13
  <div class="item">
14
  <?php
15
+ $o = new wpdreamsYesNo("close_on_document_click", __("Close result list on document click?", "ajax-search-lite"), $sd['close_on_document_click']);
16
  $params[$o->getName()] = $o->getData();
17
  ?>
18
  </div>
19
  <div class="item">
20
  <?php
21
+ $o = new wpdreamsYesNo("show_close_icon", __("Show the close icon?", "ajax-search-lite"), $sd['show_close_icon']);
22
  $params[$o->getName()] = $o->getData();
23
  ?>
24
  </div>
25
  <div class="item"><?php
26
+ $o = new wpdreamsText("noresultstext", __("No results text", "ajax-search-lite"), $sd['noresultstext']);
27
  $params[$o->getName()] = $o->getData();
28
  ?></div>
29
  <div class="item"><?php
30
+ $o = new wpdreamsText("didyoumeantext", __("Did you mean text", "ajax-search-lite"), $sd['didyoumeantext']);
31
  $params[$o->getName()] = $o->getData();
32
  ?></div>
backend/tabs/instance/layout/results_layout.php CHANGED
@@ -1,42 +1,51 @@
1
  <div class="item">
2
  <?php
3
- $o = new wpdreamsText("defaultsearchtext", __("Placeholder text", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'defaultsearchtext', $_dk));
4
  $params[$o->getName()] = $o->getData();
5
  ?>
6
  </div>
7
  <div class="item">
8
  <?php
9
- $o = new wpdreamsYesNo("showmoreresults", __("Show 'More results..' text in the bottom of the search box?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showmoreresults', $_dk));
10
  $params[$o->getName()] = $o->getData();
11
  ?>
12
  </div>
13
  <div class="item">
14
  <?php
15
- $o = new wpdreamsText("showmoreresultstext", __("' Show more results..' text", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showmoreresultstext', $_dk));
16
  $params[$o->getName()] = $o->getData();
17
  ?>
18
  </div>
19
  <div class="item">
20
  <?php
21
- $o = new wpdreamsYesNo("showauthor", __("Show author in results?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showauthor', $_dk));
22
  $params[$o->getName()] = $o->getData();
23
  ?>
24
  </div>
25
  <div class="item">
26
  <?php
27
- $o = new wpdreamsYesNo("showdate", __("Show date in results?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showdate', $_dk));
28
  $params[$o->getName()] = $o->getData();
29
  ?>
30
  </div>
31
  <div class="item">
32
  <?php
33
- $o = new wpdreamsYesNo("showdescription", __("Show description in results?", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'showdescription', $_dk));
34
  $params[$o->getName()] = $o->getData();
35
  ?>
36
  </div>
37
  <div class="item">
38
  <?php
39
- $o = new wpdreamsTextSmall("descriptionlength", __("Description length", "ajax-search-lite"), wpdreams_setval_or_getoption($sd, 'descriptionlength', $_dk));
 
 
 
 
 
 
 
 
 
40
  $params[$o->getName()] = $o->getData();
41
  ?>
42
  </div>
1
  <div class="item">
2
  <?php
3
+ $o = new wpdreamsText("defaultsearchtext", __("Placeholder text", "ajax-search-lite"), $sd['defaultsearchtext']);
4
  $params[$o->getName()] = $o->getData();
5
  ?>
6
  </div>
7
  <div class="item">
8
  <?php
9
+ $o = new wpdreamsYesNo("showmoreresults", __("Show 'More results..' text in the bottom of the search box?", "ajax-search-lite"), $sd['showmoreresults']);
10
  $params[$o->getName()] = $o->getData();
11
  ?>
12
  </div>
13
  <div class="item">
14
  <?php
15
+ $o = new wpdreamsText("showmoreresultstext", __("' Show more results..' text", "ajax-search-lite"), $sd['showmoreresultstext']);
16
  $params[$o->getName()] = $o->getData();
17
  ?>
18
  </div>
19
  <div class="item">
20
  <?php
21
+ $o = new wpdreamsYesNo("showauthor", __("Show author in results?", "ajax-search-lite"), $sd['showauthor']);
22
  $params[$o->getName()] = $o->getData();
23
  ?>
24
  </div>
25
  <div class="item">
26
  <?php
27
+ $o = new wpdreamsYesNo("showdate", __("Show date in results?", "ajax-search-lite"), $sd['showdate']);
28
  $params[$o->getName()] = $o->getData();
29
  ?>
30
  </div>
31
  <div class="item">
32
  <?php
33
+ $o = new wpdreamsYesNo("showdescription", __("Show description in results?", "ajax-search-lite"), $sd['showdescription']);
34
  $params[$o->getName()] = $o->getData();
35
  ?>
36
  </div>
37
  <div class="item">
38
  <?php
39
+ $o = new wpdreamsYesNo("description_context", __("Display the description context?", "ajax-search-lite"), $sd['description_context']);
40
+ $params[$o->getName()] = $o->getData();
41
+ ?>
42
+ <p class="descMsg">
43
+ <?php echo __("Will display the description from around the search phrase, not from the beginning.", "ajax-search-lite"); ?>
44
+ </p>
45
+ </div>
46
+ <div class="item">
47
+ <?php
48
+ $o = new wpdreamsTextSmall("descriptionlength", __("Description length", "ajax-search-lite"), $sd['descriptionlength']);
49
  $params[$o->getName()] = $o->getData();
50
  ?>
51
  </div>
backend/tabs/instance/layout_options.php CHANGED
@@ -1,15 +1,22 @@
1
  <ul id="subtabs" class='tabs'>
2
- <li><a tabid="401" class='subtheme current'><?php _e("Results layout", "ajax-search-lite"); ?></a></li>
3
- <li><a tabid="402" class='subtheme'><?php _e("Results Behaviour", "ajax-search-lite"); ?></a></li>
 
4
  </ul>
5
  <div class='tabscontent'>
6
  <div tabid="401">
 
 
 
 
 
 
7
  <fieldset>
8
  <legend><?php _e("Results layout", "ajax-search-lite"); ?></legend>
9
  <?php include(ASL_PATH."backend/tabs/instance/layout/results_layout.php"); ?>
10
  </fieldset>
11
  </div>
12
- <div tabid="402">
13
  <fieldset>
14
  <legend><?php _e("Results Behaviour", "ajax-search-lite"); ?></legend>
15
  <?php include(ASL_PATH."backend/tabs/instance/layout/results_behaviour.php"); ?>
1
  <ul id="subtabs" class='tabs'>
2
+ <li><a tabid="401" class='subtheme current'><?php _e("Search Box layout", "ajax-search-lite"); ?></a></li>
3
+ <li><a tabid="402" class='subtheme'><?php _e("Results layout", "ajax-search-lite"); ?></a></li>
4
+ <li><a tabid="403" class='subtheme'><?php _e("Results Behaviour", "ajax-search-lite"); ?></a></li>
5
  </ul>
6
  <div class='tabscontent'>
7
  <div tabid="401">
8
+ <fieldset>
9
+ <legend><?php _e("Search Box layout", "ajax-search-lite"); ?></legend>
10
+ <?php include(ASL_PATH."backend/tabs/instance/layout/box_layout.php"); ?>
11
+ </fieldset>
12
+ </div>
13
+ <div tabid="402">
14
  <fieldset>
15
  <legend><?php _e("Results layout", "ajax-search-lite"); ?></legend>
16
  <?php include(ASL_PATH."backend/tabs/instance/layout/results_layout.php"); ?>
17
  </fieldset>
18
  </div>
19
+ <div tabid="403">
20
  <fieldset>
21
  <legend><?php _e("Results Behaviour", "ajax-search-lite"); ?></legend>
22
  <?php include(ASL_PATH."backend/tabs/instance/layout/results_behaviour.php"); ?>
backend/tabs/instance/theme/custom_css.php DELETED
@@ -1,12 +0,0 @@
1
- <p class='infoMsg'>
2
- This css will be added before the plugin as inline CSS so it has a precedence
3
- over plugin CSS. (you can override existing rules)
4
- </p>
5
- <div class="item">
6
- <?php
7
- $option_name = "custom_css";
8
- $option_desc = "Custom CSS";
9
- $o = new wpdreamsTextareaBase64($option_name, $option_desc, wpdreams_setval_or_getoption($sd, $option_name, $_dk));
10
- $params[$o->getName()] = $o->getData();
11
- ?>
12
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
backend/tabs/instance/theme/horizontal_res.php DELETED
@@ -1,98 +0,0 @@
1
- <div class="item">
2
- <?php
3
- $o = new wpdreamsYesNo("hhidedesc", "Hide description if images are available", wpdreams_setval_or_getoption($sd, 'hhidedesc', $_dk));
4
- $params[$o->getName()] = $o->getData();
5
- ?>
6
- </div>
7
- <div class="item"><?php
8
- $o = new wpdreamsNumericUnit("hreswidth", "Result width", array(
9
- 'value' => wpdreams_setval_or_getoption($sd, 'hreswidth', $_dk),
10
- 'units'=>array('px'=>'px')));
11
- $params[$o->getName()] = $o->getData();
12
- ?>
13
- </div>
14
- <div class="item"><?php
15
- $o = new wpdreamsNumericUnit("hresheight", "Result height", array(
16
- 'value' => wpdreams_setval_or_getoption($sd, 'hresheight', $_dk),
17
- 'units'=>array('px'=>'px')));
18
- $params[$o->getName()] = $o->getData();
19
- ?>
20
- </div>
21
- <div class="item"><?php
22
- $o = new wpdreamsNumericUnit("hressidemargin", "Result side margin", array(
23
- 'value' => wpdreams_setval_or_getoption($sd, 'hressidemargin', $_dk),
24
- 'units'=>array('px'=>'px')));
25
- $params[$o->getName()] = $o->getData();
26
- ?>
27
- </div>
28
- <div class="item"><?php
29
- $o = new wpdreamsNumericUnit("hrespadding", "Result padding", array(
30
- 'value' => wpdreams_setval_or_getoption($sd, 'hrespadding', $_dk),
31
- 'units'=>array('px'=>'px')));
32
- $params[$o->getName()] = $o->getData();
33
- ?>
34
- </div>
35
- <div class="item"><?php
36
- $o = new wpdreamsGradient("hboxbg", "Result container background gradient", wpdreams_setval_or_getoption($sd, 'hboxbg', $_dk));
37
- $params[$o->getName()] = $o->getData();
38
- ?>
39
- </div>
40
- <div class="item">
41
- <?php
42
- $o = new wpdreamsBorder("hboxborder", "Results container border", wpdreams_setval_or_getoption($sd, 'hboxborder', $_dk));
43
- $params[$o->getName()] = $o->getData();
44
- ?>
45
- </div>
46
- <div class="item">
47
- <?php
48
- $o = new wpdreamsBoxShadow("hboxshadow", "Results container box shadow", wpdreams_setval_or_getoption($sd, 'hboxshadow', $_dk));
49
- $params[$o->getName()] = $o->getData();
50
- ?>
51
- </div>
52
- <div class="item"><?php
53
- $o = new wpdreamsAnimations("hresultinanim", "Result item incoming animation", wpdreams_setval_or_getoption($sd, 'hresultinanim', $_dk));
54
- $params[$o->getName()] = $o->getData();
55
- ?>
56
- </div>
57
- <div class="item"><?php
58
- $o = new wpdreamsGradient("hresultbg", "Result item background gradient", wpdreams_setval_or_getoption($sd, 'hresultbg', $_dk));
59
- $params[$o->getName()] = $o->getData();
60
- ?>
61
- </div>
62
- <div class="item"><?php
63
- $o = new wpdreamsGradient("hresulthbg", "Result item mouse hover background gradient", wpdreams_setval_or_getoption($sd, 'hresulthbg', $_dk));
64
- $params[$o->getName()] = $o->getData();
65
- ?>
66
- </div>
67
- <div class="item">
68
- <?php
69
- $o = new wpdreamsBorder("hresultborder", "Results item border", wpdreams_setval_or_getoption($sd, 'hresultborder', $_dk));
70
- $params[$o->getName()] = $o->getData();
71
- ?>
72
- </div>
73
- <div class="item">
74
- <?php
75
- $o = new wpdreamsBoxShadow("hresultshadow", "Results item box shadow", wpdreams_setval_or_getoption($sd, 'hresultshadow', $_dk));
76
- $params[$o->getName()] = $o->getData();
77
- ?>
78
- </div>
79
- <div class="item">
80
- <?php
81
- $o = new wpdreamsBorder("hresultimageborder", "Results image border", wpdreams_setval_or_getoption($sd, 'hresultimageborder', $_dk));
82
- $params[$o->getName()] = $o->getData();
83
- ?>
84
- </div>
85
- <div class="item">
86
- <?php
87
- $o = new wpdreamsBoxShadow("hresultimageshadow", "Results image box shadow", wpdreams_setval_or_getoption($sd, 'hresultimageshadow', $_dk));
88
- $params[$o->getName()] = $o->getData();
89
- ?>
90
- </div>
91
- <div class="item"><?php
92
- $o = new wpdreamsColorPicker("harrowcolor","Resultbar arrow color", wpdreams_setval_or_getoption($sd, 'harrowcolor', $_dk));
93
- $params[$o->getName()] = $o->getData();
94
- ?></div>
95
- <div class="item"><?php
96
- $o = new wpdreamsColorPicker("hoverflowcolor","Resultbar overflow color", wpdreams_setval_or_getoption($sd, 'hoverflowcolor', $_dk));
97
- $params[$o->getName()] = $o->getData();
98
- ?></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/tabs/instance/theme/input_field.php DELETED
@@ -1,21 +0,0 @@
1
- <div class="item"><?php
2
- $o = new wpdreamsGradient("inputbackground", "Search input field background gradient", wpdreams_setval_or_getoption($sd, 'inputbackground', $_dk));
3
- $params[$o->getName()] = $o->getData();
4
- ?></div>
5
- <div class="item">
6
- <?php
7
- $o = new wpdreamsBorder("inputborder", "Search input field border", wpdreams_setval_or_getoption($sd, 'inputborder', $_dk));
8
- $params[$o->getName()] = $o->getData();
9
- ?>
10
- </div>
11
- <div class="item">
12
- <?php
13
- $o = new wpdreamsBoxShadow("inputshadow", "Search input field Shadow", wpdreams_setval_or_getoption($sd, 'inputshadow', $_dk));
14
- $params[$o->getName()] = $o->getData();
15
- ?>
16
- </div>
17
- <div class="item"><?php
18
- $o = new wpdreamsFontComplete("inputfont", "Search input font", wpdreams_setval_or_getoption($sd, 'inputfont', $_dk));
19
- $params[$o->getName()] = $o->getData();
20
- ?>
21
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/tabs/instance/theme/isotopic_nav.php DELETED
@@ -1,43 +0,0 @@
1
- <div class="item"><?php
2
- $o = new wpdreamsCustomSelect("i_pagination_position", "Navigation position", array(
3
- 'selects'=>wpdreams_setval_or_getoption($sd, 'i_pagination_position_def', $_dk),
4
- 'value'=>wpdreams_setval_or_getoption($sd, 'i_pagination_position', $_dk)
5
- ));
6
- $params[$o->getName()] = $o->getData();
7
- ?>
8
- </div>
9
- <div class="item"><?php
10
- $o = new wpdreamsColorPicker("i_pagination_background", "Pagination background", wpdreams_setval_or_getoption($sd, 'i_pagination_background', $_dk));
11
- $params[$o->getName()] = $o->getData();
12
- ?>
13
- </div>
14
- <div class="item">
15
- <?php
16
- $o = new wpdreamsImageRadio("i_pagination_arrow", "Arrow image", array(
17
- 'images' => wpdreams_setval_or_getoption($sd, 'i_pagination_arrow_selects', $_dk),
18
- 'value'=> wpdreams_setval_or_getoption($sd, 'i_pagination_arrow', $_dk)
19
- )
20
- );
21
- $params[$o->getName()] = $o->getData();
22
- ?>
23
- </div>
24
- <div class="item"><?php
25
- $o = new wpdreamsColorPicker("i_pagination_arrow_background", "Arrow background color", wpdreams_setval_or_getoption($sd, 'i_pagination_arrow_background', $_dk));
26
- $params[$o->getName()] = $o->getData();
27
- ?>
28
- </div>
29
- <div class="item"><?php
30
- $o = new wpdreamsColorPicker("i_pagination_arrow_color", "Arrow color", wpdreams_setval_or_getoption($sd, 'i_pagination_arrow_color', $_dk));
31
- $params[$o->getName()] = $o->getData();
32
- ?>
33
- </div>
34
- <div class="item"><?php
35
- $o = new wpdreamsColorPicker("i_pagination_page_background", "Active page background color", wpdreams_setval_or_getoption($sd, 'i_pagination_page_background', $_dk));
36
- $params[$o->getName()] = $o->getData();
37
- ?>
38
- </div>
39
- <div class="item"><?php
40
- $o = new wpdreamsColorPicker("i_pagination_font_color", "Font color", wpdreams_setval_or_getoption($sd, 'i_pagination_font_color', $_dk));
41
- $params[$o->getName()] = $o->getData();
42
- ?>
43
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/tabs/instance/theme/isotopic_res.php DELETED
@@ -1,92 +0,0 @@
1
- <style>
2
- .wpdreamsTextSmall {
3
- display: inline-block;
4
- }
5
- </style>
6
- <div class="item"><?php
7
- $o = new wpdreamsCustomSelect("i_ifnoimage", "If no image found", array(
8
- 'selects'=>wpdreams_setval_or_getoption($sd, 'i_ifnoimage_def', $_dk),
9
- 'value'=>wpdreams_setval_or_getoption($sd, 'i_ifnoimage', $_dk)
10
- ));
11
- $params[$o->getName()] = $o->getData();
12
- ?>
13
- </div>
14
- <div class="item"><?php
15
- $o = new wpdreamsTextSmall("i_item_width", "Result width", wpdreams_setval_or_getoption($sd, 'i_item_width', $_dk));
16
- $params[$o->getName()] = $o->getData();
17
- ?>px
18
- <p class="descMsg">The search will try to stick close to this value when filling the width of the results list.</p>
19
- </div>
20
- <div class="item"><?php
21
- $o = new wpdreamsTextSmall("i_item_height", "Result height", wpdreams_setval_or_getoption($sd, 'i_item_height', $_dk));
22
- $params[$o->getName()] = $o->getData();
23
- ?>px
24
- </div>
25
- <div class="item"><?php
26
- $o = new wpdreamsColorPicker("i_res_item_content_background", "Result content background", wpdreams_setval_or_getoption($sd, 'i_res_item_content_background', $_dk));
27
- $params[$o->getName()] = $o->getData();
28
- ?>
29
- </div>
30
- <div class="item">
31
- <?php
32
- $o = new wpdreamsYesNo("i_overlay", "Show overlay on mouseover?", wpdreams_setval_or_getoption($sd, 'i_overlay', $_dk));
33
- $params[$o->getName()] = $o->getData();
34
- ?>
35
- </div>
36
- <div class="item">
37
- <?php
38
- $o = new wpdreamsYesNo("i_overlay_blur", "Blur overlay image on mouseover?", wpdreams_setval_or_getoption($sd, 'i_overlay_blur', $_dk));
39
- $params[$o->getName()] = $o->getData();
40
- ?>
41
- </div>
42
- <div class="item">
43
- <?php
44
- $o = new wpdreamsYesNo("i_hide_content", "Hide the content when overlay is active?", wpdreams_setval_or_getoption($sd, 'i_hide_content', $_dk));
45
- $params[$o->getName()] = $o->getData();
46
- ?>
47
- </div>
48
- <div class="item">
49
- <?php
50
- $o = new wpdreamsAnimations("i_animation", "Display animation", wpdreams_setval_or_getoption($sd, 'i_animation', $_dk));
51
- $params[$o->getName()] = $o->getData();
52
- ?>
53
- </div>
54
- <div class="item"><?php
55
- $o = new wpdreamsTextSmall("i_rows", "Rows count", wpdreams_setval_or_getoption($sd, 'i_rows', $_dk));
56
- $params[$o->getName()] = $o->getData();
57
- ?>
58
- <p class="descMsg">If the item would exceed the row limit, it gets placed to a new page.</p>
59
- </div>
60
- <div class="item">
61
- <?php
62
- $option_name = "i_res_container_padding";
63
- $option_desc = "Result container padding";
64
- $option_expl = "Include the unit as well, example: 10px or 1em or 90%";
65
- $o = new wpdreamsFour($option_name, $option_desc,
66
- array(
67
- "desc" => $option_expl,
68
- "value" => wpdreams_setval_or_getoption($sd, $option_name, $_dk)
69
- )
70
- );
71
- $params[$o->getName()] = $o->getData();
72
- ?>
73
- </div>
74
- <div class="item">
75
- <?php
76
- $option_name = "i_res_container_margin";
77
- $option_desc = "Result container margin";
78
- $option_expl = "Include the unit as well, example: 10px or 1em or 90%";
79
- $o = new wpdreamsFour($option_name, $option_desc,
80
- array(
81
- "desc" => $option_expl,
82
- "value" => wpdreams_setval_or_getoption($sd, $option_name, $_dk)
83
- )
84
- );
85
- $params[$o->getName()] = $o->getData();
86
- ?>
87
- </div>
88
- <div class="item"><?php
89
- $o = new wpdreamsColorPicker("i_res_container_bg", "Result box background", wpdreams_setval_or_getoption($sd, 'i_res_container_bg', $_dk));
90
- $params[$o->getName()] = $o->getData();
91
- ?>
92
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/tabs/instance/theme/magn_load.php DELETED
@@ -1,57 +0,0 @@
1
- <div class="item">
2
- <?php
3
- $o = new wpdreamsImageRadio("magnifierimage", "Magnifier image", array(
4
- 'images' => wpdreams_setval_or_getoption($sd, 'magnifierimage_selects', $_dk),
5
- 'value'=> wpdreams_setval_or_getoption($sd, 'magnifierimage', $_dk)
6
- )
7
- );
8
- $params[$o->getName()] = $o->getData();
9
- ?>
10
- </div>
11
- <div class="item"><?php
12
- $o = new wpdreamsColorPicker("magnifierimage_color", "Magnifier icon color", wpdreams_setval_or_getoption($sd, 'magnifierimage_color', $_dk));
13
- $params[$o->getName()] = $o->getData();
14
- ?>
15
- </div>
16
- <div class="item"><?php
17
- $o = new wpdreamsUpload("magnifierimage_custom", "Custom magnifier icon", wpdreams_setval_or_getoption($sd, 'magnifierimage_custom', $_dk));
18
- $params[$o->getName()] = $o->getData();
19
- ?>
20
- </div>
21
- <div class="item"><?php
22
- $o = new wpdreamsGradient("magnifierbackground", "Magnifier background gradient", wpdreams_setval_or_getoption($sd, 'magnifierbackground', $_dk));
23
- $params[$o->getName()] = $o->getData();
24
- ?>
25
- </div>
26
- <div class="item">
27
- <?php
28
- $o = new wpdreamsBorder("magnifierbackgroundborder", "Magnifier-icon border", wpdreams_setval_or_getoption($sd, 'magnifierbackgroundborder', $_dk));
29
- $params[$o->getName()] = $o->getData();
30
- ?>
31
- </div>
32
- <div class="item">
33
- <?php
34
- $o = new wpdreamsBoxShadow("magnifierboxshadow", "Magnifier-icon box-shadow", wpdreams_setval_or_getoption($sd, 'magnifierboxshadow', $_dk));
35
- $params[$o->getName()] = $o->getData();
36
- ?>
37
- </div>
38
- <div class="item">
39
- <?php
40
- $o = new wpdreamsImageRadio("loadingimage", "Loading image", array(
41
- 'images' => wpdreams_setval_or_getoption($sd, 'loadingimage_selects', $_dk),
42
- 'value'=> wpdreams_setval_or_getoption($sd, 'loadingimage', $_dk)
43
- )
44
- );
45
- $params[$o->getName()] = $o->getData();
46
- ?>
47
- </div>
48
- <div class="item"><?php
49
- $o = new wpdreamsColorPicker("loadingimage_color", "Loader color", wpdreams_setval_or_getoption($sd, 'loadingimage_color', $_dk));
50
- $params[$o->getName()] = $o->getData();
51
- ?>
52
- </div>
53
- <div class="item"><?php
54
- $o = new wpdreamsUpload("loadingimage_custom", "Custom magnifier icon", wpdreams_setval_or_getoption($sd, 'loadingimage_custom', $_dk));
55
- $params[$o->getName()] = $o->getData();
56
- ?>
57
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/tabs/instance/theme/overall_box.php DELETED
@@ -1,39 +0,0 @@
1
- <div class="item">
2
- <?php
3
- $o = new wpdreamsThemeChooser("themes", "Theme Chooser", $_themes);
4
- //$params[$o->getName()] = $o->getData();
5
- ?>
6
- </div>
7
- <div class="item"><?php
8
- $o = new wpdreamsNumericUnit("boxheight", "Search box height", array(
9
- 'value' => wpdreams_setval_or_getoption($sd, 'boxheight', $_dk),
10
- 'units'=>array('px'=>'px')
11
- ));
12
- $params[$o->getName()] = $o->getData();
13
- ?>
14
- </div>
15
- <div class="item"><?php
16
- $o = new wpdreamsNumericUnit("boxmargin", "Search box margin", array(
17
- 'value' => wpdreams_setval_or_getoption($sd, 'boxmargin', $_dk),
18
- 'units'=>array('px'=>'px', '%'=>'%')
19
- ));
20
- $params[$o->getName()] = $o->getData();
21
- ?>
22
- </div>
23
- <div class="item"><?php
24
- $o = new wpdreamsGradient("boxbackground", "Search box background gradient", wpdreams_setval_or_getoption($sd, 'boxbackground', $_dk));
25
- $params[$o->getName()] = $o->getData();
26
- ?>
27
- </div>
28
- <div class="item">
29
- <?php
30
- $o = new wpdreamsBorder("boxborder", "Search box border", wpdreams_setval_or_getoption($sd, 'boxborder', $_dk));
31
- $params[$o->getName()] = $o->getData();
32
- ?>
33
- </div>
34
- <div class="item">
35
- <?php
36
- $o = new wpdreamsBoxShadow("boxshadow", "Search box Shadow", wpdreams_setval_or_getoption($sd, 'boxshadow', $_dk));
37
- $params[$o->getName()] = $o->getData();
38
- ?>
39
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/tabs/instance/theme/polaroid_res.php DELETED
@@ -1,84 +0,0 @@
1
- <div class="item"><?php
2
- $o = new wpdreamsCustomSelect("pifnoimage", "If no image found", array(
3
- 'selects'=>wpdreams_setval_or_getoption($sd, 'pifnoimage_def', $_dk),
4
- 'value'=>wpdreams_setval_or_getoption($sd, 'pifnoimage', $_dk)
5
- ));
6
- $params[$o->getName()] = $o->getData();
7
- ?>
8
- </div>
9
- <div class="item">
10
- <?php
11
- $o = new wpdreamsYesNo("pshowdesc", "Show descripton on the back of the polaroid", wpdreams_setval_or_getoption($sd, 'pshowdesc', $_dk));
12
- $params[$o->getName()] = $o->getData();
13
- ?>
14
- </div>
15
- <div class="item"><?php
16
- $o = new wpdreamsNumericUnit("prescontainerheight", "Container height", array(
17
- 'value' => wpdreams_setval_or_getoption($sd, 'prescontainerheight', $_dk),
18
- 'units'=>array('px'=>'px')));
19
- $params[$o->getName()] = $o->getData();
20
- ?>
21
- </div>
22
- <div class="item"><?php
23
- $o = new wpdreamsNumericUnit("preswidth", "Result width", array(
24
- 'value' => wpdreams_setval_or_getoption($sd, 'preswidth', $_dk),
25
- 'units'=>array('px'=>'px')));
26
- $params[$o->getName()] = $o->getData();
27
- ?>
28
- </div>
29
- <div class="item"><?php
30
- $o = new wpdreamsNumericUnit("presheight", "Result height", array(
31
- 'value' => wpdreams_setval_or_getoption($sd, 'presheight', $_dk),
32
- 'units'=>array('px'=>'px')));
33
- $params[$o->getName()] = $o->getData();
34
- ?>
35
- </div>
36
- <div class="item"><?php
37
- $o = new wpdreamsNumericUnit("prespadding", "Result padding", array(
38
- 'value' => wpdreams_setval_or_getoption($sd, 'prespadding', $_dk),
39
- 'units'=>array('px'=>'px')));
40
- $params[$o->getName()] = $o->getData();
41
- ?>
42
- </div>
43
- <div class="item">
44
- <?php
45
- $o = new wpdreamsYesNo("pshowsubtitle", "Show date/author", wpdreams_setval_or_getoption($sd, 'pshowsubtitle', $_dk));
46
- $params[$o->getName()] = $o->getData();
47
- ?>
48
- </div>
49
- <div class="item"><?php
50
- $o = new wpdreamsFontComplete("prestitlefont", "Result title font", wpdreams_setval_or_getoption($sd, 'prestitlefont', $_dk));
51
- $params[$o->getName()] = $o->getData();
52
- ?>
53
- </div>
54
- <div class="item"><?php
55
- $o = new wpdreamsFontComplete("pressubtitlefont", "Result sub-title font", wpdreams_setval_or_getoption($sd, 'pressubtitlefont', $_dk));
56
- $params[$o->getName()] = $o->getData();
57
- ?>
58
- </div>
59
-
60
- <div class="item"><?php
61
- $o = new wpdreamsFontComplete("presdescfont", "Result description font", wpdreams_setval_or_getoption($sd, 'presdescfont', $_dk));
62
- $params[$o->getName()] = $o->getData();
63
- ?>
64
- </div>
65
- <div class="item"><?php
66
- $o = new wpdreamsGradient("prescontainerbg", "Container background", wpdreams_setval_or_getoption($sd, 'prescontainerbg', $_dk));
67
- $params[$o->getName()] = $o->getData();
68
- ?>
69
- </div>
70
- <div class="item"><?php
71
- $o = new wpdreamsGradient("pdotssmallcolor", "Nav dot colors", wpdreams_setval_or_getoption($sd, 'pdotssmallcolor', $_dk));
72
- $params[$o->getName()] = $o->getData();
73
- ?>
74
- </div>
75
- <div class="item"><?php
76
- $o = new wpdreamsGradient("pdotscurrentcolor", "Nav active dot color", wpdreams_setval_or_getoption($sd, 'pdotscurrentcolor', $_dk));
77
- $params[$o->getName()] = $o->getData();
78
- ?>
79
- </div>
80
- <div class="item"><?php
81
- $o = new wpdreamsGradient("pdotsflippedcolor", "Nav flipped dot color", wpdreams_setval_or_getoption($sd, 'pdotsflippedcolor', $_dk));
82
- $params[$o->getName()] = $o->getData();
83
- ?>
84
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/tabs/instance/theme/sett_dropdown.php DELETED
@@ -1,74 +0,0 @@
1
- <div class="item">
2
- <?php
3
- $o = new wpdreamsCustomSelect("settingsimagepos", "Settings icon position", array(
4
- 'selects'=>wpdreams_setval_or_getoption($sd, 'settingsimagepos_def', $_dk),
5
- 'value'=>wpdreams_setval_or_getoption($sd, 'settingsimagepos', $_dk)
6
- ));
7
- $params[$o->getName()] = $o->getData();
8
- ?>
9
- </div>
10
- <div class="item">
11
- <?php
12
- $o = new wpdreamsImageRadio("settingsimage", "Settings icon", array(
13
- 'images' => wpdreams_setval_or_getoption($sd, 'settingsimage_selects', $_dk),
14
- 'value'=> wpdreams_setval_or_getoption($sd, 'settingsimage', $_dk)
15
- )
16
- );
17
- $params[$o->getName()] = $o->getData();
18
- ?>
19
- </div>
20
- <div class="item"><?php
21
- $o = new wpdreamsColorPicker("settingsimage_color", "Settings icon color", wpdreams_setval_or_getoption($sd, 'settingsimage_color', $_dk));
22
- $params[$o->getName()] = $o->getData();
23
- ?>
24
- </div>
25
- <div class="item"><?php
26
- $o = new wpdreamsUpload("settingsimage_custom", "Custom settings icon", wpdreams_setval_or_getoption($sd, 'settingsimage_custom', $_dk));
27
- $params[$o->getName()] = $o->getData();
28
- ?>
29
- </div>
30
- <div class="item"><?php
31
- $o = new wpdreamsGradient("settingsbackground", "Settings-icon background gradient", wpdreams_setval_or_getoption($sd, 'settingsbackground', $_dk));
32
- $params[$o->getName()] = $o->getData();
33
- ?></div>
34
- <div class="item">
35
- <?php
36
- $o = new wpdreamsBorder("settingsbackgroundborder", "Settings-icon border", wpdreams_setval_or_getoption($sd, 'settingsbackgroundborder', $_dk));
37
- $params[$o->getName()] = $o->getData();
38
- ?>
39
- </div>
40
- <div class="item">
41
- <?php
42
- $o = new wpdreamsBoxShadow("settingsboxshadow", "Settings-icon box-shadow", wpdreams_setval_or_getoption($sd, 'settingsboxshadow', $_dk));
43
- $params[$o->getName()] = $o->getData();
44
- ?>
45
- </div>
46
- <div class="item"><?php
47
- $o = new wpdreamsGradient("settingsdropbackground", "Settings drop-down background gradient", wpdreams_setval_or_getoption($sd, 'settingsdropbackground', $_dk));
48
- $params[$o->getName()] = $o->getData();
49
- ?></div>
50
- <div class="item">
51
- <?php
52
- $o = new wpdreamsBoxShadow("settingsdropboxshadow", "Settings drop-down box-shadow", wpdreams_setval_or_getoption($sd, 'settingsdropboxshadow', $_dk));
53
- $params[$o->getName()] = $o->getData();
54
- ?>
55
- </div>
56
- <div class="item"><?php
57
- $o = new wpdreamsFontComplete("settingsdropfont", "Settings drop down font", wpdreams_setval_or_getoption($sd, 'settingsdropfont', $_dk));
58
- $params[$o->getName()] = $o->getData();
59
- ?>
60
- </div>
61
- <div class="item"><?php
62
- $o = new wpdreamsFontComplete("exsearchincategoriestextfont", "Settings box header text font", wpdreams_setval_or_getoption($sd, 'exsearchincategoriestextfont', $_dk));
63
- $params[$o->getName()] = $o->getData();
64
- ?>
65
- </div>
66
- <div class="item"><?php
67
- $o = new wpdreamsColorPicker("settingsdroptickcolor","Settings drop-down tick color", wpdreams_setval_or_getoption($sd, 'settingsdroptickcolor', $_dk));
68
- $params[$o->getName()] = $o->getData();
69
- ?></div>
70
- <div class="item"><?php
71
- $o = new wpdreamsGradient("settingsdroptickbggradient", "Settings drop-down tick background", wpdreams_setval_or_getoption($sd, 'settingsdroptickbggradient', $_dk));
72
- $params[$o->getName()] = $o->getData();
73
- ?>
74
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/tabs/instance/theme/typography.php DELETED
@@ -1,43 +0,0 @@
1
- <div class="item"><?php
2
- $o = new wpdreamsFontComplete("titlefont", "Results title link font", wpdreams_setval_or_getoption($sd, 'titlefont', $_dk));
3
- $params[$o->getName()] = $o->getData();
4
- ?>
5
- </div>
6
- <div class="item"><?php
7
- $o = new wpdreamsFontComplete("titlehoverfont", "Results title hover link font", wpdreams_setval_or_getoption($sd, 'titlehoverfont', $_dk));
8
- $params[$o->getName()] = $o->getData();
9
- ?>
10
- </div>
11
- <div class="item"><?php
12
- $o = new wpdreamsFontComplete("authorfont", "Author text font", wpdreams_setval_or_getoption($sd, 'authorfont', $_dk));
13
- $params[$o->getName()] = $o->getData();
14
- ?>
15
- </div>
16
- <div class="item"><?php
17
- $o = new wpdreamsFontComplete("datefont", "Date text font", wpdreams_setval_or_getoption($sd, 'datefont', $_dk));
18
- $params[$o->getName()] = $o->getData();
19
- ?>
20
- </div>
21
- <div class="item"><?php
22
- $o = new wpdreamsFontComplete("descfont", "Description text font", wpdreams_setval_or_getoption($sd, 'descfont', $_dk));
23
- $params[$o->getName()] = $o->getData();
24
- ?>
25
- </div>
26
- <div class="item"><?php
27
- $o = new wpdreamsColorPicker("exsearchincategoriesboxcolor","Grouping box header background color", wpdreams_setval_or_getoption($sd, 'exsearchincategoriesboxcolor', $_dk));
28
- $params[$o->getName()] = $o->getData();
29
- ?></div>
30
- <div class="item"><?php
31
- $o = new wpdreamsColorPicker("groupingbordercolor","Grouping box border color", wpdreams_setval_or_getoption($sd, 'groupingbordercolor', $_dk));
32
- $params[$o->getName()] = $o->getData();
33
- ?></div>
34
- <div class="item"><?php
35
- $o = new wpdreamsFontComplete("groupbytextfont", "Grouping font color", wpdreams_setval_or_getoption($sd, 'groupbytextfont', $_dk));
36
- $params[$o->getName()] = $o->getData();
37
- ?>
38
- </div>
39
- <div class="item"><?php
40
- $o = new wpdreamsFontComplete("showmorefont", "Show more font", wpdreams_setval_or_getoption($sd, 'showmorefont', $_dk));
41
- $params[$o->getName()] = $o->getData();
42
- ?>
43
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backend/tabs/instance/theme/vertical_res.php DELETED
@@ -1,49 +0,0 @@
1
- <div class="item">
2
- <?php
3
- $o = new wpdreamsBorder("resultsborder", "Results box border", wpdreams_setval_or_getoption($sd, 'resultsborder', $_dk));
4
- $params[$o->getName()] = $o->getData();
5
- ?>
6
- </div>
7
- <div class="item">
8
- <?php
9
- $o = new wpdreamsBoxShadow("resultshadow", "Results box Shadow", wpdreams_setval_or_getoption($sd, 'resultshadow', $_dk));
10
- $params[$o->getName()] = $o->getData();
11
- ?>
12
- </div>
13
- <div class="item"><?php
14
- $o = new wpdreamsAnimations("vresultinanim", "Result item incoming animation", wpdreams_setval_or_getoption($sd, 'vresultinanim', $_dk));
15
- $params[$o->getName()] = $o->getData();
16
- ?>
17
- </div>
18
- <div class="item"><?php
19
- $o = new wpdreamsNumericUnit("resultitemheight", "One result item height", array(
20
- 'value' => wpdreams_setval_or_getoption($sd, 'resultitemheight', $_dk),
21
- 'units'=>array('px'=>'px')));
22
- $params[$o->getName()] = $o->getData();
23
- ?></div>
24
- <div class="item"><?php
25
- $o = new wpdreamsColorPicker("resultsbackground","Results box background color", wpdreams_setval_or_getoption($sd, 'resultsbackground', $_dk));
26
- $params[$o->getName()] = $o->getData();
27
- ?></div>
28
- <div class="item"><?php
29
- $o = new wpdreamsColorPicker("resultscontainerbackground","Result items container box background color", wpdreams_setval_or_getoption($sd, 'resultscontainerbackground', $_dk));
30
- $params[$o->getName()] = $o->getData();
31
- ?></div>
32
- <div class="item"><?php
33
- $o = new wpdreamsGradient("vresulthbg", "Result item mouse hover box background gradient", wpdreams_setval_or_getoption($sd, 'vresulthbg', $_dk));
34
- $params[$o->getName()] = $o->getData();
35
- ?>
36
- </div>
37
- <div class="item"><?php
38
- $o = new wpdreamsColorPicker("spacercolor","Spacer color between results", wpdreams_setval_or_getoption($sd, 'spacercolor', $_dk));
39
- $params[$o->getName()] = $o->getData();
40
- ?></div>
41
- <div class="item"><?php
42
- $o = new wpdreamsColorPicker("arrowcolor","Resultbar arrow color", wpdreams_setval_or_getoption($sd, 'arrowcolor', $_dk));
43
- $params[$o->getName()] = $o->getData();
44
- ?></div>
45
- <div class="item"><?php
46
- $o = new wpdreamsColorPicker("overflowcolor","Resultbar overflow color", wpdreams_setval_or_getoption($sd, 'overflowcolor', $_dk));
47
- $params[$o->getName()] = $o->getData();
48
- ?>
49
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/style-classic-blue.css CHANGED
@@ -100,8 +100,8 @@ div[id*="ajaxsearchlite"] .probox .promagnifier .innericon svg {
100
  fill: rgb(54, 54, 54);
101
  }
102
 
103
- div[id*="ajaxsearchlite"] .probox .proloading svg {
104
- fill: rgb(54, 54, 54);
105
  }
106
 
107
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
100
  fill: rgb(54, 54, 54);
101
  }
102
 
103
+ div[id*='ajaxsearchlite'] .probox div.asl_simple-circle {
104
+ border: 4px solid rgb(54, 54, 54);
105
  }
106
 
107
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
css/style-curvy-black.css CHANGED
@@ -98,8 +98,8 @@ div[id*="ajaxsearchlite"] .probox .promagnifier .innericon svg {
98
  fill: rgb(54, 54, 54);
99
  }
100
 
101
- div[id*="ajaxsearchlite"] .probox .proloading svg {
102
- fill: rgb(0, 0, 0);
103
  }
104
 
105
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
98
  fill: rgb(54, 54, 54);
99
  }
100
 
101
+ div[id*='ajaxsearchlite'] .probox div.asl_simple-circle {
102
+ border: 4px solid rgb(0, 0, 0);
103
  }
104
 
105
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
css/style-curvy-blue.css CHANGED
@@ -96,8 +96,8 @@ div[id*="ajaxsearchlite"] .probox .promagnifier .innericon svg {
96
  fill: rgb(74, 137, 191);
97
  }
98
 
99
- div[id*="ajaxsearchlite"] .probox .proloading svg {
100
- fill: rgb(74, 137, 191);
101
  }
102
 
103
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
96
  fill: rgb(74, 137, 191);
97
  }
98
 
99
+ div[id*='ajaxsearchlite'] .probox div.asl_simple-circle {
100
+ border: 4px solid rgb(74, 137, 191);
101
  }
102
 
103
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
css/style-curvy-red.css CHANGED
@@ -98,8 +98,8 @@ div[id*="ajaxsearchlite"] .probox .promagnifier .innericon svg {
98
  fill: rgb(222, 100, 100);
99
  }
100
 
101
- div[id*="ajaxsearchlite"] .probox .proloading svg {
102
- fill: rgb(222, 100, 100);
103
  }
104
 
105
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
98
  fill: rgb(222, 100, 100);
99
  }
100
 
101
+ div[id*='ajaxsearchlite'] .probox div.asl_simple-circle {
102
+ border: 4px solid rgb(222, 100, 100);
103
  }
104
 
105
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
css/style-simple-blue.css CHANGED
@@ -106,10 +106,6 @@ div[id*="ajaxsearchlite"] .probox .promagnifier .innericon svg {
106
  fill: rgb(255, 255, 255);
107
  }
108
 
109
- div[id*="ajaxsearchlite"] .probox .proloading svg {
110
- fill: rgb(255, 255, 255);
111
- }
112
-
113
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
114
  fill: rgb(255, 255, 255);
115
  }
106
  fill: rgb(255, 255, 255);
107
  }
108
 
 
 
 
 
109
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
110
  fill: rgb(255, 255, 255);
111
  }
css/style-simple-grey.css CHANGED
@@ -107,10 +107,6 @@ div[id*="ajaxsearchlite"] .probox .promagnifier .innericon svg {
107
  fill: rgb(255, 255, 255);
108
  }
109
 
110
- div[id*="ajaxsearchlite"] .probox .proloading svg {
111
- fill: rgb(255, 255, 255);
112
- }
113
-
114
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
115
  fill: rgb(255, 255, 255);
116
  }
107
  fill: rgb(255, 255, 255);
108
  }
109
 
 
 
 
 
110
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
111
  fill: rgb(255, 255, 255);
112
  }
css/style-simple-red.css CHANGED
@@ -106,10 +106,6 @@ div[id*="ajaxsearchlite"] .probox .promagnifier .innericon svg {
106
  fill: rgb(255, 255, 255);
107
  }
108
 
109
- div[id*="ajaxsearchlite"] .probox .proloading svg {
110
- fill: rgb(255, 255, 255);
111
- }
112
-
113
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
114
  fill: rgb(255, 255, 255);
115
  }
106
  fill: rgb(255, 255, 255);
107
  }
108
 
 
 
 
 
109
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
110
  fill: rgb(255, 255, 255);
111
  }
css/style-underline.css CHANGED
@@ -96,8 +96,8 @@ div[id*="ajaxsearchlite"] .probox .promagnifier .innericon svg {
96
  fill: rgb(54, 54, 54);
97
  }
98
 
99
- div[id*="ajaxsearchlite"] .probox .proloading svg {
100
- fill: rgb(0, 0, 0);
101
  }
102
 
103
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
96
  fill: rgb(54, 54, 54);
97
  }
98
 
99
+ div[id*='ajaxsearchlite'] .probox div.asl_simple-circle {
100
+ border: 4px solid rgb(0, 0, 0);
101
  }
102
 
103
  div[id*="ajaxsearchlite"] .probox .prosettings .innericon svg {
css/style.basic.css CHANGED
@@ -1,3 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  @import url(https://fonts.googleapis.com/css?family=Open+Sans:300|Open+Sans:400|Open+Sans:700);
2
 
3
  /* General css reset */
@@ -241,12 +288,79 @@ div[id*='ajaxsearchlite'] .probox .proloading svg {
241
  display: inline-block;
242
  }
243
 
244
- div[id*='ajaxsearchlite'].asl_msie .probox .proloading svg {
245
- height: 0;
246
- width: 0;
247
- display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  }
249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
 
251
  div[id*='ajaxsearchlite'] .probox .proclose svg {
252
  background: #333333;
@@ -1012,34 +1126,16 @@ div[id*='ajaxsearchlitesettings'] .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_
1012
 
1013
  .results .mCSB_scrollTools .mCSB_buttonUp {
1014
  background-position: 0 0;
1015
- /*
1016
- sprites locations are 0 0/-16px 0/-32px 0/-48px 0 (light) and -80px 0/-96px 0/-112px 0/-128px 0 (dark)
1017
- */
1018
  }
1019
 
1020
  .results .mCSB_scrollTools .mCSB_buttonDown {
1021
  background-position: 0 -20px;
1022
- /*
1023
- sprites locations are 0 -20px/-16px -20px/-32px -20px/-48px -20px (light) and -80px -20px/-96px -20px/-112px -20px/-128px -20px (dark)
1024
- */
1025
- }
1026
-
1027
- .results .mCSB_scrollTools .mCSB_buttonLeft {
1028
- /*
1029
- background-position:0 -40px;
1030
-
1031
- sprites locations are 0 -40px/-20px -40px/-40px -40px/-60px -40px (light) and -80px -40px/-100px -40px/-120px -40px/-140px -40px (dark)
1032
- */
1033
  }
1034
 
1035
  div[id*='ajaxsearchliteres'] {
1036
  position: absolute !important;
1037
  }
1038
 
1039
- div[id*="ajaxsearchlite"].asl_msie .probox .proloading {
1040
- background-image: url("../img/ie.gif");
1041
- }
1042
-
1043
  div[id*='ajaxsearchliteres'].horizontal .results .mCSB_scrollTools .mCSB_buttonLeft,
1044
  div[id*='ajaxsearchlitesettings'] .mCSB_scrollTools .mCSB_buttonLeft {
1045
  position: relative;
1
+ /**********************************************************************************************************************\
2
+ 0. ANIMATIONS AND TRANSITIONS
3
+ \**********************************************************************************************************************/
4
+
5
+ @keyframes aslAnFadeInDrop {
6
+ 0% {opacity: 0; transform: translate(0, -50px);}
7
+ 100% {opacity: 1; transform: translate(0, 0);}
8
+ }
9
+
10
+ @-webkit-keyframes aslAnFadeInDrop {
11
+ 0% {opacity: 0; transform: translate(0, -50px); -webkit-transform: translate(0, -50px);}
12
+ 100% {opacity: 1; transform: translate(0, 0); -webkit-transform: translate(0, 0);}
13
+ }
14
+
15
+ @keyframes aslAnFadeOutDrop {
16
+ 0% {opacity: 1; transform: translate(0, 0); -webkit-transform: translate(0, 0);}
17
+ 100% {opacity: 0; transform: translate(0, -50px); -webkit-transform: translate(0, -50px);}
18
+ }
19
+
20
+ @-webkit-keyframes aslAnFadeOutDrop {
21
+ 0% {opacity: 1; transform: translate(0, 0); -webkit-transform: translate(0, 0);}
22
+ 100% {opacity: 0; transform: translate(0, -50px); -webkit-transform: translate(0, -50px);}
23
+ }
24
+
25
+ div[id*='ajaxsearchlite'].asl_an_fadeInDrop,
26
+ div[id*='ajaxsearchlite'].asl_an_fadeOutDrop {
27
+ -webkit-animation-duration: 100ms;
28
+ animation-duration: 100ms;
29
+ -webkit-animation-fill-mode: forwards; /* Chrome, Safari, Opera */
30
+ animation-fill-mode: forwards;
31
+ }
32
+
33
+ div[id*='ajaxsearchlite'].asl_an_fadeInDrop {
34
+ animation-name: aslAnFadeInDrop;
35
+ -webkit-animation-name: aslAnFadeInDrop;
36
+ }
37
+
38
+ div[id*='ajaxsearchlite'].asl_an_fadeOutDrop {
39
+ animation-name: aslAnFadeOutDrop;
40
+ -webkit-animation-name: aslAnFadeOutDrop;
41
+ }
42
+
43
+ div[id*='ajaxsearchlite'].asl_main_container {
44
+ transition: width 130ms linear;
45
+ -webkit-transition: width 130ms linear;
46
+ }
47
+
48
  @import url(https://fonts.googleapis.com/css?family=Open+Sans:300|Open+Sans:400|Open+Sans:700);
49
 
50
  /* General css reset */
288
  display: inline-block;
289
  }
290
 
291
+ div[id*='ajaxsearchlite'] .probox .proloading {
292
+ padding: 2px;
293
+ box-sizing: border-box;
294
+ }
295
+
296
+ div[id*='ajaxsearchlite'] .probox div.asl_loader,
297
+ div[id*='ajaxsearchlite'] .probox div.asl_loader * {
298
+ box-sizing: border-box !important;
299
+ margin: 0;
300
+ padding: 0;
301
+ box-shadow: none;
302
+ }
303
+
304
+ div[id*='ajaxsearchlite'] .probox div.asl_loader {
305
+ box-sizing: border-box;
306
+ display: flex;
307
+ flex: 0 1 auto;
308
+ flex-direction: column;
309
+ flex-grow: 0;
310
+ flex-shrink: 0;
311
+ flex-basis:28px;
312
+ max-width: 100%;
313
+ max-height: 100%;
314
+ width: 100%;
315
+ height: 100%;
316
+ align-items: center;
317
+ justify-content: center;
318
  }
319
 
320
+ div[id*='ajaxsearchlite'] .probox div.asl_loader-inner {
321
+ width: 100%;
322
+ margin: 0 auto;
323
+ text-align: center;
324
+ height: 100%;
325
+ }
326
+
327
+ @-webkit-keyframes rotate-simple {
328
+ 0% {
329
+ -webkit-transform: rotate(0deg);
330
+ transform: rotate(0deg); }
331
+
332
+ 50% {
333
+ -webkit-transform: rotate(180deg);
334
+ transform: rotate(180deg); }
335
+
336
+ 100% {
337
+ -webkit-transform: rotate(360deg);
338
+ transform: rotate(360deg); } }
339
+
340
+ @keyframes rotate-simple {
341
+ 0% {
342
+ -webkit-transform: rotate(0deg);
343
+ transform: rotate(0deg); }
344
+
345
+ 50% {
346
+ -webkit-transform: rotate(180deg);
347
+ transform: rotate(180deg); }
348
+
349
+ 100% {
350
+ -webkit-transform: rotate(360deg);
351
+ transform: rotate(360deg); } }
352
+
353
+ div[id*='ajaxsearchlite'] .probox div.asl_simple-circle {
354
+ margin: 0;
355
+ height: 100%;
356
+ width: 100%;
357
+ animation: rotate-simple 0.8s infinite linear;
358
+ -webkit-animation: rotate-simple 0.8s infinite linear;
359
+ border: 4px solid rgb(255, 255, 255);
360
+ border-right-color: transparent !important;
361
+ border-radius: 50%;
362
+ box-sizing: border-box;
363
+ }
364
 
365
  div[id*='ajaxsearchlite'] .probox .proclose svg {
366
  background: #333333;
1126
 
1127
  .results .mCSB_scrollTools .mCSB_buttonUp {
1128
  background-position: 0 0;
 
 
 
1129
  }
1130
 
1131
  .results .mCSB_scrollTools .mCSB_buttonDown {
1132
  background-position: 0 -20px;
 
 
 
 
 
 
 
 
 
 
 
1133
  }
1134
 
1135
  div[id*='ajaxsearchliteres'] {
1136
  position: absolute !important;
1137
  }
1138
 
 
 
 
 
1139
  div[id*='ajaxsearchliteres'].horizontal .results .mCSB_scrollTools .mCSB_buttonLeft,
1140
  div[id*='ajaxsearchlitesettings'] .mCSB_scrollTools .mCSB_buttonLeft {
1141
  position: relative;
functions.php DELETED
@@ -1,345 +0,0 @@
1
- <?php
2
-
3
- if (!function_exists("asl_generate_html_results")) {
4
- /**
5
- * Converts the results array to HTML code
6
- *
7
- * Since ASP 4.5 the results are returned as plain HTML codes instead of JSON
8
- * to allow templating. This function includes the needed template files
9
- * to generate the correct HTML code. Supports grouping.
10
- *
11
- * @since 4.5
12
- * @param $results
13
- * @param $s_options
14
- * @return string
15
- */
16
- function asl_generate_html_results($results, $s_options ) {
17
- $html = "";
18
- if (empty($results) || !empty($results['nores'])) {
19
- if (!empty($results['keywords'])) {
20
- $s_keywords = $results['keywords'];
21
- // Get the keyword suggestions template
22
- ob_start();
23
- include(ASL_INCLUDES_PATH . "views/keyword-suggestions.php");
24
- $html .= ob_get_clean();
25
- } else {
26
- // No results at all.
27
- ob_start();
28
- include(ASL_INCLUDES_PATH . "views/no-results.php");
29
- $html .= ob_get_clean();
30
- }
31
- } else {
32
-
33
- // Get the item HTML
34
- foreach($results as $k=>$r) {
35
- ob_start();
36
- include(ASL_INCLUDES_PATH . "views/result.php");
37
- $html .= ob_get_clean();
38
- }
39
-
40
- }
41
- return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $html);
42
- }
43
- }
44
-
45
- if (!function_exists("wd_closetags")) {
46
- /**
47
- * Close unclosed HTML tags
48
- *
49
- * @param $html
50
- * @return string
51
- */
52
- function wd_closetags( $html ) {
53
- $unpaired = array('hr', 'br', 'img');
54
-
55
- // put all opened tags into an array
56
- preg_match_all ( "#<([a-z]+)( .*)?(?!/)>#iU", $html, $result );
57
- $openedtags = $result[1];
58
- // remove unpaired tags
59
- if (is_array($openedtags) && count($openedtags)>0) {
60
- foreach ($openedtags as $k=>$tag) {
61
- if (in_array($tag, $unpaired))
62
- unset($openedtags[$k]);
63
- }
64
- } else {
65
- // Replace a possible un-closed tag from the end, 30 characters backwards check
66
- $html = preg_replace('/(.*)(\<[a-zA-Z].{0,30})$/', '$1', $html);
67
- return $html;
68
- }
69
- // put all closed tags into an array
70
- preg_match_all ( "#</([a-z]+)>#iU", $html, $result );
71
- $closedtags = $result[1];
72
- $len_opened = count ( $openedtags );
73
- // all tags are closed
74
- if( count ( $closedtags ) == $len_opened ) {
75
- // Replace a possible un-closed tag from the end, 30 characters backwards check
76
- $html = preg_replace('/(.*)(\<[a-zA-Z].{0,30})$/', '$1', $html);
77
- return $html;
78
- }
79
- $openedtags = array_reverse ( $openedtags );
80
- // close tags
81
- for( $i = 0; $i < $len_opened; $i++ ) {
82
- if ( !in_array ( $openedtags[$i], $closedtags ) ) {
83
- $html .= "</" . $openedtags[$i] . ">";
84
- } else {
85
- unset ( $closedtags[array_search ( $openedtags[$i], $closedtags)] );
86
- }
87
- }
88
- // Replace a possible un-closed tag from the end, 30 characters backwards check
89
- $html = preg_replace('/(.*)(\<[a-zA-Z].{0,30})$/', '$1', $html);
90
- return $html;
91
- }
92
- }
93
-
94
- if (!function_exists("mysql_escape_mimic")) {
95
- function mysql_escape_mimic($inp) {
96
- if(is_array($inp))
97
- return array_map(__METHOD__, $inp);
98
-
99
- if(!empty($inp) && is_string($inp)) {
100
- return str_replace(array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), array('\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z'), $inp);
101
- }
102
-
103
- return $inp;
104
- }
105
- }
106
-
107
- if (!function_exists("wd_in_array_r")) {
108
- function wd_in_array_r($needle, $haystack, $strict = true) {
109
- foreach ($haystack as $item) {
110
- if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && wd_in_array_r($needle, $item, $strict))) {
111
- return true;
112
- }
113
- }
114
-
115
- return false;
116
- }
117
- }
118
-
119
- if (!function_exists("wd_substr_at_word")) {
120
- function wd_substr_at_word($text, $length) {
121
- if (strlen($text) <= $length) return $text;
122
- $blogCharset = get_bloginfo('charset');
123
- $charset = $blogCharset !== '' ? $blogCharset : 'UTF-8';
124
- $s = mb_substr($text, 0, $length, $charset);
125
- return mb_substr($s, 0, strrpos($s, ' '), $charset);
126
- }
127
- }
128
-
129
- if (!function_exists("wpdreams_ismobile")) {
130
- function wpdreams_ismobile() {
131
- $is_mobile = '0';
132
- if(preg_match('/(android|iphone|ipad|up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i', strtolower($_SERVER['HTTP_USER_AGENT'])))
133
- $is_mobile=1;
134
- if((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml')>0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE']))))
135
- $is_mobile=1;
136
- $mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,4));
137
- $mobile_agents = array('w3c ','acs-','alav','alca','amoi','andr','audi','avan','benq','bird','blac','blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno','ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-','maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-','newt','noki','oper','palm','pana','pant','phil','play','port','prox','qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar','sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-','tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp','wapr','webc','winw','winw','xda','xda-');
138
-
139
- if(in_array($mobile_ua,$mobile_agents))
140
- $is_mobile=1;
141
-
142
- if (isset($_SERVER['ALL_HTTP'])) {
143
- if (strpos(strtolower($_SERVER['ALL_HTTP']),'OperaMini')>0)
144
- $is_mobile=1;
145
- }
146
- if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows')>0)
147
- $is_mobile=0;
148
- return $is_mobile;
149
- }
150
- }
151
- if (!function_exists("current_page_url")) {
152
- function current_page_url() {
153
- $pageURL = 'http';
154
- if( isset($_SERVER["HTTPS"]) ) {
155
- if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
156
- }
157
- $pageURL .= "://";
158
- if ($_SERVER["SERVER_PORT"] != "80") {
159
- $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
160
- } else {
161
- $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
162
- }
163
- return $pageURL;
164
- }
165
- }
166
- if (!function_exists("wpdreams_hex2rgb")) {
167
- function wpdreams_hex2rgb($color)
168
- {
169
- if (strlen($color)>7) return $color;
170
- if (strlen($color)<3) return "0, 0, 0";
171
- if ($color[0] == '#')
172
- $color = substr($color, 1);
173
- if (strlen($color) == 6)
174
- list($r, $g, $b) = array($color[0].$color[1],
175
- $color[2].$color[3],
176
- $color[4].$color[5]);
177
- elseif (strlen($color) == 3)
178
- list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
179
- else
180
- return false;
181
- $r = hexdec($r); $g = hexdec($g); $b = hexdec($b);
182
- return $r.", ".$g.", ".$b;
183
- }
184
- }
185
-
186
- if (!function_exists("wpdreams_rgb2hex")) {
187
- function wpdreams_rgb2hex($color)
188
- {
189
- if (strlen($color)>7) {
190
- preg_match("/.*?\((\d+), (\d+), (\d+).*?/", $color, $c);
191
- if (is_array($c) && count($c)>3) {
192
- $color = "#".sprintf("%02X", $c[1]);
193
- $color .= sprintf("%02X", $c[2]);
194
- $color .= sprintf("%02X", $c[3]);
195
- }
196
- }
197
- return $color;
198
- }
199
- }
200
-
201
- if (!function_exists("get_content_w")) {
202
- function get_content_w($id)
203
- {
204
- $my_postid = $id;
205
- $content_post = get_post($my_postid);
206
- $content = $content_post->post_content;
207
- $content = apply_filters('the_content', $content);
208
- $content = str_replace(']]>', ']]&gt;', $content);
209
- return $content;
210
- }
211
- }
212
-
213
- if (!function_exists("wpdreams_utf8safeencode")) {
214
- function wpdreams_utf8safeencode($s, $delimiter)
215
- {
216
- $convmap= array(0x0100, 0xFFFF, 0, 0xFFFF);
217
- return $delimiter."_".base64_encode(mb_encode_numericentity($s, $convmap, 'UTF-8'));
218
- }
219
- }
220
-
221
- if (!function_exists("wpdreams_utf8safedecode")) {
222
- function wpdreams_utf8safedecode($s, $delimiter)
223
- {
224
- if (strpos($s, $delimiter)!=0) return $s;
225
- $convmap= array(0x0100, 0xFFFF, 0, 0xFFFF);
226
- $_s = explode($delimiter."_", $s);
227
- return base64_decode(mb_decode_numericentity($s[1], $convmap, 'UTF-8'));
228
- }
229
- }
230
-
231
- if (!function_exists("postval_or_getoption")) {
232
- function postval_or_getoption($option)
233
- {
234
- if (isset($_POST) && isset($_POST[$option]))
235
- return $_POST[$option];
236
- return get_option($option);
237
- }
238
- }
239
-
240
- if (!function_exists("setval_or_getoption")) {
241
- function setval_or_getoption($options, $key)
242
- {
243
- if (isset($options) && isset($options[$key]))
244
- return $options[$key];
245
- $def_options = get_option('asl_defaults');
246
- if (isset($def_options[$key]))
247
- return $def_options[$key];
248
- else
249
- return "";
250
- }
251
- }
252
-
253
- if (!function_exists("wpdreams_get_image_from_content")) {
254
- function wpdreams_get_image_from_content($content, $number = 0) {
255
- if ($content=="") return false;
256
- $dom = new domDocument;
257
- @$dom->loadHTML($content);
258
- $dom->preserveWhiteSpace = false;
259
- @$images = $dom->getElementsByTagName('img');
260
- if ($images->length>0) {
261
- if ($images->length > $number) {
262
- $im = $images->item($number)->getAttribute('src');
263
- } else {
264
- $number = 0;
265
- $im = $images->item(0)->getAttribute('src');
266
- }
267
- return $im;
268
- } else {
269
- return false;
270
- }
271
- }
272
- }
273
-
274
- if (!function_exists("wpdreams_on_backend_page")) {
275
- function wpdreams_on_backend_page($pages)
276
- {
277
- if (isset($_GET) && isset($_GET['page'])) {
278
- return in_array($_GET['page'] ,$pages);
279
- }
280
- return false;
281
- }
282
- }
283
-
284
- if (!function_exists("wd_in_array_r")) {
285
- function wd_in_array_r($needle, $haystack, $strict = true) {
286
- foreach ($haystack as $item) {
287
- if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && wd_in_array_r($needle, $item, $strict))) {
288
- return true;
289
- }
290
- }
291
-
292
- return false;
293
- }
294
- }
295
-
296
- if (!function_exists("wpdreams_on_backend_page")) {
297
- /**
298
- * @param $pages
299
- * @return bool
300
- */
301
- function wpdreams_on_backend_page($pages)
302
- {
303
- if (isset($_GET) && isset($_GET['page'])) {
304
- return in_array($_GET['page'] ,$pages);
305
- }
306
- return false;
307
- }
308
- }
309
-
310
- if (!function_exists("wpdreams_on_backend_post_editor")) {
311
- /**
312
- * @return bool
313
- */
314
- function wpdreams_on_backend_post_editor() {
315
- $current_url = current_page_url();
316
- return (strpos($current_url, 'post-new.php')!==false ||
317
- strpos($current_url, 'post.php')!==false);
318
- }
319
- }
320
-
321
- if (!function_exists("wpdreams_get_blog_list")) {
322
- function wpdreams_get_blog_list( $start = 0, $num = 10, $deprecated = '' ) {
323
-
324
- global $wpdb;
325
- if (!isset($wpdb->blogs)) return array();
326
- $blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );
327
-
328
- foreach ( (array) $blogs as $details ) {
329
- $blog_list[ $details['blog_id'] ] = $details;
330
- $blog_list[ $details['blog_id'] ]['postcount'] = $wpdb->get_var( "SELECT COUNT(ID) FROM " . $wpdb->get_blog_prefix( $details['blog_id'] ). "posts WHERE post_status='publish' AND post_type='post'" );
331
- }
332
- unset( $blogs );
333
- $blogs = $blog_list;
334
-
335
- if ( false == is_array( $blogs ) )
336
- return array();
337
-
338
- if ( $num == 'all' )
339
- return array_slice( $blogs, $start, count( $blogs ) );
340
- else
341
- return array_slice( $blogs, $start, $num );
342
- }
343
- }
344
-
345
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/asl_init.class.php DELETED
@@ -1,112 +0,0 @@
1
- <?php
2
- class aslInit {
3
-
4
- function ajaxsearchlite_activate() {
5
- $this->chmod();
6
- }
7
-
8
- function asl_init() {
9
- load_plugin_textdomain( 'ajax-search-lite', false, ASL_DIR . '/languages' );
10
- }
11
-
12
- function navigation_menu() {
13
- if (current_user_can('manage_options')) {
14
- add_menu_page(
15
- __('Ajax Search Lite', 'ajax-search-lite'),
16
- __('Ajax Search Lite', 'ajax-search-lite'),
17
- 'manage_options',
18
- ASL_DIR.'/backend/settings.php',
19
- '',
20
- ASL_URL.'icon.png',
21
- "207.9"
22
- );
23
- add_submenu_page(
24
- ASL_DIR.'/backend/settings.php',
25
- __("Ajax Search Lite", 'ajax-search-lite'),
26
- __("Analytics Integration", 'ajax-search-lite'),
27
- 'manage_options',
28
- ASL_DIR.'/backend/analytics.php'
29
- );
30
- add_submenu_page(
31
- ASL_DIR.'/backend/settings.php',
32
- __("Ajax Search Lite", 'ajax-search-lite'),
33
- __("Compatibility Options", 'ajax-search-lite'),
34
- 'manage_options',
35
- ASL_DIR.'/backend/compatibility.php'
36
- );
37
- add_submenu_page(
38
- ASL_DIR.'/backend/settings.php',
39
- __("Ajax Search Lite", 'ajax-search-lite'),
40
- __("Performance Options", 'ajax-search-lite'),
41
- 'manage_options',
42
- ASL_DIR.'/backend/performance_options.php'
43
- );
44
- add_submenu_page(
45
- ASL_DIR.'/backend/settings.php',
46
- __("Ajax Search Lite", 'ajax-search-lite'),
47
- __("Help and support", 'ajax-search-lite'),
48
- 'manage_options',
49
- ASL_DIR.'/backend/help_and_support.php'
50
- );
51
- }
52
- }
53
-
54
- function styles() {
55
-
56
- }
57
-
58
- function scripts() {
59
- $prereq = 'wpdreams-asljquery';
60
- $js_source = 'nomin-scoped';
61
- $performance_options = get_option('asl_performance');
62
-
63
- $load_in_footer = w_isset_def($performance_options['load_in_footer'], 1) == 1 ? true : false;
64
-
65
- wp_register_script('wpdreams-asljquery', ASL_URL.'js/'.$js_source.'/asljquery.js', array(), ASL_CURR_VER_STRING, $load_in_footer);
66
- wp_enqueue_script('wpdreams-asljquery');
67
- wp_register_script('wpdreams-gestures', ASL_URL.'js/'.$js_source.'/jquery.gestures.js', array($prereq), ASL_CURR_VER_STRING, $load_in_footer);
68
- wp_enqueue_script('wpdreams-gestures');
69
- wp_register_script('wpdreams-easing', ASL_URL.'js/'.$js_source.'/jquery.easing.js', array($prereq), ASL_CURR_VER_STRING, $load_in_footer);
70
- wp_enqueue_script('wpdreams-easing');
71
- wp_register_script('wpdreams-mousewheel',ASL_URL.'js/'.$js_source.'/jquery.mousewheel.js', array($prereq), ASL_CURR_VER_STRING, $load_in_footer);
72
- wp_enqueue_script('wpdreams-mousewheel');
73
- wp_register_script('wpdreams-scroll', ASL_URL.'js/'.$js_source.'/jquery.mCustomScrollbar.js', array($prereq, 'wpdreams-mousewheel'), ASL_CURR_VER_STRING, $load_in_footer);
74
- wp_enqueue_script('wpdreams-scroll');
75
- wp_register_script('wpdreams-ajaxsearchlite', ASL_URL.'js/'.$js_source.'/jquery.ajaxsearchlite.js', array($prereq, "wpdreams-scroll"), ASL_CURR_VER_STRING, $load_in_footer);
76
- wp_enqueue_script('wpdreams-ajaxsearchlite');
77
- wp_register_script('wpdreams-asl-wrapper', ASL_URL.'js/'.$js_source.'/asl_wrapper.js', array($prereq, "wpdreams-ajaxsearchlite"), ASL_CURR_VER_STRING, $load_in_footer);
78
- wp_enqueue_script('wpdreams-asl-wrapper');
79
-
80
- $ajax_url = admin_url('admin-ajax.php');
81
- if ( w_isset_def($performance_options['use_custom_ajax_handler'], 0) == 1 )
82
- $ajax_url = ASL_URL . 'ajax_search.php';
83
-
84
- // @deprecated
85
- wp_localize_script( 'wpdreams-ajaxsearchlite', 'ajaxsearchlite', array(
86
- 'ajaxurl' => $ajax_url,
87
- 'backend_ajaxurl' => admin_url( 'admin-ajax.php'),
88
- 'js_scope' => 'asljQuery'
89
- ));
90
-
91
- wp_localize_script( 'wpdreams-ajaxsearchlite', 'ASL', array(
92
- 'ajaxurl' => $ajax_url,
93
- 'backend_ajaxurl' => admin_url( 'admin-ajax.php'),
94
- 'js_scope' => 'asljQuery'
95
- ));
96
-
97
- }
98
-
99
-
100
- function chmod() {
101
- if (@chmod(ASL_CSS_PATH, 0777) == false)
102
- @chmod(ASL_CSS_PATH, 0755);
103
- if (@chmod(ASL_CACHE_PATH, 0777) == false)
104
- @chmod(ASL_CACHE_PATH, 0755);
105
- if (@chmod(ASL_TT_CACHE_PATH, 0777) == false)
106
- @chmod(ASL_TT_CACHE_PATH, 0755);
107
- }
108
-
109
- function footer() {
110
-
111
- }
112
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/cache/index.html DELETED
File without changes
includes/cache/timthumb_cacheLastCleanTime.touch DELETED
File without changes
includes/classes/actions/actions.inc.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ require_once(ASL_CLASSES_PATH . "actions/class-asl-abstract.php");
5
+ require_once(ASL_CLASSES_PATH . "actions/class-asl-admin-notices.php");
6
+ require_once(ASL_CLASSES_PATH . "actions/class-asl-stylesheets.php");
7
+ require_once(ASL_CLASSES_PATH . "actions/class-asl-customfonts.php");
includes/classes/actions/class-asl-abstract.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_Action_Abstract")) {
5
+ /**
6
+ * Class WD_ASL_Action_Abstract
7
+ *
8
+ * An abstract for mainly ajax handler classes in Ajax Search Lite plugin.
9
+ *
10
+ * @class WD_ASL_Action_Abstract
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Actions
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ abstract class WD_ASL_Action_Abstract {
17
+
18
+ /**
19
+ * Static instance storage
20
+ *
21
+ * @var self
22
+ */
23
+ protected static $_instance;
24
+
25
+
26
+ /**
27
+ * Get the instance
28
+ *
29
+ * All shortcode classes must be singletons!
30
+ */
31
+
32
+ public static function getInstance() {}
33
+
34
+ /**
35
+ * The handler
36
+ *
37
+ * This function is called by the appropriate handler
38
+ */
39
+ abstract public function handle();
40
+
41
+ /**
42
+ * Cloning disabled
43
+ */
44
+ protected function __clone() {}
45
+
46
+ /**
47
+ * Serialization disabled
48
+ */
49
+ protected function __sleep() {}
50
+
51
+ /**
52
+ * De-serialization disabled
53
+ */
54
+ protected function __wakeup() {}
55
+
56
+ }
57
+ }
includes/classes/actions/class-asl-admin-notices.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_Compatibility_AdminNotices")) {
5
+ /**
6
+ * Class WD_ASL_Compatibility_AdminNotices
7
+ *
8
+ * Hide admin notices, they are so annoying
9
+ *
10
+ * @class WD_ASL_Compatibility_Action
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Actions
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_Compatibility_AdminNotices extends WD_ASL_Action_Abstract {
17
+
18
+ public function handle() {
19
+ global $wp_filter;
20
+
21
+ if(is_network_admin() && isset($wp_filter["network_admin_notices"])) {
22
+ unset($wp_filter['network_admin_notices']);
23
+ } elseif(is_user_admin() && isset($wp_filter["user_admin_notices"])) {
24
+ unset($wp_filter['user_admin_notices']);
25
+ } else {
26
+ if(isset($wp_filter["admin_notices"])) {
27
+ unset($wp_filter['admin_notices']);
28
+ }
29
+ }
30
+
31
+ if(isset($wp_filter["all_admin_notices"])) {
32
+ unset($wp_filter['all_admin_notices']);
33
+ }
34
+ }
35
+
36
+ // ------------------------------------------------------------
37
+ // ---------------- SINGLETON SPECIFIC --------------------
38
+ // ------------------------------------------------------------
39
+ public static function getInstance() {
40
+ if ( ! ( self::$_instance instanceof self ) ) {
41
+ self::$_instance = new self();
42
+ }
43
+
44
+ return self::$_instance;
45
+ }
46
+ }
47
+ }
includes/classes/actions/class-asl-customfonts.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_CustomFonts_Action")) {
5
+ /**
6
+ * Class WD_ASL_CustomFonts_Action
7
+ *
8
+ * Custom fonts used in search instances.
9
+ *
10
+ * @class WD_ASL_CustomFonts_Action
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Actions
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_CustomFonts_Action extends WD_ASL_Action_Abstract {
17
+
18
+ /**
19
+ * Importing fonts does not work correctly it appears.
20
+ * Instead adding the links directly to the header is the best way to go.
21
+ */
22
+ function handle( ) {
23
+ $_cf = WD_ASL_Search_Shortcode::getInstance();
24
+ $_cf->fonts();
25
+ }
26
+
27
+ // ------------------------------------------------------------
28
+ // ---------------- SINGLETON SPECIFIC --------------------
29
+ // ------------------------------------------------------------
30
+ public static function getInstance() {
31
+ if ( ! ( self::$_instance instanceof self ) ) {
32
+ self::$_instance = new self();
33
+ }
34
+
35
+ return self::$_instance;
36
+ }
37
+ }
38
+ }
includes/classes/actions/class-asl-stylesheets.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_StyleSheets_Action")) {
5
+ /**
6
+ * Class WD_ASL_StyleSheets_Action
7
+ *
8
+ * Handles the non-ajax searches if activated.
9
+ *
10
+ * @class WD_ASL_StyleSheets_Action
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Actions
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_StyleSheets_Action extends WD_ASL_Action_Abstract {
17
+
18
+ /**
19
+ * Holds the inline CSS
20
+ *
21
+ * @var string
22
+ */
23
+ private static $inline_css = "";
24
+
25
+ /**
26
+ * This function is bound as the handler
27
+ */
28
+ public function handle() {
29
+ if (function_exists('get_current_screen')) {
30
+ $screen = get_current_screen();
31
+ if (isset($screen) && isset($screen->id) && $screen->id == 'widgets')
32
+ return;
33
+ }
34
+
35
+ add_action('wp_head', array($this, 'inlineCSS'), 10, 0);
36
+
37
+ // Don't print if on the back-end
38
+ if (!is_admin()) {
39
+ $inst = wd_asl()->instances->get(0);
40
+ $asl_options = $inst['data'];
41
+ wp_register_style('wpdreams-asl-basic', ASL_URL.'css/style.basic.css', array(), ASL_CURR_VER_STRING);
42
+ wp_enqueue_style('wpdreams-asl-basic');
43
+ wp_enqueue_style('wpdreams-ajaxsearchlite', ASL_URL.'css/style-'.$asl_options['theme'].'.css', array(), ASL_CURR_VER_STRING);
44
+ }
45
+ self::$inline_css = "
46
+ div[id*='ajaxsearchlite'].wpdreams_asl_container {
47
+ width: ".$asl_options['box_width'].";
48
+ margin: ".wpdreams_four_to_string($asl_options['box_margin']).";
49
+ }";
50
+ }
51
+
52
+ /**
53
+ * Echos the inline CSS if available
54
+ */
55
+ public function inlineCSS() {
56
+ if (self::$inline_css != "") {
57
+ ?>
58
+ <style type="text/css" xmlns="http://www.w3.org/1999/html">
59
+ <?php echo self::$inline_css; ?>
60
+ /* ASL extra head CSS */
61
+ </style>
62
+ <?php
63
+ }
64
+
65
+ /**
66
+ * Compatibility resolution to ajax page loaders:
67
+ *
68
+ * If the _ASL variable is defined at this point, it means that the page was already loaded before,
69
+ * and this header script is executed once again. However that also means that the ASL variable is
70
+ * resetted (due to the localization script) and that the page content is changed, so ajax search pro
71
+ * is not initialized.
72
+ */
73
+ ?>
74
+ <script type="text/javascript">
75
+ if ( typeof _ASL !== "undefined" && _ASL !== null && typeof _ASL.initialize !== "undefined" )
76
+ _ASL.initialize();
77
+ </script>
78
+ <?php
79
+ }
80
+
81
+ // ------------------------------------------------------------
82
+ // ---------------- SINGLETON SPECIFIC --------------------
83
+ // ------------------------------------------------------------
84
+ public static function getInstance() {
85
+ if ( ! ( self::$_instance instanceof self ) ) {
86
+ self::$_instance = new self();
87
+ }
88
+
89
+ return self::$_instance;
90
+ }
91
+ }
92
+ }
includes/classes/ajax/ajax.inc.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ require_once(ASL_CLASSES_PATH . "ajax/class-asl-abstract.php");
5
+ require_once(ASL_CLASSES_PATH . "ajax/class-asl-search.php");
includes/classes/ajax/class-asl-abstract.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_Handler_Abstract")) {
5
+ /**
6
+ * Class WD_MS_Handler_Abstract
7
+ *
8
+ * An abstract for mainly ajax handler classes in Morphing Search plugin.
9
+ *
10
+ * @class WD_ASL_Handler_Abstract
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Ajax
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ abstract class WD_ASL_Handler_Abstract {
17
+
18
+ /**
19
+ * Static instance storage
20
+ *
21
+ * @var self
22
+ */
23
+ protected static $_instance;
24
+
25
+
26
+ /**
27
+ * Get the instance
28
+ *
29
+ * All shortcode classes must be singletons!
30
+ */
31
+
32
+ public static function getInstance() {}
33
+
34
+ /**
35
+ * The handler
36
+ *
37
+ * This function is called by the appropriate handler
38
+ */
39
+ abstract public function handle();
40
+
41
+ /**
42
+ * Cloning disabled
43
+ */
44
+ protected function __clone() {}
45
+
46
+ /**
47
+ * Serialization disabled
48
+ */
49
+ protected function __sleep() {}
50
+
51
+ /**
52
+ * De-serialization disabled
53
+ */
54
+ protected function __wakeup() {}
55
+
56
+ }
57
+ }
includes/classes/ajax/class-asl-search.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_Search_Handler")) {
5
+ /**
6
+ * Class WD_ASL_Search_Handler
7
+ *
8
+ * This is the ajax search handler class
9
+ *
10
+ * @class WD_ASL_Search_Handler
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Ajax
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_Search_Handler extends WD_ASL_Handler_Abstract {
17
+
18
+
19
+ /**
20
+ * Oversees and handles the search request
21
+ *
22
+ * @param bool $dontGroup
23
+ * @return array|mixed|void
24
+ */
25
+ public function handle($dontGroup = false) {
26
+
27
+ $s = $_POST['aslp'];
28
+ $s = apply_filters('asl_search_phrase_before_cleaning', $s);
29
+
30
+ $s = stripcslashes($s);
31
+ $s = trim($s);
32
+ $s = preg_replace('/\s+/', ' ', $s);
33
+
34
+ $s = apply_filters('asl_search_phrase_after_cleaning', $s);
35
+
36
+ $id = 0;
37
+ $instance = wd_asl()->instances->get($id);
38
+ $sd = &$instance['data'];
39
+
40
+ $searchController = new asl_searchController(array(
41
+ "phrase" => $s,
42
+ "id" => $id,
43
+ "instance" => $instance
44
+ ));
45
+
46
+ $results = $searchController->search();
47
+
48
+ if (count($results) <= 0 && $sd['kw_suggestions'])
49
+ $results = $searchController->kwSuggestions();
50
+
51
+ $results = apply_filters('asl_results', $results, $id);
52
+
53
+ do_action('asl_after_search', $s, $results, $id);
54
+
55
+ // Override from hooks
56
+ if (isset($_POST['asl_get_as_array'])) {
57
+ return $results;
58
+ }
59
+
60
+ // Generate the results here
61
+ $html_results = asl_generate_html_results( $results, $sd );
62
+
63
+ /* Clear output buffer, possible warnings */
64
+ print "!!ASLSTART!!";
65
+ //var_dump($results);die();
66
+ print_r($html_results);
67
+ print "!!ASLEND!!";
68
+ die();
69
+ }
70
+
71
+ // ------------------------------------------------------------
72
+ // ---------------- SINGLETON SPECIFIC --------------------
73
+ // ------------------------------------------------------------
74
+ public static function getInstance() {
75
+ if ( ! ( self::$_instance instanceof self ) ) {
76
+ self::$_instance = new self();
77
+ }
78
+
79
+ return self::$_instance;
80
+ }
81
+ }
82
+ }
includes/{bfi_thumb.php → classes/cache/bfi_thumb.php} RENAMED
@@ -762,78 +762,4 @@ if ( ! class_exists( 'BFI_Thumb_1_3' ) ) {
762
  return $result;
763
  }
764
  }
765
- }
766
-
767
-
768
-
769
- // don't use the default resizer since we want to allow resizing to larger sizes (than the original one)
770
- // Parts are copied from media.php
771
- // Crop is always applied (just like timthumb)
772
- // Don't use this inside the admin since sometimes images in the media library get resized
773
- if ( ! is_admin() || (defined( 'DOING_AJAX' ) && DOING_AJAX) ) {
774
- add_filter( 'image_resize_dimensions', 'bfi_image_resize_dimensions', 10, 5 );
775
- }
776
-
777
- if ( ! function_exists( 'bfi_image_resize_dimensions' ) ) {
778
- function bfi_image_resize_dimensions( $payload, $orig_w, $orig_h, $dest_w, $dest_h, $crop = false ) {
779
- $aspect_ratio = $orig_w / $orig_h;
780
- $d_aspect_ratio = $dest_w / $dest_h;
781
-
782
- $new_w = $dest_w;
783
- $new_h = $dest_h;
784
-
785
- if ( ! $new_w ) {
786
- $new_w = intval( $new_h * $aspect_ratio );
787
- }
788
-
789
- if ( ! $new_h ) {
790
- $new_h = intval( $new_w / $aspect_ratio );
791
- }
792
-
793
- $size_ratio = max( $new_w / $orig_w, $new_h / $orig_h );
794
-
795
- $crop_w = round( $new_w / $size_ratio );
796
- $crop_h = round( $new_h / $size_ratio );
797
- $s_x = floor( ( $orig_w - $crop_w ) / 2 );
798
- $s_y = floor( ( $orig_h - $crop_h ) / 2 );
799
-
800
- // the return array matches the parameters to imagecopyresampled()
801
- // int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h
802
- return array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );
803
- }
804
- }
805
-
806
-
807
- // This function allows us to latch on WP image functions such as
808
- // the_post_thumbnail, get_image_tag and wp_get_attachment_image_src
809
- // so that you won't have to use the function bfi_thumb in order to do resizing.
810
- // To make this work, in the WP image functions, when specifying an
811
- // array for the image dimensions, add a 'bfi_thumb' => true to
812
- // the array, then add your normal $params arguments.
813
- //
814
- // e.g. the_post_thumbnail( array( 1024, 400, 'bfi_thumb' => true, 'grayscale' => true ) );
815
- add_filter( 'image_downsize', 'bfi_image_downsize', 1, 3 );
816
-
817
- if ( ! function_exists( 'bfi_image_downsize' ) ) {
818
- function bfi_image_downsize( $out, $id, $size ) {
819
- if ( ! is_array( $size ) ) {
820
- return false;
821
- }
822
- if ( ! array_key_exists( 'bfi_thumb', $size ) ) {
823
- return false;
824
- }
825
- if ( empty( $size['bfi_thumb'] ) ) {
826
- return false;
827
- }
828
-
829
- $img_url = wp_get_attachment_url( $id );
830
-
831
- $params = $size;
832
- $params['width'] = $size[0];
833
- $params['height'] = $size[1];
834
-
835
- $resized_img_url = bfi_thumb( $img_url, $params );
836
-
837
- return array( $resized_img_url, $size[0], $size[1], false );
838
- }
839
- }
762
  return $result;
763
  }
764
  }
765
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/classes/cache/cache.inc.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ require_once(ASL_CLASSES_PATH . "cache/bfi_thumb.php");
includes/classes/core/class-asl-actions.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if ( !class_exists("WD_ASL_Actions") ) {
5
+ /**
6
+ * Class WD_ASL_Actions
7
+ *
8
+ * Registers the plugin Actions, with the proper handler classes.
9
+ * Handling is passed to the handle() method of the specified class.
10
+ * Handlers defined in /classes/actions/class-asp-{handler}.php
11
+ *
12
+ * @class WD_ASL_Actions
13
+ * @version 1.0
14
+ * @package AjaxSearchLite/Classes/Core
15
+ * @category Class
16
+ * @author Ernest Marcinko
17
+ */
18
+ class WD_ASL_Actions {
19
+
20
+ /**
21
+ * Array of internal known actions
22
+ *
23
+ * @var array
24
+ */
25
+ private static $actions = array(
26
+ array(
27
+ "action" => "wp_enqueue_scripts",
28
+ "handler" => "StyleSheets",
29
+ "priority" => 10,
30
+ "args" => 0
31
+ ),
32
+ array(
33
+ "action" => "wp_head",
34
+ "handler" => "CustomFonts",
35
+ "priority" => 10,
36
+ "args" => 0
37
+ ),
38
+ array(
39
+ "action" => "in_admin_header",
40
+ "handler" => "AdminNotices",
41
+ "priority" => 100000,
42
+ "args" => 0
43
+ )
44
+ );
45
+
46
+ /**
47
+ * Array of already registered handlers
48
+ *
49
+ * @var array
50
+ */
51
+ private static $registered = array();
52
+
53
+ /**
54
+ * Registers all the handlers from the $actions variable
55
+ */
56
+ public static function registerAll() {
57
+
58
+ foreach (self::$actions as $data) {
59
+ self::register($data['action'], $data['handler'], $data['priority'], $data['args']);
60
+
61
+ if ( !empty($data['cron']) )
62
+ self::registerCron( $data['handler'] );
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Get all the queued handlers
68
+ *
69
+ * @return array
70
+ */
71
+ public static function getAll( ) {
72
+ return array_keys(self::$actions);
73
+ }
74
+
75
+ /**
76
+ * Get all the already registered handlers
77
+ *
78
+ * @return array
79
+ */
80
+ public static function getRegistered() {
81
+ return self::$registered;
82
+ }
83
+
84
+ /**
85
+ * Registers an action with the handler class name.
86
+ *
87
+ * @param $action
88
+ * @param $handler string|array
89
+ * @param int $priority
90
+ * @param int $accepted_args
91
+ * @return bool
92
+ */
93
+ public static function register( $action, $handler, $priority = 10, $accepted_args = 0) {
94
+
95
+ if ( is_array($handler) ) {
96
+ $class = "WD_ASL_" . $handler[0] . "_Action";
97
+ $handle = $handler[1];
98
+ } else {
99
+ $class = "WD_ASL_" . $handler . "_Action";
100
+ $handle = "handle";
101
+ }
102
+
103
+ if ( !class_exists($class) ) return false;
104
+
105
+ add_action($action, array(call_user_func(array($class, 'getInstance')), $handle), $priority, $accepted_args);
106
+
107
+ self::$registered[] = $action;
108
+
109
+ return true;
110
+ }
111
+
112
+ public static function registerCron( $handler ) {
113
+ if ( is_array($handler) ) {
114
+ $class = "WD_ASL_" . $handler[0] . "_Action";
115
+ $handle = "cron_".$handler[1];
116
+ } else {
117
+ $class = "WD_ASL_" . $handler . "_Action";
118
+ $handle = "cron_handle";
119
+ }
120
+
121
+ $o = call_user_func(array($class, 'getInstance'));
122
+ $o->$handle();
123
+ }
124
+
125
+ /**
126
+ * Deregisters an action handler.
127
+ *
128
+ * @param $action
129
+ * @param $handler
130
+ */
131
+ public static function deregister( $action, $handler ) {
132
+
133
+ remove_action($action, array(call_user_func(array($handler, 'getInstance')), 'handle'));
134
+
135
+ }
136
+
137
+ }
138
+ }
includes/classes/core/class-asl-ajax.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if ( !class_exists("WD_ASL_Ajax") ) {
5
+ /**
6
+ * Class WD_ASL_Ajax
7
+ *
8
+ * Registers the Ajax Handlers, with the proper handler classes.
9
+ * Handling is passed to the handle() method of the specified class.
10
+ * Handlers defined in /classes/ajax/class-asp-{handler}.php
11
+ *
12
+ * @class WD_ASL_Ajax
13
+ * @version 1.0
14
+ * @package AjaxSearchLite/Classes/Core
15
+ * @category Class
16
+ * @author Ernest Marcinko
17
+ */
18
+ class WD_ASL_Ajax {
19
+
20
+ /**
21
+ * Array of internal ajax actions
22
+ *
23
+ * @var array
24
+ */
25
+ private static $actions = array(
26
+ "ajaxsearchlite_search" => array(
27
+ "handler" => "Search",
28
+ "priv" => true,
29
+ "nopriv" => true
30
+ ),
31
+ "ajaxsearchlite_autocomplete" => array(
32
+ "handler" => "Autocomplete",
33
+ "priv" => true,
34
+ "nopriv" => true
35
+ ),
36
+ "ajaxsearchlite_preview" => array(
37
+ "handler" => "Preview",
38
+ "priv" => true,
39
+ "nopriv" => false
40
+ )
41
+ );
42
+
43
+ /**
44
+ * Array of already registered handlers
45
+ *
46
+ * @var array
47
+ */
48
+ private static $registered = array();
49
+
50
+ /**
51
+ * Registers all the handlers from the $actions variable
52
+ */
53
+ public static function registerAll( $custom_ajax = false) {
54
+
55
+ foreach (self::$actions as $action => $data)
56
+ self::register($action, $data['handler'], $data['priv'], $data['nopriv'], $custom_ajax);
57
+
58
+ }
59
+
60
+ /**
61
+ * Get all the queued handlers
62
+ *
63
+ * @return array
64
+ */
65
+ public static function getAll( ) {
66
+ return array_keys(self::$actions);
67
+ }
68
+
69
+ /**
70
+ * Get all the already registered handlers
71
+ *
72
+ * @return array
73
+ */
74
+ public static function getRegistered() {
75
+ return self::$registered;
76
+ }
77
+
78
+ /**
79
+ * Checks if currently a Search Plugin ajax is in progress
80
+ *
81
+ * @param string $handle
82
+ * @return bool
83
+ */
84
+ public static function doingAjax( $handle = "" ) {
85
+ if (!empty($_POST['action'])) {
86
+ if ($handle != "")
87
+ return $_POST['action'] == $handle;
88
+ return in_array($_POST['action'], WD_ASL_Ajax::getAll());
89
+ }
90
+ return false;
91
+ }
92
+
93
+ /**
94
+ * Registers an action with the handler class name.
95
+ *
96
+ * @param $action
97
+ * @param $handler
98
+ * @param bool $priv
99
+ * @param bool $nopriv
100
+ * @return bool
101
+ */
102
+ public static function register( $action, $handler, $priv = true, $nopriv = true, $custom_ajax = false) {
103
+
104
+ if ( !$priv && !$nopriv) return false;
105
+
106
+ $class = "WD_ASL_" . $handler . "_Handler";
107
+ $prefix = $custom_ajax == true ? "ASL_" : "wp_ajax_";
108
+
109
+ if ( !class_exists($class) ) return false;
110
+
111
+ if ( $priv )
112
+ add_action($prefix . $action, array(call_user_func(array($class, 'getInstance')), 'handle'));
113
+
114
+ if ( $nopriv )
115
+ add_action($prefix . 'nopriv_' . $action, array(call_user_func(array($class, 'getInstance')), 'handle'));
116
+
117
+ self::$registered[] = $action;
118
+
119
+ return true;
120
+ }
121
+
122
+ /**
123
+ * Deregisters an action handler.
124
+ *
125
+ * @param $action
126
+ * @param $handler
127
+ */
128
+ public static function deregister( $action, $handler ) {
129
+
130
+ remove_action($action, array(call_user_func(array($handler, 'getInstance')), 'handle'));
131
+
132
+ }
133
+
134
+ /**
135
+ * Adds an action to the register queue
136
+ *
137
+ * @param $action
138
+ * @param $handler
139
+ * @param bool $priv
140
+ * @param bool $nopriv
141
+ */
142
+ public static function queue($action, $handler, $priv = true, $nopriv = true) {
143
+
144
+ self::$actions[$action] = array(
145
+ "handler" => $handler,
146
+ "priv" => $priv,
147
+ "nopriv" => $nopriv
148
+ );
149
+
150
+ }
151
+
152
+ /**
153
+ * Dequeues an action from the register queue.
154
+ *
155
+ * @param $action
156
+ */
157
+ public static function dequeue($action) {
158
+
159
+ if ( isset(self::$actions[$action]) )
160
+ unset(self::$actions[$action]);
161
+
162
+ }
163
+
164
+ }
165
+ }
includes/classes/core/class-asl-dbman.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_DBMan")) {
5
+ /**
6
+ * Class WD_ASL_DBMan
7
+ *
8
+ * Manager of main database related operations
9
+ *
10
+ * @class WD_ASL_Manager
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Core
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_DBMan {
17
+
18
+ /**
19
+ * All the table slug => name combinations used
20
+ *
21
+ * @since 1.0
22
+ * @var array
23
+ */
24
+ private $tables = array();
25
+
26
+ private static $_instance;
27
+
28
+ private function __construct() {
29
+ global $wpdb;
30
+
31
+ if (isset($wpdb->base_prefix)) {
32
+ wd_asl()->_prefix = $wpdb->base_prefix;
33
+ } else {
34
+ wd_asl()->_prefix = $wpdb->prefix;
35
+ }
36
+
37
+ foreach ($this->tables as $slug => $table)
38
+ $this->tables[$slug] = wd_asl()->_prefix . $table;
39
+
40
+ // Push the correct table names to the globals back
41
+ $this->tables = (object) $this->tables;
42
+ wd_asl()->tables = $this->tables;
43
+ }
44
+
45
+ public function create() {
46
+ // Nothing to do here yet :)
47
+ }
48
+
49
+
50
+ /**
51
+ * Return the table name by table slug
52
+ *
53
+ * @param $table_slug
54
+ * @return string
55
+ */
56
+ public function table($table_slug) {
57
+ return $this->tables->{$table_slug};
58
+ }
59
+
60
+ // ------------------------------------------------------------
61
+ // ---------------- SINGLETON SPECIFIC --------------------
62
+ // ------------------------------------------------------------
63
+
64
+ /**
65
+ * Get the instane of WD_ASL_Manager
66
+ *
67
+ * @return self
68
+ */
69
+ public static function getInstance() {
70
+ if (!(self::$_instance instanceof self)) {
71
+ self::$_instance = new self();
72
+ }
73
+
74
+ return self::$_instance;
75
+ }
76
+
77
+ /**
78
+ * Cloning disabled
79
+ */
80
+ private function __clone() {
81
+ }
82
+
83
+ /**
84
+ * Serialization disabled
85
+ */
86
+ private function __sleep() {
87
+ }
88
+
89
+ /**
90
+ * De-serialization disabled
91
+ */
92
+ private function __wakeup() {
93
+ }
94
+ }
95
+ }
includes/classes/core/class-asl-filters.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if ( !class_exists("WD_ASL_Filters") ) {
5
+ /**
6
+ * Class WD_ASL_Filters
7
+ *
8
+ * Registers the plugin Filters, with the proper handler classes.
9
+ * Handling is passed to the handle() method of the specified class.
10
+ * Handlers defined in /classes/filters/class-asp-{handler}.php
11
+ *
12
+ * @class WD_ASL_Filters
13
+ * @version 1.0
14
+ * @package AjaxSearchLite/Classes/Core
15
+ * @category Class
16
+ * @author Ernest Marcinko
17
+ */
18
+ class WD_ASL_Filters {
19
+
20
+ /**
21
+ * Array of internal known filters
22
+ *
23
+ * @var array
24
+ */
25
+ private static $filters = array(
26
+ array(
27
+ "filter" => "posts_results",
28
+ "handler" => array("SearchOverride", "override"),
29
+ "priority" => 1,
30
+ "args" => 2
31
+ ),
32
+ array(
33
+ "filter" => "page_link",
34
+ "handler" => array("SearchOverride", "fixUrls"),
35
+ "priority" => 1,
36
+ "args" => 3
37
+ ),
38
+ array(
39
+ "filter" => "post_link",
40
+ "handler" => array("SearchOverride", "fixUrls"),
41
+ "priority" => 1,
42
+ "args" => 3
43
+ ),
44
+ array(
45
+ "filter" => "post_type_link",
46
+ "handler" => array("SearchOverride", "fixUrls"),
47
+ "priority" => 1,
48
+ "args" => 3
49
+ ),
50
+ array(
51
+ "filter" => "get_search_form",
52
+ "handler" => "FormOverride",
53
+ "priority" => 1,
54
+ "args" => 1
55
+ ),
56
+ array(
57
+ "filter" => "asp_result_after_prostproc",
58
+ "handler" => array("EtcFixes", "plug_DownloadMonitorLink"),
59
+ "priority" => 1,
60
+ "args" => 2
61
+ )
62
+ );
63
+
64
+ /**
65
+ * Array of already registered handlers
66
+ *
67
+ * @var array
68
+ */
69
+ private static $registered = array();
70
+
71
+ /**
72
+ * Registers all the handlers from the $actions variable
73
+ */
74
+ public static function registerAll() {
75
+
76
+ foreach (self::$filters as $data)
77
+ self::register($data['filter'], $data['handler'], $data['priority'], $data['args']);
78
+ }
79
+
80
+ /**
81
+ * Get all the queued handlers
82
+ *
83
+ * @return array
84
+ */
85
+ public static function getAll( ) {
86
+ return array_keys(self::$filters);
87
+ }
88
+
89
+ /**
90
+ * Get all the already registered handlers
91
+ *
92
+ * @return array
93
+ */
94
+ public static function getRegistered() {
95
+ return self::$registered;
96
+ }
97
+
98
+ /**
99
+ * Registers a filter with the handler class name.
100
+ *
101
+ * @param $filter
102
+ * @param $handler string|array
103
+ * @param int $priority
104
+ * @param int $accepted_args
105
+ * @return bool
106
+ */
107
+ public static function register( $filter, $handler, $priority = 10, $accepted_args = 0) {
108
+
109
+ if ( is_array($handler) ) {
110
+ $class = "WD_ASL_" . $handler[0] . "_Filter";
111
+ $handle = $handler[1];
112
+ } else {
113
+ $class = "WD_ASL_" . $handler . "_Filter";
114
+ $handle = "handle";
115
+ }
116
+
117
+ if ( !class_exists($class) ) return false;
118
+
119
+ add_action($filter, array(call_user_func(array($class, 'getInstance')), $handle), $priority, $accepted_args);
120
+
121
+ self::$registered[] = $filter;
122
+
123
+ return true;
124
+ }
125
+
126
+ /**
127
+ * Deregisters an action handler.
128
+ *
129
+ * @param $filter
130
+ * @param $handler
131
+ */
132
+ public static function deregister( $filter, $handler ) {
133
+
134
+ remove_filter($filter, array(call_user_func(array($handler, 'getInstance')), 'handle'));
135
+
136
+ }
137
+
138
+ }
139
+ }
includes/classes/core/class-asl-globals.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+ /**
4
+ * Class WD_ASL_Globals
5
+ *
6
+ * A container class for the global variables
7
+ *
8
+ * @class WD_ASL_Globals
9
+ * @version 1.0
10
+ * @package AjaxSearchLite/Classes/Core
11
+ * @category Class
12
+ * @author Ernest Marcinko
13
+ */
14
+ class WD_ASL_Globals {
15
+
16
+ /**
17
+ * The plugin options and defaults
18
+ *
19
+ * @var array
20
+ */
21
+ public $options;
22
+
23
+ /**
24
+ * The plugin options and defaults (shorthand)
25
+ *
26
+ * @var array
27
+ */
28
+ public $o;
29
+
30
+ /**
31
+ * Instance of the init class
32
+ *
33
+ * @var WD_ASL_Init()
34
+ */
35
+ public $init;
36
+ /**
37
+ * Instance of the database manager
38
+ *
39
+ * @var WD_ASL_DBMan()
40
+ */
41
+ public $db;
42
+
43
+ /**
44
+ * Instance of the instances class
45
+ *
46
+ * @var WD_ASL_Instances()
47
+ */
48
+ public $instances;
49
+
50
+ /**
51
+ * Instance of the manager
52
+ *
53
+ * @var WD_ASL_Manager()
54
+ */
55
+ public $manager;
56
+
57
+ /**
58
+ * Array of ASP tables
59
+ *
60
+ * @var array
61
+ */
62
+ public $tables;
63
+
64
+ /**
65
+ * Session information
66
+ *
67
+ * @var WP_Session()
68
+ */
69
+ public $wp_session;
70
+
71
+ /**
72
+ * Holds the correct table prefix for ASP tables
73
+ *
74
+ * @var string
75
+ */
76
+ public $_prefix;
77
+
78
+ /**
79
+ * Debug object
80
+ *
81
+ * @var wdDebugData
82
+ */
83
+ public $debug;
84
+ }
includes/classes/core/class-asl-init.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Prevent direct access */
3
+ defined('ABSPATH') or die("You can't access this file directly.");
4
+
5
+ /**
6
+ * Class WD_ASL_init
7
+ *
8
+ * AJAX SEARCH Lite initializator Class
9
+ */
10
+ class WD_ASL_Init {
11
+
12
+ /**
13
+ * Core singleton class
14
+ * @var WD_ASL_Init self
15
+ */
16
+ private static $_instance;
17
+
18
+ private function __construct() {
19
+ wd_asl()->db = WD_ASL_DBMan::getInstance();
20
+
21
+ load_plugin_textdomain( 'ajax-search-lite', false, ASL_DIR . '/languages' );
22
+ }
23
+
24
+ /**
25
+ * Runs on activation
26
+ */
27
+ public function activate() {
28
+
29
+ WD_ASL_DBMan::getInstance()->create();
30
+
31
+ $this->chmod();
32
+
33
+ /**
34
+ * Store the version number after everything is done. This is going to help distinguishing
35
+ * stored asl_version from the ASL_CURR_VER variable. These two are different in cases:
36
+ * - Uninstalling, installing new versions
37
+ * - Uploading and overwriting old version with a new one
38
+ */
39
+ update_option('asl_version', ASL_CURRENT_VERSION);
40
+ }
41
+
42
+ /**
43
+ * Checks if the user correctly updated the plugin and fixes if not
44
+ */
45
+ public function safety_check() {
46
+ $curr_stored_ver = get_option('asl_version', 0);
47
+
48
+ // Run the re-activation actions if this is actually a newer version
49
+ if ($curr_stored_ver != ASL_CURRENT_VERSION) {
50
+ $this->activate();
51
+ //asl_generate_the_css();
52
+ }
53
+ }
54
+
55
+ /**
56
+ * Extra styles if needed..
57
+ */
58
+ public function styles() {
59
+ // Fallback on IE<=8
60
+ if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/(?i)msie [6-8]/',$_SERVER['HTTP_USER_AGENT']) ) {
61
+ // Oh, this is IE 8 or below, abort mission
62
+ return;
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Prints the scripts
68
+ */
69
+ public function scripts() {
70
+
71
+ // ------------ Dequeue some scripts causing issues on the back-end --------------
72
+ wp_dequeue_script( 'otw-admin-colorpicker' );
73
+ wp_dequeue_script( 'otw-admin-select2' );
74
+ wp_dequeue_script( 'otw-admin-otwpreview' );
75
+ wp_dequeue_script( 'otw-admin-fonts');
76
+ wp_dequeue_script( 'otw-admin-functions');
77
+ wp_dequeue_script( 'otw-admin-variables');
78
+
79
+ $com_opt = wd_asl()->o['asl_compatibility'];
80
+ $performance_options = wd_asl()->o['asl_performance'];
81
+
82
+ $prereq = 'jquery';
83
+ $js_source = $com_opt['js_source'];
84
+
85
+ $load_in_footer = w_isset_def($performance_options['load_in_footer'], 1) == 1 ? true : false;
86
+
87
+ if ($js_source == 'nomin' || $js_source == 'nomin-scoped') {
88
+ if ($js_source == "nomin-scoped") {
89
+ $prereq = "wpdreams-asljquery";
90
+ wp_register_script('wpdreams-asljquery', ASL_URL . 'js/' . $js_source . '/asljquery.js', array(), ASL_CURR_VER_STRING, $load_in_footer);
91
+ wp_enqueue_script('wpdreams-asljquery');
92
+ }
93
+ wp_register_script('wpdreams-gestures', ASL_URL . 'js/' . $js_source . '/jquery.gestures.js', array($prereq), ASL_CURR_VER_STRING, $load_in_footer);
94
+ wp_enqueue_script('wpdreams-gestures');
95
+ wp_register_script('wpdreams-mousewheel', ASL_URL . 'js/' . $js_source . '/jquery.mousewheel.js', array($prereq), ASL_CURR_VER_STRING, $load_in_footer);
96
+ wp_enqueue_script('wpdreams-mousewheel');
97
+ wp_register_script('wpdreams-scroll', ASL_URL . 'js/' . $js_source . '/jquery.mCustomScrollbar.js', array($prereq, 'wpdreams-mousewheel'), ASL_CURR_VER_STRING, $load_in_footer);
98
+ wp_enqueue_script('wpdreams-scroll');
99
+ wp_register_script('wpdreams-ajaxsearchlite', ASL_URL . 'js/' . $js_source . '/jquery.ajaxsearchlite.js', array($prereq, "wpdreams-scroll"), ASL_CURR_VER_STRING, $load_in_footer);
100
+ wp_enqueue_script('wpdreams-ajaxsearchlite');
101
+ wp_register_script('wpdreams-asl-wrapper', ASL_URL . 'js/' . $js_source . '/asl_wrapper.js', array($prereq, "wpdreams-ajaxsearchlite"), ASL_CURR_VER_STRING, $load_in_footer);
102
+ wp_enqueue_script('wpdreams-asl-wrapper');
103
+ } else {
104
+ wp_enqueue_script('jquery');
105
+ wp_register_script('wpdreams-ajaxsearchlite', ASL_URL . "js/" . $js_source . "/jquery.ajaxsearchlite.min.js", array(), ASL_CURR_VER_STRING, $load_in_footer);
106
+ wp_enqueue_script('wpdreams-ajaxsearchlite');
107
+ }
108
+
109
+ $ajax_url = admin_url('admin-ajax.php');
110
+ if ( w_isset_def($performance_options['use_custom_ajax_handler'], 0) == 1 )
111
+ $ajax_url = ASL_URL . 'ajax_search.php';
112
+
113
+ if (strpos($com_opt['js_source'], 'min-scoped') !== false) {
114
+ $scope = "asljQuery";
115
+ } else {
116
+ $scope = "jQuery";
117
+ }
118
+
119
+ // @deprecated
120
+ wp_localize_script( 'wpdreams-ajaxsearchlite', 'ajaxsearchlite', array(
121
+ 'ajaxurl' => $ajax_url,
122
+ 'backend_ajaxurl' => admin_url( 'admin-ajax.php'),
123
+ 'js_scope' => $scope
124
+ ));
125
+
126
+ wp_localize_script( 'wpdreams-ajaxsearchlite', 'ASL', array(
127
+ 'ajaxurl' => $ajax_url,
128
+ 'backend_ajaxurl' => admin_url( 'admin-ajax.php'),
129
+ 'js_scope' => $scope,
130
+ 'detect_ajax' => $com_opt['detect_ajax'],
131
+ 'version' => ASL_CURRENT_VERSION
132
+ ));
133
+
134
+ }
135
+
136
+ /**
137
+ * Tries to chmod the CSS and CACHE directories
138
+ */
139
+ public function chmod() {
140
+ if (@chmod(ASL_CSS_PATH, 0777) == false)
141
+ @chmod(ASL_CSS_PATH, 0755);
142
+ if (@chmod(ASL_CACHE_PATH, 0777) == false)
143
+ @chmod(ASL_CACHE_PATH, 0755);
144
+ if (@chmod(ASL_TT_CACHE_PATH, 0777) == false)
145
+ @chmod(ASL_TT_CACHE_PATH, 0755);
146
+ }
147
+
148
+
149
+ /**
150
+ * If anything we need in the footer
151
+ */
152
+ public function footer() {
153
+
154
+ }
155
+
156
+ /**
157
+ * Get the instane
158
+ *
159
+ * @return self
160
+ */
161
+ public static function getInstance() {
162
+ if (!(self::$_instance instanceof self)) {
163
+ self::$_instance = new self();
164
+ }
165
+
166
+ return self::$_instance;
167
+ }
168
+
169
+ /**
170
+ * Cloning disabled
171
+ */
172
+ private function __clone() {
173
+ }
174
+
175
+ /**
176
+ * Serialization disabled
177
+ */
178
+ private function __sleep() {
179
+ }
180
+
181
+ /**
182
+ * De-serialization disabled
183
+ */
184
+ private function __wakeup() {
185
+ }
186
+ }
includes/classes/core/class-asl-instances.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Prevent direct access */
3
+ defined('ABSPATH') or die("You can't access this file directly.");
4
+
5
+ /**
6
+ * Class WD_ASL_Instances
7
+ *
8
+ * This class handles the data transfer between code and instance data
9
+ *
10
+ * @class WD_ASL_Instances
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Core
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_Instances {
17
+
18
+ /**
19
+ * Core singleton class
20
+ * @var WD_ASL_Instances self
21
+ */
22
+ private static $_instance;
23
+
24
+ /**
25
+ * This holds the search instances
26
+ *
27
+ * @var array()
28
+ */
29
+ private $instances;
30
+
31
+ /**
32
+ * This holds the search instances without data
33
+ *
34
+ * @var array()
35
+ */
36
+ private $instancesNoData;
37
+
38
+ /**
39
+ * When updating, this variable sets to true, telling that instances need re-parsing
40
+ *
41
+ * @var bool
42
+ */
43
+ private $refresh = false;
44
+
45
+ /**
46
+ * Gets the search instance if exists
47
+ *
48
+ * @param int $id
49
+ * @param bool $force_refresh
50
+ * @return bool|array
51
+ */
52
+ public function get( $id = -1, $force_refresh = false ) {
53
+
54
+ if ($this->refresh || $force_refresh) {
55
+ $this->init();
56
+ $this->refresh = false;
57
+ }
58
+
59
+ if ($id > -1)
60
+ return isset($this->instances[$id]) ? $this->instances[$id] : array();
61
+
62
+ return $this->instances;
63
+ }
64
+
65
+ /**
66
+ * Gets the search instance if exists, without data
67
+ *
68
+ * @param int $id
69
+ * @param bool $force_refresh
70
+ * @return bool|array
71
+ */
72
+ public function getWithoutData( $id = -1, $force_refresh = false ) {
73
+
74
+ if ($this->refresh || $force_refresh) {
75
+ $this->init();
76
+ $this->refresh = false;
77
+ }
78
+
79
+ if ($id > -1)
80
+ return isset($this->instancesNoData[$id]) ? $this->instancesNoData[$id] : array();
81
+
82
+ return $this->instancesNoData;
83
+ }
84
+
85
+ /**
86
+ * Checks if the given search instance exists
87
+ *
88
+ * @param $id
89
+ * @return bool
90
+ */
91
+ public function exists( $id ) {
92
+ return isset($this->instances[$id]);
93
+ }
94
+
95
+ /**
96
+ * Update the search data
97
+ *
98
+ * @param $id
99
+ * @param $data
100
+ * @return false|int
101
+ */
102
+ public function update( $id = 0, $data ) {
103
+
104
+ $this->refresh = true;
105
+
106
+ return update_option("asl_options", $data);
107
+ }
108
+
109
+ // ------------------------------------------------------------
110
+ // ---------------- PRIVATE --------------------
111
+ // ------------------------------------------------------------
112
+
113
+ /**
114
+ * Just calls init
115
+ */
116
+ private function __construct() {
117
+ $this->init();
118
+ }
119
+
120
+ /**
121
+ * Fetches the search instances from the DB and stores them internally for future use
122
+ */
123
+ private function init() {
124
+ // Reset both variables, so in case of deleting no remains are left
125
+ $this->instances = array();
126
+ $this->instancesNoData = array();
127
+
128
+ $instances = array( 0 => get_option( 'asl_options', array() ));
129
+
130
+ foreach ($instances as $k => $instance) {
131
+ $this->instancesNoData[$k] = array(
132
+ "id" => $k
133
+ );
134
+
135
+ $this->instances[$k]['id'] = $k;
136
+ if ( is_array($instance) )
137
+ $this->instances[$k]['data'] = array_merge(
138
+ wd_asl()->options['asl_defaults'],
139
+ $instance
140
+ );
141
+ else
142
+ $this->instances[$k]['data'] = wd_asl()->options['asl_defaults'];
143
+ }
144
+ }
145
+
146
+ // ------------------------------------------------------------
147
+ // ---------------- SINGLETON SPECIFIC --------------------
148
+ // ------------------------------------------------------------
149
+
150
+ /**
151
+ * Get the instance of self
152
+ *
153
+ * @return self
154
+ */
155
+ public static function getInstance() {
156
+ if (!(self::$_instance instanceof self)) {
157
+ self::$_instance = new self();
158
+ }
159
+
160
+ return self::$_instance;
161
+ }
162
+
163
+ /**
164
+ * Cloning disabled
165
+ */
166
+ private function __clone() {
167
+ }
168
+
169
+ /**
170
+ * Serialization disabled
171
+ */
172
+ private function __sleep() {
173
+ }
174
+
175
+ /**
176
+ * De-serialization disabled
177
+ */
178
+ private function __wakeup() {
179
+ }
180
+ }
includes/classes/core/class-asl-manager.php ADDED
@@ -0,0 +1,297 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_Manager")) {
5
+ /**
6
+ * Class WD_ASL_Manager
7
+ *
8
+ * This is the main controller class of the plugin, should be instantiated from the plugin main file.
9
+ *
10
+ * @class WD_ASL_Manager
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Core
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_Manager {
17
+
18
+ /**
19
+ * Context of the current WP environment
20
+ *
21
+ * Is used to include the correct and only necessary files for each context to save performance
22
+ *
23
+ * Possible values:
24
+ * ajax - an ajax call triggered by the search
25
+ * frontend - simple front-end call, or an ajax request not triggered by ASP
26
+ * backend - on any of the plugin back-end pages
27
+ * global_backend - on any other back-end page
28
+ * special - special cases
29
+ *
30
+ * @since 1.0
31
+ * @var string
32
+ */
33
+ private $context = "frontend";
34
+
35
+ /**
36
+ * Core singleton class
37
+ * @var WD_ASL_Manager self
38
+ */
39
+ private static $_instance;
40
+
41
+ /**
42
+ * Initialize and run the plugin-in
43
+ */
44
+ private function __construct() {
45
+
46
+ do_action("wd_asl_before_load");
47
+
48
+ $this->preLoad();
49
+ register_activation_hook(ASL_FILE, array($this, 'activationHook'));
50
+ /**
51
+ * Available after this point:
52
+ * (array) wd_asl()->options, (global) $wd_asl->options
53
+ * (WD_ASL_Init) wd_asl()->init, (global) $wd_asl->init
54
+ * (WD_ASL_DBMan) wd_asl()->db, (global) $wd_asl->db
55
+ */
56
+ $this->getContext();
57
+ /**
58
+ * Available after this point:
59
+ * $this->context
60
+ */
61
+ $this->loadInstances();
62
+ /**
63
+ * Available after this point:
64
+ * (WD_ASL_Init) wd_asl()->instances, (global) $wd_asl->instances
65
+ */
66
+ $this->loadIncludes();
67
+ $this->loadShortcodes();
68
+ $this->loadAssets();
69
+ $this->loadMenu();
70
+
71
+ $this->loadHooks();
72
+
73
+ wd_asl()->init->safety_check();
74
+
75
+ // Late init, just before footer print scripts
76
+ add_action("wp_footer", array($this, "lateInit"), 99);
77
+
78
+ do_action("wd_asl_loaded");
79
+
80
+ }
81
+
82
+
83
+ /**
84
+ * Preloading: for functions and other stuff needed
85
+ */
86
+ private function preLoad() {
87
+
88
+ // Initialize the session
89
+ require_once(ASL_CLASSES_PATH . "session/wp-session.inc.php");
90
+ wd_asl()->wp_session = WP_Session::get_instance();
91
+
92
+ require_once(ASL_PATH . "/backend/settings/default_options.php");
93
+ require_once(ASL_CLASSES_PATH . "etc/class.asl-mb.php");
94
+
95
+ // We need to initialize the init here to get the init->table() function
96
+ wd_asl()->init = WD_ASL_Init::getInstance();
97
+
98
+ require_once(ASL_CLASSES_PATH . "etc/debug_data.class.php");
99
+ wd_asl()->debug = new wdDebugData( 'asl_debug_data' );
100
+ }
101
+
102
+ /**
103
+ * Gets the call context for further use
104
+ */
105
+ public function getContext() {
106
+
107
+ $backend_pages = WD_ASL_Menu::getMenuPages();
108
+
109
+ if ( !empty($_POST['action']) ) {
110
+ if ( in_array($_POST['action'], WD_ASL_Ajax::getAll()) )
111
+ $this->context = "ajax";
112
+ if ( isset($_POST['wd_required']) )
113
+ $this->context = "special";
114
+ // If it is not part of the plugin ajax actions, the context stays "frontend"
115
+ } else if (!empty($_GET['page']) && in_array($_GET['page'], $backend_pages)) {
116
+ $this->context = "backend";
117
+ } else if ( is_admin() ) {
118
+ $this->context = "global_backend";
119
+ } else {
120
+ $this->context = "frontend";
121
+ }
122
+
123
+ }
124
+
125
+ /**
126
+ * Loads the instance data into the global scope
127
+ */
128
+ private function loadInstances() {
129
+
130
+ wd_asl()->instances = WD_ASL_Instances::getInstance();
131
+
132
+ }
133
+
134
+ /**
135
+ * Loads the required files based on the context
136
+ */
137
+ private function loadIncludes() {
138
+
139
+ require_once(ASL_FUNCTIONS_PATH . "functions.php");
140
+ require_once(ASL_CLASSES_PATH . "ajax/ajax.inc.php");
141
+ require_once(ASL_CLASSES_PATH . "filters/filters.inc.php");
142
+ require_once(ASL_CLASSES_PATH . "cache/cache.inc.php");
143
+ require_once(ASL_CLASSES_PATH . "suggest/suggest.inc.php");
144
+ require_once(ASL_CLASSES_PATH . "search/search.inc.php");
145
+ require_once(ASL_CLASSES_PATH . "shortcodes/shortcodes.inc.php");
146
+
147
+ // This must be here!! If it's in a conditional statement, it will fail..
148
+ //require_once(ASL_PATH . "/backend/vc/vc.extend.php");
149
+
150
+ switch ($this->context) {
151
+ case "special":
152
+ require_once(ASL_PATH . "/backend/settings/types.inc.php");
153
+ break;
154
+ case "ajax":
155
+ break;
156
+ case "frontend":
157
+ break;
158
+ case "backend":
159
+ require_once(ASL_PATH . "/backend/settings/types.inc.php");
160
+ break;
161
+ case "global_backend":
162
+ break;
163
+ default:
164
+ break;
165
+ }
166
+
167
+ // Special case
168
+ if (wpdreams_on_backend_post_editor()) {
169
+ require_once(ASL_PATH . "/backend/tinymce/buttons.php");
170
+ }
171
+
172
+ // Lifting some weight off from ajax requests
173
+ if ( $this->context != "ajax") {
174
+ require_once(ASL_CLASSES_PATH . "actions/actions.inc.php");
175
+ /* Includes on Post/Page/Custom post type edit pages */
176
+ require_once(ASL_CLASSES_PATH . "widgets/widgets.inc.php");
177
+ }
178
+
179
+ }
180
+
181
+ /**
182
+ * Use the Shorcodes loader to assign the shortcodes to handler classes
183
+ */
184
+ private function loadShortcodes() {
185
+
186
+ WD_ASL_Shortcodes::registerAll();
187
+
188
+ }
189
+
190
+ /**
191
+ * Runs the Assets loader
192
+ */
193
+ private function loadAssets() {
194
+ // JS
195
+ //WD_MS_Assets::loadJS("ms_search_js");
196
+
197
+ // CSS
198
+ //WD_MS_Assets::loadCSS("ms_search_css_basic");
199
+
200
+ if ($this->context == "backend")
201
+ add_action('admin_enqueue_scripts', array(wd_asl()->init, 'scripts'));
202
+
203
+ if ($this->context == "frontend" || $this->context == "backend") {
204
+ add_action('wp_enqueue_scripts', array(wd_asl()->init, 'styles'));
205
+ add_action('wp_enqueue_scripts', array(wd_asl()->init, 'scripts'));
206
+ add_action('wp_footer', array(wd_asl()->init, 'footer'));
207
+ }
208
+ }
209
+
210
+ /**
211
+ * Generates the menu
212
+ */
213
+ private function loadMenu() {
214
+
215
+ add_action('admin_menu', array('WD_ASL_Menu', 'register'));
216
+
217
+ }
218
+
219
+ /**
220
+ *
221
+ */
222
+ private function loadHooks() {
223
+
224
+ // Register handlers only if the context is ajax indeed
225
+ if ($this->context == "ajax")
226
+ WD_ASL_Ajax::registerAll();
227
+
228
+ if ( $this->context != "ajax") {
229
+ if ($this->context == "backend")
230
+ WD_ASL_Actions::register("admin_init", "Compatibility");
231
+
232
+ WD_ASL_Actions::registerAll();
233
+ }
234
+
235
+ WD_ASL_Filters::registerAll();
236
+ }
237
+
238
+ /**
239
+ * Run at the plugin activation
240
+ */
241
+ public function activationHook() {
242
+
243
+ // Run the activation tasks
244
+ wd_asl()->init->activate();
245
+
246
+ }
247
+
248
+ /**
249
+ * This is triggered in the footer. Used for conditional loading assets and stuff.
250
+ */
251
+ public function lateInit() {
252
+ // Non-forcefully push the instance data
253
+ wd_asl()->debug->pushData(
254
+ get_option('asl_options'),
255
+ 'asl_options'
256
+ );
257
+ // Save everything we did
258
+ wd_asl()->debug->save();
259
+ }
260
+
261
+
262
+ // ------------------------------------------------------------
263
+ // ---------------- SINGLETON SPECIFIC --------------------
264
+ // ------------------------------------------------------------
265
+
266
+ /**
267
+ * Get the instane of WD_ASL_Manager
268
+ *
269
+ * @return self
270
+ */
271
+ public static function getInstance() {
272
+ if (!(self::$_instance instanceof self)) {
273
+ self::$_instance = new self();
274
+ }
275
+
276
+ return self::$_instance;
277
+ }
278
+
279
+ /**
280
+ * Cloning disabled
281
+ */
282
+ private function __clone() {
283
+ }
284
+
285
+ /**
286
+ * Serialization disabled
287
+ */
288
+ private function __sleep() {
289
+ }
290
+
291
+ /**
292
+ * De-serialization disabled
293
+ */
294
+ private function __wakeup() {
295
+ }
296
+ }
297
+ }
includes/classes/core/class-asl-menu.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_Menu")) {
5
+ /**
6
+ * Class WD_ASL_Menu
7
+ *
8
+ * Menu handler for Ajax Search Pro plugin. This class encapsulates the menu elements as well.
9
+ *
10
+ * @class WD_ASL_Menu
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Core
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_Menu {
17
+
18
+ /**
19
+ * Holds the main menu item
20
+ *
21
+ * @var array the main menu
22
+ */
23
+ private static $main_menu = array(
24
+ "title" => "Ajax Search Lite",
25
+ "slug" => "/backend/settings.php",
26
+ "position" => "206.5",
27
+ "icon_url" => 'icon.png'
28
+ );
29
+
30
+ /**
31
+ * Submenu titles and slugs
32
+ *
33
+ * @var array
34
+ */
35
+ private static $submenu_items = array(
36
+ array(
37
+ "title" => "Analytics Integration",
38
+ "slug" => "/backend/analytics.php"
39
+ ),
40
+ array(
41
+ "title" => "Compatibility Settings",
42
+ "slug" => "/backend/compatibility.php"
43
+ ),
44
+ array(
45
+ "title" => "Performance tracking",
46
+ "slug" => "/backend/performance_options.php"
47
+ ),
48
+ array(
49
+ "title" => "Help & Support",
50
+ "slug" => "/backend/help_and_support.php"
51
+ )
52
+ );
53
+
54
+ /**
55
+ * Runs the menu registration process
56
+ */
57
+ public static function register() {
58
+
59
+ $capability = ASL_DEMO == 1 ? 'read' : 'manage_options';
60
+
61
+ add_menu_page(
62
+ self::$main_menu['title'],
63
+ self::$main_menu['title'],
64
+ $capability,
65
+ ASL_DIR . self::$main_menu['slug'],
66
+ '',
67
+ ASL_URL . self::$main_menu['icon_url'],
68
+ self::$main_menu['position']
69
+ );
70
+
71
+ foreach (self::$submenu_items as $submenu) {
72
+ add_submenu_page(
73
+ ASL_DIR . self::$main_menu['slug'],
74
+ self::$main_menu['title'],
75
+ $submenu['title'],
76
+ $capability,
77
+ ASL_DIR . $submenu['slug']
78
+ );
79
+
80
+ }
81
+
82
+ }
83
+
84
+ /**
85
+ * Method to obtain the menu pages for context checking
86
+ *
87
+ * @return array
88
+ */
89
+ public static function getMenuPages() {
90
+ $ret = array();
91
+
92
+ $ret[] = ASL_DIR . self::$main_menu['slug'];
93
+
94
+ foreach (self::$submenu_items as $menu)
95
+ $ret[] = ASL_DIR . $menu['slug'];
96
+
97
+ return $ret;
98
+ }
99
+
100
+ }
101
+ }
includes/classes/core/class-asl-shortcodes.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if ( !class_exists("WD_ASL_Shortcodes") ) {
5
+ /**
6
+ * Class WD_ASL_Shortcodes
7
+ *
8
+ * Registers the plugin Shortcodes, with the proper handler classes.
9
+ * Handling is passed to the handle() method of the specified class.
10
+ * Handlers defined in /classes/shortcodes/class-asl-{handler}.php
11
+ *
12
+ * @class WD_ASL_Shortcodes
13
+ * @version 1.0
14
+ * @package AjaxSearchLite/Classes/Core
15
+ * @category Class
16
+ * @author Ernest Marcinko
17
+ */
18
+ class WD_ASL_Shortcodes {
19
+
20
+ /**
21
+ * Array of internal known shortcodes
22
+ *
23
+ * @var array
24
+ */
25
+ private static $shortcodes = array(
26
+ "wpdreams_ajaxsearchlite" => "Search"
27
+ );
28
+
29
+ /**
30
+ * Array of already registered shortcodes
31
+ *
32
+ * @var array
33
+ */
34
+ private static $registered = array();
35
+
36
+ /**
37
+ * Registers all the handlers from the $actions variable
38
+ */
39
+ public static function registerAll() {
40
+
41
+ foreach (self::$shortcodes as $shortcode => $handler)
42
+ self::register($shortcode, $handler);
43
+
44
+ }
45
+
46
+ /**
47
+ * Get all the queued handlers
48
+ *
49
+ * @return array
50
+ */
51
+ public static function getAll( ) {
52
+ return array_keys(self::$shortcodes);
53
+ }
54
+
55
+ /**
56
+ * Get all the already registered handlers
57
+ *
58
+ * @return array
59
+ */
60
+ public static function getRegistered() {
61
+ return self::$registered;
62
+ }
63
+
64
+ /**
65
+ * Registers a filter with the handler class name.
66
+ *
67
+ * @param $shortcode
68
+ * @param $handler string|array
69
+ * @return bool
70
+ */
71
+ public static function register( $shortcode, $handler ) {
72
+
73
+ if ( is_array($handler) ) {
74
+ $class = "WD_ASL_" . $handler[0] . "_Shortcode";
75
+ $handle = $handler[1];
76
+ } else {
77
+ $class = "WD_ASL_" . $handler . "_Shortcode";
78
+ $handle = "handle";
79
+ }
80
+
81
+ if ( !class_exists($class) ) return false;
82
+
83
+ add_shortcode($shortcode, array(call_user_func(array($class, 'getInstance')), $handle));
84
+
85
+ self::$registered[] = $shortcode;
86
+
87
+ return true;
88
+ }
89
+
90
+ /**
91
+ * Deregisters a shortcode
92
+ *
93
+ * @param $shortcode string
94
+ * @return bool
95
+ */
96
+ public static function deregister( $shortcode ) {
97
+
98
+ // Check if it is already registered
99
+ if ( isset(self::$registered[$shortcode]) )
100
+ remove_shortcode( $shortcode );
101
+ else if ( isset(self::$shortcodes[$shortcode]) )
102
+ unset(self::$shortcodes[$shortcode]);
103
+
104
+ return true;
105
+
106
+ }
107
+
108
+ }
109
+ }
includes/classes/core/core.inc.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ require_once(ASL_CLASSES_PATH . "core/class-asl-globals.php");
5
+ require_once(ASL_CLASSES_PATH . "core/class-asl-ajax.php");
6
+ require_once(ASL_CLASSES_PATH . "core/class-asl-actions.php");
7
+ require_once(ASL_CLASSES_PATH . "core/class-asl-filters.php");
8
+ require_once(ASL_CLASSES_PATH . "core/class-asl-shortcodes.php");
9
+ require_once(ASL_CLASSES_PATH . "core/class-asl-init.php");
10
+ //require_once(ASL_CLASSES_PATH . "core/class-asl-assets-loader.php");
11
+ require_once(ASL_CLASSES_PATH . "core/class-asl-menu.php");
12
+ require_once(ASL_CLASSES_PATH . "core/class-asl-dbman.php");
13
+ require_once(ASL_CLASSES_PATH . "core/class-asl-instances.php");
14
+ require_once(ASL_CLASSES_PATH . "core/class-asl-manager.php");
includes/classes/etc/class.asl-mb.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if ( !class_exists("ASL_mb") ) {
5
+ /**
6
+ * Class ASL_mb
7
+ *
8
+ * Simple multibite string function wrapper class for easy use
9
+ *
10
+ * @class ASL_mb
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Etc
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class ASL_mb {
17
+
18
+ public static function strlen( ) {
19
+ $args = func_get_args();
20
+ if ( function_exists("mb_strlen") )
21
+ return call_user_func_array("mb_strlen", $args);
22
+ else
23
+ return call_user_func_array("strlen", $args);
24
+ }
25
+
26
+ public static function strpos( ) {
27
+ $args = func_get_args();
28
+ if ( function_exists("mb_strpos") )
29
+ return call_user_func_array("mb_strpos", $args);
30
+ else
31
+ return call_user_func_array("strpos", $args);
32
+ }
33
+
34
+ public static function substr( ) {
35
+ $args = func_get_args();
36
+ if ( function_exists("mb_substr") )
37
+ return call_user_func_array("mb_substr", $args);
38
+ else
39
+ return call_user_func_array("substr", $args);
40
+ }
41
+
42
+ public static function strtolower( ) {
43
+ $args = func_get_args();
44
+ if ( function_exists("mb_strtolower") )
45
+ return call_user_func_array("mb_strtolower", $args);
46
+ else
47
+ return call_user_func_array("strtolower", $args);
48
+ }
49
+ }
50
+ }
includes/{debug_data.class.php → classes/etc/debug_data.class.php} RENAMED
File without changes
includes/classes/filters/class-asl-abstract.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_Filter_Abstract")) {
5
+ /**
6
+ * Class WD_MS_Filter_Abstract
7
+ *
8
+ * An abstract for filter hook handlers.
9
+ *
10
+ * @class WD_ASL_Filter_Abstract
11
+ * @version 1.0
12
+ * @package AjaxSearchPro/Classes/Filters
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ abstract class WD_ASL_Filter_Abstract {
17
+
18
+ /**
19
+ * Static instance storage
20
+ *
21
+ * @var self
22
+ */
23
+ protected static $_instance;
24
+
25
+
26
+ /**
27
+ * Get the instance
28
+ *
29
+ * All shortcode classes must be singletons!
30
+ */
31
+
32
+ public static function getInstance() {}
33
+
34
+ /**
35
+ * The handler
36
+ *
37
+ * This function is called by the appropriate handler
38
+ */
39
+ public function handle() {}
40
+
41
+ /**
42
+ * Cloning disabled
43
+ */
44
+ protected function __clone() {}
45
+
46
+ /**
47
+ * Serialization disabled
48
+ */
49
+ protected function __sleep() {}
50
+
51
+ /**
52
+ * De-serialization disabled
53
+ */
54
+ protected function __wakeup() {}
55
+
56
+ }
57
+ }
includes/classes/filters/class-asl-etc_fixes.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_EtcFixes_Filter")) {
5
+ /**
6
+ * Class WD_ASL_EtcFixes_Filter
7
+ *
8
+ * Other 3rd party plugin related filters
9
+ *
10
+ * @class WD_ASL_EtcFixes_Filter
11
+ * @version 1.0
12
+ * @package AjaxSearchPro/Classes/Filters
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_EtcFixes_Filter extends WD_ASL_Filter_Abstract {
17
+
18
+ /**
19
+ * Fix for the Download Monitor plugin download urls
20
+ *
21
+ * @param $r
22
+ * @param $sid
23
+ * @return mixed
24
+ */
25
+ function plug_DownloadMonitorLink($r, $sid) {
26
+ if ( $r->post_type == "dlm_download" && class_exists("DLM_Download") ) {
27
+ $dl = new DLM_Download($r->id);
28
+ if ( $dl->exists() ) {
29
+ $r->link = $dl->get_the_download_link();
30
+ }
31
+ }
32
+ return $r;
33
+ }
34
+
35
+ // ------------------------------------------------------------
36
+ // ---------------- SINGLETON SPECIFIC --------------------
37
+ // ------------------------------------------------------------
38
+ public static function getInstance() {
39
+ if ( ! ( self::$_instance instanceof self ) ) {
40
+ self::$_instance = new self();
41
+ }
42
+
43
+ return self::$_instance;
44
+ }
45
+ }
46
+ }
includes/classes/filters/class-asl-formoverride.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_FormOverride_Filter")) {
5
+ /**
6
+ * Class WD_ASL_FormOverride_Filter
7
+ *
8
+ * Handles the default search form layout override
9
+ *
10
+ * @class WD_ASL_FormOverride_Filter
11
+ * @version 1.0
12
+ * @package AjaxSearchPro/Classes/Filters
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_FormOverride_Filter extends WD_ASL_Filter_Abstract {
17
+
18
+ function handle( $form = "" ) {
19
+ $inst = wd_asl()->instances->get(0);
20
+
21
+ if ( $inst['data']['override_search_form'] )
22
+ return do_shortcode("[wpdreams_ajaxsearchlite]");
23
+
24
+ return $form;
25
+ }
26
+
27
+ // ------------------------------------------------------------
28
+ // ---------------- SINGLETON SPECIFIC --------------------
29
+ // ------------------------------------------------------------
30
+ public static function getInstance() {
31
+ if ( ! ( self::$_instance instanceof self ) ) {
32
+ self::$_instance = new self();
33
+ }
34
+
35
+ return self::$_instance;
36
+ }
37
+ }
38
+ }
includes/classes/filters/class-asl-searchoverride.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_SearchOverride_Filter")) {
5
+ /**
6
+ * Class WD_ASL_SearchOverride_Filter
7
+ *
8
+ * Handles search override filters
9
+ *
10
+ * @class WD_ASL_SearchOverride_Filter
11
+ * @version 1.0
12
+ * @package AjaxSearchPro/Classes/Filters
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_SearchOverride_Filter extends WD_ASL_Filter_Abstract {
17
+
18
+ public function handle() {}
19
+
20
+ public function override($posts, $wp_query) {
21
+
22
+ // Not working on paginated results, multisite
23
+ /*if (!$wp_query->is_search())
24
+ return $posts;*/
25
+
26
+ // Is this a search query
27
+ if (empty($wp_query->query_vars['s'])) {
28
+ return $posts;
29
+ }
30
+
31
+ // Is this just a NEW regular search?
32
+ if ( !isset($_GET['asl_active']) ) {
33
+ // Then clear the override
34
+ wd_asl()->wp_session['asl_override'] = false;
35
+ }
36
+
37
+ // Memorize the data across pagination for the form values..
38
+ if (isset($_POST['p_asl_data']) || isset($_POST['np_asl_data'])) {
39
+ $_p_data = isset($_POST['p_asl_data']) ? $_POST['p_asl_data'] : $_POST['np_asl_data'];
40
+ wd_asl()->wp_session['asl_form_data'] = array("data" => $_p_data);
41
+ } else if ( !empty(wd_asl()->wp_session['asl_form_data']) ) {
42
+ // Get the memorized data if exists
43
+ if ( is_object(wd_asl()->wp_session['asl_form_data']['data']) )
44
+ $_POST['np_asl_data'] = wd_asl()->wp_session['asl_form_data']['data']->toArray();
45
+ else
46
+ $_POST['np_asl_data'] = wd_asl()->wp_session['asl_form_data']['data'];
47
+ }
48
+
49
+ if (isset($_POST['p_asl_data']) && $_POST['p_asl_data'] != '') {
50
+ $_method = &$_POST;
51
+ parse_str($_method['p_asl_data'], $s_data);
52
+
53
+ // this is a new POST search, so set the session
54
+ wd_asl()->wp_session['asl_override'] = array("asl_data" => $s_data);
55
+ } else {
56
+ // Is this a paginated search?
57
+ if ( !empty(wd_asl()->wp_session['asl_override']) ) {
58
+ // ->toArray() method needs to be invoked, if the session handler converts the recursive array
59
+ if ( is_object(wd_asl()->wp_session['asl_override']['asl_data']) )
60
+ $s_data = wd_asl()->wp_session['asl_override']['asl_data']->toArray();
61
+ else
62
+ $s_data = wd_asl()->wp_session['asl_override']['asl_data'];
63
+ } else {
64
+ return $posts;
65
+ }
66
+ }
67
+
68
+ $_POST['options'] = $s_data;
69
+ $_POST['options']['non_ajax_search'] = true;
70
+ $_POST['aslp'] = $_GET['s'];
71
+ $_POST['asl_get_as_array'] = 1;
72
+
73
+ $o = WD_ASL_Search_Handler::getInstance();
74
+ $res = $o->handle( true );
75
+
76
+ // The get_query_var() is malfunctioning in some cases!!! use $_GET['paged']
77
+ //$paged = (get_query_var('paged') != 0) ? get_query_var('paged') : 1;
78
+ if ( isset($_GET['paged']) ) {
79
+ $paged = $_GET['paged'];
80
+ } else if ( isset($wp_query->query_vars['paged']) ) {
81
+ $paged = $wp_query->query_vars['paged'];
82
+ } else {
83
+ $paged = 1;
84
+ }
85
+
86
+ $paged = $paged <= 0 ? 1 : $paged;
87
+
88
+ $posts_per_page = (int)get_option('posts_per_page');
89
+
90
+ // Get and convert the results needed
91
+ $n_posts = asl_results_to_wp_obj( $res, ( $paged - 1 ) * $posts_per_page, $posts_per_page );
92
+
93
+ $wp_query->found_posts = count($res);
94
+ if (($wp_query->found_posts / $posts_per_page) > 1)
95
+ $wp_query->max_num_pages = ceil($wp_query->found_posts / $posts_per_page);
96
+ else
97
+ $wp_query->max_num_pages = 0;
98
+
99
+ return $n_posts;
100
+ }
101
+
102
+ public function fixUrls( $url, $post, $leavename ) {
103
+ if (isset($post->asl_guid))
104
+ return $post->asl_guid;
105
+ return $url;
106
+ }
107
+
108
+ // ------------------------------------------------------------
109
+ // ---------------- SINGLETON SPECIFIC --------------------
110
+ // ------------------------------------------------------------
111
+ public static function getInstance() {
112
+ if ( ! ( self::$_instance instanceof self ) ) {
113
+ self::$_instance = new self();
114
+ }
115
+
116
+ return self::$_instance;
117
+ }
118
+ }
119
+ }
includes/classes/filters/filters.inc.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ require_once(ASL_CLASSES_PATH . "filters/class-asl-abstract.php");
5
+ require_once(ASL_CLASSES_PATH . "filters/class-asl-searchoverride.php");
6
+ require_once(ASL_CLASSES_PATH . "filters/class-asl-formoverride.php");
7
+ require_once(ASL_CLASSES_PATH . "filters/class-asl-etc_fixes.php");
includes/{search.class.php → classes/search/search.class.php} RENAMED
@@ -157,38 +157,38 @@ if (!class_exists('wpdreams_search')) {
157
 
158
  }
159
 
160
- /**
161
- * Performs a full escape
162
- *
163
- * @uses wd_mysql_escape_mimic()
164
- * @param $string
165
- * @return array|mixed
166
- */
167
- protected function escape( $string ) {
168
- global $wpdb;
169
-
170
- // recursively go through if it is an array
171
- if ( is_array($string) ) {
172
- foreach ($string as $k => $v) {
173
- $string[$k] = $this->escape($v);
174
- }
175
- return $string;
176
- }
177
-
178
- if ( is_float( $string ) )
179
- return $string;
180
-
181
- // Extra escape for 4.0 >=
182
- if ( method_exists( $wpdb, 'esc_like' ) )
183
- return esc_sql( $wpdb->esc_like( $string ) );
184
-
185
- // Escape support for WP < 4.0
186
- if ( function_exists( 'like_escape' ) )
187
- return esc_sql( like_escape($string) );
188
-
189
- // Okay, what? Not one function is present, use the one we have
190
- return wd_mysql_escape_mimic($string);
191
- }
192
 
193
  /**
194
  * Converts a string to number, array of strings to array of numbers
157
 
158
  }
159
 
160
+ /**
161
+ * Performs a safe sanitation and escape
162
+ *
163
+ * @uses wd_mysql_escape_mimic()
164
+ * @param $string
165
+ * @return array|mixed
166
+ */
167
+ protected function escape( $string ) {
168
+ global $wpdb;
169
+
170
+ // recursively go through if it is an array
171
+ if ( is_array($string) ) {
172
+ foreach ($string as $k => $v) {
173
+ $string[$k] = $this->escape($v);
174
+ }
175
+ return $string;
176
+ }
177
+
178
+ if ( is_float( $string ) )
179
+ return $string;
180
+
181
+ // Extra escape for 4.0 >=
182
+ if ( method_exists( $wpdb, 'esc_like' ) )
183
+ return esc_sql( $wpdb->esc_like( $string ) );
184
+
185
+ // Escape support for WP < 4.0
186
+ if ( function_exists( 'like_escape' ) )
187
+ return esc_sql( like_escape($string) );
188
+
189
+ // Okay, what? Not one function is present, use the one we have
190
+ return wd_mysql_escape_mimic($string);
191
+ }
192
 
193
  /**
194
  * Converts a string to number, array of strings to array of numbers
includes/classes/search/search.controller.class.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Prevent direct access */
3
+ defined('ABSPATH') or die("You can't access this file directly.");
4
+
5
+ if (!class_exists('asl_searchController')) {
6
+ /**
7
+ * Class asl_searchController
8
+ *
9
+ * A controller slash wrapper class for the whole search process.
10
+ *
11
+ */
12
+ class asl_searchController {
13
+ /*
14
+ * Results
15
+ */
16
+ private $results;
17
+
18
+ /*
19
+ * Array of phrases of all synonym variations
20
+ */
21
+ private $finalPhrases = array();
22
+
23
+ /*
24
+ * Constructor args
25
+ */
26
+ private $args;
27
+
28
+ /*
29
+ * Search Options
30
+ */
31
+ private $so;
32
+
33
+ /*
34
+ * Caching Options
35
+ */
36
+ private $co;
37
+
38
+ public function __construct( $args ) {
39
+
40
+ $defaults = array(
41
+ 'phrase' => "",
42
+ 'id' => 0,
43
+ 'instance' => null
44
+ );
45
+ $args = wp_parse_args( $args, $defaults );
46
+
47
+ $this->args = $args;
48
+ }
49
+
50
+ public function search() {
51
+ $this->parseOptions();
52
+
53
+ $sd = &$this->args['instance']['data'];
54
+ $s = $this->args['phrase'];
55
+ $id = $this->args['id'];
56
+
57
+ $allpageposts = array();
58
+ $pageposts = array();
59
+
60
+ do_action('asl_before_search', $s);
61
+
62
+ $params = array('data' => $sd, 'options' => $this->so);
63
+
64
+ // VC 4.6+ fix: Shortcodes are not loaded in ajax responses
65
+ // class_exists() is mandatory, some PHP versions fail
66
+ if ( class_exists("WPBMap") && method_exists("WPBMap", "addAllMappedShortcodes") )
67
+ WPBMap::addAllMappedShortcodes();
68
+
69
+ $_posts = new wpdreams_searchContent($params);
70
+ $pageposts = $_posts->search($s);
71
+ $allpageposts = array_merge($allpageposts, $pageposts);
72
+
73
+ do_action('asl_after_pagepost_results', $s, $pageposts);
74
+
75
+ $allpageposts = apply_filters('asl_pagepost_results', $allpageposts);
76
+
77
+
78
+ $results = array_merge(
79
+ $allpageposts
80
+ );
81
+
82
+ $results = apply_filters('asl_results', $results);
83
+
84
+ do_action('asl_after_search', $s, $results);
85
+
86
+ return $results;
87
+ }
88
+
89
+ public function kwSuggestions() {
90
+ $sd = &$this->args['instance']['data'];
91
+ $results = array();
92
+
93
+ $types = array();
94
+
95
+ if ($sd['searchinposts'] == 1)
96
+ $types[] = "post";
97
+ if ($sd['searchinpages'] == 1)
98
+ $types[] = "page";
99
+ if (isset($sd['selected-customtypes']) && count($sd['selected-customtypes']) > 0)
100
+ $types = array_merge($types, $sd['selected-customtypes']);
101
+
102
+ $t = new wpd_keywordSuggest("google", array(
103
+ 'maxCount' => w_isset_def( $sd['kw_count'], 10 ),
104
+ 'maxCharsPerWord' => w_isset_def($sd['kw_length'], 60),
105
+ 'postTypes' => $types,
106
+ 'lang' => w_isset_def( $sd['kw_google_lang'], "en" ),
107
+ 'overrideUrl' => ''
108
+ ));
109
+
110
+ $keywords = $t->getKeywords( trim($this->args['phrase']) );
111
+
112
+ if ($keywords != false) {
113
+ $results['keywords'] = $keywords;
114
+ $results['nores'] = 1;
115
+ $results = apply_filters('asl_only_keyword_results', $results);
116
+ }
117
+
118
+ return $results;
119
+ }
120
+
121
+ private function parseOptions() {
122
+ $sd = &$this->args['instance']['data'];
123
+
124
+ $sd['image_options'] = array(
125
+ 'show_images' => $sd['show_images'],
126
+ 'image_bg_color' => '#FFFFFF',
127
+ 'image_transparency' => 1,
128
+ 'image_crop_location' => w_isset_def($sd['image_crop_location'], "c"),
129
+ 'image_width' => $sd['image_width'],
130
+ 'image_height' => $sd['image_height'],
131
+ 'image_source1' => $sd['image_source1'],
132
+ 'image_source2' => $sd['image_source2'],
133
+ 'image_source3' => $sd['image_source3'],
134
+ 'image_source4' => $sd['image_source4'],
135
+ 'image_source5' => $sd['image_source5'],
136
+ 'image_default' => $sd['image_default'],
137
+ 'image_custom_field' => $sd['image_custom_field']
138
+ );
139
+
140
+ // ----------------- Recalculate image width/height ---------------
141
+ switch ($sd['resultstype']) {
142
+ case "horizontal":
143
+ /* Same width as height */
144
+ $sd['image_options']['image_width'] = wpdreams_width_from_px($sd['image_options']['hreswidth']);
145
+ $sd['image_options']['image_height'] = wpdreams_width_from_px($sd['image_options']['hreswidth']);
146
+ break;
147
+ case "polaroid":
148
+ $sd['image_options']['image_width'] = intval($sd['preswidth']);
149
+ $sd['image_options']['image_height'] = intval($sd['preswidth']);
150
+ break;
151
+ case "isotopic":
152
+ $sd['image_options']['image_width'] = intval($sd['i_item_width'] * 1.5);
153
+ $sd['image_options']['image_height'] = intval($sd['i_item_height'] * 1.5);
154
+ break;
155
+ }
156
+
157
+ if (isset($sd['selected-imagesettings'])) {
158
+ $sd['settings-imagesettings'] = $sd['selected-imagesettings'];
159
+ }
160
+ /*if (isset($search) && $sd['exactonly']!=1) {
161
+ $_s = explode(" ", $s);
162
+ }*/
163
+ if (isset($_POST['options'])) {
164
+ if (is_array($_POST['options']))
165
+ $this->so = $_POST['options'];
166
+ else
167
+ parse_str($_POST['options'], $this->so);
168
+ }
169
+ }
170
+ }
171
+ }
includes/classes/search/search.inc.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ /* Search related classes */
5
+ require_once(ASL_CLASSES_PATH . "search/search.controller.class.php");
6
+ require_once(ASL_CLASSES_PATH . "search/search.class.php");
7
+ require_once(ASL_CLASSES_PATH . "search/search_content.class.php");
includes/{search_content.class.php → classes/search/search_content.class.php} RENAMED
@@ -8,11 +8,11 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
8
  protected function do_search() {
9
  global $wpdb;
10
  global $q_config;
11
- global $asl_debug_data;
12
 
13
  $options = $this->options;
14
  $comp_options = get_option( 'asl_compatibility' );
15
  $searchData = $this->searchData;
 
16
 
17
  $parts = array();
18
  $relevance_parts = array();
@@ -66,8 +66,10 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
66
  $s = $this->s; // full keyword
67
  $_s = $this->_s; // array of keywords
68
 
69
- $_si = implode( '|', $_s ); // imploded phrase for regexp
70
- $_si = $_si != '' ? $_si : $s;
 
 
71
 
72
  $q_config['language'] = $options['qtranslate_lang'];
73
 
@@ -467,7 +469,6 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
467
  ) ? $wpdb->posts. ".post_excerpt" : "''";
468
  /*---------------------------------------------------------------*/
469
 
470
-
471
  $orderby = ( ( isset( $searchData['selected-orderby'] ) && $searchData['selected-orderby'] != '' ) ? $searchData['selected-orderby'] : "post_date DESC" );
472
  $querystr = "
473
  SELECT
@@ -497,13 +498,13 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
497
  AND ( $wpml_query )
498
  GROUP BY
499
  $wpdb->posts.ID
500
- ";
501
- $querystr .= " ORDER BY relevance DESC, " . $wpdb->posts . "." . $orderby . "
502
- LIMIT " . $searchData['maxresults'];
503
 
504
  $pageposts = $wpdb->get_results( $querystr, OBJECT );
505
 
506
- $asl_debug_data->pushData(
507
  array(
508
  "phrase" => $s,
509
  "options" => $options,
@@ -517,10 +518,7 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
517
  //var_dump($pageposts);die("!!");
518
 
519
  $this->results = $pageposts;
520
-
521
-
522
  return $pageposts;
523
-
524
  }
525
 
526
  protected function post_process() {
@@ -531,6 +529,12 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
531
  $s = $this->s;
532
  $_s = $this->_s;
533
 
 
 
 
 
 
 
534
  $performance_options = get_option('asl_performance');
535
 
536
  if ( is_multisite() ) {
@@ -609,17 +613,11 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
609
  }
610
  }
611
 
612
- //remove the search shortcodes properly
613
- add_shortcode('wpdreams_ajaxsearchpro', array($this, 'return_empty_string'));
614
- add_shortcode('wpdreams_ajaxsearchlite', array($this, 'return_empty_string'));
615
-
616
  if ( ! isset( $searchData['striptagsexclude'] ) ) {
617
  $searchData['striptagsexclude'] = "<a><span>";
618
  }
619
 
620
  if ( ! isset( $searchData['descriptionfield'] ) || $searchData['descriptionfield'] == "0" || is_array( $searchData['descriptionfield'] ) ) {
621
- if (w_isset_def($searchData['strip_shortcodes'], 0) == 1)
622
- $r->content = strip_shortcodes($r->content);
623
  if ( function_exists( 'qtrans_getLanguage' ) ) {
624
  $r->content = apply_filters( 'the_content', $r->content );
625
  }
@@ -641,12 +639,17 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
641
  if ( $_content == "" && $r->content != '') {
642
  $_content = $r->content;
643
  }
644
- if ( $_content != "" ) {
645
- $_content = str_replace( '[wpdreams_ajaxsearchlite]', "", $_content );
646
- }
647
 
648
- if ( $_content != "" ) {
649
- $_content = apply_filters( 'the_content', $_content );
 
 
 
 
 
 
 
 
650
  }
651
 
652
  // Remove styles and scripts
@@ -769,90 +772,95 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
769
  }
770
  }
771
 
772
- /**
773
- * Returns the context of a phrase within a text.
774
- *
775
- * @param $str string context
776
- * @param $needle string context
777
- * @param $context int length of the context
778
- * @param $maxlength int maximum length of the string in characters
779
- * @return string
780
- */
781
- function context_find($str, $needle, $context, $maxlength) {
782
- $haystack = ' '.trim($str).' ';
783
-
784
- $fn_strpos = "strpos";
785
- $fn_substr = "substr";
786
- $fn_strlen = "strlen";
787
-
788
- // Use multibyte string functions if available
789
- if ( function_exists('mb_substr') ) {
790
- $fn_strpos = "mb_strpos";
791
- $fn_substr = "mb_substr";
792
- $fn_strlen = "mb_strlen";
793
-
794
- $haystack = mb_strtolower($haystack);
795
- $needle = mb_strtolower($needle);
796
- } else {
797
- $haystack = strtolower($haystack);
798
- $needle = strtolower($needle);
799
- }
800
 
801
- if ( $i = $fn_strpos($haystack, $needle) ) {
802
- $start=$i;
803
- $end=$i;
804
- $spaces=0;
805
 
806
- while ($spaces < ((int) $context/2) && $start > 0) {
807
- $start--;
808
- if ($fn_substr($haystack, $start, 1) == ' ') {
809
- $spaces++;
810
- }
811
- }
812
 
813
- while ($spaces < ($context +1) && $end < $fn_strlen($haystack)) {
814
- $end++;
815
- if ($fn_substr($haystack,$end,1) == ' ') {
816
- $spaces++;
817
- }
818
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
819
 
820
- while ($spaces < ($context +1) && $start > 0) {
821
- $start--;
822
- if ($fn_substr($haystack, $start, 1) == ' ') {
823
- $spaces++;
824
- }
825
- }
826
 
827
- $result = trim($fn_substr($haystack, $start, ($end - $start)));
 
 
 
 
 
828
 
829
- // Somewhere inbetween..
830
- if ( $start != 0 && $end < $fn_strlen($haystack) )
831
- return "..." . $result . "...";
832
 
833
- // Beginning
834
- if ( $start == 0 && $end < $fn_strlen($haystack) )
835
- return $result . "...";
836
 
837
- // End
838
- if ( $start != 0 && $end == $fn_strlen($haystack) )
839
- return "..." . $result;
840
 
841
- // If it is too long, strip it
842
- if ( $fn_strlen($result) > $maxlength)
843
- return wd_substr_at_word( $result, $maxlength ) . "...";
844
 
845
- // Else, it is the whole
846
- return $result;
 
847
 
848
- } else {
849
- // If it is too long, strip it
850
- if ( $fn_strlen($str) > $maxlength)
851
- return wd_substr_at_word( $str, $maxlength ) . "...";
852
 
853
- return $str;
854
- }
855
- }
 
 
 
 
 
 
 
 
856
 
857
  /**
858
  * An empty function to override individual shortcodes, this must be public
8
  protected function do_search() {
9
  global $wpdb;
10
  global $q_config;
 
11
 
12
  $options = $this->options;
13
  $comp_options = get_option( 'asl_compatibility' );
14
  $searchData = $this->searchData;
15
+ $sd = &$searchData;
16
 
17
  $parts = array();
18
  $relevance_parts = array();
66
  $s = $this->s; // full keyword
67
  $_s = $this->_s; // array of keywords
68
 
69
+ if (isset($options['non_ajax_search']))
70
+ $this->remaining_limit = 500;
71
+ else
72
+ $this->remaining_limit = $searchData['maxresults'];
73
 
74
  $q_config['language'] = $options['qtranslate_lang'];
75
 
469
  ) ? $wpdb->posts. ".post_excerpt" : "''";
470
  /*---------------------------------------------------------------*/
471
 
 
472
  $orderby = ( ( isset( $searchData['selected-orderby'] ) && $searchData['selected-orderby'] != '' ) ? $searchData['selected-orderby'] : "post_date DESC" );
473
  $querystr = "
474
  SELECT
498
  AND ( $wpml_query )
499
  GROUP BY
500
  $wpdb->posts.ID
501
+ ORDER BY
502
+ ".$sd['orderby_primary'].", ".$sd['orderby_secondary'].", id DESC
503
+ LIMIT " . $this->remaining_limit;
504
 
505
  $pageposts = $wpdb->get_results( $querystr, OBJECT );
506
 
507
+ wd_asl()->debug->pushData(
508
  array(
509
  "phrase" => $s,
510
  "options" => $options,
518
  //var_dump($pageposts);die("!!");
519
 
520
  $this->results = $pageposts;
 
 
521
  return $pageposts;
 
522
  }
523
 
524
  protected function post_process() {
529
  $s = $this->s;
530
  $_s = $this->_s;
531
 
532
+ // No post processing is needed on non-ajax search
533
+ if ( isset($options['non_ajax_search']) ) {
534
+ $this->results = $pageposts;
535
+ return $pageposts;
536
+ }
537
+
538
  $performance_options = get_option('asl_performance');
539
 
540
  if ( is_multisite() ) {
613
  }
614
  }
615
 
 
 
 
 
616
  if ( ! isset( $searchData['striptagsexclude'] ) ) {
617
  $searchData['striptagsexclude'] = "<a><span>";
618
  }
619
 
620
  if ( ! isset( $searchData['descriptionfield'] ) || $searchData['descriptionfield'] == "0" || is_array( $searchData['descriptionfield'] ) ) {
 
 
621
  if ( function_exists( 'qtrans_getLanguage' ) ) {
622
  $r->content = apply_filters( 'the_content', $r->content );
623
  }
639
  if ( $_content == "" && $r->content != '') {
640
  $_content = $r->content;
641
  }
 
 
 
642
 
643
+ // Deal with the shortcodes here, for more accuracy
644
+ if ( $searchData['shortcode_op'] == "remove" ) {
645
+ if ( $_content != "" ) {
646
+ // Remove shortcodes, keep the content, really fast and effective method
647
+ $_content = preg_replace("~(?:\[/?)[^\]]+/?\]~su", '', $_content);
648
+ }
649
+ } else {
650
+ if ( $_content != "" ) {
651
+ $_content = apply_filters( 'the_content', $_content, $searchId );
652
+ }
653
  }
654
 
655
  // Remove styles and scripts
772
  }
773
  }
774
 
775
+ /**
776
+ * Returns the context of a phrase within a text (max 1800 characters).
777
+ * Uses preg_split method to iterate through strings.
778
+ *
779
+ * @param $str string context
780
+ * @param $needle string context
781
+ * @param $context int length of the context
782
+ * @param $maxlength int maximum length of the string in characters
783
+ * @return string
784
+ */
785
+ function context_find($str, $needle, $context, $maxlength) {
786
+ $haystack = ' '.trim($str).' ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
787
 
788
+ // To prevent memory overflow, we need to limit the hay to relatively low count
789
+ $haystack = wd_substr_at_word(ASL_mb::strtolower($haystack), 1800);
790
+ $needle = ASL_mb::strtolower($needle);
 
791
 
792
+ if ( $needle == "" ) return $str;
 
 
 
 
 
793
 
794
+ /**
795
+ * This is an interesting issue. Turns out mb_substr($hay, $start, 1) is very ineffective.
796
+ * the preg_split(..) method is far more efficient in terms of speed, however it needs much more
797
+ * memory. In our case speed is the top priority. However to prevent memory overflow, the haystack
798
+ * is reduced to 1800 characters (roughly 300 words) first.
799
+ *
800
+ * Reference ticket: https://wp-dreams.com/forums/topic/search-speed/
801
+ * Speed tests: http://stackoverflow.com/questions/3666306/how-to-iterate-utf-8-string-in-php
802
+ */
803
+ $chrArray = preg_split('//u', $haystack, -1, PREG_SPLIT_NO_EMPTY);
804
+ $hay_length = count($chrArray) - 1;
805
+
806
+ if ( $i = ASL_mb::strpos($haystack, $needle) ) {
807
+ $start=$i;
808
+ $end=$i;
809
+ $spaces=0;
810
+
811
+ while ($spaces < ((int) $context/2) && $start > 0) {
812
+ $start--;
813
+ if ($chrArray[$start] == ' ') {
814
+ $spaces++;
815
+ }
816
+ }
817
 
818
+ while ($spaces < ($context +1) && $end < $hay_length) {
819
+ $end++;
820
+ if ($chrArray[$end] == ' ') {
821
+ $spaces++;
822
+ }
823
+ }
824
 
825
+ while ($spaces < ($context +1) && $start > 0) {
826
+ $start--;
827
+ if ($chrArray[$start] == ' ') {
828
+ $spaces++;
829
+ }
830
+ }
831
 
832
+ $str_start = ($start - 1) < 0 ? 0 : ($start -1);
833
+ $str_end = ($end - 1) < 0 ? 0 : ($end -1);
 
834
 
835
+ $result = trim(ASL_mb::substr($str, $str_start, ($str_end - $str_start)));
 
 
836
 
837
+ // Somewhere inbetween..
838
+ if ( $start != 0 && $end < $hay_length )
839
+ return "..." . $result . "...";
840
 
841
+ // Beginning
842
+ if ( $start == 0 && $end < $hay_length )
843
+ return $result . "...";
844
 
845
+ // End
846
+ if ( $start != 0 && $end == $hay_length )
847
+ return "..." . $result;
848
 
849
+ // If it is too long, strip it
850
+ if ( ASL_mb::strlen($result) > $maxlength)
851
+ return wd_substr_at_word( $result, $maxlength ) . "...";
 
852
 
853
+ // Else, it is the whole
854
+ return $result;
855
+
856
+ } else {
857
+ // If it is too long, strip it
858
+ if ( ASL_mb::strlen($str) > $maxlength)
859
+ return wd_substr_at_word( $str, $maxlength ) . "...";
860
+
861
+ return $str;
862
+ }
863
+ }
864
 
865
  /**
866
  * An empty function to override individual shortcodes, this must be public
includes/classes/session/includes/class-recursive-arrayaccess.php ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Multidimensional ArrayAccess
4
+ *
5
+ * Allows ArrayAccess-like functionality with multidimensional arrays. Fully supports
6
+ * both sets and unsets.
7
+ *
8
+ * @package WordPress
9
+ * @subpackage Session
10
+ * @since 3.7.0
11
+ */
12
+
13
+ /**
14
+ * Recursive array class to allow multidimensional array access.
15
+ *
16
+ * @package WordPress
17
+ * @since 3.7.0
18
+ */
19
+ class Recursive_ArrayAccess implements ArrayAccess, Iterator, Countable {
20
+ /**
21
+ * Internal data collection.
22
+ *
23
+ * @var array
24
+ */
25
+ protected $container = array();
26
+
27
+ /**
28
+ * Flag whether or not the internal collection has been changed.
29
+ *
30
+ * @var bool
31
+ */
32
+ protected $dirty = false;
33
+
34
+ /**
35
+ * Default object constructor.
36
+ *
37
+ * @param array $data
38
+ */
39
+ protected function __construct( $data = array() ) {
40
+ foreach ( $data as $key => $value ) {
41
+ $this[ $key ] = $value;
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Allow deep copies of objects
47
+ */
48
+ public function __clone() {
49
+ foreach ( $this->container as $key => $value ) {
50
+ if ( $value instanceof self ) {
51
+ $this[ $key ] = clone $value;
52
+ }
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Output the data container as a multidimensional array.
58
+ *
59
+ * @return array
60
+ */
61
+ public function toArray() {
62
+ $data = $this->container;
63
+ foreach ( $data as $key => $value ) {
64
+ if ( $value instanceof self ) {
65
+ $data[ $key ] = $value->toArray();
66
+ }
67
+ }
68
+ return $data;
69
+ }
70
+
71
+ /*****************************************************************/
72
+ /* ArrayAccess Implementation */
73
+ /*****************************************************************/
74
+
75
+ /**
76
+ * Whether a offset exists
77
+ *
78
+ * @link http://php.net/manual/en/arrayaccess.offsetexists.php
79
+ *
80
+ * @param mixed $offset An offset to check for.
81
+ *
82
+ * @return boolean true on success or false on failure.
83
+ */
84
+ public function offsetExists( $offset ) {
85
+ return isset( $this->container[ $offset ]) ;
86
+ }
87
+
88
+ /**
89
+ * Offset to retrieve
90
+ *
91
+ * @link http://php.net/manual/en/arrayaccess.offsetget.php
92
+ *
93
+ * @param mixed $offset The offset to retrieve.
94
+ *
95
+ * @return mixed Can return all value types.
96
+ */
97
+ public function offsetGet( $offset ) {
98
+ return isset( $this->container[ $offset ] ) ? $this->container[ $offset ] : null;
99
+ }
100
+
101
+ /**
102
+ * Offset to set
103
+ *
104
+ * @link http://php.net/manual/en/arrayaccess.offsetset.php
105
+ *
106
+ * @param mixed $offset The offset to assign the value to.
107
+ * @param mixed $value The value to set.
108
+ *
109
+ * @return void
110
+ */
111
+ public function offsetSet( $offset, $data ) {
112
+ if ( is_array( $data ) ) {
113
+ $data = new self( $data );
114
+ }
115
+ if ( $offset === null ) { // don't forget this!
116
+ $this->container[] = $data;
117
+ } else {
118
+ $this->container[ $offset ] = $data;
119
+ }
120
+
121
+ $this->dirty = true;
122
+ }
123
+
124
+ /**
125
+ * Offset to unset
126
+ *
127
+ * @link http://php.net/manual/en/arrayaccess.offsetunset.php
128
+ *
129
+ * @param mixed $offset The offset to unset.
130
+ *
131
+ * @return void
132
+ */
133
+ public function offsetUnset( $offset ) {
134
+ unset( $this->container[ $offset ] );
135
+
136
+ $this->dirty = true;
137
+ }
138
+
139
+
140
+ /*****************************************************************/
141
+ /* Iterator Implementation */
142
+ /*****************************************************************/
143
+
144
+ /**
145
+ * Current position of the array.
146
+ *
147
+ * @link http://php.net/manual/en/iterator.current.php
148
+ *
149
+ * @return mixed
150
+ */
151
+ public function current() {
152
+ return current( $this->container );
153
+ }
154
+
155
+ /**
156
+ * Key of the current element.
157
+ *
158
+ * @link http://php.net/manual/en/iterator.key.php
159
+ *
160
+ * @return mixed
161
+ */
162
+ public function key() {
163
+ return key( $this->container );
164
+ }
165
+
166
+ /**
167
+ * Move the internal point of the container array to the next item
168
+ *
169
+ * @link http://php.net/manual/en/iterator.next.php
170
+ *
171
+ * @return void
172
+ */
173
+ public function next() {
174
+ next( $this->container );
175
+ }
176
+
177
+ /**
178
+ * Rewind the internal point of the container array.
179
+ *
180
+ * @link http://php.net/manual/en/iterator.rewind.php
181
+ *
182
+ * @return void
183
+ */
184
+ public function rewind() {
185
+ reset( $this->container );
186
+ }
187
+
188
+ /**
189
+ * Is the current key valid?
190
+ *
191
+ * @link http://php.net/manual/en/iterator.rewind.php
192
+ *
193
+ * @return bool
194
+ */
195
+ public function valid() {
196
+ return $this->offsetExists( $this->key() );
197
+ }
198
+
199
+ /*****************************************************************/
200
+ /* Countable Implementation */
201
+ /*****************************************************************/
202
+
203
+ /**
204
+ * Get the count of elements in the container array.
205
+ *
206
+ * @link http://php.net/manual/en/countable.count.php
207
+ *
208
+ * @return int
209
+ */
210
+ public function count() {
211
+ return count( $this->container );
212
+ }
213
+ }
includes/classes/session/includes/class-wp-session-utils.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Utility class for sesion utilities
5
+ *
6
+ * THIS CLASS SHOULD NEVER BE INSTANTIATED
7
+ */
8
+ class WP_Session_Utils {
9
+ /**
10
+ * Count the total sessions in the database.
11
+ *
12
+ * @global wpdb $wpdb
13
+ *
14
+ * @return int
15
+ */
16
+ public static function count_sessions() {
17
+ global $wpdb;
18
+
19
+ $query = "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_wp_session_expires_%'";
20
+
21
+ /**
22
+ * Filter the query in case tables are non-standard.
23
+ *
24
+ * @param string $query Database count query
25
+ */
26
+ $query = apply_filters( 'wp_session_count_query', $query );
27
+
28
+ $sessions = $wpdb->get_var( $query );
29
+
30
+ return absint( $sessions );
31
+ }
32
+
33
+ /**
34
+ * Create a new, random session in the database.
35
+ *
36
+ * @param null|string $date
37
+ */
38
+ public static function create_dummy_session( $date = null ) {
39
+ // Generate our date
40
+ if ( null !== $date ) {
41
+ $time = strtotime( $date );
42
+
43
+ if ( false === $time ) {
44
+ $date = null;
45
+ } else {
46
+ $expires = date( 'U', strtotime( $date ) );
47
+ }
48
+ }
49
+
50
+ // If null was passed, or if the string parsing failed, fall back on a default
51
+ if ( null === $date ) {
52
+ /**
53
+ * Filter the expiration of the session in the database
54
+ *
55
+ * @param int
56
+ */
57
+ $expires = time() + (int) apply_filters( 'wp_session_expiration', 30 * 60 );
58
+ }
59
+
60
+ $session_id = self::generate_id();
61
+
62
+ // Store the session
63
+ add_option( "_wp_session_{$session_id}", array(), '', 'no' );
64
+ add_option( "_wp_session_expires_{$session_id}", $expires, '', 'no' );
65
+ }
66
+
67
+ /**
68
+ * Delete old sessions from the database.
69
+ *
70
+ * @param int $limit Maximum number of sessions to delete.
71
+ *
72
+ * @global wpdb $wpdb
73
+ *
74
+ * @return int Sessions deleted.
75
+ */
76
+ public static function delete_old_sessions( $limit = 1000 ) {
77
+ global $wpdb;
78
+
79
+ $limit = absint( $limit );
80
+ $keys = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE '_wp_session_expires_%' ORDER BY option_value ASC LIMIT 0, {$limit}" );
81
+
82
+ $now = time();
83
+ $expired = array();
84
+ $count = 0;
85
+
86
+ foreach( $keys as $expiration ) {
87
+ $key = $expiration->option_name;
88
+ $expires = $expiration->option_value;
89
+
90
+ if ( $now > $expires ) {
91
+ $session_id = addslashes( substr( $key, 20 ) );
92
+
93
+ $expired[] = $key;
94
+ $expired[] = "_wp_session_{$session_id}";
95
+
96
+ $count += 1;
97
+ }
98
+ }
99
+
100
+ // Delete expired sessions
101
+ if ( ! empty( $expired ) ) {
102
+ $names = implode( "','", $expired );
103
+ $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name IN ('{$names}')" );
104
+ }
105
+
106
+ return $count;
107
+ }
108
+
109
+ /**
110
+ * Remove all sessions from the database, regardless of expiration.
111
+ *
112
+ * @global wpdb $wpdb
113
+ *
114
+ * @return int Sessions deleted
115
+ */
116
+ public static function delete_all_sessions() {
117
+ global $wpdb;
118
+
119
+ $count = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '_wp_session_%'" );
120
+
121
+ return (int) ( $count / 2 );
122
+ }
123
+
124
+ /**
125
+ * Generate a new, random session ID.
126
+ *
127
+ * @return string
128
+ */
129
+ public static function generate_id() {
130
+ require_once( ABSPATH . 'wp-includes/class-phpass.php' );
131
+ $hash = new PasswordHash( 8, false );
132
+
133
+ return md5( $hash->get_random_bytes( 32 ) );
134
+ }
135
+ }
includes/classes/session/includes/class-wp-session.php ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WordPress session managment.
4
+ *
5
+ * Standardizes WordPress session data using database-backed options for storage.
6
+ * for storing user session information.
7
+ *
8
+ * @package WordPress
9
+ * @subpackage Session
10
+ * @since 3.7.0
11
+ */
12
+
13
+ /**
14
+ * WordPress Session class for managing user session data.
15
+ *
16
+ * Leave all attributes and methods PUBLIC - some plugins use older versions, and it breaks compatibility
17
+ *
18
+ * @package WordPress
19
+ * @since 3.7.0
20
+ */
21
+ class WP_Session extends Recursive_ArrayAccess {
22
+ /**
23
+ * ID of the current session.
24
+ *
25
+ * @var string
26
+ */
27
+ public $session_id;
28
+
29
+ /**
30
+ * Unix timestamp when session expires.
31
+ *
32
+ * @var int
33
+ */
34
+ public $expires;
35
+
36
+ /**
37
+ * Unix timestamp indicating when the expiration time needs to be reset.
38
+ *
39
+ * @var int
40
+ */
41
+ public $exp_variant;
42
+
43
+ /**
44
+ * Singleton instance.
45
+ *
46
+ * @var bool|WP_Session
47
+ */
48
+ private static $instance = false;
49
+
50
+ /**
51
+ * Retrieve the current session instance.
52
+ *
53
+ * @param bool $session_id Session ID from which to populate data.
54
+ *
55
+ * @return bool|WP_Session
56
+ */
57
+ public static function get_instance() {
58
+ if ( ! self::$instance ) {
59
+ self::$instance = new self();
60
+ }
61
+
62
+ return self::$instance;
63
+ }
64
+
65
+ /**
66
+ * Default constructor.
67
+ * Will rebuild the session collection from the given session ID if it exists. Otherwise, will
68
+ * create a new session with that ID.
69
+ *
70
+ * @param $session_id
71
+ * @uses apply_filters Calls `wp_session_expiration` to determine how long until sessions expire.
72
+ */
73
+ public function __construct() {
74
+ if ( isset( $_COOKIE[WP_SESSION_COOKIE] ) ) {
75
+ $cookie = stripslashes( $_COOKIE[WP_SESSION_COOKIE] );
76
+ $cookie_crumbs = explode( '||', $cookie );
77
+
78
+ $this->session_id = $cookie_crumbs[0];
79
+ $this->expires = $cookie_crumbs[1];
80
+ $this->exp_variant = $cookie_crumbs[2];
81
+
82
+ // Update the session expiration if we're past the variant time
83
+ if ( time() > $this->exp_variant ) {
84
+ $this->set_expiration();
85
+ delete_option( "_wp_session_expires_{$this->session_id}" );
86
+ add_option( "_wp_session_expires_{$this->session_id}", $this->expires, '', 'no' );
87
+ }
88
+ } else {
89
+ $this->session_id = WP_Session_Utils::generate_id();
90
+ $this->set_expiration();
91
+ }
92
+
93
+ $this->read_data();
94
+
95
+ $this->set_cookie();
96
+
97
+ }
98
+
99
+ /**
100
+ * Set both the expiration time and the expiration variant.
101
+ *
102
+ * If the current time is below the variant, we don't update the session's expiration time. If it's
103
+ * greater than the variant, then we update the expiration time in the database. This prevents
104
+ * writing to the database on every page load for active sessions and only updates the expiration
105
+ * time if we're nearing when the session actually expires.
106
+ *
107
+ * By default, the expiration time is set to 30 minutes.
108
+ * By default, the expiration variant is set to 24 minutes.
109
+ *
110
+ * As a result, the session expiration time - at a maximum - will only be written to the database once
111
+ * every 24 minutes. After 30 minutes, the session will have been expired. No cookie will be sent by
112
+ * the browser, and the old session will be queued for deletion by the garbage collector.
113
+ *
114
+ * @uses apply_filters Calls `wp_session_expiration_variant` to get the max update window for session data.
115
+ * @uses apply_filters Calls `wp_session_expiration` to get the standard expiration time for sessions.
116
+ */
117
+ public function set_expiration() {
118
+ $this->exp_variant = time() + (int) apply_filters( 'wp_session_expiration_variant', 24 * 60 );
119
+ $this->expires = time() + (int) apply_filters( 'wp_session_expiration', 30 * 60 );
120
+ }
121
+
122
+ /**
123
+ * Set the session cookie
124
+ * @uses apply_filters Calls `wp_session_cookie_secure` to set the $secure parameter of setcookie()
125
+ * @uses apply_filters Calls `wp_session_cookie_httponly` to set the $httponly parameter of setcookie()
126
+ */
127
+ public function set_cookie() {
128
+ $secure = apply_filters('wp_session_cookie_secure', false);
129
+ $httponly = apply_filters('wp_session_cookie_httponly', false);
130
+ setcookie( WP_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant , $this->expires, COOKIEPATH, COOKIE_DOMAIN, $secure, $httponly );
131
+ }
132
+
133
+ /**
134
+ * Read data from a transient for the current session.
135
+ *
136
+ * Automatically resets the expiration time for the session transient to some time in the future.
137
+ *
138
+ * @return array
139
+ */
140
+ public function read_data() {
141
+ $this->container = get_option( "_wp_session_{$this->session_id}", array() );
142
+
143
+ return $this->container;
144
+ }
145
+
146
+ /**
147
+ * Write the data from the current session to the data storage system.
148
+ */
149
+ public function write_data() {
150
+ $option_key = "_wp_session_{$this->session_id}";
151
+
152
+ if ( false === get_option( $option_key ) ) {
153
+ add_option( "_wp_session_{$this->session_id}", $this->container, '', 'no' );
154
+ add_option( "_wp_session_expires_{$this->session_id}", $this->expires, '', 'no' );
155
+ } else {
156
+ delete_option( "_wp_session_{$this->session_id}" );
157
+ add_option( "_wp_session_{$this->session_id}", $this->container, '', 'no' );
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Output the current container contents as a JSON-encoded string.
163
+ *
164
+ * @return string
165
+ */
166
+ public function json_out() {
167
+ return json_encode( $this->container );
168
+ }
169
+
170
+ /**
171
+ * Decodes a JSON string and, if the object is an array, overwrites the session container with its contents.
172
+ *
173
+ * @param string $data
174
+ *
175
+ * @return bool
176
+ */
177
+ public function json_in( $data ) {
178
+ $array = json_decode( $data );
179
+
180
+ if ( is_array( $array ) ) {
181
+ $this->container = $array;
182
+ return true;
183
+ }
184
+
185
+ return false;
186
+ }
187
+
188
+ /**
189
+ * Regenerate the current session's ID.
190
+ *
191
+ * @param bool $delete_old Flag whether or not to delete the old session data from the server.
192
+ */
193
+ public function regenerate_id( $delete_old = false ) {
194
+ if ( $delete_old ) {
195
+ delete_option( "_wp_session_{$this->session_id}" );
196
+ }
197
+
198
+ $this->session_id = WP_Session_Utils::generate_id();
199
+
200
+ $this->set_cookie();
201
+ }
202
+
203
+ /**
204
+ * Check if a session has been initialized.
205
+ *
206
+ * @return bool
207
+ */
208
+ public function session_started() {
209
+ return !!self::$instance;
210
+ }
211
+
212
+ /**
213
+ * Return the read-only cache expiration value.
214
+ *
215
+ * @return int
216
+ */
217
+ public function cache_expiration() {
218
+ return $this->expires;
219
+ }
220
+
221
+ /**
222
+ * Flushes all session variables.
223
+ */
224
+ public function reset() {
225
+ $this->container = array();
226
+ }
227
+ }
includes/classes/session/includes/wp-cli.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * CLI commands for WP Session Manager
5
+ *
6
+ * @package WP_Session
7
+ * @subpackage Commands
8
+ */
9
+ class WP_Session_Command extends \WP_CLI_Command {
10
+
11
+ /**
12
+ * Count the total number of sessions stored in the database.
13
+ *
14
+ *
15
+ * ## EXAMPLES
16
+ *
17
+ * wp session count
18
+ *
19
+ * @global wpdb $wpdb
20
+ *
21
+ * @param array $args
22
+ * @param array $assoc_args
23
+ */
24
+ public function count( $args, $assoc_args ) {
25
+ $sessions = WP_Session_Utils::count_sessions();
26
+
27
+ \WP_CLI::line( sprintf( '%d sessions currently exist.', absint( $sessions ) ) );
28
+ }
29
+
30
+ /**
31
+ * Delete sessions from the database.
32
+ *
33
+ * ## OPTIONS
34
+ *
35
+ * [--all]
36
+ * : Flag whether or not to purge all sessions from the database.
37
+ *
38
+ * [--batch=<batch>]
39
+ * : Set the batch size for deleting old sessions
40
+ *
41
+ * [--limit=<limit>]
42
+ * : Delete just this number of old sessions
43
+ *
44
+ * ## EXAMPLES
45
+ *
46
+ * wp session delete
47
+ * wp session delete [--batch=<batch>]
48
+ * wp session delete [--limit=<limit>]
49
+ * wp session delete [--all]
50
+ *
51
+ * @synopsis [--all] [--batch=<batch>] [--limit=<limit>]
52
+ *
53
+ * @param array $args
54
+ * @param array $assoc_args
55
+ */
56
+ public function delete( $args, $assoc_args ) {
57
+ if ( isset( $assoc_args['limit'] ) ) {
58
+ $limit = absint( $assoc_args['limit'] );
59
+
60
+ $count = WP_Session_Utils::delete_old_sessions( $limit );
61
+
62
+ if ( $count > 0 ) {
63
+ \WP_CLI::line( sprintf( 'Deleted %d sessions.', $count ) );
64
+ }
65
+
66
+ // Clear memory
67
+ self::free_up_memory();
68
+ return;
69
+ }
70
+
71
+ // Determine if we're deleting all sessions or just a subset.
72
+ $all = isset( $assoc_args['all'] );
73
+
74
+ /**
75
+ * Determine the size of each batch for deletion.
76
+ *
77
+ * @param int
78
+ */
79
+ $batch = isset( $assoc_args['batch'] ) ? absint( $assoc_args['batch'] ) : apply_filters( 'wp_session_delete_batch_size', 1000 );
80
+
81
+ switch ( $all ) {
82
+ case true:
83
+ $count = WP_Session_Utils::delete_all_sessions();
84
+
85
+ \WP_CLI::line( sprintf( 'Deleted all %d sessions.', $count ) );
86
+ break;
87
+ case false:
88
+ do {
89
+ $count = WP_Session_Utils::delete_old_sessions( $batch );
90
+
91
+ if ( $count > 0 ) {
92
+ \WP_CLI::line( sprintf( 'Deleted %d sessions.', $count ) );
93
+ }
94
+
95
+ // Clear memory
96
+ self::free_up_memory();
97
+ } while ( $count > 0 );
98
+ break;
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Generate a number of dummy sessions for testing purposes.
104
+ *
105
+ * ## OPTIONS
106
+ *
107
+ * <count>
108
+ * : Number of sessions to create.
109
+ *
110
+ * [--expires=<date>]
111
+ * : Optional expiration time tagged for each session. Will use WordPress' local time.
112
+ *
113
+ * ## EXAMPLES
114
+ *
115
+ * wp session generate 5000
116
+ * wp session generate 5000 --expires="2014-11-09T08:00"
117
+ *
118
+ * @synopsis <count> [--expires=<date>]
119
+ *
120
+ * @param array $args
121
+ * @param array $assoc_args
122
+ */
123
+ public function generate( $args, $assoc_args ) {
124
+ $count = absint( $args[0] );
125
+ $date = isset( $assoc_args['expires'] ) ? $assoc_args['expires'] : null;
126
+
127
+ $notify = \WP_CLI\Utils\make_progress_bar( 'Generating sessions', $count );
128
+
129
+ for ( $i = 0; $i < $count; $i ++ ) {
130
+ WP_Session_Utils::create_dummy_session( $date );
131
+ $notify->tick();
132
+ }
133
+
134
+ $notify->finish();
135
+ }
136
+
137
+ /**
138
+ * Free up memory
139
+ *
140
+ * @global WP_Object_Cache $wp_object_cache
141
+ * @global wpdb $wpdb
142
+ */
143
+ private function free_up_memory() {
144
+ global $wp_object_cache, $wpdb;
145
+ $wpdb->queries = array();
146
+
147
+ if ( ! is_object( $wp_object_cache ) ) {
148
+ return;
149
+ }
150
+
151
+ $wp_object_cache->group_ops = array();
152
+ $wp_object_cache->stats = array();
153
+ $wp_object_cache->memcache_debug = array();
154
+ $wp_object_cache->cache = array();
155
+ }
156
+ }
157
+
158
+ \WP_CLI::add_command( 'session', 'WP_Session_Command' );
includes/classes/session/includes/wp-session.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WordPress session managment.
4
+ *
5
+ * Standardizes WordPress session data and uses either database transients or in-memory caching
6
+ * for storing user session information.
7
+ *
8
+ * @package WordPress
9
+ * @subpackage Session
10
+ * @since 3.7.0
11
+ */
12
+
13
+ /**
14
+ * Return the current cache expire setting.
15
+ *
16
+ * @return int
17
+ */
18
+ function wp_session_cache_expire() {
19
+ $wp_session = WP_Session::get_instance();
20
+
21
+ return $wp_session->cache_expiration();
22
+ }
23
+
24
+ /**
25
+ * Alias of wp_session_write_close()
26
+ */
27
+ function wp_session_commit() {
28
+ wp_session_write_close();
29
+ }
30
+
31
+ /**
32
+ * Load a JSON-encoded string into the current session.
33
+ *
34
+ * @param string $data
35
+ */
36
+ function wp_session_decode( $data ) {
37
+ $wp_session = WP_Session::get_instance();
38
+
39
+ return $wp_session->json_in( $data );
40
+ }
41
+
42
+ /**
43
+ * Encode the current session's data as a JSON string.
44
+ *
45
+ * @return string
46
+ */
47
+ function wp_session_encode() {
48
+ $wp_session = WP_Session::get_instance();
49
+
50
+ return $wp_session->json_out();
51
+ }
52
+
53
+ /**
54
+ * Regenerate the session ID.
55
+ *
56
+ * @param bool $delete_old_session
57
+ *
58
+ * @return bool
59
+ */
60
+ function wp_session_regenerate_id( $delete_old_session = false ) {
61
+ $wp_session = WP_Session::get_instance();
62
+
63
+ $wp_session->regenerate_id( $delete_old_session );
64
+
65
+ return true;
66
+ }
67
+
68
+ /**
69
+ * Start new or resume existing session.
70
+ *
71
+ * Resumes an existing session based on a value sent by the _wp_session cookie.
72
+ *
73
+ * @return bool
74
+ */
75
+ function wp_session_start() {
76
+ $wp_session = WP_Session::get_instance();
77
+ do_action( 'wp_session_start' );
78
+
79
+ return $wp_session->session_started();
80
+ }
81
+ if ( ! defined( 'WP_CLI' ) || false === WP_CLI ) {
82
+ add_action( 'plugins_loaded', 'wp_session_start' );
83
+ }
84
+
85
+ /**
86
+ * Return the current session status.
87
+ *
88
+ * @return int
89
+ */
90
+ function wp_session_status() {
91
+ $wp_session = WP_Session::get_instance();
92
+
93
+ if ( $wp_session->session_started() ) {
94
+ return PHP_SESSION_ACTIVE;
95
+ }
96
+
97
+ return PHP_SESSION_NONE;
98
+ }
99
+
100
+ /**
101
+ * Unset all session variables.
102
+ */
103
+ function wp_session_unset() {
104
+ $wp_session = WP_Session::get_instance();
105
+
106
+ $wp_session->reset();
107
+ }
108
+
109
+ /**
110
+ * Write session data and end session
111
+ */
112
+ function wp_session_write_close() {
113
+ $wp_session = WP_Session::get_instance();
114
+
115
+ $wp_session->write_data();
116
+ do_action( 'wp_session_commit' );
117
+ }
118
+ if ( ! defined( 'WP_CLI' ) || false === WP_CLI ) {
119
+ add_action( 'shutdown', 'wp_session_write_close' );
120
+ }
121
+
122
+ /**
123
+ * Clean up expired sessions by removing data and their expiration entries from
124
+ * the WordPress options table.
125
+ *
126
+ * This method should never be called directly and should instead be triggered as part
127
+ * of a scheduled task or cron job.
128
+ */
129
+ function wp_session_cleanup() {
130
+ if ( defined( 'WP_SETUP_CONFIG' ) ) {
131
+ return;
132
+ }
133
+
134
+ if ( ! defined( 'WP_INSTALLING' ) ) {
135
+ /**
136
+ * Determine the size of each batch for deletion.
137
+ *
138
+ * @param int
139
+ */
140
+ $batch_size = apply_filters( 'wp_session_delete_batch_size', 1000 );
141
+
142
+ // Delete a batch of old sessions
143
+ WP_Session_Utils::delete_old_sessions( $batch_size );
144
+ }
145
+
146
+ // Allow other plugins to hook in to the garbage collection process.
147
+ do_action( 'wp_session_cleanup' );
148
+ }
149
+ add_action( 'wp_session_garbage_collection', 'wp_session_cleanup' );
150
+
151
+ /**
152
+ * Register the garbage collector as a twice daily event.
153
+ */
154
+ function wp_session_register_garbage_collection() {
155
+ if ( ! wp_next_scheduled( 'wp_session_garbage_collection' ) ) {
156
+ wp_schedule_event( time(), 'hourly', 'wp_session_garbage_collection' );
157
+ }
158
+ }
159
+ add_action( 'wp', 'wp_session_register_garbage_collection' );
includes/classes/session/wp-session.inc.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WordPress session manager by Eric Mann - thank you man
4
+ *
5
+ * Taken from: http://jumping-duck.com/wordpress/plugins
6
+ * Author: Eric Mann, http://eamann.com
7
+ */
8
+
9
+ // Safely include the needed files..
10
+
11
+ // let users change the session cookie name
12
+ if( ! defined( 'WP_SESSION_COOKIE' ) ) {
13
+ define( 'WP_SESSION_COOKIE', '_wp_session' );
14
+ }
15
+
16
+ if ( ! class_exists( 'Recursive_ArrayAccess' ) ) {
17
+ include ASL_CLASSES_PATH . 'session/includes/class-recursive-arrayaccess.php';
18
+ }
19
+
20
+ // Include utilities class
21
+ if ( ! class_exists( 'WP_Session_Utils' ) ) {
22
+ include ASL_CLASSES_PATH . 'session/includes/class-wp-session-utils.php';
23
+ }
24
+
25
+ // Include WP_CLI routines early
26
+ if ( defined( 'WP_CLI' ) && WP_CLI ) {
27
+ include ASL_CLASSES_PATH . 'session/includes/wp-cli.php';
28
+ }
29
+
30
+ // Only include the functionality if it's not pre-defined.
31
+ if ( ! class_exists( 'WP_Session' ) ) {
32
+ include ASL_CLASSES_PATH . 'session/includes/class-wp-session.php';
33
+ include ASL_CLASSES_PATH . 'session/includes/wp-session.php';
34
+ }
includes/classes/shortcodes/class-asl-abstract.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_Shortcode_Abstract")) {
5
+ /**
6
+ * Class WD_ASL_Shortcode_Abstract
7
+ *
8
+ * An abstract for shortcodes handlers.
9
+ *
10
+ * @class WD_ASL_Shortcode_Abstract
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Shortcodes
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ abstract class WD_ASL_Shortcode_Abstract {
17
+
18
+ /**
19
+ * Static instance storage
20
+ *
21
+ * @var self
22
+ */
23
+ protected static $_instance;
24
+
25
+
26
+ /**
27
+ * Get the instance
28
+ *
29
+ * All shortcode classes must be singletons!
30
+ */
31
+
32
+ public static function getInstance() {}
33
+
34
+ /**
35
+ * This function is called by the appropriate handler
36
+ *
37
+ * @param $atts array|null
38
+ */
39
+ abstract public function handle( $atts );
40
+
41
+ /**
42
+ * Cloning disabled
43
+ */
44
+ protected function __clone() {}
45
+
46
+ /**
47
+ * Serialization disabled
48
+ */
49
+ protected function __sleep() {}
50
+
51
+ /**
52
+ * De-serialization disabled
53
+ */
54
+ protected function __wakeup() {}
55
+
56
+ }
57
+ }
includes/classes/shortcodes/class-asl-search.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ if (!class_exists("WD_ASL_Search_Shortcode")) {
5
+ /**
6
+ * Class WD_ASL_Search_Shortcode
7
+ *
8
+ * Search bar shortcode
9
+ *
10
+ * @class WD_ASL_Search_Shortcode
11
+ * @version 1.0
12
+ * @package AjaxSearchLite/Classes/Shortcodes
13
+ * @category Class
14
+ * @author Ernest Marcinko
15
+ */
16
+ class WD_ASL_Search_Shortcode extends WD_ASL_Shortcode_Abstract {
17
+
18
+ /**
19
+ * Overall instance count
20
+ *
21
+ * @var int
22
+ */
23
+ private static $instanceCount = 0;
24
+
25
+ /**
26
+ * Used in views, true if the data view is printed
27
+ *
28
+ * @var bool
29
+ */
30
+ private static $dataPrinted = false;
31
+
32
+ /**
33
+ * Instance count per search ID
34
+ *
35
+ * @var array
36
+ */
37
+ private static $perInstanceCount = array();
38
+
39
+ /**
40
+ * Does the search shortcode stuff
41
+ *
42
+ * @param array|null $atts
43
+ * @return string|void
44
+ */
45
+ public function handle($atts) {
46
+ $style = null;
47
+ self::$instanceCount++;
48
+
49
+ extract(shortcode_atts(array(
50
+ 'id' => 'something'
51
+ ), $atts));
52
+
53
+ $inst = wd_asl()->instances->get(0);
54
+ $style = $inst['data'];
55
+
56
+ // Set the "_fo" item to indicate that the non-ajax search was made via this form, and save the options there
57
+ if (isset($_POST['p_asl_data']) || isset($_POST['np_asl_data'])) {
58
+ $_p_data = isset($_POST['p_asl_data']) ? $_POST['p_asl_data'] : $_POST['np_asl_data'];
59
+ parse_str($_p_data, $style['_fo']);
60
+ }
61
+
62
+ $settingsHidden = ((
63
+ w_isset_def($style['show_frontend_search_settings'], 1) == 1
64
+ ) ? false : true);
65
+
66
+ do_action('asl_layout_before_shortcode', $id);
67
+
68
+ $out = "";
69
+ ob_start();
70
+ include(ASL_PATH."includes/views/asl.shortcode.php");
71
+ $out = ob_get_clean();
72
+
73
+ do_action('asl_layout_after_shortcode', $id);
74
+
75
+ return $out;
76
+ }
77
+
78
+ /**
79
+ * Importing fonts does not work correctly it appears.
80
+ * Instead adding the links directly to the header is the best way to go.
81
+ */
82
+ public function fonts( $style = "" ) {
83
+ return;
84
+
85
+ $imports = array();
86
+ $font_sources = array("inputfont", "descfont", "titlefont",
87
+ "authorfont", "datefont", "showmorefont", "groupfont",
88
+ "exsearchincategoriestextfont", "groupbytextfont", "settingsdropfont",
89
+ "prestitlefont", "presdescfont", "pressubtitlefont", "search_text_font");
90
+
91
+
92
+ if ($style != "") {
93
+ foreach($font_sources as $fs) {
94
+ if (isset($style["import-".$fs]) && !in_array(trim($style["import-".$fs]), $imports))
95
+ $imports[] = trim($style["import-".$fs]);
96
+ }
97
+ } else {
98
+ foreach (wd_asl()->instances->get() as $instance) {
99
+ foreach($font_sources as $fs) {
100
+ if (isset($instance['data']["import-".$fs]) && !in_array(trim($instance['data']["import-".$fs]), $imports))
101
+ $imports[] = trim($instance['data']["import-".$fs]);
102
+ }
103
+ }
104
+ }
105
+
106
+ foreach ($imports as $import) {
107
+ $import = trim(str_replace(array("@import url(", ");", "https:", "http:"), "", $import));
108
+ ?>
109
+ <link href='<?php echo $import; ?>' rel='stylesheet' type='text/css'>
110
+ <?php
111
+ }
112
+ }
113
+
114
+ // ------------------------------------------------------------
115
+ // ---------------- SINGLETON SPECIFIC --------------------
116
+ // ------------------------------------------------------------
117
+ public static function getInstance() {
118
+ if ( ! ( self::$_instance instanceof self ) ) {
119
+ self::$_instance = new self();
120
+ }
121
+
122
+ return self::$_instance;
123
+ }
124
+ }
125
+ }
includes/classes/shortcodes/shortcodes.inc.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ require_once(ASL_CLASSES_PATH . "shortcodes/class-asl-abstract.php");
5
+ require_once(ASL_CLASSES_PATH . "shortcodes/class-asl-search.php");
includes/{suggest → classes/suggest}/google_suggest.class.php RENAMED
@@ -8,7 +8,7 @@ if (!class_exists('wpd_googleKeywordSuggest')) {
8
  *
9
  * @class wpd_googleKeywordSuggest
10
  * @version 1.2
11
- * @package AjaxSearchPro/Classes
12
  * @category Class
13
  * @author Ernest Marcinko
14
  */
@@ -37,12 +37,12 @@ if (!class_exists('wpd_googleKeywordSuggest')) {
37
 
38
 
39
  function getKeywords($q) {
40
- $q = str_replace(' ', '+', $q);
41
  $method = $this->can_get_file();
42
  if ($method == false) {
43
  return array('Error: The fopen url wrapper is not enabled on your server!');
44
  }
45
- $_content = $this->url_get_contents($this->url . $q, $method);
46
  if ($_content == null || $_content == "") return array();
47
  if (function_exists('mb_convert_encoding'))
48
  $_content = mb_convert_encoding($_content, "UTF-8");
8
  *
9
  * @class wpd_googleKeywordSuggest
10
  * @version 1.2
11
+ * @package AjaxSearchLite/Classes
12
  * @category Class
13
  * @author Ernest Marcinko
14
  */
37
 
38
 
39
  function getKeywords($q) {
40
+ $qf = str_replace(' ', '+', $q);
41
  $method = $this->can_get_file();
42
  if ($method == false) {
43
  return array('Error: The fopen url wrapper is not enabled on your server!');
44
  }
45
+ $_content = $this->url_get_contents($this->url . rawurlencode($qf), $method);
46
  if ($_content == null || $_content == "") return array();
47
  if (function_exists('mb_convert_encoding'))
48
  $_content = mb_convert_encoding($_content, "UTF-8");
includes/{suggest → classes/suggest}/suggest-abstract.class.php RENAMED
@@ -12,7 +12,7 @@ if (!class_exists('wpd_keywordSuggestAbstract')) {
12
  *
13
  * @class wpd_keywordSuggest
14
  * @version 1.0
15
- * @package AjaxSearchPro/Classes
16
  * @category Class
17
  * @author Ernest Marcinko
18
  */
@@ -73,13 +73,13 @@ if (!class_exists('wpd_keywordSuggestAbstract')) {
73
  if ( is_float( $string ) )
74
  return $string;
75
 
76
- // Escape for 4.0 >=
77
  if ( method_exists( $wpdb, 'esc_like' ) )
78
- return $wpdb->esc_like( $string );
79
 
80
  // Escape support for WP < 4.0
81
  if ( function_exists( 'like_escape' ) )
82
- return like_escape($string);
83
 
84
  // Okay, what? Not one function is present, use the one we have
85
  return wd_mysql_escape_mimic($string);
12
  *
13
  * @class wpd_keywordSuggest
14
  * @version 1.0
15
+ * @package AjaxSearchLite/Classes
16
  * @category Class
17
  * @author Ernest Marcinko
18
  */
73
  if ( is_float( $string ) )
74
  return $string;
75
 
76
+ // Extra escape for 4.0 >=
77
  if ( method_exists( $wpdb, 'esc_like' ) )
78
+ return esc_sql( $wpdb->esc_like( $string ) );
79
 
80
  // Escape support for WP < 4.0
81
  if ( function_exists( 'like_escape' ) )
82
+ return esc_sql( like_escape($string) );
83
 
84
  // Okay, what? Not one function is present, use the one we have
85
  return wd_mysql_escape_mimic($string);
includes/{suggest → classes/suggest}/suggest-wrapper.class.php RENAMED
@@ -12,7 +12,7 @@ if (!class_exists('wpd_keywordSuggest')) {
12
  *
13
  * @class wpd_keywordSuggest
14
  * @version 1.0
15
- * @package AjaxSearchPro/Classes
16
  * @category Class
17
  * @author Ernest Marcinko
18
  */
12
  *
13
  * @class wpd_keywordSuggest
14
  * @version 1.0
15
+ * @package AjaxSearchLite/Classes
16
  * @category Class
17
  * @author Ernest Marcinko
18
  */
includes/classes/suggest/suggest.inc.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ /**
5
+ * Includes all files required for keyword suggestions
6
+ */
7
+
8
+ require_once(ASL_CLASSES_PATH . "suggest/suggest-abstract.class.php");
9
+ require_once(ASL_CLASSES_PATH . "suggest/google_suggest.class.php");
10
+ require_once(ASL_CLASSES_PATH . "suggest/suggest-wrapper.class.php");
includes/classes/widgets/class-search-widget.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class AjaxSearchLiteWidget extends WP_Widget {
3
+ public function __construct() {
4
+ $widget_ops = array('classname' => 'AjaxSearchLiteWidget', 'description' => 'Displays an Ajax Search Lite!' );
5
+ parent::__construct('AjaxSearchLiteWidget', 'Ajax Search Lite', $widget_ops);
6
+ }
7
+ public function form($instance) {
8
+ $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
9
+ ?>
10
+ <p>
11
+ <label for="<?php echo $this->get_field_id('title'); ?>">
12
+ Title:
13
+ <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
14
+ name="<?php echo $this->get_field_name('title'); ?>" type="text"
15
+ value="<?php echo esc_attr($title); ?>" />
16
+ </label>
17
+ </p>
18
+ <?php
19
+ }
20
+
21
+ public function update($new_instance, $old_instance) {
22
+ $instance = $old_instance;
23
+ $instance['title'] = $new_instance['title'];
24
+ return $instance;
25
+ }
26
+
27
+ public function widget($args, $instance) {
28
+ extract($args, EXTR_SKIP);
29
+ echo $before_widget;
30
+ $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
31
+ if (!empty($title))
32
+ echo $before_title . $title . $after_title;;
33
+ // WIDGET CODE GOES HERE
34
+ echo do_shortcode("[wpdreams_ajaxsearchlite]");
35
+ echo $after_widget;
36
+ }
37
+ }
includes/classes/widgets/widgets.inc.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) die('-1');
3
+
4
+ require_once(ASL_CLASSES_PATH . "widgets/class-search-widget.php");
5
+
6
+ add_action( 'widgets_init', create_function( '', 'return register_widget("AjaxSearchLiteWidget");' ) );
includes/functions/functions.php ADDED
@@ -0,0 +1,835 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!function_exists("w_isset_def")) {
4
+ function w_isset_def(&$v, $d)
5
+ {
6
+ if (isset($v)) return $v;
7
+ return $d;
8
+ }
9
+ }
10
+
11
+ if (!function_exists("wpdreams_setval_or_getoption")) {
12
+ function wpdreams_setval_or_getoption($options, $key, $def_key)
13
+ {
14
+ if (isset($options) && isset($options[$key]))
15
+ return $options[$key];
16
+ $def_options = get_option($def_key);
17
+ return $def_options[$key];
18
+ }
19
+ }
20
+
21
+ if (!function_exists("wpdreams_get_selected")) {
22
+ function wpdreams_get_selected($option, $key) {
23
+ return isset($option['selected-'.$key])?$option['selected-'.$key]:array();
24
+ }
25
+ }
26
+
27
+ if (!function_exists("wpdreams_keyword_count_sort")) {
28
+ function wpdreams_keyword_count_sort($first, $sec) {
29
+ return $sec[1] - $first[1];
30
+ }
31
+ }
32
+
33
+ if (!function_exists("wpdreams_get_stylesheet")) {
34
+ function wpdreams_get_stylesheet($dir, $id, $style) {
35
+ ob_start();
36
+ include($dir."style.css.php");
37
+ $out = ob_get_contents();
38
+ ob_end_clean();
39
+ if (isset($style['custom_css_special']) && isset($style['custom_css_selector'])
40
+ && $style['custom_css_special'] != "") {
41
+ $out.= " ".stripcslashes(str_replace('[instance]',
42
+ str_replace('THEID', $id, $style['custom_css_selector']),
43
+ $style['custom_css_special']));
44
+ }
45
+ return $out;
46
+ }
47
+ }
48
+
49
+ if (!function_exists("wpdreams_update_stylesheet")) {
50
+ function wpdreams_update_stylesheet($dir, $id, $style) {
51
+ $out = wpdreams_get_stylesheet($dir, $id, $style);
52
+ if (isset($style['css_compress']) && $style['css_compress'] == true)
53
+ $out = wpdreams_css_compress($out);
54
+ return @file_put_contents($dir."style".$id.".css", $out, FILE_TEXT);
55
+ }
56
+ }
57
+
58
+ if (!function_exists("wpdreams_parse_params")) {
59
+ function wpdreams_parse_params($params) {
60
+ foreach ($params as $k=>$v) {
61
+ $_tmp = explode('classname-', $k);
62
+ if ($_tmp!=null && count($_tmp)>1) {
63
+ ob_start();
64
+ $c = new $v('0', '0', $params[$_tmp[1]]);
65
+ $out = ob_get_clean();
66
+ $params['selected-'.$_tmp[1]] = $c->getSelected();
67
+ }
68
+ $_tmp = null;
69
+ $_tmp = explode('wpdfont-', $k);
70
+ if ($_tmp!=null && count($_tmp)>1) {
71
+ ob_start();
72
+ $c = new $v('0', '0', $params[$_tmp[1]]);
73
+ $out = ob_get_clean();
74
+ $params['import-'.$_tmp[1]] = $c->getImport();
75
+ }
76
+ }
77
+ return $params;
78
+ }
79
+ }
80
+
81
+ if (!function_exists("wpdreams_admin_hex2rgb")) {
82
+ function wpdreams_admin_hex2rgb($color)
83
+ {
84
+ if (strlen($color)>7) return $color;
85
+ if (strlen($color)<3) return "rgba(0, 0, 0, 1)";
86
+ if ($color[0] == '#')
87
+ $color = substr($color, 1);
88
+ if (strlen($color) == 6)
89
+ list($r, $g, $b) = array($color[0].$color[1],
90
+ $color[2].$color[3],
91
+ $color[4].$color[5]);
92
+ elseif (strlen($color) == 3)
93
+ list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
94
+ else
95
+ return false;
96
+ $r = hexdec($r); $g = hexdec($g); $b = hexdec($b);
97
+ return "rgba(".$r.", ".$g.", ".$b.", 1)";
98
+ }
99
+ }
100
+ if (!function_exists("wpdreams_four_to_string")) {
101
+ function wpdreams_four_to_string($data) {
102
+ // 1.Top 2.Bottom 3.Right 4.Left
103
+ preg_match("/\|\|(.*?)\|\|(.*?)\|\|(.*?)\|\|(.*?)\|\|/", $data, $matches);
104
+ // 1.Top 3.Right 2.Bottom 4.Left
105
+ return $matches[1]." ".$matches[3]." ".$matches[2]." ".$matches[4];
106
+ }
107
+ }
108
+
109
+
110
+ if (!function_exists("wpdreams_box_shadow_css")) {
111
+ function wpdreams_box_shadow_css($css) {
112
+ $css = str_replace("\n", "", $css);
113
+ preg_match("/box-shadow:(.*?)px (.*?)px (.*?)px (.*?)px (.*?);/", $css, $matches);
114
+ $ci = $matches[5];
115
+ $hlength = $matches[1];
116
+ $vlength = $matches[2];
117
+ $blurradius = $matches[3];
118
+ $spread = $matches[4];
119
+ $moz_blur = ($blurradius>2)?$blurradius - 2:0;
120
+ if ($hlength==0 && $vlength==0 && $blurradius==0 && $spread==0) {
121
+ echo "box-shadow: none;";
122
+ } else {
123
+ echo "box-shadow:".$hlength."px ".$vlength."px ".$moz_blur."px ".$spread."px ".$ci.";";
124
+ echo "-webkit-box-shadow:".$hlength."px ".$vlength."px ".$blurradius."px ".$spread."px ".$ci.";";
125
+ echo "-ms-box-shadow:".$hlength."px ".$vlength."px ".$blurradius."px ".$spread."px ".$ci.";";
126
+ }
127
+ }
128
+ }
129
+
130
+ if (!function_exists("wpdreams_gradient_css")) {
131
+ function wpdreams_gradient_css($data, $print=true)
132
+ {
133
+
134
+ $data = str_replace("\n", "", $data);
135
+ preg_match("/(.*?)-(.*?)-(.*?)-(.*)/", $data, $matches);
136
+
137
+ if (!isset($matches[1]) || !isset($matches[2]) || !isset($matches[3])) {
138
+ // Probably only 1 color..
139
+ if ($print) echo "background: ".$data.";";
140
+ return "background: ".$data.";";
141
+ }
142
+
143
+ $type = $matches[1];
144
+ $deg = $matches[2];
145
+ $color1 = wpdreams_admin_hex2rgb($matches[3]);
146
+ $color2 = wpdreams_admin_hex2rgb($matches[4]);
147
+
148
+ // Check for full transparency
149
+ preg_match("/rgba\(.*?,.*?,.*?,[\s]*(.*?)\)/", $color1, $opacity1);
150
+ preg_match("/rgba\(.*?,.*?,.*?,[\s]*(.*?)\)/", $color2, $opacity2);
151
+ if (isset($opacity1[1]) && $opacity1[1] == "0" && isset($opacity2[1]) && $opacity2[1] == "0") {
152
+ if ($print) echo "background: transparent;";
153
+ return "background: transparent;";
154
+ }
155
+
156
+ ob_start();
157
+ //compatibility
158
+ /*if (strlen($color1)>7) {
159
+ preg_match("/\((.*?)\)/", $color1, $matches);
160
+ $colors = explode(',', $matches[1]);
161
+ echo "background: rgb($colors[0], $colors[1], $colors[2]);";
162
+ } else {
163
+ echo "background: ".$color1.";";
164
+ } */
165
+ //linear
166
+
167
+ if ($type!='0' || $type!=0) {
168
+ ?>
169
+ background-image: linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>);
170
+ background-image: -webkit-linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>);
171
+ background-image: -moz-linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>);
172
+ background-image: -o-linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>);
173
+ background-image: -ms-linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>);
174
+ <?php
175
+ } else {
176
+ //radial
177
+ ?>
178
+ background-image: -moz-radial-gradient(center, ellipse cover, <?php echo $color1; ?>, <?php echo $color2; ?>);
179
+ background-image: -webkit-gradient(radial, center center, 0px, center center, 100%, <?php echo $color1; ?>, <?php echo $color2; ?>);
180
+ background-image: -webkit-radial-gradient(center, ellipse cover, <?php echo $color1; ?>, <?php echo $color2; ?>);
181
+ background-image: -o-radial-gradient(center, ellipse cover, <?php echo $color1; ?>, <?php echo $color2; ?>);
182
+ background-image: -ms-radial-gradient(center, ellipse cover, <?php echo $color1; ?>, <?php echo $color2; ?>);
183
+ background-image: radial-gradient(ellipse at center, <?php echo $color1; ?>, <?php echo $color2; ?>);
184
+ <?php
185
+ }
186
+ $out = ob_get_clean();
187
+ if ($print) echo $out;
188
+ return $out;
189
+ }
190
+ }
191
+
192
+ if (!function_exists("wpdreams_gradient_css_rgba")) {
193
+ function wpdreams_gradient_css_rgba($data, $print=true)
194
+ {
195
+
196
+ $data = str_replace("\n", "", $data);
197
+ preg_match("/(.*?)-(.*?)-(.*?)-(.*)/", $data, $matches);
198
+
199
+ if (!isset($matches[1]) || !isset($matches[2]) || !isset($matches[3])) {
200
+ // Probably only 1 color..
201
+ echo "background: ".$data.";";
202
+ return;
203
+ }
204
+
205
+ $type = $matches[1];
206
+ $deg = $matches[2];
207
+ $color1 = wpdreams_admin_hex2rgb($matches[3]);
208
+ $color2 = wpdreams_admin_hex2rgb($matches[4]);
209
+
210
+ ob_start();
211
+ //compatibility
212
+
213
+
214
+ if ($type!='0' || $type!=0) {
215
+ ?>linear-gradient(<?php echo $deg; ?>deg, <?php echo $color1; ?>, <?php echo $color2; ?>)<?php
216
+ } else {
217
+ //radial
218
+ ?>radial-gradient(ellipse at center, <?php echo $color1; ?>, <?php echo $color2; ?>)<?php
219
+ }
220
+ $out = ob_get_clean();
221
+ if ($print) echo $out;
222
+ return $out;
223
+ }
224
+ }
225
+
226
+
227
+ if (!function_exists("wpdreams_border_width")) {
228
+ function wpdreams_border_width($css)
229
+ {
230
+ $css = str_replace("\n", "", $css);
231
+
232
+ preg_match("/border:(.*?)px (.*?) (.*?);/", $css, $matches);
233
+
234
+ return $matches[1];
235
+
236
+ }
237
+ }
238
+
239
+ if (!function_exists("wpdreams_width_from_px")) {
240
+ function wpdreams_width_from_px($css)
241
+ {
242
+ $css = str_replace("\n", "", $css);
243
+
244
+ preg_match("/(.*?)px/", $css, $matches);
245
+
246
+ return $matches[1];
247
+
248
+ }
249
+ }
250
+
251
+ if (!function_exists("wpdreams_x2")) {
252
+ function wpdreams_x2($url)
253
+ {
254
+ $ext = pathinfo($url, PATHINFO_EXTENSION);
255
+ return str_replace('.'.$ext, 'x2.'.$ext, $url);
256
+ }
257
+ }
258
+
259
+ if (!function_exists("wpdreams_in_array_r")) {
260
+ function wpdreams_in_array_r($needle, $haystack, $strict = false) {
261
+ foreach ($haystack as $item) {
262
+ if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && wpdreams_in_array_r($needle, $item, $strict))) {
263
+ return true;
264
+ }
265
+ }
266
+
267
+ return false;
268
+ }
269
+ }
270
+
271
+ if (!function_exists("wpdreams_css_compress")) {
272
+ function wpdreams_css_compress ($code) {
273
+ $code = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $code);
274
+ $code = str_replace(array("\r\n", "\r", "\n", "\t", ' '), '', $code);
275
+ $code = str_replace('{ ', '{', $code);
276
+ $code = str_replace(' }', '}', $code);
277
+ $code = str_replace('; ', ';', $code);
278
+ return $code;
279
+ }
280
+ }
281
+
282
+ if (!function_exists("wpdreams_get_all_taxonomies")) {
283
+ function wpdreams_get_all_taxonomies() {
284
+ $args = array(
285
+ 'public' => true,
286
+ '_builtin' => false
287
+
288
+ );
289
+ $output = 'names'; // or objects
290
+ $operator = 'and'; // 'and' or 'or'
291
+ $taxonomies = get_taxonomies( $args, $output, $operator );
292
+ return $taxonomies;
293
+ }
294
+ }
295
+
296
+ if (!function_exists("wpdreams_get_all_terms")) {
297
+ function wpdreams_get_all_terms() {
298
+ $taxonomies = wpdreams_get_all_taxonomies();
299
+ $terms = array();
300
+ $_terms = array();
301
+ foreach ($taxonomies as $taxonomy) {
302
+ $_temp = get_terms($taxonomy, 'orderby=name');
303
+ foreach ($_temp as $k=>$v)
304
+ $terms[] = $v;
305
+ }
306
+ foreach ($terms as $k=>$v) {
307
+ $_terms[$v->term_id] = $v;
308
+ }
309
+ return $_terms;
310
+ }
311
+ }
312
+
313
+ if (!function_exists("wpdreams_get_all_term_ids")) {
314
+ function wpdreams_get_all_term_ids() {
315
+ $taxonomies = wpdreams_get_all_taxonomies();
316
+ $terms = array();
317
+ foreach ($taxonomies as $taxonomy) {
318
+ $_temp = get_terms($taxonomy, 'orderby=name');
319
+ foreach ($_temp as $k=>$v)
320
+ $terms[] = $v->term_id;
321
+ }
322
+ return $terms;
323
+ }
324
+ }
325
+
326
+ if (!function_exists("wpdreams_four_to_string")) {
327
+ function wpdreams_four_to_string($data) {
328
+ // 1.Top 2.Bottom 3.Right 4.Left
329
+ preg_match("/\|\|(.*?)\|\|(.*?)\|\|(.*?)\|\|(.*?)\|\|/", $data, $matches);
330
+ // 1.Top 3.Right 2.Bottom 4.Left
331
+ return $matches[1]." ".$matches[3]." ".$matches[2]." ".$matches[4];
332
+ }
333
+ }
334
+
335
+ if (!function_exists("wpdreams_four_to_array")) {
336
+ function wpdreams_four_to_array($data) {
337
+ // 1.Top 2.Bottom 3.Right 4.Left
338
+ preg_match("/\|\|(.*?)\|\|(.*?)\|\|(.*?)\|\|(.*?)\|\|/", $data, $matches);
339
+ // 1.Top 3.Right 2.Bottom 4.Left
340
+ return array(
341
+ "top" => $matches[1],
342
+ "right" => $matches[3],
343
+ "bottom" => $matches[2],
344
+ "left" => $matches[4]
345
+ );
346
+ }
347
+ }
348
+
349
+ if (!function_exists("asl_generate_html_results")) {
350
+ /**
351
+ * Converts the results array to HTML code
352
+ *
353
+ * Since ASL 4.5 the results are returned as plain HTML codes instead of JSON
354
+ * to allow templating. This function includes the needed template files
355
+ * to generate the correct HTML code. Supports grouping.
356
+ *
357
+ * @since 4.5
358
+ * @param $results
359
+ * @param $s_options
360
+ * @return string
361
+ */
362
+ function asl_generate_html_results($results, $s_options ) {
363
+ $html = "";
364
+ if (empty($results) || !empty($results['nores'])) {
365
+ if (!empty($results['keywords'])) {
366
+ $s_keywords = $results['keywords'];
367
+ // Get the keyword suggestions template
368
+ ob_start();
369
+ include(ASL_INCLUDES_PATH . "views/keyword-suggestions.php");
370
+ $html .= ob_get_clean();
371
+ } else {
372
+ // No results at all.
373
+ ob_start();
374
+ include(ASL_INCLUDES_PATH . "views/no-results.php");
375
+ $html .= ob_get_clean();
376
+ }
377
+ } else {
378
+
379
+ // Get the item HTML
380
+ foreach($results as $k=>$r) {
381
+ ob_start();
382
+ include(ASL_INCLUDES_PATH . "views/result.php");
383
+ $html .= ob_get_clean();
384
+ }
385
+
386
+ }
387
+ return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $html);
388
+ }
389
+ }
390
+
391
+ if (!function_exists('asl_icl_t')) {
392
+ /* Ajax Search Lite wrapper for WPML print */
393
+ function asl_icl_t($name, $value) {
394
+ if (function_exists('icl_t'))
395
+ return icl_t('ajax-search-lite', $name, $value);
396
+ return $value;
397
+ }
398
+ }
399
+
400
+ if (!function_exists("wd_closetags")) {
401
+ /**
402
+ * Close unclosed HTML tags
403
+ *
404
+ * @param $html
405
+ * @return string
406
+ */
407
+ function wd_closetags( $html ) {
408
+ $unpaired = array('hr', 'br', 'img');
409
+
410
+ // put all opened tags into an array
411
+ preg_match_all ( "#<([a-z]+)( .*)?(?!/)>#iU", $html, $result );
412
+ $openedtags = $result[1];
413
+ // remove unpaired tags
414
+ if (is_array($openedtags) && count($openedtags)>0) {
415
+ foreach ($openedtags as $k=>$tag) {
416
+ if (in_array($tag, $unpaired))
417
+ unset($openedtags[$k]);
418
+ }
419
+ } else {
420
+ // Replace a possible un-closed tag from the end, 30 characters backwards check
421
+ $html = preg_replace('/(.*)(\<[a-zA-Z].{0,30})$/', '$1', $html);
422
+ return $html;
423
+ }
424
+ // put all closed tags into an array
425
+ preg_match_all ( "#</([a-z]+)>#iU", $html, $result );
426
+ $closedtags = $result[1];
427
+ $len_opened = count ( $openedtags );
428
+ // all tags are closed
429
+ if( count ( $closedtags ) == $len_opened ) {
430
+ // Replace a possible un-closed tag from the end, 30 characters backwards check
431
+ $html = preg_replace('/(.*)(\<[a-zA-Z].{0,30})$/', '$1', $html);
432
+ return $html;
433
+ }
434
+ $openedtags = array_reverse ( $openedtags );
435
+ // close tags
436
+ for( $i = 0; $i < $len_opened; $i++ ) {
437
+ if ( !in_array ( $openedtags[$i], $closedtags ) ) {
438
+ $html .= "</" . $openedtags[$i] . ">";
439
+ } else {
440
+ unset ( $closedtags[array_search ( $openedtags[$i], $closedtags)] );
441
+ }
442
+ }
443
+ // Replace a possible un-closed tag from the end, 30 characters backwards check
444
+ $html = preg_replace('/(.*)(\<[a-zA-Z].{0,30})$/', '$1', $html);
445
+ return $html;
446
+ }
447
+ }
448
+
449
+ if (!function_exists("mysql_escape_mimic")) {
450
+ function mysql_escape_mimic($inp) {
451
+ if(is_array($inp))
452
+ return array_map(__METHOD__, $inp);
453
+
454
+ if(!empty($inp) && is_string($inp)) {
455
+ return str_replace(array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), array('\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z'), $inp);
456
+ }
457
+
458
+ return $inp;
459
+ }
460
+ }
461
+
462
+ if (!function_exists("wd_in_array_r")) {
463
+ function wd_in_array_r($needle, $haystack, $strict = true) {
464
+ foreach ($haystack as $item) {
465
+ if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && wd_in_array_r($needle, $item, $strict))) {
466
+ return true;
467
+ }
468
+ }
469
+
470
+ return false;
471
+ }
472
+ }
473
+
474
+ if (!function_exists("wd_substr_at_word")) {
475
+ function wd_substr_at_word($text, $length) {
476
+ if (strlen($text) <= $length) return $text;
477
+ $blogCharset = get_bloginfo('charset');
478
+ $charset = $blogCharset !== '' ? $blogCharset : 'UTF-8';
479
+ $s = mb_substr($text, 0, $length, $charset);
480
+ return mb_substr($s, 0, strrpos($s, ' '), $charset);
481
+ }
482
+ }
483
+
484
+ if (!function_exists("wpdreams_ismobile")) {
485
+ function wpdreams_ismobile() {
486
+ $is_mobile = '0';
487
+ if(preg_match('/(android|iphone|ipad|up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i', strtolower($_SERVER['HTTP_USER_AGENT'])))
488
+ $is_mobile=1;
489
+ if((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml')>0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE']))))
490
+ $is_mobile=1;
491
+ $mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,4));
492
+ $mobile_agents = array('w3c ','acs-','alav','alca','amoi','andr','audi','avan','benq','bird','blac','blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno','ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-','maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-','newt','noki','oper','palm','pana','pant','phil','play','port','prox','qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar','sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-','tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp','wapr','webc','winw','winw','xda','xda-');
493
+
494
+ if(in_array($mobile_ua,$mobile_agents))
495
+ $is_mobile=1;
496
+
497
+ if (isset($_SERVER['ALL_HTTP'])) {
498
+ if (strpos(strtolower($_SERVER['ALL_HTTP']),'OperaMini')>0)
499
+ $is_mobile=1;
500
+ }
501
+ if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows')>0)
502
+ $is_mobile=0;
503
+ return $is_mobile;
504
+ }
505
+ }
506
+ if (!function_exists("current_page_url")) {
507
+ function current_page_url() {
508
+ $pageURL = 'http';
509
+ if( isset($_SERVER["HTTPS"]) ) {
510
+ if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
511
+ }
512
+ $pageURL .= "://";
513
+ if ($_SERVER["SERVER_PORT"] != "80") {
514
+ $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
515
+ } else {
516
+ $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
517
+ }
518
+ return $pageURL;
519
+ }
520
+ }
521
+ if (!function_exists("wpdreams_hex2rgb")) {
522
+ function wpdreams_hex2rgb($color)
523
+ {
524
+ if (strlen($color)>7) return $color;
525
+ if (strlen($color)<3) return "0, 0, 0";
526
+ if ($color[0] == '#')
527
+ $color = substr($color, 1);
528
+ if (strlen($color) == 6)
529
+ list($r, $g, $b) = array($color[0].$color[1],
530
+ $color[2].$color[3],
531
+ $color[4].$color[5]);
532
+ elseif (strlen($color) == 3)
533
+ list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
534
+ else
535
+ return false;
536
+ $r = hexdec($r); $g = hexdec($g); $b = hexdec($b);
537
+ return $r.", ".$g.", ".$b;
538
+ }
539
+ }
540
+
541
+ if (!function_exists("wpdreams_rgb2hex")) {
542
+ function wpdreams_rgb2hex($color)
543
+ {
544
+ if (strlen($color)>7) {
545
+ preg_match("/.*?\((\d+), (\d+), (\d+).*?/", $color, $c);
546
+ if (is_array($c) && count($c)>3) {
547
+ $color = "#".sprintf("%02X", $c[1]);
548
+ $color .= sprintf("%02X", $c[2]);
549
+ $color .= sprintf("%02X", $c[3]);
550
+ }
551
+ }
552
+ return $color;
553
+ }
554
+ }
555
+
556
+ if (!function_exists("get_content_w")) {
557
+ function get_content_w($id)
558
+ {
559
+ $my_postid = $id;
560
+ $content_post = get_post($my_postid);
561
+ $content = $content_post->post_content;
562
+ $content = apply_filters('the_content', $content);
563
+ $content = str_replace(']]>', ']]&gt;', $content);
564
+ return $content;
565
+ }
566
+ }
567
+
568
+ if (!function_exists("wpdreams_utf8safeencode")) {
569
+ function wpdreams_utf8safeencode($s, $delimiter)
570
+ {
571
+ $convmap= array(0x0100, 0xFFFF, 0, 0xFFFF);
572
+ return $delimiter."_".base64_encode(mb_encode_numericentity($s, $convmap, 'UTF-8'));
573
+ }
574
+ }
575
+
576
+ if (!function_exists("wpdreams_utf8safedecode")) {
577
+ function wpdreams_utf8safedecode($s, $delimiter)
578
+ {
579
+ if (strpos($s, $delimiter)!=0) return $s;
580
+ $convmap= array(0x0100, 0xFFFF, 0, 0xFFFF);
581
+ $_s = explode($delimiter."_", $s);
582
+ return base64_decode(mb_decode_numericentity($s[1], $convmap, 'UTF-8'));
583
+ }
584
+ }
585
+
586
+ if (!function_exists("postval_or_getoption")) {
587
+ function postval_or_getoption($option)
588
+ {
589
+ if (isset($_POST) && isset($_POST[$option]))
590
+ return $_POST[$option];
591
+ return get_option($option);
592
+ }
593
+ }
594
+
595
+ if (!function_exists("setval_or_getoption")) {
596
+ function setval_or_getoption($options, $key)
597
+ {
598
+ if (isset($options) && isset($options[$key]))
599
+ return $options[$key];
600
+ $def_options = get_option('asl_defaults');
601
+ if (isset($def_options[$key]))
602
+ return $def_options[$key];
603
+ else
604
+ return "";
605
+ }
606
+ }
607
+
608
+ if (!function_exists("wpdreams_get_image_from_content")) {
609
+ function wpdreams_get_image_from_content($content, $number = 0) {
610
+ if ($content=="") return false;
611
+ $dom = new domDocument;
612
+ @$dom->loadHTML($content);
613
+ $dom->preserveWhiteSpace = false;
614
+ @$images = $dom->getElementsByTagName('img');
615
+ if ($images->length>0) {
616
+ if ($images->length > $number) {
617
+ $im = $images->item($number)->getAttribute('src');
618
+ } else {
619
+ $number = 0;
620
+ $im = $images->item(0)->getAttribute('src');
621
+ }
622
+ return $im;
623
+ } else {
624
+ return false;
625
+ }
626
+ }
627
+ }
628
+
629
+ if (!function_exists("wpdreams_on_backend_page")) {
630
+ function wpdreams_on_backend_page($pages)
631
+ {
632
+ if (isset($_GET) && isset($_GET['page'])) {
633
+ return in_array($_GET['page'] ,$pages);
634
+ }
635
+ return false;
636
+ }
637
+ }
638
+
639
+ if (!function_exists("wd_in_array_r")) {
640
+ function wd_in_array_r($needle, $haystack, $strict = true) {
641
+ foreach ($haystack as $item) {
642
+ if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && wd_in_array_r($needle, $item, $strict))) {
643
+ return true;
644
+ }
645
+ }
646
+
647
+ return false;
648
+ }
649
+ }
650
+
651
+ if (!function_exists("wpdreams_on_backend_page")) {
652
+ /**
653
+ * @param $pages
654
+ * @return bool
655
+ */
656
+ function wpdreams_on_backend_page($pages)
657
+ {
658
+ if (isset($_GET) && isset($_GET['page'])) {
659
+ return in_array($_GET['page'] ,$pages);
660
+ }
661
+ return false;
662
+ }
663
+ }
664
+
665
+ if (!function_exists("wpdreams_on_backend_post_editor")) {
666
+ /**
667
+ * @return bool
668
+ */
669
+ function wpdreams_on_backend_post_editor() {
670
+ $current_url = current_page_url();
671
+ return (strpos($current_url, 'post-new.php')!==false ||
672
+ strpos($current_url, 'post.php')!==false);
673
+ }
674
+ }
675
+
676
+ if (!function_exists("wpdreams_get_blog_list")) {
677
+ function wpdreams_get_blog_list( $start = 0, $num = 10, $deprecated = '' ) {
678
+
679
+ global $wpdb;
680
+ if (!isset($wpdb->blogs)) return array();
681
+ $blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );
682
+
683
+ foreach ( (array) $blogs as $details ) {
684
+ $blog_list[ $details['blog_id'] ] = $details;
685
+ $blog_list[ $details['blog_id'] ]['postcount'] = $wpdb->get_var( "SELECT COUNT(ID) FROM " . $wpdb->get_blog_prefix( $details['blog_id'] ). "posts WHERE post_status='publish' AND post_type='post'" );
686
+ }
687
+ unset( $blogs );
688
+ $blogs = $blog_list;
689
+
690
+ if ( false == is_array( $blogs ) )
691
+ return array();
692
+
693
+ if ( $num == 'all' )
694
+ return array_slice( $blogs, $start, count( $blogs ) );
695
+ else
696
+ return array_slice( $blogs, $start, $num );
697
+ }
698
+ }
699
+
700
+ //----------------------------------------------------------------------------------------------------------------------
701
+ // 6. NON-AJAX RESULTS
702
+ //----------------------------------------------------------------------------------------------------------------------
703
+
704
+ if ( !class_exists("asl_dummyPost") ) {
705
+ /**
706
+ * Class asl_dummyPost
707
+ *
708
+ * A default class to instantiate to generate post like results.
709
+ */
710
+ class asl_dummyPost {
711
+
712
+ public $ID = -10;
713
+ public $post_title = "";
714
+ public $post_author = "";
715
+ public $post_name = "";
716
+ public $post_type = "post"; // Everything unknown is going to be a post
717
+ public $post_date = ""; // Format: 0000-00-00 00:00:00
718
+ public $post_date_gmt = ""; // Format: 0000-00-00 00:00:00
719
+ public $post_content = ""; // The full content of the post
720
+ public $post_excerpt = ""; // User-defined post excerpt
721
+ public $post_status = "publish"; // See get_post_status for values
722
+ public $comment_status = "closed"; // Returns: { open, closed }
723
+ public $ping_status = "closed"; // Returns: { open, closed }
724
+ public $post_password = ""; // Returns empty string if no password
725
+ public $post_parent = 0; // Parent Post ID (default 0)
726
+ public $post_modified = ""; // Format: 0000-00-00 00:00:00
727
+ public $post_modified_gmt = ""; // Format: 0000-00-00 00:00:00
728
+ public $comment_count = 0; // Number of comments on post (numeric string)
729
+ public $menu_order = 0; // Order value as set through page-attribute when enabled (numeric string. Defaults to 0)
730
+ public $guid = "";
731
+ public $asl_guid;
732
+
733
+ function __construct() {}
734
+ }
735
+ }
736
+
737
+ if ( !function_exists("asl_results_to_wp_obj") ) {
738
+ /**
739
+ * Converts ajax results from Ajax Search Pro to post like objects to be displayable
740
+ * on the regular search results page.
741
+ *
742
+ * @param $results
743
+ * @param int $from
744
+ * @param string $count
745
+ * @return array
746
+ */
747
+ function asl_results_to_wp_obj($results, $from = 0, $count = "all") {
748
+ if (empty($results))
749
+ return array();
750
+
751
+ if ($count == "all")
752
+ $results_slice = array_slice($results, $from);
753
+ else
754
+ $results_slice = array_slice($results, $from, $count);
755
+
756
+ if (empty($results_slice))
757
+ return array();
758
+
759
+ $wp_res_arr = array();
760
+
761
+ $date_format = get_option('date_format');
762
+ $time_format = get_option('time_format');
763
+
764
+ $current_date = date($date_format . " " . $time_format, time());
765
+
766
+ foreach ($results_slice as $r) {
767
+
768
+ if (is_multisite())
769
+ switch_to_blog($r->blogid);
770
+
771
+ switch ($r->content_type) {
772
+ case "pagepost":
773
+ $res = get_post($r->id);
774
+ break;
775
+ case "blog":
776
+ $res = new asl_dummyPost();
777
+ $res->post_title = $r->title;
778
+ $res->asl_guid = $r->link;
779
+ $res->post_content = $r->content;
780
+ $res->post_excerpt = $r->content;
781
+ $res->post_date = $current_date;
782
+ break;
783
+ case "bp_group":
784
+ $res = new asl_dummyPost();
785
+ $res->post_title = $r->title;
786
+ $res->asl_guid = $r->link;
787
+ $res->post_content = $r->content;
788
+ $res->post_excerpt = $r->content;
789
+ $res->post_date = $r->date;
790
+ break;
791
+ case "bp_activity":
792
+ $res = new asl_dummyPost();
793
+ $res->post_title = $r->title;
794
+ $res->asl_guid = $r->link;
795
+ $res->post_content = $r->content;
796
+ $res->post_excerpt = $r->content;
797
+ $res->post_date = $r->date;
798
+ break;
799
+ case "comment":
800
+ $res = get_post($r->post_id);
801
+ if (isset($res->post_title)) {
802
+ $res->post_title = $r->title;
803
+ $res->asl_guid = $r->link;
804
+ $res->post_content = $r->content;
805
+ $res->post_excerpt = $r->content;
806
+ }
807
+ break;
808
+ case "term":
809
+ $res = new asl_dummyPost();
810
+ $res->post_title = $r->title;
811
+ $res->asl_guid = $r->link;
812
+ $res->guid = $r->link;
813
+ $res->post_date = $current_date;
814
+ break;
815
+ case "user":
816
+ $res = new asl_dummyPost();
817
+ $res->post_title = $r->title;
818
+ $res->asl_guid = $r->link;
819
+ $res->guid = $r->link;
820
+ $res->post_date = $current_date;
821
+ break;
822
+ }
823
+
824
+ if (!empty($res)) {
825
+ $res = apply_filters("asl_regular_search_result", $res);
826
+ $wp_res_arr[] = $res;
827
+ }
828
+
829
+ if (is_multisite())
830
+ restore_current_blog();
831
+ }
832
+
833
+ return $wp_res_arr;
834
+ }
835
+ }
includes/hooks.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- /* Prevent direct access */
3
- defined('ABSPATH') or die("You can't access this file directly.");
4
-
5
- function asl_search_stylesheets() {
6
- // Don't print if on the back-end
7
- if (!is_admin()) {
8
- $asl_options = get_option('asl_options');
9
- wp_register_style('wpdreams-asl-basic', ASL_URL.'css/style.basic.css', array(), ASL_CURR_VER_STRING);
10
- wp_enqueue_style('wpdreams-asl-basic');
11
- wp_enqueue_style('wpdreams-ajaxsearchlite', plugins_url('css/style-'.w_isset_def($asl_options['theme'], 'polaroid').'.css', dirname(__FILE__)), array(), ASL_CURR_VER_STRING);
12
- }
13
- }
14
-
15
- add_action('wp_print_styles', 'asl_search_stylesheets');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/imagecache.class.php DELETED
@@ -1,241 +0,0 @@
1
- <?php
2
- /* Prevent direct access */
3
- defined('ABSPATH') or die("You can't access this file directly.");
4
-
5
- /*
6
- * Creates a cache of the image file in the given dimensions
7
- * as a jpeg file into the specified folder.
8
- * <code>
9
- * //Parse the first image from text
10
- * new wpdreamsImageCache($im, $saveas, $w, $h, 1)
11
- * //Parse the image from url
12
- * new wpdreamsImageCache($im, $saveas, $w, $h)
13
- * </code>
14
- *
15
- * @author Ernest Marcinko <ernest.marcinko@wp-dreams.com>
16
- * @version 1.0
17
- * @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio
18
- * @copyright Copyright (c) 2012, Ernest Marcinko
19
- */
20
- if (!class_exists('wpdreamsImageCache')) {
21
- class wpdreamsImageCache {
22
- /*
23
- * Constructor
24
- *
25
- * @param string $im text containing the image or image url
26
- * @param string $saveas path to the cache folder WITH DS on the end!
27
- * @param int $w width of the result image
28
- * @param int $h height of the result image
29
- * @param int $imagenum (optional) the number of the image found in the text to be cached, if left blank, then the $im is treated as an url and NOT as TEXT!
30
- */
31
-
32
- function __construct($im, $unique, $saveas, $w, $h, $imagenum=-1, $color="#ffffff") {
33
-
34
- $this->im = $im;
35
- $this->unique = $unique;
36
- $this->saveas = $saveas;
37
- $this->saveas = $saveas;
38
- $this->w = $w;
39
- $this->h = $h;
40
- $this->imagenum = $imagenum;
41
- $this->bgcolor = $color;
42
-
43
- $exists = $this->file_exists();
44
-
45
- if ($exists!==false) {
46
- $this->resultImageName = $exists;
47
- } else {
48
-
49
- if ($imagenum>=0) {
50
- $this->content = $im;
51
- $this->imagenum = $imagenum-1;
52
- $this->parse_content();
53
- } else {
54
- $this->im = $im;
55
- }
56
- if (function_exists('get_home_path'))
57
- $this->path = get_home_path();
58
- else
59
- $this->path = NULL;
60
- if (function_exists('get_home_url'))
61
- $this->url = get_home_url();
62
- else
63
- $this->url = NULL;
64
- /* Clear all possible warning, not safe, but still.. */
65
- ob_start();
66
- $this->resultImageName = $this->img_resizer($this->im, 100, $w, $h, $saveas, $color);
67
- ob_end_clean();
68
-
69
- }
70
- }
71
-
72
- function file_exists() {
73
- $filename = md5($this->unique.$this->w.$this->h.$this->imagenum).".jpg";
74
- $saveas = $this->saveas.$filename;
75
- if (file_exists($saveas)) return $filename;
76
- return false;
77
- }
78
-
79
- function parse_content() {
80
- $this->im = "";
81
- if ($this->content=="") return;
82
- $dom = new domDocument;
83
- @$dom->loadHTML($this->content);
84
- $dom->preserveWhiteSpace = false;
85
- @$images = $dom->getElementsByTagName('img');
86
- if ($images->length>0) {
87
- if ($images->length>$this->imagenum) {
88
- $this->im = $images->item($this->imagenum)->getAttribute('src');
89
- } else {
90
- $this->imagenum = 0;
91
- $this->im = $images->item(0)->getAttribute('src');
92
- }
93
- }
94
- }
95
-
96
- function get_image() {
97
- return $this->resultImageName;
98
- }
99
-
100
- function _ckdir($fn) {
101
- if (strpos($fn,"/") !== false) {
102
- $p=substr($fn,0,strrpos($fn,"/"));
103
- if (!is_dir($p)) {
104
- //_o("Mkdir: ".$p);
105
- mkdir($p,0777,true);
106
- }
107
- }
108
- }
109
-
110
- function check_color($color)
111
- {
112
- if (strlen($color)>7) {
113
- preg_match("/.*?\((\d+), (\d+), (\d+).*?/", $color, $c);
114
- if (is_array($c) && count($c)>3) {
115
- $color = "#".sprintf("%02X", $c[1]);
116
- $color .= sprintf("%02X", $c[2]);
117
- $color .= sprintf("%02X", $c[3]);
118
- }
119
- }
120
- return $color;
121
- }
122
-
123
- function img_resizer($src,$quality,$w,$h,$saveas, $color) {
124
- if (!extension_loaded('gd') || !function_exists('gd_info')) {
125
- return "";
126
- }
127
- $color = $this->check_color($color);
128
- $method = $this->can_get_file();
129
- if( $method==false) {
130
- return "";
131
- }
132
- if ($src=="") return "";
133
- $filename = md5($this->unique.$w.$h.$this->imagenum).".jpg";
134
- $saveas .= $filename;
135
- if (file_exists($saveas)) return $filename;
136
- $r = 1;
137
- $_file = $this->url_get_contents($src, $method);
138
- if ($_file=="") return "";
139
- $OldImage = imagecreatefromstring($_file);
140
- $_bgcolor = $this->hex2rgb($color);
141
- $bgcolor = imagecolorallocate($OldImage, $_bgcolor[0],$_bgcolor[1],$_bgcolor[2]);
142
-
143
-
144
- if ($r) {
145
- if ($method==1) {
146
- list($width, $height) =$this->fast_getimagesize($OldImage);
147
- } else {
148
- list($width,$height) =getimagesize($src);
149
- }
150
-
151
- if ($width<=0 || $height<=0) return "";
152
-
153
- $_ratio=array($width/$height,$w/$h);
154
- if ($_ratio[0] != $_ratio[1]) {
155
- $_scale=min((float)($width/$w),(float)($height/$h));
156
- $cropX=(float)($width-($_scale*$w));
157
- $cropY=(float)($height-($_scale*$h));
158
- $cropW=(float)($width-$cropX);
159
- $cropH=(float)($height-$cropY);
160
- $crop=ImageCreateTrueColor($cropW,$cropH);
161
- imagefilledrectangle($crop, 0, 0, $cropW, $cropH, $bgcolor);
162
- ImageCopy($crop,$OldImage,0,0,(int)($cropX/2),(int)($cropY/2),$cropW,$cropH);
163
- }
164
-
165
- $NewThumb=ImageCreateTrueColor($w,$h);
166
- imagefilledrectangle($NewThumb, 0, 0, $w, $h, $bgcolor);
167
- if (isset($crop)) {
168
- ImageCopyResampled($NewThumb,$crop,0,0,0,0,$w,$h,$cropW,$cropH);
169
- ImageDestroy($crop);
170
- } else {
171
- ImageCopyResampled($NewThumb,$OldImage,0,0,0,0,$w,$h,$width,$height);
172
- }
173
- $this->_ckdir($saveas);
174
- ImageJpeg($NewThumb,$saveas,$quality);
175
- ImageDestroy($NewThumb);
176
- ImageDestroy($OldImage);
177
- }
178
- return $filename;
179
- }
180
-
181
- function can_get_file() {
182
- if (function_exists('curl_init')){
183
- return 2;
184
- } else if (ini_get('allow_url_fopen')==true) {
185
- return 2;
186
- }
187
- return false;
188
- }
189
-
190
- function url_get_contents($Url, $method) {
191
- if ($method==2) {
192
- //var_dump($this->replace_url_path($Url));
193
- return file_get_contents($this->replace_url_path($Url));
194
- } else if ($method==1) {
195
- $ch = curl_init();
196
- curl_setopt($ch, CURLOPT_URL, $Url);
197
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
198
- $output = curl_exec($ch);
199
- curl_close($ch);
200
- return $output;
201
- }
202
- }
203
-
204
- function fast_getimagesize($im) {
205
- $width = imagesx($im);
206
- $height = imagesy($im);
207
- return array($width, $height);
208
- }
209
-
210
- function set_home_path_url($path, $url) {
211
- if ($path!="" && $url!="") {
212
- $this->path = $path;
213
- $this->url = $url;
214
- }
215
- }
216
-
217
- function replace_url_path($file) {
218
- if ($this->url!=NULL && $this->path!=NULL) {
219
- return str_replace($this->url, $this->path, $file);
220
- }
221
- return $file;
222
- }
223
-
224
- function hex2rgb($color) {
225
- if (strlen($color)<3) return array(255,255,255);
226
- if ($color[0] == '#')
227
- $color = substr($color, 1);
228
- if (strlen($color) == 6)
229
- list($r, $g, $b) = array($color[0].$color[1],
230
- $color[2].$color[3],
231
- $color[4].$color[5]);
232
- elseif (strlen($color) == 3)
233
- list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
234
- else
235
- return false;
236
- $r = hexdec($r); $g = hexdec($g); $b = hexdec($b);
237
- return array($r ,$g ,$b);
238
- }
239
- }
240
- }
241
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/search_demo.class.php DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- /* Prevent direct access */
3
- defined('ABSPATH') or die("You can't access this file directly.");
4
-
5
- if (!class_exists('wpdreams_searchDemo')) {
6
- class wpdreams_searchDemo extends wpdreams_search {
7
-
8
- protected function do_search() {
9
- global $wpdb;
10
-
11
- if (isset($wpdb->base_prefix)) {
12
- $_prefix = $wpdb->base_prefix;
13
- } else {
14
- $_prefix = $wpdb->prefix;
15
- }
16
-
17
- $options = $this->options;
18
- $searchData = $this->searchData;
19
-
20
- $querystr = "
21
- SELECT
22
- $wpdb->posts.post_title as title,
23
- $wpdb->posts.ID as id,
24
- $wpdb->posts.post_date as date,
25
- $wpdb->posts.post_content as content,
26
- $wpdb->posts.post_excerpt as excerpt,
27
- $wpdb->users.user_nicename as author,
28
- $wpdb->posts.post_type as post_type
29
- FROM $wpdb->posts
30
- LEFT JOIN $wpdb->users ON $wpdb->users.ID = $wpdb->posts.post_author
31
- ORDER BY ".$wpdb->posts.".post_date DESC
32
- LIMIT 10";
33
-
34
- $pageposts = $wpdb->get_results($querystr, OBJECT);
35
-
36
- $this->results = $pageposts;
37
- return $pageposts;
38
-
39
- }
40
-
41
- }
42
- }
43
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/shortcodes.php DELETED
@@ -1,48 +0,0 @@
1
- <?php
2
- /* Prevent direct access */
3
- defined('ABSPATH') or die("You can't access this file directly.");
4
-
5
- add_shortcode('wpdreams_ajaxsearchlite_results', 'add_ajaxsearchlite_results');
6
- add_shortcode( 'wpdreams_ajaxsearchlite', array( aslShortcodeContainer::get_instance(), 'wpdreams_asl_shortcode' ) );
7
-
8
- class aslShortcodeContainer {
9
-
10
- protected static $instance = NULL;
11
- private static $instanceCount = 0;
12
-
13
- public static function get_instance() {
14
- // create an object
15
- NULL === self::$instance and self::$instance = new self;
16
- return self::$instance; // return the object
17
- }
18
-
19
- function wpdreams_asl_shortcode($atts) {
20
- $style = null;
21
- self::$instanceCount++;
22
-
23
- extract(shortcode_atts(array(
24
- 'id' => 'something'
25
- ), $atts));
26
-
27
- $style = get_option('asl_options');
28
- $def_data = get_option('asl_defaults');
29
-
30
- $style = array_merge($def_data, $style);
31
-
32
-
33
- $settingsHidden = ((
34
- w_isset_def($style['show_frontend_search_settings'], 1) == 1
35
- ) ? false : true);
36
-
37
- do_action('asl_layout_before_shortcode', $id);
38
-
39
- $out = "";
40
- ob_start();
41
- include(ASL_PATH."includes/views/asl.shortcode.php");
42
- $out = ob_get_clean();
43
-
44
- do_action('asl_layout_after_shortcode', $id);
45
-
46
- return $out;
47
- }
48
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/suggest.class.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- /* Prevent direct access */
3
- defined('ABSPATH') or die("You can't access this file directly.");
4
-
5
- if (!class_exists('keywordSuggest')) {
6
- class keywordSuggest {
7
- function __construct($lang="en", $overrideUrl = '') {
8
- $this->lang = $lang;
9
- if ($overrideUrl!='') {
10
- $this->url = $overrideUrl;
11
- } else {
12
- $this->url = 'http://suggestqueries.google.com/complete/search?output=toolbar&oe=utf-8&client=toolbar&hl='.$this->lang.'&q=';
13
- }
14
- }
15
-
16
-
17
- function getKeywords($q) {
18
- $q = str_replace(' ', '+', $q);
19
- $method = $this->can_get_file();
20
- if ($method==false) {
21
- return array('Error: The fopen url wrapper is not enabled on your server!');
22
- }
23
- $_content = $this->url_get_contents($this->url.$q, $method);
24
- if ($_content=="") return false;
25
- $_content = mb_convert_encoding($_content, "UTF-8");
26
- $xml = simplexml_load_string($this->url_get_contents($this->url.$q, $method));
27
- $json = json_encode($xml);
28
- $array = json_decode($json,TRUE);
29
- $res = array();
30
- if (isset($array['CompleteSuggestion'])) {
31
- foreach($array['CompleteSuggestion'] as $k=>$v) {
32
- if (isset($v['suggestion']))
33
- $res[] = $v['suggestion']['@attributes']['data'];
34
- elseif (isset($v[0]))
35
- $res[] = $v[0]['@attributes']['data'];
36
- }
37
- }
38
- if (count($res)>0)
39
- return $res;
40
- else
41
- return false;
42
- }
43
-
44
- function can_get_file() {
45
- if (function_exists('curl_init')){
46
- return 1;
47
- } else if (ini_get('allow_url_fopen')==true) {
48
- return 2;
49
- }
50
- return false;
51
- }
52
-
53
- function url_get_contents($Url, $method) {
54
- if ($method==2) {
55
- return file_get_contents($Url);
56
- } else if ($method==1) {
57
- $ch = curl_init();
58
- curl_setopt($ch, CURLOPT_URL, $Url);
59
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
60
- $output = curl_exec($ch);
61
- curl_close($ch);
62
- return $output;
63
- }
64
- }
65
- }
66
- }
67
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/suggest/suggest.inc.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- /**
3
- * Includes all files required for keyword suggestions
4
- */
5
-
6
- require_once(ASL_PATH . "/includes/suggest/suggest-abstract.class.php");
7
- require_once(ASL_PATH . "/includes/suggest/google_suggest.class.php");
8
- require_once(ASL_PATH . "/includes/suggest/suggest-wrapper.class.php");
 
 
 
 
 
 
 
 
includes/views/asl.shortcode.php CHANGED
@@ -1,6 +1,9 @@
1
  <?php
2
  $id = self::$instanceCount;
3
  $real_id = self::$instanceCount;
 
 
 
4
  ?>
5
  <div id='ajaxsearchlite<?php echo self::$instanceCount; ?>' class="wpdreams_asl_container">
6
  <div class="probox">
@@ -24,7 +27,7 @@
24
 
25
  <?php do_action('asl_layout_before_settings', $id); ?>
26
 
27
- <div class='prosettings' <?php echo($settingsHidden ? "style='display:none;'" : ""); ?>opened=0>
28
  <?php do_action('asl_layout_in_settings', $id); ?>
29
  <div class='innericon'>
30
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
@@ -39,7 +42,7 @@
39
 
40
  <div class='proinput'>
41
  <form action='' autocomplete="off">
42
- <input type='search' class='orig' name='phrase' placeholder='<?php echo w_isset_def($style["defaultsearchtext"], ""); ?>' value='<?php echo get_search_query(); ?>' autocomplete="off"/>
43
  <input type='text' class='autocomplete' name='phrase' value='' autocomplete="off"/>
44
  <span class='loading'></span>
45
  <input type='submit' style='width:0; height: 0; visibility: hidden;'>
@@ -52,12 +55,7 @@
52
 
53
  <div class='proloading'>
54
 
55
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32">
56
- <path opacity=".25" d="M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"/>
57
- <path d="M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z">
58
- <animateTransform attributeName="transform" type="rotate" from="0 16 16" to="360 16 16" dur="0.8s" repeatCount="indefinite" />
59
- </path>
60
- </svg>
61
 
62
  <?php do_action('asl_layout_in_loading', $id); ?>
63
  </div>
@@ -79,6 +77,29 @@
79
  </div>
80
  </div>
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  <div id='ajaxsearchlitesettings<?php echo $id; ?>' class="searchsettings wpdreams_asl_settings">
83
  <form name='options'>
84
 
@@ -101,7 +122,7 @@
101
 
102
  <div class="option<?php echo(($style['showexactmatches'] != 1) ? " hiddend" : ""); ?>">
103
  <input type="checkbox" value="checked" id="set_exactonly<?php echo $id; ?>"
104
- name="set_exactonly" <?php echo(($style['exactonly'] == 1) ? 'checked="checked"' : ''); ?>/>
105
  <label for="set_exactonly<?php echo $id; ?>"></label>
106
  </div>
107
  <div class="label<?php echo(($style['showexactmatches'] != 1) ? " hiddend" : ""); ?>">
@@ -109,7 +130,7 @@
109
  </div>
110
  <div class="option<?php echo(($style['showsearchintitle'] != 1) ? " hiddend" : ""); ?>">
111
  <input type="checkbox" value="None" id="set_intitle<?php echo $id; ?>"
112
- name="set_intitle" <?php echo(($style['searchintitle'] == 1) ? 'checked="checked"' : ''); ?>/>
113
  <label for="set_intitle<?php echo $id; ?>"></label>
114
  </div>
115
  <div class="label<?php echo(($style['showsearchintitle'] != 1) ? " hiddend" : ""); ?>">
@@ -117,7 +138,7 @@
117
  </div>
118
  <div class="option<?php echo(($style['showsearchincontent'] != 1) ? " hiddend" : ""); ?>">
119
  <input type="checkbox" value="None" id="set_incontent<?php echo $id; ?>"
120
- name="set_incontent" <?php echo(($style['searchincontent'] == 1) ? 'checked="checked"' : ''); ?>/>
121
  <label for="set_incontent<?php echo $id; ?>"></label>
122
  </div>
123
  <div class="label<?php echo(($style['showsearchincontent'] != 1) ? " hiddend" : ""); ?>">
@@ -126,13 +147,13 @@
126
 
127
  <div class="option hiddend">
128
  <input type="checkbox" value="None" id="set_inexcerpt<?php echo $id; ?>"
129
- name="set_inexcerpt" <?php echo(($style['searchinexcerpt'] == 1) ? 'checked="checked"' : ''); ?>/>
130
  <label for="set_inexcerpt<?php echo $id; ?>"></label>
131
  </div>
132
 
133
  <div class="option<?php echo(($style['showsearchinposts'] != 1) ? " hiddend" : ""); ?>">
134
  <input type="checkbox" value="None" id="set_inposts<?php echo $id; ?>"
135
- name="set_inposts" <?php echo(($style['searchinposts'] == 1) ? 'checked="checked"' : ''); ?>/>
136
  <label for="set_inposts<?php echo $id; ?>"></label>
137
  </div>
138
  <div class="label<?php echo(($style['showsearchinposts'] != 1) ? " hiddend" : ""); ?>">
@@ -140,7 +161,7 @@
140
  </div>
141
  <div class="option<?php echo(($style['showsearchinpages'] != 1) ? " hiddend" : ""); ?>">
142
  <input type="checkbox" value="None" id="set_inpages<?php echo $id; ?>"
143
- name="set_inpages" <?php echo(($style['searchinpages'] == 1) ? 'checked="checked"' : ''); ?>/>
144
  <label for="set_inpages<?php echo $id; ?>"></label>
145
  </div>
146
  <div class="label<?php echo(($style['showsearchinpages'] != 1) ? " hiddend" : ""); ?>">
@@ -204,7 +225,7 @@
204
 
205
  <fieldset>
206
  <?php if ($style['exsearchincategoriestext'] != ""): ?>
207
- <legend><?php echo $style['exsearchincategoriestext']; ?></legend>
208
  <?php endif; ?>
209
  <div class='categoryfilter asl_sett_scroll'>
210
  <?php
@@ -217,7 +238,10 @@
217
  $_all_cat = get_terms('category', array('fields'=>'ids'));
218
  $_needed_cat = array_diff($_all_cat, $style['selected-exsearchincategories']);
219
  foreach ($_needed_cat as $k => $v) {
220
- $selected = !in_array($v, $style['selected-excludecategories']);
 
 
 
221
  $cat = get_category($v);
222
  $val = $cat->name;
223
  $hidden = (($style['showsearchincategories']) == 0 ? " hiddend" : "");
@@ -291,7 +315,7 @@
291
  $ana_options = get_option('asl_analytics');
292
  $scope = "asljQuery";
293
  ?>
294
- <div class="asl_init_data wpdreams_asl_data_ct" style="display:none !important;" id="asl_init_id_<?php echo $id; ?>">
295
  {
296
  "homeurl": "<?php echo home_url('/'); ?>",
297
  "resultstype": "vertical",
@@ -337,6 +361,22 @@
337
  "iihideContent": <?php echo w_isset_def($style['i_hide_content'], 1); ?>,
338
  "iianimation": "<?php echo w_isset_def($style['i_animation'], 1); ?>",
339
  "analytics": <?php echo w_isset_def($ana_options['analytics'], 0); ?>,
340
- "analyticsString": "<?php echo w_isset_def($ana_options['analytics_string'], ""); ?>"
 
 
 
 
 
341
  }
342
- </div>
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  $id = self::$instanceCount;
3
  $real_id = self::$instanceCount;
4
+
5
+ if ( isset($style['_fo']) && !isset($style['_fo']['categoryset']) )
6
+ $style['_fo']['categoryset'] = array();
7
  ?>
8
  <div id='ajaxsearchlite<?php echo self::$instanceCount; ?>' class="wpdreams_asl_container">
9
  <div class="probox">
27
 
28
  <?php do_action('asl_layout_before_settings', $id); ?>
29
 
30
+ <div class='prosettings' <?php echo($settingsHidden ? "style='display:none;'" : ""); ?> data-opened=0>
31
  <?php do_action('asl_layout_in_settings', $id); ?>
32
  <div class='innericon'>
33
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
42
 
43
  <div class='proinput'>
44
  <form action='' autocomplete="off">
45
+ <input type='search' class='orig' name='phrase' placeholder='<?php echo asl_icl_t( "Search bar placeholder text", w_isset_def($style['defaultsearchtext'], '') ); ?>' value='<?php echo get_search_query(); ?>' autocomplete="off"/>
46
  <input type='text' class='autocomplete' name='phrase' value='' autocomplete="off"/>
47
  <span class='loading'></span>
48
  <input type='submit' style='width:0; height: 0; visibility: hidden;'>
55
 
56
  <div class='proloading'>
57
 
58
+ <div class="asl_loader"><div class="asl_loader-inner asl_simple-circle"></div></div>
 
 
 
 
 
59
 
60
  <?php do_action('asl_layout_in_loading', $id); ?>
61
  </div>
77
  </div>
78
  </div>
79
 
80
+ <?php
81
+ // Search redirection, memorize general options
82
+ if ( isset($style['_fo']) ) {
83
+ $_checked = array(
84
+ "set_exactonly" => isset($style['_fo']["set_exactonly"]) ? ' checked="checked"' : "",
85
+ "set_intitle" => isset($style['_fo']["set_intitle"]) ? ' checked="checked"' : "",
86
+ "set_incontent" => isset($style['_fo']["set_incontent"]) ? ' checked="checked"' : "",
87
+ "set_inexcerpt" => isset($style['_fo']["set_inexcerpt"]) ? ' checked="checked"' : "",
88
+ "set_inposts" => isset($style['_fo']["set_inposts"]) ? ' checked="checked"' : "",
89
+ "set_inpages" => isset($style['_fo']["set_inpages"]) ? ' checked="checked"' : "",
90
+ );
91
+ } else {
92
+ $_checked = array(
93
+ "set_exactonly" => $style['exactonly'] == 1 ? ' checked="checked"' : "",
94
+ "set_intitle" => $style['searchintitle'] == 1 ? ' checked="checked"' : "",
95
+ "set_incontent" => $style['searchincontent'] == 1 ? ' checked="checked"' : "",
96
+ "set_inexcerpt" => $style['searchinexcerpt'] == 1 ? ' checked="checked"' : "",
97
+ "set_inposts" => $style['searchinposts'] == 1 ? ' checked="checked"' : "",
98
+ "set_inpages" => $style['searchinpages'] == 1 ? ' checked="checked"' : "",
99
+ );
100
+ }
101
+ ?>
102
+
103
  <div id='ajaxsearchlitesettings<?php echo $id; ?>' class="searchsettings wpdreams_asl_settings">
104
  <form name='options'>
105
 
122
 
123
  <div class="option<?php echo(($style['showexactmatches'] != 1) ? " hiddend" : ""); ?>">
124
  <input type="checkbox" value="checked" id="set_exactonly<?php echo $id; ?>"
125
+ name="set_exactonly" <?php echo $_checked["set_exactonly"]; ?>/>
126
  <label for="set_exactonly<?php echo $id; ?>"></label>
127
  </div>
128
  <div class="label<?php echo(($style['showexactmatches'] != 1) ? " hiddend" : ""); ?>">
130
  </div>
131
  <div class="option<?php echo(($style['showsearchintitle'] != 1) ? " hiddend" : ""); ?>">
132
  <input type="checkbox" value="None" id="set_intitle<?php echo $id; ?>"
133
+ name="set_intitle" <?php echo $_checked["set_intitle"]; ?>/>
134
  <label for="set_intitle<?php echo $id; ?>"></label>
135
  </div>
136
  <div class="label<?php echo(($style['showsearchintitle'] != 1) ? " hiddend" : ""); ?>">
138
  </div>
139
  <div class="option<?php echo(($style['showsearchincontent'] != 1) ? " hiddend" : ""); ?>">
140
  <input type="checkbox" value="None" id="set_incontent<?php echo $id; ?>"
141
+ name="set_incontent" <?php echo $_checked["set_incontent"]; ?>/>
142
  <label for="set_incontent<?php echo $id; ?>"></label>
143
  </div>
144
  <div class="label<?php echo(($style['showsearchincontent'] != 1) ? " hiddend" : ""); ?>">
147
 
148
  <div class="option hiddend">
149
  <input type="checkbox" value="None" id="set_inexcerpt<?php echo $id; ?>"
150
+ name="set_inexcerpt" <?php echo $_checked["set_inexcerpt"]; ?>/>
151
  <label for="set_inexcerpt<?php echo $id; ?>"></label>
152
  </div>
153
 
154
  <div class="option<?php echo(($style['showsearchinposts'] != 1) ? " hiddend" : ""); ?>">
155
  <input type="checkbox" value="None" id="set_inposts<?php echo $id; ?>"
156
+ name="set_inposts" <?php echo $_checked["set_inposts"]; ?>/>
157
  <label for="set_inposts<?php echo $id; ?>"></label>
158
  </div>
159
  <div class="label<?php echo(($style['showsearchinposts'] != 1) ? " hiddend" : ""); ?>">
161
  </div>
162
  <div class="option<?php echo(($style['showsearchinpages'] != 1) ? " hiddend" : ""); ?>">
163
  <input type="checkbox" value="None" id="set_inpages<?php echo $id; ?>"
164
+ name="set_inpages" <?php echo $_checked["set_inpages"]; ?>/>
165
  <label for="set_inpages<?php echo $id; ?>"></label>
166
  </div>
167
  <div class="label<?php echo(($style['showsearchinpages'] != 1) ? " hiddend" : ""); ?>">
225
 
226
  <fieldset>
227
  <?php if ($style['exsearchincategoriestext'] != ""): ?>
228
+ <legend><?php echo asl_icl_t("Categories filter box text", $style['exsearchincategoriestext']); ?></legend>
229
  <?php endif; ?>
230
  <div class='categoryfilter asl_sett_scroll'>
231
  <?php
238
  $_all_cat = get_terms('category', array('fields'=>'ids'));
239
  $_needed_cat = array_diff($_all_cat, $style['selected-exsearchincategories']);
240
  foreach ($_needed_cat as $k => $v) {
241
+ if ( isset($style['_fo']) )
242
+ $selected = in_array( $v, $style['_fo']['categoryset'] );
243
+ else
244
+ $selected = ! in_array( $v, $style['selected-excludecategories'] );
245
  $cat = get_category($v);
246
  $val = $cat->name;
247
  $hidden = (($style['showsearchincategories']) == 0 ? " hiddend" : "");
315
  $ana_options = get_option('asl_analytics');
316
  $scope = "asljQuery";
317
  ?>
318
+ <?php ob_start(); ?>
319
  {
320
  "homeurl": "<?php echo home_url('/'); ?>",
321
  "resultstype": "vertical",
361
  "iihideContent": <?php echo w_isset_def($style['i_hide_content'], 1); ?>,
362
  "iianimation": "<?php echo w_isset_def($style['i_animation'], 1); ?>",
363
  "analytics": <?php echo w_isset_def($ana_options['analytics'], 0); ?>,
364
+ "analyticsString": "<?php echo w_isset_def($ana_options['analytics_string'], ""); ?>",
365
+ "redirectonclick": <?php echo $style['redirectonclick']; ?>,
366
+ "redirectClickTo": "<?php echo $style['redirect_click_to']; ?>",
367
+ "redirect_on_enter": <?php echo $style['redirect_on_enter']; ?>,
368
+ "redirectEnterTo": "<?php echo $style['redirect_enter_to']; ?>",
369
+ "overridewpdefault": "<?php echo $style['override_default_results']; ?>"
370
  }
371
+ <?php $_asl_script_out = ob_get_clean(); ?>
372
+ <?php if (wd_asl()->o['asl_compatibility']['js_init'] == "blocking"): ?>
373
+ <script type="text/javascript">
374
+ if ( typeof ASL_INSTANCES == "undefined" )
375
+ var ASL_INSTANCES = {};
376
+ ASL_INSTANCES['<?php echo $id; ?>'] = <?php echo $_asl_script_out; ?>;
377
+ </script>
378
+ <?php else: ?>
379
+ <div class="asl_init_data wpdreams_asl_data_ct" style="display:none !important;" id="asl_init_id_<?php echo $id; ?>">
380
+ <?php echo $_asl_script_out; ?>
381
+ </div>
382
+ <?php endif; ?>
includes/widgets.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- class AjaxSearchLiteWidget extends WP_Widget
3
- {
4
- function __construct() {
5
- $widget_ops = array('classname' => 'AjaxSearchLiteWidget', 'description' => 'Displays an Ajax Search Lite!' );
6
- parent::__construct('AjaxSearchLiteWidget', 'Ajax Search Lite', $widget_ops);
7
- }
8
- function form($instance)
9
- {
10
- $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
11
- ?>
12
- <p>
13
- <label for="<?php echo $this->get_field_id('title'); ?>">
14
- Title:
15
- <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
16
- name="<?php echo $this->get_field_name('title'); ?>" type="text"
17
- value="<?php echo esc_attr($title); ?>" />
18
- </label>
19
- </p>
20
- <?php
21
- }
22
-
23
- function update($new_instance, $old_instance)
24
- {
25
- $instance = $old_instance;
26
- $instance['title'] = $new_instance['title'];
27
- return $instance;
28
- }
29
-
30
- function widget($args, $instance)
31
- {
32
- extract($args, EXTR_SKIP);
33
- echo $before_widget;
34
- $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
35
- if (!empty($title))
36
- echo $before_title . $title . $after_title;;
37
- // WIDGET CODE GOES HERE
38
- echo do_shortcode("[wpdreams_ajaxsearchlite]");
39
- echo $after_widget;
40
- }
41
- }
42
-
43
- add_action( 'widgets_init', create_function('', 'return register_widget("AjaxSearchLiteWidget");') );
44
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/min-scoped/jquery.ajaxsearchlite.min.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
2
+ !function(n,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=n.document?t(n,!0):function(n){if(!n.document)throw new Error("jQuery requires a window with a document");return t(n)}:t(n)}("undefined"!=typeof window?window:this,function(n,t){var c=[],l=c.slice,ki=c.concat,ni=c.push,di=c.indexOf,ct={},hf=ct.toString,nt=ct.hasOwnProperty,r={},gi="1.11.1",i=function(n,t){return new i.fn.init(n,t)},cf=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,lf=/^-ms-/,af=/-([\da-z])/gi,vf=function(n,t){return t.toUpperCase()};i.fn=i.prototype={jquery:gi,constructor:i,selector:"",length:0,toArray:function(){return l.call(this)},get:function(n){return null!=n?0>n?this[n+this.length]:this[n]:l.call(this)},pushStack:function(n){var t=i.merge(this.constructor(),n);return t.prevObject=this,t.context=this.context,t},each:function(n,t){return i.each(this,n,t)},map:function(n){return this.pushStack(i.map(this,function(t,i){return n.call(t,i,t)}))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(n){var i=this.length,t=+n+(0>n?i:0);return this.pushStack(t>=0&&i>t?[this[t]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:ni,sort:c.sort,splice:c.splice};i.extend=i.fn.extend=function(){var r,e,t,f,o,s,n=arguments[0]||{},u=1,c=arguments.length,h=!1;for("boolean"==typeof n&&(h=n,n=arguments[u]||{},u++),"object"==typeof n||i.isFunction(n)||(n={}),u===c&&(n=this,u--);c>u;u++)if(null!=(o=arguments[u]))for(f in o)r=n[f],t=o[f],n!==t&&(h&&t&&(i.isPlainObject(t)||(e=i.isArray(t)))?(e?(e=!1,s=r&&i.isArray(r)?r:[]):s=r&&i.isPlainObject(r)?r:{},n[f]=i.extend(h,s,t)):void 0!==t&&(n[f]=t));return n};i.extend({expando:"jQuery"+(gi+Math.random()).replace(/\D/g,""),isReady:!0,error:function(n){throw new Error(n);},noop:function(){},isFunction:function(n){return"function"===i.type(n)},isArray:Array.isArray||function(n){return"array"===i.type(n)},isWindow:function(n){return null!=n&&n==n.window},isNumeric:function(n){return!i.isArray(n)&&n-parseFloat(n)>=0},isEmptyObject:function(n){for(var t in n)return!1;return!0},isPlainObject:function(n){var t;if(!n||"object"!==i.type(n)||n.nodeType||i.isWindow(n))return!1;try{if(n.constructor&&!nt.call(n,"constructor")&&!nt.call(n.constructor.prototype,"isPrototypeOf"))return!1}catch(u){return!1}if(r.ownLast)for(t in n)return nt.call(n,t);for(t in n);return void 0===t||nt.call(n,t)},type:function(n){return null==n?n+"":"object"==typeof n||"function"==typeof n?ct[hf.call(n)]||"object":typeof n},globalEval:function(t){t&&i.trim(t)&&(n.execScript||function(t){n.eval.call(n,t)})(t)},camelCase:function(n){return n.replace(lf,"ms-").replace(af,vf)},nodeName:function(n,t){return n.nodeName&&n.nodeName.toLowerCase()===t.toLowerCase()},each:function(n,t,i){var u,r=0,f=n.length,e=ti(n);if(i){if(e){for(;f>r;r++)if(u=t.apply(n[r],i),u===!1)break}else for(r in n)if(u=t.apply(n[r],i),u===!1)break}else if(e){for(;f>r;r++)if(u=t.call(n[r],r,n[r]),u===!1)break}else for(r in n)if(u=t.call(n[r],r,n[r]),u===!1)break;return n},trim:function(n){return null==n?"":(n+"").replace(cf,"")},makeArray:function(n,t){var r=t||[];return null!=n&&(ti(Object(n))?i.merge(r,"string"==typeof n?[n]:n):ni.call(r,n)),r},inArray:function(n,t,i){var r;if(t){if(di)return di.call(t,n,i);for(r=t.length,i=i?0>i?Math.max(0,r+i):i:0;r>i;i++)if(i in t&&t[i]===n)return i}return-1},merge:function(n,t){for(var r=+t.length,i=0,u=n.length;r>i;)n[u++]=t[i++];if(r!==r)while(void 0!==t[i])n[u++]=t[i++];return n.length=u,n},grep:function(n,t,i){for(var u,f=[],r=0,e=n.length,o=!i;e>r;r++)u=!t(n[r],r),u!==o&&f.push(n[r]);return f},map:function(n,t,i){var u,r=0,e=n.length,o=ti(n),f=[];if(o)for(;e>r;r++)u=t(n[r],r,i),null!=u&&f.push(u);else for(r in n)u=t(n[r],r,i),null!=u&&f.push(u);return ki.apply([],f)},guid:1,proxy:function(n,t){var u,r,f;return"string"==typeof t&&(f=n[t],t=n,n=f),i.isFunction(n)?(u=l.call(arguments,2),r=function(){return n.apply(t||this,u.concat(l.call(arguments)))},r.guid=n.guid=n.guid||i.guid++,r):void 0},now:function(){return+new Date},support:r});i.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(n,t){ct["[object "+t+"]"]=t.toLowerCase()});function ti(n){var t=n.length,r=i.type(n);return"function"===r||i.isWindow(n)?!1:1===n.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in n}var tt=function(n){var it,u,t,ht,oi,et,wt,si,ct,y,rt,p,e,l,a,o,g,lt,ot,f="sizzle"+-new Date,s=n.document,v=0,ki=0,hi=ni(),ci=ni(),li=ni(),bt=function(n,t){return n===t&&(rt=!0),0},ut="undefined",ai=1<<31,di={}.hasOwnProperty,w=[],gi=w.pop,nr=w.push,b=w.push,vi=w.slice,nt=w.indexOf||function(n){for(var t=0,i=this.length;i>t;t++)if(this[t]===n)return t;return-1},kt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",i="[\\x20\\t\\r\\n\\f]",ft="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",yi=ft.replace("w","w#"),pi="\\["+i+"*("+ft+")(?:"+i+"*([*^$|!~]?=)"+i+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+yi+"))|)"+i+"*\\]",dt=":("+ft+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+pi+")*)|.*)\\)|)",at=new RegExp("^"+i+"+|((?:^|[^\\\\])(?:\\\\.)*)"+i+"+$","g"),tr=new RegExp("^"+i+"*,"+i+"*"),ir=new RegExp("^"+i+"*([>+~]|"+i+")"+i+"*"),rr=new RegExp("="+i+"*([^\\]'\"]*?)"+i+"*\\]","g"),ur=new RegExp(dt),fr=new RegExp("^"+yi+"$"),vt={ID:new RegExp("^#("+ft+")"),CLASS:new RegExp("^\\.("+ft+")"),TAG:new RegExp("^("+ft.replace("w","w*")+")"),ATTR:new RegExp("^"+pi),PSEUDO:new RegExp("^"+dt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+i+"*(even|odd|(([+-]|)(\\d*)n|)"+i+"*(?:([+-]|)"+i+"*(\\d+)|))"+i+"*\\)|)","i"),bool:new RegExp("^(?:"+kt+")$","i"),needsContext:new RegExp("^"+i+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+i+"*((?:-\\d)?\\d*)"+i+"*\\)|)(?=[^-]|$)","i")},er=/^(?:input|select|textarea|button)$/i,or=/^h\d$/i,st=/^[^{]+\{\s*\[native \w/,sr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,gt=/[+~]/,hr=/'|\\/g,k=new RegExp("\\\\([\\da-f]{1,6}"+i+"?|("+i+")|.)","ig"),d=function(n,t,i){var r="0x"+t-65536;return r!==r||i?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{b.apply(w=vi.call(s.childNodes),s.childNodes);w[s.childNodes.length].nodeType}catch(yr){b={apply:w.length?function(n,t){nr.apply(n,vi.call(t))}:function(n,t){for(var i=n.length,r=0;n[i++]=t[r++];);n.length=i-1}}}function r(n,t,i,r){var w,h,c,v,k,y,d,l,nt,g;if((t?t.ownerDocument||t:s)!==e&&p(t),t=t||e,i=i||[],!n||"string"!=typeof n)return i;if(1!==(v=t.nodeType)&&9!==v)return[];if(a&&!r){if(w=sr.exec(n))if(c=w[1]){if(9===v){if(h=t.getElementById(c),!h||!h.parentNode)return i;if(h.id===c)return i.push(h),i}else if(t.ownerDocument&&(h=t.ownerDocument.getElementById(c))&&ot(t,h)&&h.id===c)return i.push(h),i}else{if(w[2])return b.apply(i,t.getElementsByTagName(n)),i;if((c=w[3])&&u.getElementsByClassName&&t.getElementsByClassName)return b.apply(i,t.getElementsByClassName(c)),i}if(u.qsa&&(!o||!o.test(n))){if(l=d=f,nt=t,g=9===v&&n,1===v&&"object"!==t.nodeName.toLowerCase()){for(y=et(n),(d=t.getAttribute("id"))?l=d.replace(hr,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",k=y.length;k--;)y[k]=l+yt(y[k]);nt=gt.test(n)&&ii(t.parentNode)||t;g=y.join(",")}if(g)try{return b.apply(i,nt.querySelectorAll(g)),i}catch(tt){}finally{d||t.removeAttribute("id")}}}return si(n.replace(at,"$1"),t,i,r)}function ni(){var i=[];function n(r,u){return i.push(r+" ")>t.cacheLength&&delete n[i.shift()],n[r+" "]=u}return n}function h(n){return n[f]=!0,n}function c(n){var t=e.createElement("div");try{return!!n(t)}catch(i){return!1}finally{t.parentNode&&t.parentNode.removeChild(t);t=null}}function ti(n,i){for(var u=n.split("|"),r=n.length;r--;)t.attrHandle[u[r]]=i}function wi(n,t){var i=t&&n,r=i&&1===n.nodeType&&1===t.nodeType&&(~t.sourceIndex||ai)-(~n.sourceIndex||ai);if(r)return r;if(i)while(i=i.nextSibling)if(i===t)return-1;return n?1:-1}function cr(n){return function(t){var i=t.nodeName.toLowerCase();return"input"===i&&t.type===n}}function lr(n){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===n}}function tt(n){return h(function(t){return t=+t,h(function(i,r){for(var u,f=n([],i.length,t),e=f.length;e--;)i[u=f[e]]&&(i[u]=!(r[u]=i[u]))})})}function ii(n){return n&&typeof n.getElementsByTagName!==ut&&n}u=r.support={};oi=r.isXML=function(n){var t=n&&(n.ownerDocument||n).documentElement;return t?"HTML"!==t.nodeName:!1};p=r.setDocument=function(n){var v,r=n?n.ownerDocument||n:s,h=r.defaultView;return r!==e&&9===r.nodeType&&r.documentElement?(e=r,l=r.documentElement,a=!oi(r),h&&h!==h.top&&(h.addEventListener?h.addEventListener("unload",function(){p()},!1):h.attachEvent&&h.attachEvent("onunload",function(){p()})),u.attributes=c(function(n){return n.className="i",!n.getAttribute("className")}),u.getElementsByTagName=c(function(n){return n.appendChild(r.createComment("")),!n.getElementsByTagName("*").length}),u.getElementsByClassName=st.test(r.getElementsByClassName)&&c(function(n){return n.innerHTML="<div class='a'><\/div><div class='a i'><\/div>",n.firstChild.className="i",2===n.getElementsByClassName("i").length}),u.getById=c(function(n){return l.appendChild(n).id=f,!r.getElementsByName||!r.getElementsByName(f).length}),u.getById?(t.find.ID=function(n,t){if(typeof t.getElementById!==ut&&a){var i=t.getElementById(n);return i&&i.parentNode?[i]:[]}},t.filter.ID=function(n){var t=n.replace(k,d);return function(n){return n.getAttribute("id")===t}}):(delete t.find.ID,t.filter.ID=function(n){var t=n.replace(k,d);return function(n){var i=typeof n.getAttributeNode!==ut&&n.getAttributeNode("id");return i&&i.value===t}}),t.find.TAG=u.getElementsByTagName?function(n,t){if(typeof t.getElementsByTagName!==ut)return t.getElementsByTagName(n)}:function(n,t){var i,r=[],f=0,u=t.getElementsByTagName(n);if("*"===n){while(i=u[f++])1===i.nodeType&&r.push(i);return r}return u},t.find.CLASS=u.getElementsByClassName&&function(n,t){if(typeof t.getElementsByClassName!==ut&&a)return t.getElementsByClassName(n)},g=[],o=[],(u.qsa=st.test(r.querySelectorAll))&&(c(function(n){n.innerHTML="<select msallowclip=''><option selected=''><\/option><\/select>";n.querySelectorAll("[msallowclip^='']").length&&o.push("[*^$]="+i+"*(?:''|\"\")");n.querySelectorAll("[selected]").length||o.push("\\["+i+"*(?:value|"+kt+")");n.querySelectorAll(":checked").length||o.push(":checked")}),c(function(n){var t=r.createElement("input");t.setAttribute("type","hidden");n.appendChild(t).setAttribute("name","D");n.querySelectorAll("[name=d]").length&&o.push("name"+i+"*[*^$|!~]?=");n.querySelectorAll(":enabled").length||o.push(":enabled",":disabled");n.querySelectorAll("*,:x");o.push(",.*:")})),(u.matchesSelector=st.test(lt=l.matches||l.webkitMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.msMatchesSelector))&&c(function(n){u.disconnectedMatch=lt.call(n,"div");lt.call(n,"[s!='']:x");g.push("!=",dt)}),o=o.length&&new RegExp(o.join("|")),g=g.length&&new RegExp(g.join("|")),v=st.test(l.compareDocumentPosition),ot=v||st.test(l.contains)?function(n,t){var r=9===n.nodeType?n.documentElement:n,i=t&&t.parentNode;return n===i||!(!i||1!==i.nodeType||!(r.contains?r.contains(i):n.compareDocumentPosition&&16&n.compareDocumentPosition(i)))}:function(n,t){if(t)while(t=t.parentNode)if(t===n)return!0;return!1},bt=v?function(n,t){if(n===t)return rt=!0,0;var i=!n.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(n.ownerDocument||n)===(t.ownerDocument||t)?n.compareDocumentPosition(t):1,1&i||!u.sortDetached&&t.compareDocumentPosition(n)===i?n===r||n.ownerDocument===s&&ot(s,n)?-1:t===r||t.ownerDocument===s&&ot(s,t)?1:y?nt.call(y,n)-nt.call(y,t):0:4&i?-1:1)}:function(n,t){if(n===t)return rt=!0,0;var i,u=0,o=n.parentNode,h=t.parentNode,f=[n],e=[t];if(!o||!h)return n===r?-1:t===r?1:o?-1:h?1:y?nt.call(y,n)-nt.call(y,t):0;if(o===h)return wi(n,t);for(i=n;i=i.parentNode;)f.unshift(i);for(i=t;i=i.parentNode;)e.unshift(i);while(f[u]===e[u])u++;return u?wi(f[u],e[u]):f[u]===s?-1:e[u]===s?1:0},r):e};r.matches=function(n,t){return r(n,null,null,t)};r.matchesSelector=function(n,t){if((n.ownerDocument||n)!==e&&p(n),t=t.replace(rr,"='$1']"),!(!u.matchesSelector||!a||g&&g.test(t)||o&&o.test(t)))try{var i=lt.call(n,t);if(i||u.disconnectedMatch||n.document&&11!==n.document.nodeType)return i}catch(f){}return r(t,e,null,[n]).length>0};r.contains=function(n,t){return(n.ownerDocument||n)!==e&&p(n),ot(n,t)};r.attr=function(n,i){(n.ownerDocument||n)!==e&&p(n);var f=t.attrHandle[i.toLowerCase()],r=f&&di.call(t.attrHandle,i.toLowerCase())?f(n,i,!a):void 0;return void 0!==r?r:u.attributes||!a?n.getAttribute(i):(r=n.getAttributeNode(i))&&r.specified?r.value:null};r.error=function(n){throw new Error("Syntax error, unrecognized expression: "+n);};r.uniqueSort=function(n){var r,f=[],t=0,i=0;if(rt=!u.detectDuplicates,y=!u.sortStable&&n.slice(0),n.sort(bt),rt){while(r=n[i++])r===n[i]&&(t=f.push(i));while(t--)n.splice(f[t],1)}return y=null,n};ht=r.getText=function(n){var r,i="",u=0,t=n.nodeType;if(t){if(1===t||9===t||11===t){if("string"==typeof n.textContent)return n.textContent;for(n=n.firstChild;n;n=n.nextSibling)i+=ht(n)}else if(3===t||4===t)return n.nodeValue}else while(r=n[u++])i+=ht(r);return i};t=r.selectors={cacheLength:50,createPseudo:h,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(n){return n[1]=n[1].replace(k,d),n[3]=(n[3]||n[4]||n[5]||"").replace(k,d),"~="===n[2]&&(n[3]=" "+n[3]+" "),n.slice(0,4)},CHILD:function(n){return n[1]=n[1].toLowerCase(),"nth"===n[1].slice(0,3)?(n[3]||r.error(n[0]),n[4]=+(n[4]?n[5]+(n[6]||1):2*("even"===n[3]||"odd"===n[3])),n[5]=+(n[7]+n[8]||"odd"===n[3])):n[3]&&r.error(n[0]),n},PSEUDO:function(n){var i,t=!n[6]&&n[2];return vt.CHILD.test(n[0])?null:(n[3]?n[2]=n[4]||n[5]||"":t&&ur.test(t)&&(i=et(t,!0))&&(i=t.indexOf(")",t.length-i)-t.length)&&(n[0]=n[0].slice(0,i),n[2]=t.slice(0,i)),n.slice(0,3))}},filter:{TAG:function(n){var t=n.replace(k,d).toLowerCase();return"*"===n?function(){return!0}:function(n){return n.nodeName&&n.nodeName.toLowerCase()===t}},CLASS:function(n){var t=hi[n+" "];return t||(t=new RegExp("(^|"+i+")"+n+"("+i+"|$)"))&&hi(n,function(n){return t.test("string"==typeof n.className&&n.className||typeof n.getAttribute!==ut&&n.getAttribute("class")||"")})},ATTR:function(n,t,i){return function(u){var f=r.attr(u,n);return null==f?"!="===t:t?(f+="","="===t?f===i:"!="===t?f!==i:"^="===t?i&&0===f.indexOf(i):"*="===t?i&&f.indexOf(i)>-1:"$="===t?i&&f.slice(-i.length)===i:"~="===t?(" "+f+" ").indexOf(i)>-1:"|="===t?f===i||f.slice(0,i.length+1)===i+"-":!1):!0}},CHILD:function(n,t,i,r,u){var s="nth"!==n.slice(0,3),o="last"!==n.slice(-4),e="of-type"===t;return 1===r&&0===u?function(n){return!!n.parentNode}:function(t,i,h){var a,k,c,l,y,w,b=s!==o?"nextSibling":"previousSibling",p=t.parentNode,g=e&&t.nodeName.toLowerCase(),d=!h&&!e;if(p){if(s){while(b){for(c=t;c=c[b];)if(e?c.nodeName.toLowerCase()===g:1===c.nodeType)return!1;w=b="only"===n&&!w&&"nextSibling"}return!0}if(w=[o?p.firstChild:p.lastChild],o&&d){for(k=p[f]||(p[f]={}),a=k[n]||[],y=a[0]===v&&a[1],l=a[0]===v&&a[2],c=y&&p.childNodes[y];c=++y&&c&&c[b]||(l=y=0)||w.pop();)if(1===c.nodeType&&++l&&c===t){k[n]=[v,y,l];break}}else if(d&&(a=(t[f]||(t[f]={}))[n])&&a[0]===v)l=a[1];else while(c=++y&&c&&c[b]||(l=y=0)||w.pop())if((e?c.nodeName.toLowerCase()===g:1===c.nodeType)&&++l&&(d&&((c[f]||(c[f]={}))[n]=[v,l]),c===t))break;return l-=u,l===r||l%r==0&&l/r>=0}}},PSEUDO:function(n,i){var e,u=t.pseudos[n]||t.setFilters[n.toLowerCase()]||r.error("unsupported pseudo: "+n);return u[f]?u(i):u.length>1?(e=[n,n,"",i],t.setFilters.hasOwnProperty(n.toLowerCase())?h(function(n,t){for(var r,f=u(n,i),e=f.length;e--;)r=nt.call(n,f[e]),n[r]=!(t[r]=f[e])}):function(n){return u(n,0,e)}):u}},pseudos:{not:h(function(n){var i=[],r=[],t=wt(n.replace(at,"$1"));return t[f]?h(function(n,i,r,u){for(var e,o=t(n,null,u,[]),f=n.length;f--;)(e=o[f])&&(n[f]=!(i[f]=e))}):function(n,u,f){return i[0]=n,t(i,null,f,r),!r.pop()}}),has:h(function(n){return function(t){return r(n,t).length>0}}),contains:h(function(n){return function(t){return(t.textContent||t.innerText||ht(t)).indexOf(n)>-1}}),lang:h(function(n){return fr.test(n||"")||r.error("unsupported lang: "+n),n=n.replace(k,d).toLowerCase(),function(t){var i;do if(i=a?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return i=i.toLowerCase(),i===n||0===i.indexOf(n+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=n.location&&n.location.hash;return i&&i.slice(1)===t.id},root:function(n){return n===l},focus:function(n){return n===e.activeElement&&(!e.hasFocus||e.hasFocus())&&!!(n.type||n.href||~n.tabIndex)},enabled:function(n){return n.disabled===!1},disabled:function(n){return n.disabled===!0},checked:function(n){var t=n.nodeName.toLowerCase();return"input"===t&&!!n.checked||"option"===t&&!!n.selected},selected:function(n){return n.parentNode&&n.parentNode.selectedIndex,n.selected===!0},empty:function(n){for(n=n.firstChild;n;n=n.nextSibling)if(n.nodeType<6)return!1;return!0},parent:function(n){return!t.pseudos.empty(n)},header:function(n){return or.test(n.nodeName)},input:function(n){return er.test(n.nodeName)},button:function(n){var t=n.nodeName.toLowerCase();return"input"===t&&"button"===n.type||"button"===t},text:function(n){var t;return"input"===n.nodeName.toLowerCase()&&"text"===n.type&&(null==(t=n.getAttribute("type"))||"text"===t.toLowerCase())},first:tt(function(){return[0]}),last:tt(function(n,t){return[t-1]}),eq:tt(function(n,t,i){return[0>i?i+t:i]}),even:tt(function(n,t){for(var i=0;t>i;i+=2)n.push(i);return n}),odd:tt(function(n,t){for(var i=1;t>i;i+=2)n.push(i);return n}),lt:tt(function(n,t,i){for(var r=0>i?i+t:i;--r>=0;)n.push(r);return n}),gt:tt(function(n,t,i){for(var r=0>i?i+t:i;++r<t;)n.push(r);return n})}};t.pseudos.nth=t.pseudos.eq;for(it in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[it]=cr(it);for(it in{submit:!0,reset:!0})t.pseudos[it]=lr(it);function bi(){}bi.prototype=t.filters=t.pseudos;t.setFilters=new bi;et=r.tokenize=function(n,i){var e,f,s,o,u,h,c,l=ci[n+" "];if(l)return i?0:l.slice(0);for(u=n,h=[],c=t.preFilter;u;){(!e||(f=tr.exec(u)))&&(f&&(u=u.slice(f[0].length)||u),h.push(s=[]));e=!1;(f=ir.exec(u))&&(e=f.shift(),s.push({value:e,type:f[0].replace(at," ")}),u=u.slice(e.length));for(o in t.filter)(f=vt[o].exec(u))&&(!c[o]||(f=c[o](f)))&&(e=f.shift(),s.push({value:e,type:o,matches:f}),u=u.slice(e.length));if(!e)break}return i?u.length:u?r.error(n):ci(n,h).slice(0)};function yt(n){for(var t=0,r=n.length,i="";r>t;t++)i+=n[t].value;return i}function ri(n,t,i){var r=t.dir,u=i&&"parentNode"===r,e=ki++;return t.first?function(t,i,f){while(t=t[r])if(1===t.nodeType||u)return n(t,i,f)}:function(t,i,o){var s,h,c=[v,e];if(o){while(t=t[r])if((1===t.nodeType||u)&&n(t,i,o))return!0}else while(t=t[r])if(1===t.nodeType||u){if(h=t[f]||(t[f]={}),(s=h[r])&&s[0]===v&&s[1]===e)return c[2]=s[2];if(h[r]=c,c[2]=n(t,i,o))return!0}}}function ui(n){return n.length>1?function(t,i,r){for(var u=n.length;u--;)if(!n[u](t,i,r))return!1;return!0}:n[0]}function ar(n,t,i){for(var u=0,f=t.length;f>u;u++)r(n,t[u],i);return i}function pt(n,t,i,r,u){for(var e,o=[],f=0,s=n.length,h=null!=t;s>f;f++)(e=n[f])&&(!i||i(e,r,u))&&(o.push(e),h&&t.push(f));return o}function fi(n,t,i,r,u,e){return r&&!r[f]&&(r=fi(r)),u&&!u[f]&&(u=fi(u,e)),h(function(f,e,o,s){var l,c,a,p=[],y=[],w=e.length,k=f||ar(t||"*",o.nodeType?[o]:o,[]),v=!n||!f&&t?k:pt(k,p,n,o,s),h=i?u||(f?n:w||r)?[]:e:v;if(i&&i(v,h,o,s),r)for(l=pt(h,y),r(l,[],o,s),c=l.length;c--;)(a=l[c])&&(h[y[c]]=!(v[y[c]]=a));if(f){if(u||n){if(u){for(l=[],c=h.length;c--;)(a=h[c])&&l.push(v[c]=a);u(null,h=[],l,s)}for(c=h.length;c--;)(a=h[c])&&(l=u?nt.call(f,a):p[c])>-1&&(f[l]=!(e[l]=a))}}else h=pt(h===e?h.splice(w,h.length):h),u?u(null,e,h,s):b.apply(e,h)})}function ei(n){for(var s,u,r,o=n.length,h=t.relative[n[0].type],c=h||t.relative[" "],i=h?1:0,l=ri(function(n){return n===s},c,!0),a=ri(function(n){return nt.call(s,n)>-1},c,!0),e=[function(n,t,i){return!h&&(i||t!==ct)||((s=t).nodeType?l(n,t,i):a(n,t,i))}];o>i;i++)if(u=t.relative[n[i].type])e=[ri(ui(e),u)];else{if(u=t.filter[n[i].type].apply(null,n[i].matches),u[f]){for(r=++i;o>r;r++)if(t.relative[n[r].type])break;return fi(i>1&&ui(e),i>1&&yt(n.slice(0,i-1).concat({value:" "===n[i-2].type?"*":""})).replace(at,"$1"),u,r>i&&ei(n.slice(i,r)),o>r&&ei(n=n.slice(r)),o>r&&yt(n))}e.push(u)}return ui(e)}function vr(n,i){var u=i.length>0,f=n.length>0,o=function(o,s,h,c,l){var y,d,w,k=0,a="0",g=o&&[],p=[],nt=ct,tt=o||f&&t.find.TAG("*",l),it=v+=null==nt?1:Math.random()||.1,rt=tt.length;for(l&&(ct=s!==e&&s);a!==rt&&null!=(y=tt[a]);a++){if(f&&y){for(d=0;w=n[d++];)if(w(y,s,h)){c.push(y);break}l&&(v=it)}u&&((y=!w&&y)&&k--,o&&g.push(y))}if(k+=a,u&&a!==k){for(d=0;w=i[d++];)w(g,p,s,h);if(o){if(k>0)while(a--)g[a]||p[a]||(p[a]=gi.call(c));p=pt(p)}b.apply(c,p);l&&!o&&p.length>0&&k+i.length>1&&r.uniqueSort(c)}return l&&(v=it,ct=nt),g};return u?h(o):o}return wt=r.compile=function(n,t){var r,u=[],e=[],i=li[n+" "];if(!i){for(t||(t=et(n)),r=t.length;r--;)i=ei(t[r]),i[f]?u.push(i):e.push(i);i=li(n,vr(e,u));i.selector=n}return i},si=r.select=function(n,i,r,f){var s,e,o,l,v,c="function"==typeof n&&n,h=!f&&et(n=c.selector||n);if(r=r||[],1===h.length){if(e=h[0]=h[0].slice(0),e.length>2&&"ID"===(o=e[0]).type&&u.getById&&9===i.nodeType&&a&&t.relative[e[1].type]){if(i=(t.find.ID(o.matches[0].replace(k,d),i)||[])[0],!i)return r;c&&(i=i.parentNode);n=n.slice(e.shift().value.length)}for(s=vt.needsContext.test(n)?0:e.length;s--;){if(o=e[s],t.relative[l=o.type])break;if((v=t.find[l])&&(f=v(o.matches[0].replace(k,d),gt.test(e[0].type)&&ii(i.parentNode)||i))){if(e.splice(s,1),n=f.length&&yt(e),!n)return b.apply(r,f),r;break}}}return(c||wt(n,h))(f,i,!a,r,gt.test(n)&&ii(i.parentNode)||i),r},u.sortStable=f.split("").sort(bt).join("")===f,u.detectDuplicates=!!rt,p(),u.sortDetached=c(function(n){return 1&n.compareDocumentPosition(e.createElement("div"))}),c(function(n){return n.innerHTML="<a href='#'><\/a>","#"===n.firstChild.getAttribute("href")})||ti("type|href|height|width",function(n,t,i){if(!i)return n.getAttribute(t,"type"===t.toLowerCase()?1:2)}),u.attributes&&c(function(n){return n.innerHTML="<input/>",n.firstChild.setAttribute("value",""),""===n.firstChild.getAttribute("value")})||ti("value",function(n,t,i){if(!i&&"input"===n.nodeName.toLowerCase())return n.defaultValue}),c(function(n){return null==n.getAttribute("disabled")})||ti(kt,function(n,t,i){var r;if(!i)return n[t]===!0?t.toLowerCase():(r=n.getAttributeNode(t))&&r.specified?r.value:null}),r}(n);i.find=tt;i.expr=tt.selectors;i.expr[":"]=i.expr.pseudos;i.unique=tt.uniqueSort;i.text=tt.getText;i.isXMLDoc=tt.isXML;i.contains=tt.contains;var nr=i.expr.match.needsContext,tr=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,yf=/^.[^:#\[\.,]*$/;function ii(n,t,r){if(i.isFunction(t))return i.grep(n,function(n,i){return!!t.call(n,i,n)!==r});if(t.nodeType)return i.grep(n,function(n){return n===t!==r});if("string"==typeof t){if(yf.test(t))return i.filter(t,n,r);t=i.filter(t,n)}return i.grep(n,function(n){return i.inArray(n,t)>=0!==r})}i.filter=function(n,t,r){var u=t[0];return r&&(n=":not("+n+")"),1===t.length&&1===u.nodeType?i.find.matchesSelector(u,n)?[u]:[]:i.find.matches(n,i.grep(t,function(n){return 1===n.nodeType}))};i.fn.extend({find:function(n){var t,r=[],u=this,f=u.length;if("string"!=typeof n)return this.pushStack(i(n).filter(function(){for(t=0;f>t;t++)if(i.contains(u[t],this))return!0}));for(t=0;f>t;t++)i.find(n,u[t],r);return r=this.pushStack(f>1?i.unique(r):r),r.selector=this.selector?this.selector+" "+n:n,r},filter:function(n){return this.pushStack(ii(this,n||[],!1))},not:function(n){return this.pushStack(ii(this,n||[],!0))},is:function(n){return!!ii(this,"string"==typeof n&&nr.test(n)?i(n):n||[],!1).length}});var ft,u=n.document,pf=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,wf=i.fn.init=function(n,t){var r,f;if(!n)return this;if("string"==typeof n){if(r="<"===n.charAt(0)&&">"===n.charAt(n.length-1)&&n.length>=3?[null,n,null]:pf.exec(n),!r||!r[1]&&t)return!t||t.jquery?(t||ft).find(n):this.constructor(t).find(n);if(r[1]){if(t=t instanceof i?t[0]:t,i.merge(this,i.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:u,!0)),tr.test(r[1])&&i.isPlainObject(t))for(r in t)i.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(f=u.getElementById(r[2]),f&&f.parentNode){if(f.id!==r[2])return ft.find(n);this.length=1;this[0]=f}return this.context=u,this.selector=n,this}return n.nodeType?(this.context=this[0]=n,this.length=1,this):i.isFunction(n)?"undefined"!=typeof ft.ready?ft.ready(n):n(i):(void 0!==n.selector&&(this.selector=n.selector,this.context=n.context),i.makeArray(n,this))};wf.prototype=i.fn;ft=i(u);var bf=/^(?:parents|prev(?:Until|All))/,kf={children:!0,contents:!0,next:!0,prev:!0};i.extend({dir:function(n,t,r){for(var f=[],u=n[t];u&&9!==u.nodeType&&(void 0===r||1!==u.nodeType||!i(u).is(r));)1===u.nodeType&&f.push(u),u=u[t];return f},sibling:function(n,t){for(var i=[];n;n=n.nextSibling)1===n.nodeType&&n!==t&&i.push(n);return i}});i.fn.extend({has:function(n){var t,r=i(n,this),u=r.length;return this.filter(function(){for(t=0;u>t;t++)if(i.contains(this,r[t]))return!0})},closest:function(n,t){for(var r,f=0,o=this.length,u=[],e=nr.test(n)||"string"!=typeof n?i(n,t||this.context):0;o>f;f++)for(r=this[f];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(e?e.index(r)>-1:1===r.nodeType&&i.find.matchesSelector(r,n))){u.push(r);break}return this.pushStack(u.length>1?i.unique(u):u)},index:function(n){return n?"string"==typeof n?i.inArray(this[0],i(n)):i.inArray(n.jquery?n[0]:n,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(n,t){return this.pushStack(i.unique(i.merge(this.get(),i(n,t))))},addBack:function(n){return this.add(null==n?this.prevObject:this.prevObject.filter(n))}});function ir(n,t){do n=n[t];while(n&&1!==n.nodeType);return n}i.each({parent:function(n){var t=n.parentNode;return t&&11!==t.nodeType?t:null},parents:function(n){return i.dir(n,"parentNode")},parentsUntil:function(n,t,r){return i.dir(n,"parentNode",r)},next:function(n){return ir(n,"nextSibling")},prev:function(n){return ir(n,"previousSibling")},nextAll:function(n){return i.dir(n,"nextSibling")},prevAll:function(n){return i.dir(n,"previousSibling")},nextUntil:function(n,t,r){return i.dir(n,"nextSibling",r)},prevUntil:function(n,t,r){return i.dir(n,"previousSibling",r)},siblings:function(n){return i.sibling((n.parentNode||{}).firstChild,n)},children:function(n){return i.sibling(n.firstChild)},contents:function(n){return i.nodeName(n,"iframe")?n.contentDocument||n.contentWindow.document:i.merge([],n.childNodes)}},function(n,t){i.fn[n]=function(r,u){var f=i.map(this,t,r);return"Until"!==n.slice(-5)&&(u=r),u&&"string"==typeof u&&(f=i.filter(u,f)),this.length>1&&(kf[n]||(f=i.unique(f)),bf.test(n)&&(f=f.reverse())),this.pushStack(f)}});var h=/\S+/g,rr={};function df(n){var t=rr[n]={};return i.each(n.match(h)||[],function(n,i){t[i]=!0}),t}i.Callbacks=function(n){n="string"==typeof n?rr[n]||df(n):i.extend({},n);var o,u,h,f,e,c,t=[],r=!n.once&&[],l=function(i){for(u=n.memory&&i,h=!0,e=c||0,c=0,f=t.length,o=!0;t&&f>e;e++)if(t[e].apply(i[0],i[1])===!1&&n.stopOnFalse){u=!1;break}o=!1;t&&(r?r.length&&l(r.shift()):u?t=[]:s.disable())},s={add:function(){if(t){var r=t.length;!function e(r){i.each(r,function(r,u){var f=i.type(u);"function"===f?n.unique&&s.has(u)||t.push(u):u&&u.length&&"string"!==f&&e(u)})}(arguments);o?f=t.length:u&&(c=r,l(u))}return this},remove:function(){return t&&i.each(arguments,function(n,r){for(var u;(u=i.inArray(r,t,u))>-1;)t.splice(u,1),o&&(f>=u&&f--,e>=u&&e--)}),this},has:function(n){return n?i.inArray(n,t)>-1:!(!t||!t.length)},empty:function(){return t=[],f=0,this},disable:function(){return t=r=u=void 0,this},disabled:function(){return!t},lock:function(){return r=void 0,u||s.disable(),this},locked:function(){return!r},fireWith:function(n,i){return!t||h&&!r||(i=i||[],i=[n,i.slice?i.slice():i],o?r.push(i):l(i)),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!h}};return s};i.extend({Deferred:function(n){var u=[["resolve","done",i.Callbacks("once memory"),"resolved"],["reject","fail",i.Callbacks("once memory"),"rejected"],["notify","progress",i.Callbacks("memory")]],f="pending",r={state:function(){return f},always:function(){return t.done(arguments).fail(arguments),this},then:function(){var n=arguments;return i.Deferred(function(f){i.each(u,function(u,e){var o=i.isFunction(n[u])&&n[u];t[e[1]](function(){var n=o&&o.apply(this,arguments);n&&i.isFunction(n.promise)?n.promise().done(f.resolve).fail(f.reject).progress(f.notify):f[e[0]+"With"](this===r?f.promise():this,o?[n]:arguments)})});n=null}).promise()},promise:function(n){return null!=n?i.extend(n,r):r}},t={};return r.pipe=r.then,i.each(u,function(n,i){var e=i[2],o=i[3];r[i[1]]=e.add;o&&e.add(function(){f=o},u[1^n][2].disable,u[2][2].lock);t[i[0]]=function(){return t[i[0]+"With"](this===t?r:this,arguments),this};t[i[0]+"With"]=e.fireWith}),r.promise(t),n&&n.call(t,t),t},when:function(n){var t=0,u=l.call(arguments),r=u.length,e=1!==r||n&&i.isFunction(n.promise)?r:0,f=1===e?n:i.Deferred(),h=function(n,t,i){return function(r){t[n]=this;i[n]=arguments.length>1?l.call(arguments):r;i===o?f.notifyWith(t,i):--e||f.resolveWith(t,i)}},o,c,s;if(r>1)for(o=new Array(r),c=new Array(r),s=new Array(r);r>t;t++)u[t]&&i.isFunction(u[t].promise)?u[t].promise().done(h(t,s,u)).fail(f.reject).progress(h(t,c,o)):--e;return e||f.resolveWith(s,u),f.promise()}});var lt;i.fn.ready=function(n){return i.ready.promise().done(n),this};i.extend({isReady:!1,readyWait:1,holdReady:function(n){n?i.readyWait++:i.ready(!0)},ready:function(n){if(n===!0?!--i.readyWait:!i.isReady){if(!u.body)return setTimeout(i.ready);i.isReady=!0;n!==!0&&--i.readyWait>0||(lt.resolveWith(u,[i]),i.fn.triggerHandler&&(i(u).triggerHandler("ready"),i(u).off("ready")))}}});function ur(){u.addEventListener?(u.removeEventListener("DOMContentLoaded",a,!1),n.removeEventListener("load",a,!1)):(u.detachEvent("onreadystatechange",a),n.detachEvent("onload",a))}function a(){(u.addEventListener||"load"===event.type||"complete"===u.readyState)&&(ur(),i.ready())}i.ready.promise=function(t){if(!lt)if(lt=i.Deferred(),"complete"===u.readyState)setTimeout(i.ready);else if(u.addEventListener)u.addEventListener("DOMContentLoaded",a,!1),n.addEventListener("load",a,!1);else{u.attachEvent("onreadystatechange",a);n.attachEvent("onload",a);var r=!1;try{r=null==n.frameElement&&u.documentElement}catch(e){}r&&r.doScroll&&!function f(){if(!i.isReady){try{r.doScroll("left")}catch(n){return setTimeout(f,50)}ur();i.ready()}}()}return lt.promise(t)};var s="undefined";for(var gf in i(r))break;r.ownLast="0"!==gf;r.inlineBlockNeedsLayout=!1;i(function(){var f,t,n,i;n=u.getElementsByTagName("body")[0];n&&n.style&&(t=u.createElement("div"),i=u.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(t),typeof t.style.zoom!==s&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",r.inlineBlockNeedsLayout=f=3===t.offsetWidth,f&&(n.style.zoom=1)),n.removeChild(i))}),function(){var n=u.createElement("div");if(null==r.deleteExpando){r.deleteExpando=!0;try{delete n.test}catch(t){r.deleteExpando=!1}}n=null}();i.acceptData=function(n){var t=i.noData[(n.nodeName+" ").toLowerCase()],r=+n.nodeType||1;return 1!==r&&9!==r?!1:!t||t!==!0&&n.getAttribute("classid")===t};var ne=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,te=/([A-Z])/g;function fr(n,t,r){if(void 0===r&&1===n.nodeType){var u="data-"+t.replace(te,"-$1").toLowerCase();if(r=n.getAttribute(u),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:ne.test(r)?i.parseJSON(r):r}catch(f){}i.data(n,t,r)}else r=void 0}return r}function ri(n){for(var t in n)if(("data"!==t||!i.isEmptyObject(n[t]))&&"toJSON"!==t)return!1;return!0}function er(n,t,r,u){if(i.acceptData(n)){var s,e,h=i.expando,l=n.nodeType,o=l?i.cache:n,f=l?n[h]:n[h]&&h;if(f&&o[f]&&(u||o[f].data)||void 0!==r||"string"!=typeof t)return f||(f=l?n[h]=c.pop()||i.guid++:h),o[f]||(o[f]=l?{}:{toJSON:i.noop}),("object"==typeof t||"function"==typeof t)&&(u?o[f]=i.extend(o[f],t):o[f].data=i.extend(o[f].data,t)),e=o[f],u||(e.data||(e.data={}),e=e.data),void 0!==r&&(e[i.camelCase(t)]=r),"string"==typeof t?(s=e[t],null==s&&(s=e[i.camelCase(t)])):s=e,s}}function or(n,t,u){if(i.acceptData(n)){var o,s,h=n.nodeType,f=h?i.cache:n,e=h?n[i.expando]:i.expando;if(f[e]){if(t&&(o=u?f[e]:f[e].data)){for(i.isArray(t)?t=t.concat(i.map(t,i.camelCase)):(t in o)?t=[t]:(t=i.camelCase(t),t=(t in o)?[t]:t.split(" ")),s=t.length;s--;)delete o[t[s]];if(u?!ri(o):!i.isEmptyObject(o))return}(u||(delete f[e].data,ri(f[e])))&&(h?i.cleanData([n],!0):r.deleteExpando||f!=f.window?delete f[e]:f[e]=null)}}}i.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(n){return n=n.nodeType?i.cache[n[i.expando]]:n[i.expando],!!n&&!ri(n)},data:function(n,t,i){return er(n,t,i)},removeData:function(n,t){return or(n,t)},_data:function(n,t,i){return er(n,t,i,!0)},_removeData:function(n,t){return or(n,t,!0)}});i.fn.extend({data:function(n,t){var f,u,e,r=this[0],o=r&&r.attributes;if(void 0===n){if(this.length&&(e=i.data(r),1===r.nodeType&&!i._data(r,"parsedAttrs"))){for(f=o.length;f--;)o[f]&&(u=o[f].name,0===u.indexOf("data-")&&(u=i.camelCase(u.slice(5)),fr(r,u,e[u])));i._data(r,"parsedAttrs",!0)}return e}return"object"==typeof n?this.each(function(){i.data(this,n)}):arguments.length>1?this.each(function(){i.data(this,n,t)}):r?fr(r,n,i.data(r,n)):void 0},removeData:function(n){return this.each(function(){i.removeData(this,n)})}});i.extend({queue:function(n,t,r){var u;if(n)return(t=(t||"fx")+"queue",u=i._data(n,t),r&&(!u||i.isArray(r)?u=i._data(n,t,i.makeArray(r)):u.push(r)),u||[])},dequeue:function(n,t){t=t||"fx";var r=i.queue(n,t),e=r.length,u=r.shift(),f=i._queueHooks(n,t),o=function(){i.dequeue(n,t)};"inprogress"===u&&(u=r.shift(),e--);u&&("fx"===t&&r.unshift("inprogress"),delete f.stop,u.call(n,o,f));!e&&f&&f.empty.fire()},_queueHooks:function(n,t){var r=t+"queueHooks";return i._data(n,r)||i._data(n,r,{empty:i.Callbacks("once memory").add(function(){i._removeData(n,t+"queue");i._removeData(n,r)})})}});i.fn.extend({queue:function(n,t){var r=2;return"string"!=typeof n&&(t=n,n="fx",r--),arguments.length<r?i.queue(this[0],n):void 0===t?this:this.each(function(){var r=i.queue(this,n,t);i._queueHooks(this,n);"fx"===n&&"inprogress"!==r[0]&&i.dequeue(this,n)})},dequeue:function(n){return this.each(function(){i.dequeue(this,n)})},clearQueue:function(n){return this.queue(n||"fx",[])},promise:function(n,t){var r,f=1,e=i.Deferred(),u=this,o=this.length,s=function(){--f||e.resolveWith(u,[u])};for("string"!=typeof n&&(t=n,n=void 0),n=n||"fx";o--;)r=i._data(u[o],n+"queueHooks"),r&&r.empty&&(f++,r.empty.add(s));return s(),e.promise(t)}});var at=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,p=["Top","Right","Bottom","Left"],et=function(n,t){return n=t||n,"none"===i.css(n,"display")||!i.contains(n.ownerDocument,n)},w=i.access=function(n,t,r,u,f,e,o){var s=0,c=n.length,h=null==r;if("object"===i.type(r)){f=!0;for(s in r)i.access(n,t,s,r[s],!0,e,o)}else if(void 0!==u&&(f=!0,i.isFunction(u)||(o=!0),h&&(o?(t.call(n,u),t=null):(h=t,t=function(n,t,r){return h.call(i(n),r)})),t))for(;c>s;s++)t(n[s],r,o?u:u.call(n[s],s,t(n[s],r)));return f?n:h?t.call(n):c?t(n[0],r):e},ui=/^(?:checkbox|radio)$/i;!function(){var t=u.createElement("input"),n=u.createElement("div"),i=u.createDocumentFragment();if(n.innerHTML=" <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>",r.leadingWhitespace=3===n.firstChild.nodeType,r.tbody=!n.getElementsByTagName("tbody").length,r.htmlSerialize=!!n.getElementsByTagName("link").length,r.html5Clone="<:nav><\/:nav>"!==u.createElement("nav").cloneNode(!0).outerHTML,t.type="checkbox",t.checked=!0,i.appendChild(t),r.appendChecked=t.checked,n.innerHTML="<textarea>x<\/textarea>",r.noCloneChecked=!!n.cloneNode(!0).lastChild.defaultValue,i.appendChild(n),n.innerHTML="<input type='radio' checked='checked' name='t'/>",r.checkClone=n.cloneNode(!0).cloneNode(!0).lastChild.checked,r.noCloneEvent=!0,n.attachEvent&&(n.attachEvent("onclick",function(){r.noCloneEvent=!1}),n.cloneNode(!0).click()),null==r.deleteExpando){r.deleteExpando=!0;try{delete n.test}catch(f){r.deleteExpando=!1}}}(),function(){var t,i,f=u.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})i="on"+t,(r[t+"Bubbles"]=i in n)||(f.setAttribute(i,"t"),r[t+"Bubbles"]=f.attributes[i].expando===!1);f=null}();var fi=/^(?:input|select|textarea)$/i,ie=/^key/,re=/^(?:mouse|pointer|contextmenu)|click/,sr=/^(?:focusinfocus|focusoutblur)$/,hr=/^([^.]*)(?:\.(.+)|)$/;function vt(){return!0}function it(){return!1}function cr(){try{return u.activeElement}catch(n){}}i.event={global:{},add:function(n,t,r,u,f){var w,y,b,p,o,c,l,a,e,k,d,v=i._data(n);if(v){for(r.handler&&(p=r,r=p.handler,f=p.selector),r.guid||(r.guid=i.guid++),(y=v.events)||(y=v.events={}),(c=v.handle)||(c=v.handle=function(n){if(typeof i!==s&&(!n||i.event.triggered!==n.type))return i.event.dispatch.apply(c.elem,arguments)},c.elem=n),t=(t||"").match(h)||[""],b=t.length;b--;)w=hr.exec(t[b])||[],e=d=w[1],k=(w[2]||"").split(".").sort(),e&&(o=i.event.special[e]||{},e=(f?o.delegateType:o.bindType)||e,o=i.event.special[e]||{},l=i.extend({type:e,origType:d,data:u,handler:r,guid:r.guid,selector:f,needsContext:f&&i.expr.match.needsContext.test(f),namespace:k.join(".")},p),(a=y[e])||(a=y[e]=[],a.delegateCount=0,o.setup&&o.setup.call(n,u,k,c)!==!1||(n.addEventListener?n.addEventListener(e,c,!1):n.attachEvent&&n.attachEvent("on"+e,c))),o.add&&(o.add.call(n,l),l.handler.guid||(l.handler.guid=r.guid)),f?a.splice(a.delegateCount++,0,l):a.push(l),i.event.global[e]=!0);n=null}},remove:function(n,t,r,u,f){var y,o,s,b,p,a,c,l,e,w,k,v=i.hasData(n)&&i._data(n);if(v&&(a=v.events)){for(t=(t||"").match(h)||[""],p=t.length;p--;)if(s=hr.exec(t[p])||[],e=k=s[1],w=(s[2]||"").split(".").sort(),e){for(c=i.event.special[e]||{},e=(u?c.delegateType:c.bindType)||e,l=a[e]||[],s=s[2]&&new RegExp("(^|\\.)"+w.join("\\.(?:.*\\.|)")+"(\\.|$)"),b=y=l.length;y--;)o=l[y],!f&&k!==o.origType||r&&r.guid!==o.guid||s&&!s.test(o.namespace)||u&&u!==o.selector&&("**"!==u||!o.selector)||(l.splice(y,1),o.selector&&l.delegateCount--,c.remove&&c.remove.call(n,o));b&&!l.length&&(c.teardown&&c.teardown.call(n,w,v.handle)!==!1||i.removeEvent(n,e,v.handle),delete a[e])}else for(e in a)i.event.remove(n,e+t[p],r,u,!0);i.isEmptyObject(a)&&(delete v.handle,i._removeData(n,"events"))}},trigger:function(t,r,f,e){var l,a,o,p,c,h,w,y=[f||u],s=nt.call(t,"type")?t.type:t,v=nt.call(t,"namespace")?t.namespace.split("."):[];if(o=h=f=f||u,3!==f.nodeType&&8!==f.nodeType&&!sr.test(s+i.event.triggered)&&(s.indexOf(".")>=0&&(v=s.split("."),s=v.shift(),v.sort()),a=s.indexOf(":")<0&&"on"+s,t=t[i.expando]?t:new i.Event(s,"object"==typeof t&&t),t.isTrigger=e?2:3,t.namespace=v.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=f),r=null==r?[t]:i.makeArray(r,[t]),c=i.event.special[s]||{},e||!c.trigger||c.trigger.apply(f,r)!==!1)){if(!e&&!c.noBubble&&!i.isWindow(f)){for(p=c.delegateType||s,sr.test(p+s)||(o=o.parentNode);o;o=o.parentNode)y.push(o),h=o;h===(f.ownerDocument||u)&&y.push(h.defaultView||h.parentWindow||n)}for(w=0;(o=y[w++])&&!t.isPropagationStopped();)t.type=w>1?p:c.bindType||s,l=(i._data(o,"events")||{})[t.type]&&i._data(o,"handle"),l&&l.apply(o,r),l=a&&o[a],l&&l.apply&&i.acceptData(o)&&(t.result=l.apply(o,r),t.result===!1&&t.preventDefault());if(t.type=s,!e&&!t.isDefaultPrevented()&&(!c._default||c._default.apply(y.pop(),r)===!1)&&i.acceptData(f)&&a&&f[s]&&!i.isWindow(f)){h=f[a];h&&(f[a]=null);i.event.triggered=s;try{f[s]()}catch(b){}i.event.triggered=void 0;h&&(f[a]=h)}return t.result}},dispatch:function(n){n=i.event.fix(n);var e,f,t,r,o,s=[],h=l.call(arguments),c=(i._data(this,"events")||{})[n.type]||[],u=i.event.special[n.type]||{};if(h[0]=n,n.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,n)!==!1){for(s=i.event.handlers.call(this,n,c),e=0;(r=s[e++])&&!n.isPropagationStopped();)for(n.currentTarget=r.elem,o=0;(t=r.handlers[o++])&&!n.isImmediatePropagationStopped();)(!n.namespace_re||n.namespace_re.test(t.namespace))&&(n.handleObj=t,n.data=t.data,f=((i.event.special[t.origType]||{}).handle||t.handler).apply(r.elem,h),void 0!==f&&(n.result=f)===!1&&(n.preventDefault(),n.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,n),n.result}},handlers:function(n,t){var f,e,u,o,h=[],s=t.delegateCount,r=n.target;if(s&&r.nodeType&&(!n.button||"click"!==n.type))for(;r!=this;r=r.parentNode||this)if(1===r.nodeType&&(r.disabled!==!0||"click"!==n.type)){for(u=[],o=0;s>o;o++)e=t[o],f=e.selector+" ",void 0===u[f]&&(u[f]=e.needsContext?i(f,this).index(r)>=0:i.find(f,this,null,[r]).length),u[f]&&u.push(e);u.length&&h.push({elem:r,handlers:u})}return s<t.length&&h.push({elem:this,handlers:t.slice(s)}),h},fix:function(n){if(n[i.expando])return n;var e,o,s,r=n.type,f=n,t=this.fixHooks[r];for(t||(this.fixHooks[r]=t=re.test(r)?this.mouseHooks:ie.test(r)?this.keyHooks:{}),s=t.props?this.props.concat(t.props):this.props,n=new i.Event(f),e=s.length;e--;)o=s[e],n[o]=f[o];return n.target||(n.target=f.srcElement||u),3===n.target.nodeType&&(n.target=n.target.parentNode),n.metaKey=!!n.metaKey,t.filter?t.filter(n,f):n},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(n,t){return null==n.which&&(n.which=null!=t.charCode?t.charCode:t.keyCode),n}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(n,t){var i,e,r,f=t.button,o=t.fromElement;return null==n.pageX&&null!=t.clientX&&(e=n.target.ownerDocument||u,r=e.documentElement,i=e.body,n.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),n.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),!n.relatedTarget&&o&&(n.relatedTarget=o===n.target?t.toElement:o),n.which||void 0===f||(n.which=1&f?1:2&f?3:4&f?2:0),n}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cr()&&this.focus)try{return this.focus(),!1}catch(n){}},delegateType:"focusin"},blur:{trigger:function(){if(this===cr()&&this.blur)return(this.blur(),!1)},delegateType:"focusout"},click:{trigger:function(){if(i.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return(this.click(),!1)},_default:function(n){return i.nodeName(n.target,"a")}},beforeunload:{postDispatch:function(n){void 0!==n.result&&n.originalEvent&&(n.originalEvent.returnValue=n.result)}}},simulate:function(n,t,r,u){var f=i.extend(new i.Event,r,{type:n,isSimulated:!0,originalEvent:{}});u?i.event.trigger(f,null,t):i.event.dispatch.call(t,f);f.isDefaultPrevented()&&r.preventDefault()}};i.removeEvent=u.removeEventListener?function(n,t,i){n.removeEventListener&&n.removeEventListener(t,i,!1)}:function(n,t,i){var r="on"+t;n.detachEvent&&(typeof n[r]===s&&(n[r]=null),n.detachEvent(r,i))};i.Event=function(n,t){return this instanceof i.Event?(n&&n.type?(this.originalEvent=n,this.type=n.type,this.isDefaultPrevented=n.defaultPrevented||void 0===n.defaultPrevented&&n.returnValue===!1?vt:it):this.type=n,t&&i.extend(this,t),this.timeStamp=n&&n.timeStamp||i.now(),void(this[i.expando]=!0)):new i.Event(n,t)};i.Event.prototype={isDefaultPrevented:it,isPropagationStopped:it,isImmediatePropagationStopped:it,preventDefault:function(){var n=this.originalEvent;this.isDefaultPrevented=vt;n&&(n.preventDefault?n.preventDefault():n.returnValue=!1)},stopPropagation:function(){var n=this.originalEvent;this.isPropagationStopped=vt;n&&(n.stopPropagation&&n.stopPropagation(),n.cancelBubble=!0)},stopImmediatePropagation:function(){var n=this.originalEvent;this.isImmediatePropagationStopped=vt;n&&n.stopImmediatePropagation&&n.stopImmediatePropagation();this.stopPropagation()}};i.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(n,t){i.event.special[n]={delegateType:t,bindType:t,handle:function(n){var u,f=this,r=n.relatedTarget,e=n.handleObj;return(!r||r!==f&&!i.contains(f,r))&&(n.type=e.origType,u=e.handler.apply(this,arguments),n.type=t),u}}});r.submitBubbles||(i.event.special.submit={setup:function(){return i.nodeName(this,"form")?!1:void i.event.add(this,"click._submit keypress._submit",function(n){var r=n.target,t=i.nodeName(r,"input")||i.nodeName(r,"button")?r.form:void 0;t&&!i._data(t,"submitBubbles")&&(i.event.add(t,"submit._submit",function(n){n._submit_bubble=!0}),i._data(t,"submitBubbles",!0))})},postDispatch:function(n){n._submit_bubble&&(delete n._submit_bubble,this.parentNode&&!n.isTrigger&&i.event.simulate("submit",this.parentNode,n,!0))},teardown:function(){return i.nodeName(this,"form")?!1:void i.event.remove(this,"._submit")}});r.changeBubbles||(i.event.special.change={setup:function(){return fi.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(i.event.add(this,"propertychange._change",function(n){"checked"===n.originalEvent.propertyName&&(this._just_changed=!0)}),i.event.add(this,"click._change",function(n){this._just_changed&&!n.isTrigger&&(this._just_changed=!1);i.event.simulate("change",this,n,!0)})),!1):void i.event.add(this,"beforeactivate._change",function(n){var t=n.target;fi.test(t.nodeName)&&!i._data(t,"changeBubbles")&&(i.event.add(t,"change._change",function(n){!this.parentNode||n.isSimulated||n.isTrigger||i.event.simulate("change",this.parentNode,n,!0)}),i._data(t,"changeBubbles",!0))})},handle:function(n){var t=n.target;if(this!==t||n.isSimulated||n.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return n.handleObj.handler.apply(this,arguments)},teardown:function(){return i.event.remove(this,"._change"),!fi.test(this.nodeName)}});r.focusinBubbles||i.each({focus:"focusin",blur:"focusout"},function(n,t){var r=function(n){i.event.simulate(t,n.target,i.event.fix(n),!0)};i.event.special[t]={setup:function(){var u=this.ownerDocument||this,f=i._data(u,t);f||u.addEventListener(n,r,!0);i._data(u,t,(f||0)+1)},teardown:function(){var u=this.ownerDocument||this,f=i._data(u,t)-1;f?i._data(u,t,f):(u.removeEventListener(n,r,!0),i._removeData(u,t))}}});i.fn.extend({on:function(n,t,r,u,f){var o,e;if("object"==typeof n){"string"!=typeof t&&(r=r||t,t=void 0);for(o in n)this.on(o,t,r,n[o],f);return this}if(null==r&&null==u?(u=t,r=t=void 0):null==u&&("string"==typeof t?(u=r,r=void 0):(u=r,r=t,t=void 0)),u===!1)u=it;else if(!u)return this;return 1===f&&(e=u,u=function(n){return i().off(n),e.apply(this,arguments)},u.guid=e.guid||(e.guid=i.guid++)),this.each(function(){i.event.add(this,n,u,r,t)})},one:function(n,t,i,r){return this.on(n,t,i,r,1)},off:function(n,t,r){var u,f;if(n&&n.preventDefault&&n.handleObj)return u=n.handleObj,i(n.delegateTarget).off(u.namespace?u.origType+"."+u.namespace:u.origType,u.selector,u.handler),this;if("object"==typeof n){for(f in n)this.off(f,t,n[f]);return this}return(t===!1||"function"==typeof t)&&(r=t,t=void 0),r===!1&&(r=it),this.each(function(){i.event.remove(this,n,r,t)})},trigger:function(n,t){return this.each(function(){i.event.trigger(n,t,this)})},triggerHandler:function(n,t){var r=this[0];if(r)return i.event.trigger(n,t,r,!0)}});function lr(n){var i=ar.split("|"),t=n.createDocumentFragment();if(t.createElement)while(i.length)t.createElement(i.pop());return t}var ar="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ue=/ jQuery\d+="(?:null|\d+)"/g,vr=new RegExp("<(?:"+ar+")[\\s/>]","i"),ei=/^\s+/,yr=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,pr=/<([\w:]+)/,wr=/<tbody/i,fe=/<|&#?\w+;/,ee=/<(?:script|style|link)/i,oe=/checked\s*(?:[^=]|=\s*.checked.)/i,br=/^$|\/(?:java|ecma)script/i,se=/^true\/(.*)/,he=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,o={option:[1,"<select multiple='multiple'>","<\/select>"],legend:[1,"<fieldset>","<\/fieldset>"],area:[1,"<map>","<\/map>"],param:[1,"<object>","<\/object>"],thead:[1,"<table>","<\/table>"],tr:[2,"<table><tbody>","<\/tbody><\/table>"],col:[2,"<table><tbody><\/tbody><colgroup>","<\/colgroup><\/table>"],td:[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],_default:r.htmlSerialize?[0,"",""]:[1,"X<div>","<\/div>"]},ce=lr(u),oi=ce.appendChild(u.createElement("div"));o.optgroup=o.option;o.tbody=o.tfoot=o.colgroup=o.caption=o.thead;o.th=o.td;function f(n,t){var e,u,o=0,r=typeof n.getElementsByTagName!==s?n.getElementsByTagName(t||"*"):typeof n.querySelectorAll!==s?n.querySelectorAll(t||"*"):void 0;if(!r)for(r=[],e=n.childNodes||n;null!=(u=e[o]);o++)!t||i.nodeName(u,t)?r.push(u):i.merge(r,f(u,t));return void 0===t||t&&i.nodeName(n,t)?i.merge([n],r):r}function le(n){ui.test(n.type)&&(n.defaultChecked=n.checked)}function kr(n,t){return i.nodeName(n,"table")&&i.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?n.getElementsByTagName("tbody")[0]||n.appendChild(n.ownerDocument.createElement("tbody")):n}function dr(n){return n.type=(null!==i.find.attr(n,"type"))+"/"+n.type,n}function gr(n){var t=se.exec(n.type);return t?n.type=t[1]:n.removeAttribute("type"),n}function si(n,t){for(var u,r=0;null!=(u=n[r]);r++)i._data(u,"globalEval",!t||i._data(t[r],"globalEval"))}function nu(n,t){if(1===t.nodeType&&i.hasData(n)){var u,f,o,s=i._data(n),r=i._data(t,s),e=s.events;if(e){delete r.handle;r.events={};for(u in e)for(f=0,o=e[u].length;o>f;f++)i.event.add(t,u,e[u][f])}r.data&&(r.data=i.extend({},r.data))}}function ae(n,t){var u,e,f;if(1===t.nodeType){if(u=t.nodeName.toLowerCase(),!r.noCloneEvent&&t[i.expando]){f=i._data(t);for(e in f.events)i.removeEvent(t,e,f.handle);t.removeAttribute(i.expando)}"script"===u&&t.text!==n.text?(dr(t).text=n.text,gr(t)):"object"===u?(t.parentNode&&(t.outerHTML=n.outerHTML),r.html5Clone&&n.innerHTML&&!i.trim(t.innerHTML)&&(t.innerHTML=n.innerHTML)):"input"===u&&ui.test(n.type)?(t.defaultChecked=t.checked=n.checked,t.value!==n.value&&(t.value=n.value)):"option"===u?t.defaultSelected=t.selected=n.defaultSelected:("input"===u||"textarea"===u)&&(t.defaultValue=n.defaultValue)}}i.extend({clone:function(n,t,u){var e,c,s,o,h,l=i.contains(n.ownerDocument,n);if(r.html5Clone||i.isXMLDoc(n)||!vr.test("<"+n.nodeName+">")?s=n.cloneNode(!0):(oi.innerHTML=n.outerHTML,oi.removeChild(s=oi.firstChild)),!(r.noCloneEvent&&r.noCloneChecked||1!==n.nodeType&&11!==n.nodeType||i.isXMLDoc(n)))for(e=f(s),h=f(n),o=0;null!=(c=h[o]);++o)e[o]&&ae(c,e[o]);if(t)if(u)for(h=h||f(n),e=e||f(s),o=0;null!=(c=h[o]);o++)nu(c,e[o]);else nu(n,s);return e=f(s,"script"),e.length>0&&si(e,!l&&f(n,"script")),e=h=c=null,s},buildFragment:function(n,t,u,e){for(var c,s,b,h,p,w,a,k=n.length,v=lr(t),l=[],y=0;k>y;y++)if(s=n[y],s||0===s)if("object"===i.type(s))i.merge(l,s.nodeType?[s]:s);else if(fe.test(s)){for(h=h||v.appendChild(t.createElement("div")),p=(pr.exec(s)||["",""])[1].toLowerCase(),a=o[p]||o._default,h.innerHTML=a[1]+s.replace(yr,"<$1><\/$2>")+a[2],c=a[0];c--;)h=h.lastChild;if(!r.leadingWhitespace&&ei.test(s)&&l.push(t.createTextNode(ei.exec(s)[0])),!r.tbody)for(s="table"!==p||wr.test(s)?"<table>"!==a[1]||wr.test(s)?0:h:h.firstChild,c=s&&s.childNodes.length;c--;)i.nodeName(w=s.childNodes[c],"tbody")&&!w.childNodes.length&&s.removeChild(w);for(i.merge(l,h.childNodes),h.textContent="";h.firstChild;)h.removeChild(h.firstChild);h=v.lastChild}else l.push(t.createTextNode(s));for(h&&v.removeChild(h),r.appendChecked||i.grep(f(l,"input"),le),y=0;s=l[y++];)if((!e||-1===i.inArray(s,e))&&(b=i.contains(s.ownerDocument,s),h=f(v.appendChild(s),"script"),b&&si(h),u))for(c=0;s=h[c++];)br.test(s.type||"")&&u.push(s);return h=null,v},cleanData:function(n,t){for(var u,e,f,o,a=0,h=i.expando,l=i.cache,v=r.deleteExpando,y=i.event.special;null!=(u=n[a]);a++)if((t||i.acceptData(u))&&(f=u[h],o=f&&l[f])){if(o.events)for(e in o.events)y[e]?i.event.remove(u,e):i.removeEvent(u,e,o.handle);l[f]&&(delete l[f],v?delete u[h]:typeof u.removeAttribute!==s?u.removeAttribute(h):u[h]=null,c.push(f))}}});i.fn.extend({text:function(n){return w(this,function(n){return void 0===n?i.text(this):this.empty().append((this[0]&&this[0].ownerDocument||u).createTextNode(n))},null,n,arguments.length)},append:function(){return this.domManip(arguments,function(n){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=kr(this,n);t.appendChild(n)}})},prepend:function(){return this.domManip(arguments,function(n){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=kr(this,n);t.insertBefore(n,t.firstChild)}})},before:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this)})},after:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling)})},remove:function(n,t){for(var r,e=n?i.filter(n,this):this,u=0;null!=(r=e[u]);u++)t||1!==r.nodeType||i.cleanData(f(r)),r.parentNode&&(t&&i.contains(r.ownerDocument,r)&&si(f(r,"script")),r.parentNode.removeChild(r));return this},empty:function(){for(var n,t=0;null!=(n=this[t]);t++){for(1===n.nodeType&&i.cleanData(f(n,!1));n.firstChild;)n.removeChild(n.firstChild);n.options&&i.nodeName(n,"select")&&(n.options.length=0)}return this},clone:function(n,t){return n=null==n?!1:n,t=null==t?n:t,this.map(function(){return i.clone(this,n,t)})},html:function(n){return w(this,function(n){var t=this[0]||{},u=0,e=this.length;if(void 0===n)return 1===t.nodeType?t.innerHTML.replace(ue,""):void 0;if(!("string"!=typeof n||ee.test(n)||!r.htmlSerialize&&vr.test(n)||!r.leadingWhitespace&&ei.test(n)||o[(pr.exec(n)||["",""])[1].toLowerCase()])){n=n.replace(yr,"<$1><\/$2>");try{for(;e>u;u++)t=this[u]||{},1===t.nodeType&&(i.cleanData(f(t,!1)),t.innerHTML=n);t=0}catch(s){}}t&&this.empty().append(n)},null,n,arguments.length)},replaceWith:function(){var n=arguments[0];return this.domManip(arguments,function(t){n=this.parentNode;i.cleanData(f(this));n&&n.replaceChild(t,this)}),n&&(n.length||n.nodeType)?this:this.remove()},detach:function(n){return this.remove(n,!0)},domManip:function(n,t){n=ki.apply([],n);var h,u,c,o,v,s,e=0,l=this.length,p=this,w=l-1,a=n[0],y=i.isFunction(a);if(y||l>1&&"string"==typeof a&&!r.checkClone&&oe.test(a))return this.each(function(i){var r=p.eq(i);y&&(n[0]=a.call(this,i,r.html()));r.domManip(n,t)});if(l&&(s=i.buildFragment(n,this[0].ownerDocument,!1,this),h=s.firstChild,1===s.childNodes.length&&(s=h),h)){for(o=i.map(f(s,"script"),dr),c=o.length;l>e;e++)u=s,e!==w&&(u=i.clone(u,!0,!0),c&&i.merge(o,f(u,"script"))),t.call(this[e],u,e);if(c)for(v=o[o.length-1].ownerDocument,i.map(o,gr),e=0;c>e;e++)u=o[e],br.test(u.type||"")&&!i._data(u,"globalEval")&&i.contains(v,u)&&(u.src?i._evalUrl&&i._evalUrl(u.src):i.globalEval((u.text||u.textContent||u.innerHTML||"").replace(he,"")));s=h=null}return this}});i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,t){i.fn[n]=function(n){for(var u,r=0,f=[],e=i(n),o=e.length-1;o>=r;r++)u=r===o?this:this.clone(!0),i(e[r])[t](u),ni.apply(f,u.get());return this.pushStack(f)}});var ot,tu={};function iu(t,r){var f,u=i(r.createElement(t)).appendTo(r.body),e=n.getDefaultComputedStyle&&(f=n.getDefaultComputedStyle(u[0]))?f.display:i.css(u[0],"display");return u.detach(),e}function yt(n){var r=u,t=tu[n];return t||(t=iu(n,r),"none"!==t&&t||(ot=(ot||i("<iframe frameborder='0' width='0' height='0'/>")).appendTo(r.documentElement),r=(ot[0].contentWindow||ot[0].contentDocument).document,r.write(),r.close(),t=iu(n,r),ot.detach()),tu[n]=t),t}!function(){var n;r.shrinkWrapBlocks=function(){if(null!=n)return n;n=!1;var t,i,r;return i=u.getElementsByTagName("body")[0],i&&i.style?(t=u.createElement("div"),r=u.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(r).appendChild(t),typeof t.style.zoom!==s&&(t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",t.appendChild(u.createElement("div")).style.width="5px",n=3!==t.offsetWidth),i.removeChild(r),n):void 0}}();var ru=/^margin/,pt=new RegExp("^("+at+")(?!px)[a-z%]+$","i"),b,k,ve=/^(top|right|bottom|left)$/;n.getComputedStyle?(b=function(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)},k=function(n,t,r){var e,o,s,u,f=n.style;return r=r||b(n),u=r?r.getPropertyValue(t)||r[t]:void 0,r&&(""!==u||i.contains(n.ownerDocument,n)||(u=i.style(n,t)),pt.test(u)&&ru.test(t)&&(e=f.width,o=f.minWidth,s=f.maxWidth,f.minWidth=f.maxWidth=f.width=u,u=r.width,f.width=e,f.minWidth=o,f.maxWidth=s)),void 0===u?u:u+""}):u.documentElement.currentStyle&&(b=function(n){return n.currentStyle},k=function(n,t,i){var o,f,e,r,u=n.style;return i=i||b(n),r=i?i[t]:void 0,null==r&&u&&u[t]&&(r=u[t]),pt.test(r)&&!ve.test(t)&&(o=u.left,f=n.runtimeStyle,e=f&&f.left,e&&(f.left=n.currentStyle.left),u.left="fontSize"===t?"1em":r,r=u.pixelLeft+"px",u.left=o,e&&(f.left=e)),void 0===r?r:r+""||"auto"});function uu(n,t){return{get:function(){var i=n();if(null!=i)return i?void delete this.get:(this.get=t).apply(this,arguments)}}}!function(){var f,t,l,o,s,e,h;if(f=u.createElement("div"),f.innerHTML=" <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>",l=f.getElementsByTagName("a")[0],t=l&&l.style){t.cssText="float:left;opacity:.5";r.opacity="0.5"===t.opacity;r.cssFloat=!!t.cssFloat;f.style.backgroundClip="content-box";f.cloneNode(!0).style.backgroundClip="";r.clearCloneStyle="content-box"===f.style.backgroundClip;r.boxSizing=""===t.boxSizing||""===t.MozBoxSizing||""===t.WebkitBoxSizing;i.extend(r,{reliableHiddenOffsets:function(){return null==e&&c(),e},boxSizingReliable:function(){return null==s&&c(),s},pixelPosition:function(){return null==o&&c(),o},reliableMarginRight:function(){return null==h&&c(),h}});function c(){var i,r,f,t;r=u.getElementsByTagName("body")[0];r&&r.style&&(i=u.createElement("div"),f=u.createElement("div"),f.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",r.appendChild(f).appendChild(i),i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o=s=!1,h=!0,n.getComputedStyle&&(o="1%"!==(n.getComputedStyle(i,null)||{}).top,s="4px"===(n.getComputedStyle(i,null)||{width:"4px"}).width,t=i.appendChild(u.createElement("div")),t.style.cssText=i.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",i.style.width="1px",h=!parseFloat((n.getComputedStyle(t,null)||{}).marginRight)),i.innerHTML="<table><tr><td><\/td><td>t<\/td><\/tr><\/table>",t=i.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",e=0===t[0].offsetHeight,e&&(t[0].style.display="",t[1].style.display="none",e=0===t[0].offsetHeight),r.removeChild(f))}}}();i.swap=function(n,t,i,r){var f,u,e={};for(u in t)e[u]=n.style[u],n.style[u]=t[u];f=i.apply(n,r||[]);for(u in t)n.style[u]=e[u];return f};var hi=/alpha\([^)]*\)/i,ye=/opacity\s*=\s*([^)]*)/,pe=/^(none|table(?!-c[ea]).+)/,we=new RegExp("^("+at+")(.*)$","i"),be=new RegExp("^([+-])=("+at+")","i"),ke={position:"absolute",visibility:"hidden",display:"block"},fu={letterSpacing:"0",fontWeight:"400"},eu=["Webkit","O","Moz","ms"];function ou(n,t){if(t in n)return t;for(var r=t.charAt(0).toUpperCase()+t.slice(1),u=t,i=eu.length;i--;)if(t=eu[i]+r,t in n)return t;return u}function su(n,t){for(var f,r,o,e=[],u=0,s=n.length;s>u;u++)r=n[u],r.style&&(e[u]=i._data(r,"olddisplay"),f=r.style.display,t?(e[u]||"none"!==f||(r.style.display=""),""===r.style.display&&et(r)&&(e[u]=i._data(r,"olddisplay",yt(r.nodeName)))):(o=et(r),(f&&"none"!==f||!o)&&i._data(r,"olddisplay",o?f:i.css(r,"display"))));for(u=0;s>u;u++)r=n[u],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?e[u]||"":"none"));return n}function hu(n,t,i){var r=we.exec(t);return r?Math.max(0,r[1]-(i||0))+(r[2]||"px"):t}function cu(n,t,r,u,f){for(var e=r===(u?"border":"content")?4:"width"===t?1:0,o=0;4>e;e+=2)"margin"===r&&(o+=i.css(n,r+p[e],!0,f)),u?("content"===r&&(o-=i.css(n,"padding"+p[e],!0,f)),"margin"!==r&&(o-=i.css(n,"border"+p[e]+"Width",!0,f))):(o+=i.css(n,"padding"+p[e],!0,f),"padding"!==r&&(o+=i.css(n,"border"+p[e]+"Width",!0,f)));return o}function lu(n,t,u){var o=!0,f="width"===t?n.offsetWidth:n.offsetHeight,e=b(n),s=r.boxSizing&&"border-box"===i.css(n,"boxSizing",!1,e);if(0>=f||null==f){if(f=k(n,t,e),(0>f||null==f)&&(f=n.style[t]),pt.test(f))return f;o=s&&(r.boxSizingReliable()||f===n.style[t]);f=parseFloat(f)||0}return f+cu(n,t,u||(s?"border":"content"),o,e)+"px"}i.extend({cssHooks:{opacity:{get:function(n,t){if(t){var i=k(n,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:r.cssFloat?"cssFloat":"styleFloat"},style:function(n,t,u,f){if(n&&3!==n.nodeType&&8!==n.nodeType&&n.style){var o,h,e,s=i.camelCase(t),c=n.style;if(t=i.cssProps[s]||(i.cssProps[s]=ou(c,s)),e=i.cssHooks[t]||i.cssHooks[s],void 0===u)return e&&"get"in e&&void 0!==(o=e.get(n,!1,f))?o:c[t];if(h=typeof u,"string"===h&&(o=be.exec(u))&&(u=(o[1]+1)*o[2]+parseFloat(i.css(n,t)),h="number"),null!=u&&u===u&&("number"!==h||i.cssNumber[s]||(u+="px"),r.clearCloneStyle||""!==u||0!==t.indexOf("background")||(c[t]="inherit"),!(e&&"set"in e&&void 0===(u=e.set(n,u,f)))))try{c[t]=u}catch(l){}}},css:function(n,t,r,u){var s,f,e,o=i.camelCase(t);return t=i.cssProps[o]||(i.cssProps[o]=ou(n.style,o)),e=i.cssHooks[t]||i.cssHooks[o],e&&"get"in e&&(f=e.get(n,!0,r)),void 0===f&&(f=k(n,t,u)),"normal"===f&&t in fu&&(f=fu[t]),""===r||r?(s=parseFloat(f),r===!0||i.isNumeric(s)?s||0:f):f}});i.each(["height","width"],function(n,t){i.cssHooks[t]={get:function(n,r,u){if(r)return pe.test(i.css(n,"display"))&&0===n.offsetWidth?i.swap(n,ke,function(){return lu(n,t,u)}):lu(n,t,u)},set:function(n,u,f){var e=f&&b(n);return hu(n,u,f?cu(n,t,f,r.boxSizing&&"border-box"===i.css(n,"boxSizing",!1,e),e):0)}}});r.opacity||(i.cssHooks.opacity={get:function(n,t){return ye.test((t&&n.currentStyle?n.currentStyle.filter:n.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(n,t){var r=n.style,u=n.currentStyle,e=i.isNumeric(t)?"alpha(opacity="+100*t+")":"",f=u&&u.filter||r.filter||"";r.zoom=1;(t>=1||""===t)&&""===i.trim(f.replace(hi,""))&&r.removeAttribute&&(r.removeAttribute("filter"),""===t||u&&!u.filter)||(r.filter=hi.test(f)?f.replace(hi,e):f+" "+e)}});i.cssHooks.marginRight=uu(r.reliableMarginRight,function(n,t){if(t)return i.swap(n,{display:"inline-block"},k,[n,"marginRight"])});i.each({margin:"",padding:"",border:"Width"},function(n,t){i.cssHooks[n+t]={expand:function(i){for(var r=0,f={},u="string"==typeof i?i.split(" "):[i];4>r;r++)f[n+p[r]+t]=u[r]||u[r-2]||u[0];return f}};ru.test(n)||(i.cssHooks[n+t].set=hu)});i.fn.extend({css:function(n,t){return w(this,function(n,t,r){var f,e,o={},u=0;if(i.isArray(t)){for(f=b(n),e=t.length;e>u;u++)o[t[u]]=i.css(n,t[u],!1,f);return o}return void 0!==r?i.style(n,t,r):i.css(n,t)},n,t,arguments.length>1)},show:function(){return su(this,!0)},hide:function(){return su(this)},toggle:function(n){return"boolean"==typeof n?n?this.show():this.hide():this.each(function(){et(this)?i(this).show():i(this).hide()})}});function e(n,t,i,r,u){return new e.prototype.init(n,t,i,r,u)}i.Tween=e;e.prototype={constructor:e,init:function(n,t,r,u,f,e){this.elem=n;this.prop=r;this.easing=f||"swing";this.options=t;this.start=this.now=this.cur();this.end=u;this.unit=e||(i.cssNumber[r]?"":"px")},cur:function(){var n=e.propHooks[this.prop];return n&&n.get?n.get(this):e.propHooks._default.get(this)},run:function(n){var r,t=e.propHooks[this.prop];return this.pos=r=this.options.duration?i.easing[this.easing](n,this.options.duration*n,0,1,this.options.duration):n,this.now=(this.end-this.start)*r+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),t&&t.set?t.set(this):e.propHooks._default.set(this),this}};e.prototype.init.prototype=e.prototype;e.propHooks={_default:{get:function(n){var t;return null==n.elem[n.prop]||n.elem.style&&null!=n.elem.style[n.prop]?(t=i.css(n.elem,n.prop,""),t&&"auto"!==t?t:0):n.elem[n.prop]},set:function(n){i.fx.step[n.prop]?i.fx.step[n.prop](n):n.elem.style&&(null!=n.elem.style[i.cssProps[n.prop]]||i.cssHooks[n.prop])?i.style(n.elem,n.prop,n.now+n.unit):n.elem[n.prop]=n.now}}};e.propHooks.scrollTop=e.propHooks.scrollLeft={set:function(n){n.elem.nodeType&&n.elem.parentNode&&(n.elem[n.prop]=n.now)}};i.easing={linear:function(n){return n},swing:function(n){return.5-Math.cos(n*Math.PI)/2}};i.fx=e.prototype.init;i.fx.step={};var rt,wt,de=/^(?:toggle|show|hide)$/,au=new RegExp("^(?:([+-])=|)("+at+")([a-z%]*)$","i"),ge=/queueHooks$/,bt=[no],st={"*":[function(n,t){var f=this.createTween(n,t),s=f.cur(),r=au.exec(t),e=r&&r[3]||(i.cssNumber[n]?"":"px"),u=(i.cssNumber[n]||"px"!==e&&+s)&&au.exec(i.css(f.elem,n)),o=1,h=20;if(u&&u[3]!==e){e=e||u[3];r=r||[];u=+s||1;do o=o||".5",u/=o,i.style(f.elem,n,u+e);while(o!==(o=f.cur()/s)&&1!==o&&--h)}return r&&(u=f.start=+u||+s||0,f.unit=e,f.end=r[1]?u+(r[1]+1)*r[2]:+r[2]),f}]};function vu(){return setTimeout(function(){rt=void 0}),rt=i.now()}function kt(n,t){var r,i={height:n},u=0;for(t=t?1:0;4>u;u+=2-t)r=p[u],i["margin"+r]=i["padding"+r]=n;return t&&(i.opacity=i.width=n),i}function yu(n,t,i){for(var u,f=(st[t]||[]).concat(st["*"]),r=0,e=f.length;e>r;r++)if(u=f[r].call(i,t,n))return u}function no(n,t,u){var f,a,p,v,s,w,h,b,l=this,y={},o=n.style,c=n.nodeType&&et(n),e=i._data(n,"fxshow");u.queue||(s=i._queueHooks(n,"fx"),null==s.unqueued&&(s.unqueued=0,w=s.empty.fire,s.empty.fire=function(){s.unqueued||w()}),s.unqueued++,l.always(function(){l.always(function(){s.unqueued--;i.queue(n,"fx").length||s.empty.fire()})}));1===n.nodeType&&("height"in t||"width"in t)&&(u.overflow=[o.overflow,o.overflowX,o.overflowY],h=i.css(n,"display"),b="none"===h?i._data(n,"olddisplay")||yt(n.nodeName):h,"inline"===b&&"none"===i.css(n,"float")&&(r.inlineBlockNeedsLayout&&"inline"!==yt(n.nodeName)?o.zoom=1:o.display="inline-block"));u.overflow&&(o.overflow="hidden",r.shrinkWrapBlocks()||l.always(function(){o.overflow=u.overflow[0];o.overflowX=u.overflow[1];o.overflowY=u.overflow[2]}));for(f in t)if(a=t[f],de.exec(a)){if(delete t[f],p=p||"toggle"===a,a===(c?"hide":"show")){if("show"!==a||!e||void 0===e[f])continue;c=!0}y[f]=e&&e[f]||i.style(n,f)}else h=void 0;if(i.isEmptyObject(y))"inline"===("none"===h?yt(n.nodeName):h)&&(o.display=h);else{e?"hidden"in e&&(c=e.hidden):e=i._data(n,"fxshow",{});p&&(e.hidden=!c);c?i(n).show():l.done(function(){i(n).hide()});l.done(function(){var t;i._removeData(n,"fxshow");for(t in y)i.style(n,t,y[t])});for(f in y)v=yu(c?e[f]:0,f,l),f in e||(e[f]=v.start,c&&(v.end=v.start,v.start="width"===f||"height"===f?1:0))}}function to(n,t){var r,f,e,u,o;for(r in n)if(f=i.camelCase(r),e=t[f],u=n[r],i.isArray(u)&&(e=u[1],u=n[r]=u[0]),r!==f&&(n[f]=u,delete n[r]),o=i.cssHooks[f],o&&"expand"in o){u=o.expand(u);delete n[f];for(r in u)r in n||(n[r]=u[r],t[r]=e)}else t[f]=e}function pu(n,t,r){var h,e,o=0,l=bt.length,f=i.Deferred().always(function(){delete c.elem}),c=function(){if(e)return!1;for(var s=rt||vu(),t=Math.max(0,u.startTime+u.duration-s),h=t/u.duration||0,i=1-h,r=0,o=u.tweens.length;o>r;r++)u.tweens[r].run(i);return f.notifyWith(n,[u,i,t]),1>i&&o?t:(f.resolveWith(n,[u]),!1)},u=f.promise({elem:n,props:i.extend({},t),opts:i.extend(!0,{specialEasing:{}},r),originalProperties:t,originalOptions:r,startTime:rt||vu(),duration:r.duration,tweens:[],createTween:function(t,r){var f=i.Tween(n,u.opts,t,r,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(f),f},stop:function(t){var i=0,r=t?u.tweens.length:0;if(e)return this;for(e=!0;r>i;i++)u.tweens[i].run(1);return t?f.resolveWith(n,[u,t]):f.rejectWith(n,[u,t]),this}}),s=u.props;for(to(s,u.opts.specialEasing);l>o;o++)if(h=bt[o].call(u,n,s,u.opts))return h;return i.map(s,yu,u),i.isFunction(u.opts.start)&&u.opts.start.call(n,u),i.fx.timer(i.extend(c,{elem:n,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}i.Animation=i.extend(pu,{tweener:function(n,t){i.isFunction(n)?(t=n,n=["*"]):n=n.split(" ");for(var r,u=0,f=n.length;f>u;u++)r=n[u],st[r]=st[r]||[],st[r].unshift(t)},prefilter:function(n,t){t?bt.unshift(n):bt.push(n)}});i.speed=function(n,t,r){var u=n&&"object"==typeof n?i.extend({},n):{complete:r||!r&&t||i.isFunction(n)&&n,duration:n,easing:r&&t||t&&!i.isFunction(t)&&t};return u.duration=i.fx.off?0:"number"==typeof u.duration?u.duration:u.duration in i.fx.speeds?i.fx.speeds[u.duration]:i.fx.speeds._default,(null==u.queue||u.queue===!0)&&(u.queue="fx"),u.old=u.complete,u.complete=function(){i.isFunction(u.old)&&u.old.call(this);u.queue&&i.dequeue(this,u.queue)},u};i.fn.extend({fadeTo:function(n,t,i,r){return this.filter(et).css("opacity",0).show().end().animate({opacity:t},n,i,r)},animate:function(n,t,r,u){var o=i.isEmptyObject(n),e=i.speed(t,r,u),f=function(){var t=pu(this,i.extend({},n),e);(o||i._data(this,"finish"))&&t.stop(!0)};return f.finish=f,o||e.queue===!1?this.each(f):this.queue(e.queue,f)},stop:function(n,t,r){var u=function(n){var t=n.stop;delete n.stop;t(r)};return"string"!=typeof n&&(r=t,t=n,n=void 0),t&&n!==!1&&this.queue(n||"fx",[]),this.each(function(){var o=!0,t=null!=n&&n+"queueHooks",e=i.timers,f=i._data(this);if(t)f[t]&&f[t].stop&&u(f[t]);else for(t in f)f[t]&&f[t].stop&&ge.test(t)&&u(f[t]);for(t=e.length;t--;)e[t].elem!==this||null!=n&&e[t].queue!==n||(e[t].anim.stop(r),o=!1,e.splice(t,1));(o||!r)&&i.dequeue(this,n)})},finish:function(n){return n!==!1&&(n=n||"fx"),this.each(function(){var t,f=i._data(this),r=f[n+"queue"],e=f[n+"queueHooks"],u=i.timers,o=r?r.length:0;for(f.finish=!0,i.queue(this,n,[]),e&&e.stop&&e.stop.call(this,!0),t=u.length;t--;)u[t].elem===this&&u[t].queue===n&&(u[t].anim.stop(!0),u.splice(t,1));for(t=0;o>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete f.finish})}});i.each(["toggle","show","hide"],function(n,t){var r=i.fn[t];i.fn[t]=function(n,i,u){return null==n||"boolean"==typeof n?r.apply(this,arguments):this.animate(kt(t,!0),n,i,u)}});i.each({slideDown:kt("show"),slideUp:kt("hide"),slideToggle:kt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(n,t){i.fn[n]=function(n,i,r){return this.animate(t,n,i,r)}});i.timers=[];i.fx.tick=function(){var r,n=i.timers,t=0;for(rt=i.now();t<n.length;t++)r=n[t],r()||n[t]!==r||n.splice(t--,1);n.length||i.fx.stop();rt=void 0};i.fx.timer=function(n){i.timers.push(n);n()?i.fx.start():i.timers.pop()};i.fx.interval=13;i.fx.start=function(){wt||(wt=setInterval(i.fx.tick,i.fx.interval))};i.fx.stop=function(){clearInterval(wt);wt=null};i.fx.speeds={slow:600,fast:200,_default:400};i.fn.delay=function(n,t){return n=i.fx?i.fx.speeds[n]||n:n,t=t||"fx",this.queue(t,function(t,i){var r=setTimeout(t,n);i.stop=function(){clearTimeout(r)}})},function(){var n,t,f,i,e;t=u.createElement("div");t.setAttribute("className","t");t.innerHTML=" <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>";i=t.getElementsByTagName("a")[0];f=u.createElement("select");e=f.appendChild(u.createElement("option"));n=t.getElementsByTagName("input")[0];i.style.cssText="top:1px";r.getSetAttribute="t"!==t.className;r.style=/top/.test(i.getAttribute("style"));r.hrefNormalized="/a"===i.getAttribute("href");r.checkOn=!!n.value;r.optSelected=e.selected;r.enctype=!!u.createElement("form").enctype;f.disabled=!0;r.optDisabled=!e.disabled;n=u.createElement("input");n.setAttribute("value","");r.input=""===n.getAttribute("value");n.value="t";n.setAttribute("type","radio");r.radioValue="t"===n.value}();var io=/\r/g;i.fn.extend({val:function(n){var t,r,f,u=this[0];return arguments.length?(f=i.isFunction(n),this.each(function(r){var u;1===this.nodeType&&(u=f?n.call(this,r,i(this).val()):n,null==u?u="":"number"==typeof u?u+="":i.isArray(u)&&(u=i.map(u,function(n){return null==n?"":n+""})),t=i.valHooks[this.type]||i.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,u,"value")||(this.value=u))})):u?(t=i.valHooks[u.type]||i.valHooks[u.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(r=t.get(u,"value"))?r:(r=u.value,"string"==typeof r?r.replace(io,""):null==r?"":r)):void 0}});i.extend({valHooks:{option:{get:function(n){var t=i.find.attr(n,"value");return null!=t?t:i.trim(i.text(n))}},select:{get:function(n){for(var o,t,s=n.options,u=n.selectedIndex,f="select-one"===n.type||0>u,h=f?null:[],c=f?u+1:s.length,e=0>u?c:f?u:0;c>e;e++)if(t=s[e],!(!t.selected&&e!==u||(r.optDisabled?t.disabled:null!==t.getAttribute("disabled"))||t.parentNode.disabled&&i.nodeName(t.parentNode,"optgroup"))){if(o=i(t).val(),f)return o;h.push(o)}return h},set:function(n,t){for(var f,r,u=n.options,o=i.makeArray(t),e=u.length;e--;)if(r=u[e],i.inArray(i.valHooks.option.get(r),o)>=0)try{r.selected=f=!0}catch(s){r.scrollHeight}else r.selected=!1;return f||(n.selectedIndex=-1),u}}}});i.each(["radio","checkbox"],function(){i.valHooks[this]={set:function(n,t){if(i.isArray(t))return n.checked=i.inArray(i(n).val(),t)>=0}};r.checkOn||(i.valHooks[this].get=function(n){return null===n.getAttribute("value")?"on":n.value})});var ut,wu,v=i.expr.attrHandle,ci=/^(?:checked|selected)$/i,d=r.getSetAttribute,dt=r.input;i.fn.extend({attr:function(n,t){return w(this,i.attr,n,t,arguments.length>1)},removeAttr:function(n){return this.each(function(){i.removeAttr(this,n)})}});i.extend({attr:function(n,t,r){var u,f,e=n.nodeType;if(n&&3!==e&&8!==e&&2!==e)return typeof n.getAttribute===s?i.prop(n,t,r):(1===e&&i.isXMLDoc(n)||(t=t.toLowerCase(),u=i.attrHooks[t]||(i.expr.match.bool.test(t)?wu:ut)),void 0===r?u&&"get"in u&&null!==(f=u.get(n,t))?f:(f=i.find.attr(n,t),null==f?void 0:f):null!==r?u&&"set"in u&&void 0!==(f=u.set(n,r,t))?f:(n.setAttribute(t,r+""),r):void i.removeAttr(n,t))},removeAttr:function(n,t){var r,u,e=0,f=t&&t.match(h);if(f&&1===n.nodeType)while(r=f[e++])u=i.propFix[r]||r,i.expr.match.bool.test(r)?dt&&d||!ci.test(r)?n[u]=!1:n[i.camelCase("default-"+r)]=n[u]=!1:i.attr(n,r,""),n.removeAttribute(d?r:u)},attrHooks:{type:{set:function(n,t){if(!r.radioValue&&"radio"===t&&i.nodeName(n,"input")){var u=n.value;return n.setAttribute("type",t),u&&(n.value=u),t}}}}});wu={set:function(n,t,r){return t===!1?i.removeAttr(n,r):dt&&d||!ci.test(r)?n.setAttribute(!d&&i.propFix[r]||r,r):n[i.camelCase("default-"+r)]=n[r]=!0,r}};i.each(i.expr.match.bool.source.match(/\w+/g),function(n,t){var r=v[t]||i.find.attr;v[t]=dt&&d||!ci.test(t)?function(n,t,i){var u,f;return i||(f=v[t],v[t]=u,u=null!=r(n,t,i)?t.toLowerCase():null,v[t]=f),u}:function(n,t,r){if(!r)return n[i.camelCase("default-"+t)]?t.toLowerCase():null}});dt&&d||(i.attrHooks.value={set:function(n,t,r){return i.nodeName(n,"input")?void(n.defaultValue=t):ut&&ut.set(n,t,r)}});d||(ut={set:function(n,t,i){var r=n.getAttributeNode(i);return r||n.setAttributeNode(r=n.ownerDocument.createAttribute(i)),r.value=t+="","value"===i||t===n.getAttribute(i)?t:void 0}},v.id=v.name=v.coords=function(n,t,i){var r;if(!i)return(r=n.getAttributeNode(t))&&""!==r.value?r.value:null},i.valHooks.button={get:function(n,t){var i=n.getAttributeNode(t);if(i&&i.specified)return i.value},set:ut.set},i.attrHooks.contenteditable={set:function(n,t,i){ut.set(n,""===t?!1:t,i)}},i.each(["width","height"],function(n,t){i.attrHooks[t]={set:function(n,i){if(""===i)return(n.setAttribute(t,"auto"),i)}}}));r.style||(i.attrHooks.style={get:function(n){return n.style.cssText||void 0},set:function(n,t){return n.style.cssText=t+""}});var ro=/^(?:input|select|textarea|button|object)$/i,uo=/^(?:a|area)$/i;i.fn.extend({prop:function(n,t){return w(this,i.prop,n,t,arguments.length>1)},removeProp:function(n){return n=i.propFix[n]||n,this.each(function(){try{this[n]=void 0;delete this[n]}catch(t){}})}});i.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(n,t,r){var f,u,o,e=n.nodeType;if(n&&3!==e&&8!==e&&2!==e)return o=1!==e||!i.isXMLDoc(n),o&&(t=i.propFix[t]||t,u=i.propHooks[t]),void 0!==r?u&&"set"in u&&void 0!==(f=u.set(n,r,t))?f:n[t]=r:u&&"get"in u&&null!==(f=u.get(n,t))?f:n[t]},propHooks:{tabIndex:{get:function(n){var t=i.find.attr(n,"tabindex");return t?parseInt(t,10):ro.test(n.nodeName)||uo.test(n.nodeName)&&n.href?0:-1}}}});r.hrefNormalized||i.each(["href","src"],function(n,t){i.propHooks[t]={get:function(n){return n.getAttribute(t,4)}}});r.optSelected||(i.propHooks.selected={get:function(n){var t=n.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}});i.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){i.propFix[this.toLowerCase()]=this});r.enctype||(i.propFix.enctype="encoding");var li=/[\t\r\n\f]/g;i.fn.extend({addClass:function(n){var o,t,r,u,s,f,e=0,c=this.length,l="string"==typeof n&&n;if(i.isFunction(n))return this.each(function(t){i(this).addClass(n.call(this,t,this.className))});if(l)for(o=(n||"").match(h)||[];c>e;e++)if(t=this[e],r=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(li," "):" ")){for(s=0;u=o[s++];)r.indexOf(" "+u+" ")<0&&(r+=u+" ");f=i.trim(r);t.className!==f&&(t.className=f)}return this},removeClass:function(n){var o,t,r,u,s,f,e=0,c=this.length,l=0===arguments.length||"string"==typeof n&&n;if(i.isFunction(n))return this.each(function(t){i(this).removeClass(n.call(this,t,this.className))});if(l)for(o=(n||"").match(h)||[];c>e;e++)if(t=this[e],r=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(li," "):"")){for(s=0;u=o[s++];)while(r.indexOf(" "+u+" ")>=0)r=r.replace(" "+u+" "," ");f=n?i.trim(r):"";t.className!==f&&(t.className=f)}return this},toggleClass:function(n,t){var r=typeof n;return"boolean"==typeof t&&"string"===r?t?this.addClass(n):this.removeClass(n):this.each(i.isFunction(n)?function(r){i(this).toggleClass(n.call(this,r,this.className,t),t)}:function(){if("string"===r)for(var t,f=0,u=i(this),e=n.match(h)||[];t=e[f++];)u.hasClass(t)?u.removeClass(t):u.addClass(t);else(r===s||"boolean"===r)&&(this.className&&i._data(this,"__className__",this.className),this.className=this.className||n===!1?"":i._data(this,"__className__")||"")})},hasClass:function(n){for(var i=" "+n+" ",t=0,r=this.length;r>t;t++)if(1===this[t].nodeType&&(" "+this[t].className+" ").replace(li," ").indexOf(i)>=0)return!0;return!1}});i.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(n,t){i.fn[t]=function(n,i){return arguments.length>0?this.on(t,null,n,i):this.trigger(t)}});i.fn.extend({hover:function(n,t){return this.mouseenter(n).mouseleave(t||n)},bind:function(n,t,i){return this.on(n,null,t,i)},unbind:function(n,t){return this.off(n,null,t)},delegate:function(n,t,i,r){return this.on(t,n,i,r)},undelegate:function(n,t,i){return 1===arguments.length?this.off(n,"**"):this.off(t,n||"**",i)}});var ai=i.now(),vi=/\?/,fo=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;i.parseJSON=function(t){if(n.JSON&&n.JSON.parse)return n.JSON.parse(t+"");var f,r=null,u=i.trim(t+"");return u&&!i.trim(u.replace(fo,function(n,t,i,u){return f&&t&&(r=0),0===r?n:(f=i||t,r+=!u-!i,"")}))?Function("return "+u)():i.error("Invalid JSON: "+t)};i.parseXML=function(t){var r,u;if(!t||"string"!=typeof t)return null;try{n.DOMParser?(u=new DOMParser,r=u.parseFromString(t,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(t))}catch(f){r=void 0}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||i.error("Invalid XML: "+t),r};var g,y,eo=/#.*$/,bu=/([?&])_=[^&]*/,oo=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,so=/^(?:GET|HEAD)$/,ho=/^\/\//,ku=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,du={},yi={},gu="*/".concat("*");try{y=location.href}catch(ns){y=u.createElement("a");y.href="";y=y.href}g=ku.exec(y.toLowerCase())||[];function nf(n){return function(t,r){"string"!=typeof t&&(r=t,t="*");var u,f=0,e=t.toLowerCase().match(h)||[];if(i.isFunction(r))while(u=e[f++])"+"===u.charAt(0)?(u=u.slice(1)||"*",(n[u]=n[u]||[]).unshift(r)):(n[u]=n[u]||[]).push(r)}}function tf(n,t,r,u){var f={},o=n===yi;function e(s){var h;return f[s]=!0,i.each(n[s]||[],function(n,i){var s=i(t,r,u);return"string"!=typeof s||o||f[s]?o?!(h=s):void 0:(t.dataTypes.unshift(s),e(s),!1)}),h}return e(t.dataTypes[0])||!f["*"]&&e("*")}function pi(n,t){var u,r,f=i.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((f[r]?n:u||(u={}))[r]=t[r]);return u&&i.extend(!0,n,u),n}function co(n,t,i){for(var o,e,u,f,s=n.contents,r=n.dataTypes;"*"===r[0];)r.shift(),void 0===e&&(e=n.mimeType||t.getResponseHeader("Content-Type"));if(e)for(f in s)if(s[f]&&s[f].test(e)){r.unshift(f);break}if(r[0]in i)u=r[0];else{for(f in i){if(!r[0]||n.converters[f+" "+r[0]]){u=f;break}o||(o=f)}u=u||o}if(u)return(u!==r[0]&&r.unshift(u),i[u])}function lo(n,t,i,r){var h,u,f,s,e,o={},c=n.dataTypes.slice();if(c[1])for(f in n.converters)o[f.toLowerCase()]=n.converters[f];for(u=c.shift();u;)if(n.responseFields[u]&&(i[n.responseFields[u]]=t),!e&&r&&n.dataFilter&&(t=n.dataFilter(t,n.dataType)),e=u,u=c.shift())if("*"===u)u=e;else if("*"!==e&&e!==u){if(f=o[e+" "+u]||o["* "+u],!f)for(h in o)if(s=h.split(" "),s[1]===u&&(f=o[e+" "+s[0]]||o["* "+s[0]])){f===!0?f=o[h]:o[h]!==!0&&(u=s[0],c.unshift(s[1]));break}if(f!==!0)if(f&&n.throws)t=f(t);else try{t=f(t)}catch(l){return{state:"parsererror",error:f?l:"No conversion from "+e+" to "+u}}}return{state:"success",data:t}}i.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:y,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(g[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":gu,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":i.parseJSON,"text xml":i.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(n,t){return t?pi(pi(n,i.ajaxSettings),t):pi(i.ajaxSettings,n)},ajaxPrefilter:nf(du),ajaxTransport:nf(yi),ajax:function(n,t){"object"==typeof n&&(t=n,n=void 0);t=t||{};var s,c,f,b,k,l,a,v,r=i.ajaxSetup({},t),o=r.context||r,d=r.context&&(o.nodeType||o.jquery)?i(o):i.event,nt=i.Deferred(),tt=i.Callbacks("once memory"),p=r.statusCode||{},it={},rt={},e=0,ut="canceled",u={readyState:0,getResponseHeader:function(n){var t;if(2===e){if(!v)for(v={};t=oo.exec(b);)v[t[1].toLowerCase()]=t[2];t=v[n.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===e?b:null},setRequestHeader:function(n,t){var i=n.toLowerCase();return e||(n=rt[i]=rt[i]||n,it[n]=t),this},overrideMimeType:function(n){return e||(r.mimeType=n),this},statusCode:function(n){var t;if(n)if(2>e)for(t in n)p[t]=[p[t],n[t]];else u.always(n[u.status]);return this},abort:function(n){var t=n||ut;return a&&a.abort(t),w(0,t),this}};if(nt.promise(u).complete=tt.add,u.success=u.done,u.error=u.fail,r.url=((n||r.url||y)+"").replace(eo,"").replace(ho,g[1]+"//"),r.type=t.method||t.type||r.method||r.type,r.dataTypes=i.trim(r.dataType||"*").toLowerCase().match(h)||[""],null==r.crossDomain&&(s=ku.exec(r.url.toLowerCase()),r.crossDomain=!(!s||s[1]===g[1]&&s[2]===g[2]&&(s[3]||("http:"===s[1]?"80":"443"))===(g[3]||("http:"===g[1]?"80":"443")))),r.data&&r.processData&&"string"!=typeof r.data&&(r.data=i.param(r.data,r.traditional)),tf(du,r,t,u),2===e)return u;l=r.global;l&&0==i.active++&&i.event.trigger("ajaxStart");r.type=r.type.toUpperCase();r.hasContent=!so.test(r.type);f=r.url;r.hasContent||(r.data&&(f=r.url+=(vi.test(f)?"&":"?")+r.data,delete r.data),r.cache===!1&&(r.url=bu.test(f)?f.replace(bu,"$1_="+ai++):f+(vi.test(f)?"&":"?")+"_="+ai++));r.ifModified&&(i.lastModified[f]&&u.setRequestHeader("If-Modified-Since",i.lastModified[f]),i.etag[f]&&u.setRequestHeader("If-None-Match",i.etag[f]));(r.data&&r.hasContent&&r.contentType!==!1||t.contentType)&&u.setRequestHeader("Content-Type",r.contentType);u.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+("*"!==r.dataTypes[0]?", "+gu+"; q=0.01":""):r.accepts["*"]);for(c in r.headers)u.setRequestHeader(c,r.headers[c]);if(r.beforeSend&&(r.beforeSend.call(o,u,r)===!1||2===e))return u.abort();ut="abort";for(c in{success:1,error:1,complete:1})u[c](r[c]);if(a=tf(yi,r,t,u)){u.readyState=1;l&&d.trigger("ajaxSend",[u,r]);r.async&&r.timeout>0&&(k=setTimeout(function(){u.abort("timeout")},r.timeout));try{e=1;a.send(it,w)}catch(ft){if(!(2>e))throw ft;w(-1,ft)}}else w(-1,"No Transport");function w(n,t,s,h){var v,it,g,y,w,c=t;2!==e&&(e=2,k&&clearTimeout(k),a=void 0,b=h||"",u.readyState=n>0?4:0,v=n>=200&&300>n||304===n,s&&(y=co(r,u,s)),y=lo(r,y,u,v),v?(r.ifModified&&(w=u.getResponseHeader("Last-Modified"),w&&(i.lastModified[f]=w),w=u.getResponseHeader("etag"),w&&(i.etag[f]=w)),204===n||"HEAD"===r.type?c="nocontent":304===n?c="notmodified":(c=y.state,it=y.data,g=y.error,v=!g)):(g=c,(n||!c)&&(c="error",0>n&&(n=0))),u.status=n,u.statusText=(t||c)+"",v?nt.resolveWith(o,[it,c,u]):nt.rejectWith(o,[u,c,g]),u.statusCode(p),p=void 0,l&&d.trigger(v?"ajaxSuccess":"ajaxError",[u,r,v?it:g]),tt.fireWith(o,[u,c]),l&&(d.trigger("ajaxComplete",[u,r]),--i.active||i.event.trigger("ajaxStop")))}return u},getJSON:function(n,t,r){return i.get(n,t,r,"json")},getScript:function(n,t){return i.get(n,void 0,t,"script")}});i.each(["get","post"],function(n,t){i[t]=function(n,r,u,f){return i.isFunction(r)&&(f=f||u,u=r,r=void 0),i.ajax({url:n,type:t,dataType:f,data:r,success:u})}});i.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(n,t){i.fn[t]=function(n){return this.on(t,n)}});i._evalUrl=function(n){return i.ajax({url:n,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})};i.fn.extend({wrapAll:function(n){if(i.isFunction(n))return this.each(function(t){i(this).wrapAll(n.call(this,t))});if(this[0]){var t=i(n,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]);t.map(function(){for(var n=this;n.firstChild&&1===n.firstChild.nodeType;)n=n.firstChild;return n}).append(this)}return this},wrapInner:function(n){return this.each(i.isFunction(n)?function(t){i(this).wrapInner(n.call(this,t))}:function(){var t=i(this),r=t.contents();r.length?r.wrapAll(n):t.append(n)})},wrap:function(n){var t=i.isFunction(n);return this.each(function(r){i(this).wrapAll(t?n.call(this,r):n)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()}});i.expr.filters.hidden=function(n){return n.offsetWidth<=0&&n.offsetHeight<=0||!r.reliableHiddenOffsets()&&"none"===(n.style&&n.style.display||i.css(n,"display"))};i.expr.filters.visible=function(n){return!i.expr.filters.hidden(n)};var ao=/%20/g,vo=/\[\]$/,rf=/\r?\n/g,yo=/^(?:submit|button|image|reset|file)$/i,po=/^(?:input|select|textarea|keygen)/i;function wi(n,t,r,u){var f;if(i.isArray(t))i.each(t,function(t,i){r||vo.test(n)?u(n,i):wi(n+"["+("object"==typeof i?t:"")+"]",i,r,u)});else if(r||"object"!==i.type(t))u(n,t);else for(f in t)wi(n+"["+f+"]",t[f],r,u)}i.param=function(n,t){var r,u=[],f=function(n,t){t=i.isFunction(t)?t():null==t?"":t;u[u.length]=encodeURIComponent(n)+"="+encodeURIComponent(t)};if(void 0===t&&(t=i.ajaxSettings&&i.ajaxSettings.traditional),i.isArray(n)||n.jquery&&!i.isPlainObject(n))i.each(n,function(){f(this.name,this.value)});else for(r in n)wi(r,n[r],t,f);return u.join("&").replace(ao,"+")};i.fn.extend({serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var n=i.prop(this,"elements");return n?i.makeArray(n):this}).filter(function(){var n=this.type;return this.name&&!i(this).is(":disabled")&&po.test(this.nodeName)&&!yo.test(n)&&(this.checked||!ui.test(n))}).map(function(n,t){var r=i(this).val();return null==r?null:i.isArray(r)?i.map(r,function(n){return{name:t.name,value:n.replace(rf,"\r\n")}}):{name:t.name,value:r.replace(rf,"\r\n")}}).get()}});i.ajaxSettings.xhr=void 0!==n.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&uf()||bo()}:uf;var wo=0,gt={},ht=i.ajaxSettings.xhr();n.ActiveXObject&&i(n).on("unload",function(){for(var n in gt)gt[n](void 0,!0)});r.cors=!!ht&&"withCredentials"in ht;ht=r.ajax=!!ht;ht&&i.ajaxTransport(function(n){if(!n.crossDomain||r.cors){var t;return{send:function(r,u){var e,f=n.xhr(),o=++wo;if(f.open(n.type,n.url,n.async,n.username,n.password),n.xhrFields)for(e in n.xhrFields)f[e]=n.xhrFields[e];n.mimeType&&f.overrideMimeType&&f.overrideMimeType(n.mimeType);n.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(e in r)void 0!==r[e]&&f.setRequestHeader(e,r[e]+"");f.send(n.hasContent&&n.data||null);t=function(r,e){var s,c,h;if(t&&(e||4===f.readyState))if(delete gt[o],t=void 0,f.onreadystatechange=i.noop,e)4!==f.readyState&&f.abort();else{h={};s=f.status;"string"==typeof f.responseText&&(h.text=f.responseText);try{c=f.statusText}catch(l){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=h.text?200:404}h&&u(s,c,h,f.getAllResponseHeaders())};n.async?4===f.readyState?setTimeout(t):f.onreadystatechange=gt[o]=t:t()},abort:function(){t&&t(void 0,!0)}}}});function uf(){try{return new n.XMLHttpRequest}catch(t){}}function bo(){try{return new n.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}i.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(n){return i.globalEval(n),n}}});i.ajaxPrefilter("script",function(n){void 0===n.cache&&(n.cache=!1);n.crossDomain&&(n.type="GET",n.global=!1)});i.ajaxTransport("script",function(n){if(n.crossDomain){var t,r=u.head||i("head")[0]||u.documentElement;return{send:function(i,f){t=u.createElement("script");t.async=!0;n.scriptCharset&&(t.charset=n.scriptCharset);t.src=n.url;t.onload=t.onreadystatechange=function(n,i){(i||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,i||f(200,"success"))};r.insertBefore(t,r.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var ff=[],bi=/(=)\?(?=&|$)|\?\?/;i.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var n=ff.pop()||i.expando+"_"+ai++;return this[n]=!0,n}});i.ajaxPrefilter("json jsonp",function(t,r,u){var f,o,e,s=t.jsonp!==!1&&(bi.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&bi.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return(f=t.jsonpCallback=i.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(bi,"$1"+f):t.jsonp!==!1&&(t.url+=(vi.test(t.url)?"&":"?")+t.jsonp+"="+f),t.converters["script json"]=function(){return e||i.error(f+" was not called"),e[0]},t.dataTypes[0]="json",o=n[f],n[f]=function(){e=arguments},u.always(function(){n[f]=o;t[f]&&(t.jsonpCallback=r.jsonpCallback,ff.push(f));e&&i.isFunction(o)&&o(e[0]);e=o=void 0}),"script")});i.parseHTML=function(n,t,r){if(!n||"string"!=typeof n)return null;"boolean"==typeof t&&(r=t,t=!1);t=t||u;var f=tr.exec(n),e=!r&&[];return f?[t.createElement(f[1])]:(f=i.buildFragment([n],t,e),e&&e.length&&i(e).remove(),i.merge([],f.childNodes))};var ef=i.fn.load;i.fn.load=function(n,t,r){if("string"!=typeof n&&ef)return ef.apply(this,arguments);var u,o,s,f=this,e=n.indexOf(" ");return e>=0&&(u=i.trim(n.slice(e,n.length)),n=n.slice(0,e)),i.isFunction(t)?(r=t,t=void 0):t&&"object"==typeof t&&(s="POST"),f.length>0&&i.ajax({url:n,type:s,dataType:"html",data:t}).done(function(n){o=arguments;f.html(u?i("<div>").append(i.parseHTML(n)).find(u):n)}).complete(r&&function(n,t){f.each(r,o||[n.responseText,t,n])}),this};i.expr.filters.animated=function(n){return i.grep(i.timers,function(t){return n===t.elem}).length};var of=n.document.documentElement;function sf(n){return i.isWindow(n)?n:9===n.nodeType?n.defaultView||n.parentWindow:!1}i.offset={setOffset:function(n,t,r){var e,o,s,h,u,c,v,l=i.css(n,"position"),a=i(n),f={};"static"===l&&(n.style.position="relative");u=a.offset();s=i.css(n,"top");c=i.css(n,"left");v=("absolute"===l||"fixed"===l)&&i.inArray("auto",[s,c])>-1;v?(e=a.position(),h=e.top,o=e.left):(h=parseFloat(s)||0,o=parseFloat(c)||0);i.isFunction(t)&&(t=t.call(n,r,u));null!=t.top&&(f.top=t.top-u.top+h);null!=t.left&&(f.left=t.left-u.left+o);"using"in t?t.using.call(n,f):a.css(f)}};i.fn.extend({offset:function(n){if(arguments.length)return void 0===n?this:this.each(function(t){i.offset.setOffset(this,n,t)});var t,f,u={top:0,left:0},r=this[0],e=r&&r.ownerDocument;if(e)return t=e.documentElement,i.contains(t,r)?(typeof r.getBoundingClientRect!==s&&(u=r.getBoundingClientRect()),f=sf(e),{top:u.top+(f.pageYOffset||t.scrollTop)-(t.clientTop||0),left:u.left+(f.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):u},position:function(){if(this[0]){var n,r,t={top:0,left:0},u=this[0];return"fixed"===i.css(u,"position")?r=u.getBoundingClientRect():(n=this.offsetParent(),r=this.offset(),i.nodeName(n[0],"html")||(t=n.offset()),t.top+=i.css(n[0],"borderTopWidth",!0),t.left+=i.css(n[0],"borderLeftWidth",!0)),{top:r.top-t.top-i.css(u,"marginTop",!0),left:r.left-t.left-i.css(u,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent||of;n&&!i.nodeName(n,"html")&&"static"===i.css(n,"position");)n=n.offsetParent;return n||of})}});i.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(n,t){var r=/Y/.test(t);i.fn[n]=function(u){return w(this,function(n,u,f){var e=sf(n);return void 0===f?e?t in e?e[t]:e.document.documentElement[u]:n[u]:void(e?e.scrollTo(r?i(e).scrollLeft():f,r?f:i(e).scrollTop()):n[u]=f)},n,u,arguments.length,null)}});i.each(["top","left"],function(n,t){i.cssHooks[t]=uu(r.pixelPosition,function(n,r){if(r)return(r=k(n,t),pt.test(r)?i(n).position()[t]+"px":r)})});i.each({Height:"height",Width:"width"},function(n,t){i.each({padding:"inner"+n,content:t,"":"outer"+n},function(r,u){i.fn[u]=function(u,f){var e=arguments.length&&(r||"boolean"!=typeof u),o=r||(u===!0||f===!0?"margin":"border");return w(this,function(t,r,u){var f;return i.isWindow(t)?t.document.documentElement["client"+n]:9===t.nodeType?(f=t.documentElement,Math.max(t.body["scroll"+n],f["scroll"+n],t.body["offset"+n],f["offset"+n],f["client"+n])):void 0===u?i.css(t,r,o):i.style(t,r,u,o)},t,e?u:void 0,e,null)}})});i.fn.size=function(){return this.length};i.fn.andSelf=i.fn.addBack;"function"==typeof define&&define.amd&&define("asljQuery",[],function(){return i});var ko=n.jQuery,go=n.$;return i.noConflict=function(t){return n.$===i&&(n.$=go),t&&n.jQuery===i&&(n.asljQuery=ko),i},typeof t===s&&(n.asljQuery=n.$=i),i}),function(n,t,i){(function(t){typeof define=="function"&&define.amd&&define.amd.jQuery?define(["jquery"],t):typeof module!="undefined"&&module.exports?t(require("jquery")):t(n)})(function(n){var u="left",f="right",e="up",o="down",y="in",p="out",w="none",tt="auto",b="swipe",k="pinch",d="tap",it="doubletap",rt="longtap",g="horizontal",nt="vertical",a="all",ft=10,ut="start",s="move",t="end",r="cancel",l="ontouchstart"in i,v=i.navigator.msPointerEnabled&&!i.navigator.pointerEnabled&&!l,h=(i.navigator.pointerEnabled||i.navigator.msPointerEnabled)&&!l,c="TouchSwipe";n.fn.swipe=function(t){var r=n(this),i=r.data(c);if(i&&typeof t=="string"){if(i[t])return i[t].apply(this,Array.prototype.slice.call(arguments,1));n.error("Method "+t+" does not exist on jQuery.swipe")}else if(i&&typeof t=="object")i.option.apply(this,arguments);else if(!i&&(typeof t=="object"||!t))return et.apply(this,arguments);return r};n.fn.swipe.version="1.6.15";n.fn.swipe.defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:!0};n.fn.swipe.phases={PHASE_START:ut,PHASE_MOVE:s,PHASE_END:t,PHASE_CANCEL:r};n.fn.swipe.directions={LEFT:u,RIGHT:f,UP:e,DOWN:o,IN:y,OUT:p};n.fn.swipe.pageScroll={NONE:w,HORIZONTAL:g,VERTICAL:nt,AUTO:tt};n.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:a};function et(t){return t&&t.allowPageScroll===undefined&&(t.swipe!==undefined||t.swipeStatus!==undefined)&&(t.allowPageScroll=w),t.click!==undefined&&t.tap===undefined&&(t.tap=t.click),t||(t={}),t=n.extend({},n.fn.swipe.defaults,t),this.each(function(){var r=n(this),i=r.data(c);i||(i=new ot(this,t),r.data(c,i))})}function ot(i,et){var et=n.extend({},et),si=l||h||!et.fallbackToMouseEvents,hi=si?h?v?"MSPointerDown":"pointerdown":"touchstart":"mousedown",ki=si?h?v?"MSPointerMove":"pointermove":"touchmove":"mousemove",di=si?h?v?"MSPointerUp":"pointerup":"touchend":"mouseup",ri=si?h?"mouseleave":null:"mouseleave",ci=h?v?"MSPointerCancel":"pointercancel":"touchcancel",at=0,vt=null,yt=null,lt=0,gt=0,ni=0,pt=1,bt=0,kt=0,li=null,ot=n(i),st="start",ct=0,ht={},gi=0,ai=0,vi=0,nr=0,ti=0,fi=null,ei=null;try{ot.bind(hi,tr);ot.bind(ci,ui)}catch(ff){n.error("events not supported "+hi+","+ci+" on jQuery.swipe")}this.enable=function(){return ot.bind(hi,tr),ot.bind(ci,ui),ot};this.disable=function(){return lr(),ot};this.destroy=function(){lr();ot.data(c,null);ot=null};this.option=function(t,i){if(typeof t=="object")et=n.extend(et,t);else if(et[t]!==undefined){if(i===undefined)return et[t];et[t]=i}else if(t)n.error("Option "+t+" does not exist on jQuery.swipe.options");else return et;return null};function tr(t){if(!pu()&&!(n(t.target).closest(et.excludedElements,ot).length>0)){var i=t.originalEvent?t.originalEvent:t,f,u=i.touches,e=u?u[0]:i;return(st=ut,u?ct=u.length:et.preventDefaultEvents!==!1&&t.preventDefault(),at=0,vt=null,yt=null,kt=null,lt=0,gt=0,ni=0,pt=1,bt=0,li=ku(),dr(),wi(0,e),!u||ct===et.fingers||et.fingers===a||oi()?(gi=ii(),ct==2&&(wi(1,u[1]),gt=ni=cr(ht[0].start,ht[1].start)),(et.swipeStatus||et.pinchStatus)&&(f=wt(i,st))):f=!1,f===!1)?(st=r,wt(i,st),f):(et.hold&&(ei=setTimeout(n.proxy(function(){ot.trigger("hold",[i.target]);et.hold&&(f=et.hold.call(ot,i,i.target))},this),et.longTapThreshold)),pi(!0),null)}}function ir(n){var f=n.originalEvent?n.originalEvent:n;if(st!==t&&st!==r&&!yi()){var o,i=f.touches,h=i?i[0]:f,u=gr(h);if(ai=ii(),i&&(ct=i.length),et.hold&&clearTimeout(ei),st=s,ct==2&&(gt==0?(wi(1,i[1]),gt=ni=cr(ht[0].start,ht[1].start)):(gr(i[1]),ni=cr(ht[0].end,ht[1].end),kt=gu(ht[0].end,ht[1].end)),pt=du(gt,ni),bt=Math.abs(gt-ni)),ct===et.fingers||et.fingers===a||!i||oi()){if(vt=iu(u.start,u.end),yt=iu(u.last,u.end),uu(n,yt),at=nf(u.start,u.end),lt=tu(),bu(vt,at),o=wt(f,st),!et.triggerOnTouchEnd||et.triggerOnTouchLeave){var e=!0;if(et.triggerOnTouchLeave){var c=rf(this);e=uf(u.end,c)}!et.triggerOnTouchEnd&&e?st=fr(s):et.triggerOnTouchLeave&&!e&&(st=fr(t));(st==r||st==t)&&wt(f,st)}}else st=r,wt(f,st);o===!1&&(st=r,wt(f,st))}}function rr(n){var i=n.originalEvent?n.originalEvent:n,u=i.touches;if(u){if(u.length&&!yi())return yu(i),!0;if(u.length&&yi())return!0}return yi()&&(ct=nr),ai=ii(),lt=tu(),or()||!er()?(st=r,wt(i,st)):et.triggerOnTouchEnd||et.triggerOnTouchEnd==!1&&st===s?(et.preventDefaultEvents!==!1&&n.preventDefault(),st=t,wt(i,st)):!et.triggerOnTouchEnd&&br()?(st=t,dt(i,st,d)):st===s&&(st=r,wt(i,st)),pi(!1),null}function ui(){ct=0;ai=0;gi=0;gt=0;ni=0;pt=1;dr();pi(!1)}function ur(n){var i=n.originalEvent?n.originalEvent:n;et.triggerOnTouchLeave&&(st=fr(t),wt(i,st))}function lr(){ot.unbind(hi,tr);ot.unbind(ci,ui);ot.unbind(ki,ir);ot.unbind(di,rr);ri&&ot.unbind(ri,ur);pi(!1)}function fr(n){var i=n,f=ar(),u=er(),e=or();return!f||e?i=r:u&&n==s&&(!et.triggerOnTouchEnd||et.triggerOnTouchLeave)?i=t:!u&&n==t&&et.triggerOnTouchLeave&&(i=r),i}function wt(n,i){var u,f=n.touches;return(eu()||sr())&&(u=dt(n,i,b)),(fu()||oi())&&u!==!1&&(u=dt(n,i,k)),au()&&u!==!1?u=dt(n,i,it):vu()&&u!==!1?u=dt(n,i,rt):lu()&&u!==!1&&(u=dt(n,i,d)),i===r&&(sr()&&(u=dt(n,i,b)),oi()&&(u=dt(n,i,k)),ui(n)),i===t&&(f?f.length||ui(n):ui(n)),u}function dt(i,s,h){var c;if(h==b){if(ot.trigger("swipeStatus",[s,vt||null,at||0,lt||0,ct,ht,yt]),et.swipeStatus&&(c=et.swipeStatus.call(ot,i,s,vt||null,at||0,lt||0,ct,ht,yt),c===!1))return!1;if(s==t&&yr()){if(clearTimeout(fi),clearTimeout(ei),ot.trigger("swipe",[vt,at,lt,ct,ht,yt]),et.swipe&&(c=et.swipe.call(ot,i,vt,at,lt,ct,ht,yt),c===!1))return!1;switch(vt){case u:ot.trigger("swipeLeft",[vt,at,lt,ct,ht,yt]);et.swipeLeft&&(c=et.swipeLeft.call(ot,i,vt,at,lt,ct,ht,yt));break;case f:ot.trigger("swipeRight",[vt,at,lt,ct,ht,yt]);et.swipeRight&&(c=et.swipeRight.call(ot,i,vt,at,lt,ct,ht,yt));break;case e:ot.trigger("swipeUp",[vt,at,lt,ct,ht,yt]);et.swipeUp&&(c=et.swipeUp.call(ot,i,vt,at,lt,ct,ht,yt));break;case o:ot.trigger("swipeDown",[vt,at,lt,ct,ht,yt]);et.swipeDown&&(c=et.swipeDown.call(ot,i,vt,at,lt,ct,ht,yt))}}}if(h==k){if(ot.trigger("pinchStatus",[s,kt||null,bt||0,lt||0,ct,pt,ht]),et.pinchStatus&&(c=et.pinchStatus.call(ot,i,s,kt||null,bt||0,lt||0,ct,pt,ht),c===!1))return!1;if(s==t&&vr())switch(kt){case y:ot.trigger("pinchIn",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchIn&&(c=et.pinchIn.call(ot,i,kt||null,bt||0,lt||0,ct,pt,ht));break;case p:ot.trigger("pinchOut",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchOut&&(c=et.pinchOut.call(ot,i,kt||null,bt||0,lt||0,ct,pt,ht))}}return h==d?(s===r||s===t)&&(clearTimeout(fi),clearTimeout(ei),hr()&&!su()?(ti=ii(),fi=setTimeout(n.proxy(function(){ti=null;ot.trigger("tap",[i.target]);et.tap&&(c=et.tap.call(ot,i,i.target))},this),et.doubleTapThreshold)):(ti=null,ot.trigger("tap",[i.target]),et.tap&&(c=et.tap.call(ot,i,i.target)))):h==it?(s===r||s===t)&&(clearTimeout(fi),clearTimeout(ei),ti=null,ot.trigger("doubletap",[i.target]),et.doubleTap&&(c=et.doubleTap.call(ot,i,i.target))):h==rt&&(s===r||s===t)&&(clearTimeout(fi),ti=null,ot.trigger("longtap",[i.target]),et.longTap&&(c=et.longTap.call(ot,i,i.target))),c}function er(){var n=!0;return et.threshold!==null&&(n=at>=et.threshold),n}function or(){var n=!1;return et.cancelThreshold!==null&&vt!==null&&(n=nu(vt)-at>=et.cancelThreshold),n}function ru(){return et.pinchThreshold!==null?bt>=et.pinchThreshold:!0}function ar(){return et.maxTimeThreshold?lt>=et.maxTimeThreshold?!1:!0:!0}function uu(n,t){if(et.preventDefaultEvents!==!1)if(et.allowPageScroll===w)n.preventDefault();else{var i=et.allowPageScroll===tt;switch(t){case u:(et.swipeLeft&&i||!i&&et.allowPageScroll!=g)&&n.preventDefault();break;case f:(et.swipeRight&&i||!i&&et.allowPageScroll!=g)&&n.preventDefault();break;case e:(et.swipeUp&&i||!i&&et.allowPageScroll!=nt)&&n.preventDefault();break;case o:(et.swipeDown&&i||!i&&et.allowPageScroll!=nt)&&n.preventDefault()}}}function vr(){var n=pr(),t=wr(),i=ru();return n&&t&&i}function oi(){return!!(et.pinchStatus||et.pinchIn||et.pinchOut)}function fu(){return!!(vr()&&oi())}function yr(){var n=ar(),t=er(),i=pr(),r=wr(),u=or();return!u&&r&&i&&t&&n}function sr(){return!!(et.swipe||et.swipeStatus||et.swipeLeft||et.swipeRight||et.swipeUp||et.swipeDown)}function eu(){return!!(yr()&&sr())}function pr(){return ct===et.fingers||et.fingers===a||!l}function wr(){return ht[0].end.x!==0}function br(){return!!et.tap}function hr(){return!!et.doubleTap}function ou(){return!!et.longTap}function kr(){if(ti==null)return!1;var n=ii();return hr()&&n-ti<=et.doubleTapThreshold}function su(){return kr()}function hu(){return(ct===1||!l)&&(isNaN(at)||at<et.threshold)}function cu(){return lt>et.longTapThreshold&&at<ft}function lu(){return!!(hu()&&br())}function au(){return!!(kr()&&hr())}function vu(){return!!(cu()&&ou())}function yu(n){vi=ii();nr=n.touches.length+1}function dr(){vi=0;nr=0}function yi(){var n=!1;if(vi){var t=ii()-vi;t<=et.fingerReleaseThreshold&&(n=!0)}return n}function pu(){return!!(ot.data(c+"_intouch")===!0)}function pi(n){ot&&(n===!0?(ot.bind(ki,ir),ot.bind(di,rr),ri&&ot.bind(ri,ur)):(ot.unbind(ki,ir,!1),ot.unbind(di,rr,!1),ri&&ot.unbind(ri,ur,!1)),ot.data(c+"_intouch",n===!0))}function wi(n,t){var i={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return i.start.x=i.last.x=i.end.x=t.pageX||t.clientX,i.start.y=i.last.y=i.end.y=t.pageY||t.clientY,ht[n]=i,i}function gr(n){var i=n.identifier!==undefined?n.identifier:0,t=wu(i);return t===null&&(t=wi(i,n)),t.last.x=t.end.x,t.last.y=t.end.y,t.end.x=n.pageX||n.clientX,t.end.y=n.pageY||n.clientY,t}function wu(n){return ht[n]||null}function bu(n,t){t=Math.max(t,nu(n));li[n].distance=t}function nu(n){return li[n]?li[n].distance:undefined}function ku(){var n={};return n[u]=bi(u),n[f]=bi(f),n[e]=bi(e),n[o]=bi(o),n}function bi(n){return{direction:n,distance:0}}function tu(){return ai-gi}function cr(n,t){var i=Math.abs(n.x-t.x),r=Math.abs(n.y-t.y);return Math.round(Math.sqrt(i*i+r*r))}function du(n,t){var i=t/n*1;return i.toFixed(2)}function gu(){return pt<1?p:y}function nf(n,t){return Math.round(Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2)))}function tf(n,t){var r=n.x-t.x,u=t.y-n.y,f=Math.atan2(u,r),i=Math.round(f*180/Math.PI);return i<0&&(i=360-Math.abs(i)),i}function iu(n,t){var i=tf(n,t);return i<=45&&i>=0?u:i<=360&&i>=315?u:i>=135&&i<=225?f:i>45&&i<135?o:e}function ii(){var n=new Date;return n.getTime()}function rf(t){t=n(t);var i=t.offset();return{left:i.left,right:i.left+t.outerWidth(),top:i.top,bottom:i.top+t.outerHeight()}}function uf(n,t){return n.x>t.left&&n.x<t.right&&n.y>t.top&&n.y<t.bottom}}})}(asljQuery,asljQuery,window),function(n,t,i){
3
+ /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
4
+ * Licensed under the MIT License (LICENSE.txt).
5
+ *
6
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
7
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
8
+ * Thanks to: Seamus Leahy for adding deltaX and deltaY
9
+ *
10
+ * Version: 3.0.6
11
+ *
12
+ * Requires: 1.2.2+
13
+ */
14
+ (function(n){var t=["DOMMouseScroll","mousewheel"];if(n.event.fixHooks)for(var u=t.length;u;)n.event.fixHooks[t[--u]]=n.event.mouseHooks;n.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var n=t.length;n;)this.addEventListener(t[--n],r,!1);else this.onmousewheel=r},teardown:function(){if(this.removeEventListener)for(var n=t.length;n;)this.removeEventListener(t[--n],r,!1);else this.onmousewheel=null}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}});function r(t){var r=t||i.event,o=[].slice.call(arguments,1),u=0,e=0,f=0;return t=n.event.fix(r),t.type="mousewheel",r.wheelDelta&&(u=r.wheelDelta/120),r.detail&&(u=-r.detail/3),f=u,r.axis!==undefined&&r.axis===r.HORIZONTAL_AXIS&&(f=0,e=-1*u),r.wheelDeltaY!==undefined&&(f=r.wheelDeltaY/120),r.wheelDeltaX!==undefined&&(e=-1*r.wheelDeltaX/120),o.unshift(t,u,e,f),(n.event.dispatch||n.event.handle).apply(this,o)}})(n)}(asljQuery,asljQuery,window),function(n,t,i){(function(n){var r={init:function(t){var r={set_width:!1,set_height:!1,horizontalScroll:!1,scrollInertia:950,mouseWheel:!0,mouseWheelPixels:"auto",autoDraggerLength:!0,autoHideScrollbar:!1,snapAmount:null,snapOffset:0,scrollButtons:{enable:!1,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:!0,updateOnContentResize:!1,autoExpandHorizontalScroll:!1,autoScrollOnFocus:!0,normalizeMouseWheelDelta:!1},contentTouchScroll:!0,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},t=n.extend(!0,r,t);return this.each(function(){var r=n(this);if(t.set_width&&r.css("width",t.set_width),t.set_height&&r.css("height",t.set_height),n(document).data("mCustomScrollbar-index")){var p=parseInt(n(document).data("mCustomScrollbar-index"));n(document).data("mCustomScrollbar-index",p+1)}else n(document).data("mCustomScrollbar-index","1");r.wrapInner("<div class='mCustomScrollBox"+" mCS-"+t.theme+"' id='mCSB_"+n(document).data("mCustomScrollbar-index")+"' style='position:relative; height:100%; overflow:hidden; max-width:100%;' />").addClass("mCustomScrollbar _mCS_"+n(document).data("mCustomScrollbar-index"));var u=r.children(".mCustomScrollBox");if(t.horizontalScroll){u.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />");var l=u.children(".mCSB_h_wrapper");l.wrapInner("<div class='mCSB_container' style='position:absolute; left:0;' />").children(".mCSB_container").css({width:l.children().outerWidth(),position:"relative"}).unwrap()}else u.wrapInner("<div class='mCSB_container' style='position:relative; top:0;' />");var f=u.children(".mCSB_container");n.support.touch&&f.addClass("mCS_touch");f.after("<div class='mCSB_scrollTools' style='position:absolute;'><div class='mCSB_draggerContainer'><div class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' style='position:relative;'><\/div><\/div><div class='mCSB_draggerRail'><\/div><\/div><\/div>");var s=u.children(".mCSB_scrollTools"),w=s.children(".mCSB_draggerContainer"),e=w.children(".mCSB_dragger");if(t.horizontalScroll?e.data("minDraggerWidth",e.width()):e.data("minDraggerHeight",e.height()),t.scrollButtons.enable&&(t.horizontalScroll?s.prepend("<a class='mCSB_buttonLeft' oncontextmenu='return false;'><\/a>").append("<a class='mCSB_buttonRight' oncontextmenu='return false;'><\/a>"):s.prepend("<a class='mCSB_buttonUp' oncontextmenu='return false;'><\/a>").append("<a class='mCSB_buttonDown' oncontextmenu='return false;'><\/a>")),u.bind("scroll",function(){r.is(".mCS_disabled")||u.scrollTop(0).scrollLeft(0)}),r.data({mCS_Init:!0,mCustomScrollbarIndex:n(document).data("mCustomScrollbar-index"),horizontalScroll:t.horizontalScroll,scrollInertia:t.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:t.mouseWheel,mouseWheelPixels:t.mouseWheelPixels,autoDraggerLength:t.autoDraggerLength,autoHideScrollbar:t.autoHideScrollbar,snapAmount:t.snapAmount,snapOffset:t.snapOffset,scrollButtons_enable:t.scrollButtons.enable,scrollButtons_scrollType:t.scrollButtons.scrollType,scrollButtons_scrollSpeed:t.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:t.scrollButtons.scrollAmount,autoExpandHorizontalScroll:t.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:t.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:t.advanced.normalizeMouseWheelDelta,contentTouchScroll:t.contentTouchScroll,onScrollStart_Callback:t.callbacks.onScrollStart,onScroll_Callback:t.callbacks.onScroll,onTotalScroll_Callback:t.callbacks.onTotalScroll,onTotalScrollBack_Callback:t.callbacks.onTotalScrollBack,onTotalScroll_Offset:t.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:t.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:t.callbacks.whileScrolling,bindEvent_scrollbar_drag:!1,bindEvent_content_touch:!1,bindEvent_scrollbar_click:!1,bindEvent_mousewheel:!1,bindEvent_buttonsContinuous_y:!1,bindEvent_buttonsContinuous_x:!1,bindEvent_buttonsPixels_y:!1,bindEvent_buttonsPixels_x:!1,bindEvent_focusin:!1,bindEvent_autoHideScrollbar:!1,mCSB_buttonScrollRight:!1,mCSB_buttonScrollLeft:!1,mCSB_buttonScrollDown:!1,mCSB_buttonScrollUp:!1}),t.horizontalScroll)r.css("max-width")!=="none"&&(t.advanced.updateOnContentResize||(t.advanced.updateOnContentResize=!0));else if(r.css("max-height")!=="none"){var o=!1,h=parseInt(r.css("max-height"));r.css("max-height").indexOf("%")>=0&&(o=h,h=r.parent().height()*o/100);r.css("overflow","hidden");u.css("max-height",h)}if(r.mCustomScrollbar("update"),t.advanced.updateOnBrowserResize){var c,a=n(i).width(),v=n(i).height();n(i).bind("resize."+r.data("mCustomScrollbarIndex"),function(){c&&clearTimeout(c);c=setTimeout(function(){if(!r.is(".mCS_disabled")&&!r.is(".mCS_destroyed")){var t=n(i).width(),f=n(i).height();(a!==t||v!==f)&&(r.css("max-height")!=="none"&&o&&u.css("max-height",r.parent().height()*o/100),r.mCustomScrollbar("update"),a=t,v=f)}},150)})}if(t.advanced.updateOnContentResize){var b;if(t.horizontalScroll)var y=f.outerWidth();else var y=f.outerHeight();b=setInterval(function(){if(t.horizontalScroll){t.advanced.autoExpandHorizontalScroll&&f.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:f.outerWidth(),position:"relative"}).unwrap();var n=f.outerWidth()}else var n=f.outerHeight();n!=y&&(r.mCustomScrollbar("update"),y=n)},300)}})},update:function(){var i=n(this),u=i.children(".mCustomScrollBox"),r=u.children(".mCSB_container");r.removeClass("mCS_no_scrollbar");i.removeClass("mCS_disabled mCS_destroyed");u.scrollTop(0).scrollLeft(0);var f=u.children(".mCSB_scrollTools"),e=f.children(".mCSB_draggerContainer"),t=e.children(".mCSB_dragger");if(i.data("horizontalScroll")){var p=f.children(".mCSB_buttonLeft"),w=f.children(".mCSB_buttonRight"),h=u.width();i.data("autoExpandHorizontalScroll")&&r.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:r.outerWidth(),position:"relative"}).unwrap();var c=r.outerWidth()}else var b=f.children(".mCSB_buttonUp"),k=f.children(".mCSB_buttonDown"),l=u.height(),a=r.outerHeight();if(a>l&&!i.data("horizontalScroll")){f.css("display","block");var o=e.height();if(i.data("autoDraggerLength")){var v=Math.round(l/a*o),d=t.data("minDraggerHeight");if(v<=d)t.css({height:d});else if(v>=o-10){var it=o-10;t.css({height:it})}else t.css({height:v});t.children(".mCSB_dragger_bar").css({"line-height":t.height()+"px"})}var rt=t.height(),g=(a-l)/(o-rt);i.data("scrollAmount",g).mCustomScrollbar("scrolling",u,r,e,t,b,k,p,w);var nt=Math.abs(r.position().top);i.mCustomScrollbar("scrollTo",nt,{scrollInertia:0,trigger:"internal"})}else if(c>h&&i.data("horizontalScroll")){f.css("display","block");var s=e.width();if(i.data("autoDraggerLength")){var y=Math.round(h/c*s),tt=t.data("minDraggerWidth");if(y<=tt)t.css({width:tt});else if(y>=s-10){var ut=s-10;t.css({width:ut})}else t.css({width:y})}var ft=t.width(),g=(c-h)/(s-ft);i.data("scrollAmount",g).mCustomScrollbar("scrolling",u,r,e,t,b,k,p,w);var nt=Math.abs(r.position().left);i.mCustomScrollbar("scrollTo",nt,{scrollInertia:0,trigger:"internal"})}else u.unbind("mousewheel focusin"),i.data("horizontalScroll")?t.add(r).css("left",0):t.add(r).css("top",0),f.css("display","none"),r.addClass("mCS_no_scrollbar"),i.data({bindEvent_mousewheel:!1,bindEvent_focusin:!1})},scrolling:function(i,r,u,f,e,o,s,h){var c=n(this);if(!c.data("bindEvent_scrollbar_drag")){var v,y;n.support.msPointer?(f.bind("MSPointerDown",function(t){t.preventDefault();c.data({on_drag:!0});f.addClass("mCSB_dragger_onDrag");var i=n(this),e=i.offset(),r=t.originalEvent.pageX-e.left,u=t.originalEvent.pageY-e.top;r<i.width()&&r>0&&u<i.height()&&u>0&&(v=u,y=r)}),n(document).bind("MSPointerMove."+c.data("mCustomScrollbarIndex"),function(n){if(n.preventDefault(),c.data("on_drag")){var i=f,t=i.offset(),r=n.originalEvent.pageX-t.left,u=n.originalEvent.pageY-t.top;g(v,y,u,r)}}).bind("MSPointerUp."+c.data("mCustomScrollbarIndex"),function(){c.data({on_drag:!1});f.removeClass("mCSB_dragger_onDrag")})):(f.bind("mousedown touchstart",function(t){t.preventDefault();t.stopImmediatePropagation();var e=n(this),u=e.offset(),i,r;if(t.type==="touchstart"){var o=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0];i=o.pageX-u.left;r=o.pageY-u.top}else c.data({on_drag:!0}),f.addClass("mCSB_dragger_onDrag"),i=t.pageX-u.left,r=t.pageY-u.top;i<e.width()&&i>0&&r<e.height()&&r>0&&(v=r,y=i)}).bind("touchmove",function(t){t.preventDefault();t.stopImmediatePropagation();var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],u=n(this),r=u.offset(),f=i.pageX-r.left,e=i.pageY-r.top;g(v,y,e,f)}),n(document).bind("mousemove."+c.data("mCustomScrollbarIndex"),function(n){if(c.data("on_drag")){var i=f,t=i.offset(),r=n.pageX-t.left,u=n.pageY-t.top;g(v,y,u,r)}}).bind("mouseup."+c.data("mCustomScrollbarIndex"),function(){c.data({on_drag:!1});f.removeClass("mCSB_dragger_onDrag")}));c.data({bindEvent_scrollbar_drag:!0})}function g(n,t,i,r){c.data("horizontalScroll")?c.mCustomScrollbar("scrollTo",f.position().left-t+r,{moveDragger:!0,trigger:"internal"}):c.mCustomScrollbar("scrollTo",f.position().top-n+i,{moveDragger:!0,trigger:"internal"})}if(n.support.touch&&c.data("contentTouchScroll")&&!c.data("bindEvent_content_touch")){var l,p,a,w,b,it,rt;r.bind("touchstart",function(t){t.stopImmediatePropagation();l=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0];p=n(this);a=p.offset();b=l.pageX-a.left;w=l.pageY-a.top;it=w;rt=b});r.bind("touchmove",function(t){t.preventDefault();t.stopImmediatePropagation();l=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0];p=n(this).parent();a=p.offset();b=l.pageX-a.left;w=l.pageY-a.top;c.data("horizontalScroll")?c.mCustomScrollbar("scrollTo",rt-b,{trigger:"internal"}):c.mCustomScrollbar("scrollTo",it-w,{trigger:"internal"})})}if(c.data("bindEvent_scrollbar_click")||(u.bind("click",function(t){var i=(t.pageY-u.offset().top)*c.data("scrollAmount"),r=n(t.target);c.data("horizontalScroll")&&(i=(t.pageX-u.offset().left)*c.data("scrollAmount"));(r.hasClass("mCSB_draggerContainer")||r.hasClass("mCSB_draggerRail"))&&c.mCustomScrollbar("scrollTo",i,{trigger:"internal",scrollEasing:"draggerRailEase"})}),c.data({bindEvent_scrollbar_click:!0})),c.data("mouseWheel")&&(c.data("bindEvent_mousewheel")||(i.bind("mousewheel",function(n,t){var o,i=c.data("mouseWheelPixels"),s=Math.abs(r.position().top),e=f.position().top,h=u.height()-f.height();c.data("normalizeMouseWheelDelta")&&(t=t<0?-1:1);i==="auto"&&(i=100+Math.round(c.data("scrollAmount")/2));c.data("horizontalScroll")&&(e=f.position().left,h=u.width()-f.width(),s=Math.abs(r.position().left));(t>0&&e!==0||t<0&&e!==h)&&(n.preventDefault(),n.stopImmediatePropagation());o=s-t*i;c.mCustomScrollbar("scrollTo",o,{trigger:"internal"})}),c.data({bindEvent_mousewheel:!0}))),c.data("scrollButtons_enable"))if(c.data("scrollButtons_scrollType")==="pixels"){c.data("horizontalScroll")?(h.add(s).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",nt,tt),c.data({bindEvent_buttonsContinuous_x:!1}),c.data("bindEvent_buttonsPixels_x")||(h.bind("click",function(n){n.preventDefault();k(Math.abs(r.position().left)+c.data("scrollButtons_scrollAmount"))}),s.bind("click",function(n){n.preventDefault();k(Math.abs(r.position().left)-c.data("scrollButtons_scrollAmount"))}),c.data({bindEvent_buttonsPixels_x:!0}))):(o.add(e).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",nt,tt),c.data({bindEvent_buttonsContinuous_y:!1}),c.data("bindEvent_buttonsPixels_y")||(o.bind("click",function(n){n.preventDefault();k(Math.abs(r.position().top)+c.data("scrollButtons_scrollAmount"))}),e.bind("click",function(n){n.preventDefault();k(Math.abs(r.position().top)-c.data("scrollButtons_scrollAmount"))}),c.data({bindEvent_buttonsPixels_y:!0})));function k(n){f.data("preventAction")||(f.data("preventAction",!0),c.mCustomScrollbar("scrollTo",n,{trigger:"internal"}))}}else{if(c.data("horizontalScroll")){if(h.add(s).unbind("click"),c.data({bindEvent_buttonsPixels_x:!1}),!c.data("bindEvent_buttonsContinuous_x")){h.bind("mousedown touchstart MSPointerDown",function(n){n.preventDefault();var t=d();c.data({mCSB_buttonScrollRight:setInterval(function(){c.mCustomScrollbar("scrollTo",Math.abs(r.position().left)+t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var nt=function(n){n.preventDefault();clearInterval(c.data("mCSB_buttonScrollRight"))};h.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",nt);s.bind("mousedown touchstart MSPointerDown",function(n){n.preventDefault();var t=d();c.data({mCSB_buttonScrollLeft:setInterval(function(){c.mCustomScrollbar("scrollTo",Math.abs(r.position().left)-t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var tt=function(n){n.preventDefault();clearInterval(c.data("mCSB_buttonScrollLeft"))};s.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",tt);c.data({bindEvent_buttonsContinuous_x:!0})}}else if(o.add(e).unbind("click"),c.data({bindEvent_buttonsPixels_y:!1}),!c.data("bindEvent_buttonsContinuous_y")){o.bind("mousedown touchstart MSPointerDown",function(n){n.preventDefault();var t=d();c.data({mCSB_buttonScrollDown:setInterval(function(){c.mCustomScrollbar("scrollTo",Math.abs(r.position().top)+t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var ut=function(n){n.preventDefault();clearInterval(c.data("mCSB_buttonScrollDown"))};o.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",ut);e.bind("mousedown touchstart MSPointerDown",function(n){n.preventDefault();var t=d();c.data({mCSB_buttonScrollUp:setInterval(function(){c.mCustomScrollbar("scrollTo",Math.abs(r.position().top)-t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var ft=function(n){n.preventDefault();clearInterval(c.data("mCSB_buttonScrollUp"))};e.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",ft);c.data({bindEvent_buttonsContinuous_y:!0})}function d(){var n=c.data("scrollButtons_scrollSpeed");return c.data("scrollButtons_scrollSpeed")==="auto"&&(n=Math.round((c.data("scrollInertia")+100)/40)),n}}c.data("autoScrollOnFocus")&&(c.data("bindEvent_focusin")||(i.bind("focusin",function(){i.scrollTop(0).scrollLeft(0);var t=n(document.activeElement);if(t.is("input,textarea,select,button,a[tabindex],area,object")){var f=r.position().top,u=t.position().top,e=i.height()-t.outerHeight();c.data("horizontalScroll")&&(f=r.position().left,u=t.position().left,e=i.width()-t.outerWidth());(f+u<0||f+u>e)&&c.mCustomScrollbar("scrollTo",u,{trigger:"internal"})}}),c.data({bindEvent_focusin:!0})));c.data("autoHideScrollbar")&&(c.data("bindEvent_autoHideScrollbar")||(i.bind("mouseenter",function(){i.addClass("mCS-mouse-over");t.showScrollbar.call(i.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(n){i.removeClass("mCS-mouse-over");n.type==="mouseleave"&&t.hideScrollbar.call(i.children(".mCSB_scrollTools"))}),c.data({bindEvent_autoHideScrollbar:!0})))},scrollTo:function(i,r){var u=n(this),d={moveDragger:!1,trigger:"external",callbacks:!0,scrollInertia:u.data("scrollInertia"),scrollEasing:u.data("scrollEasing")},r=n.extend(d,r),e,o=u.children(".mCustomScrollBox"),f=o.children(".mCSB_container"),v=o.children(".mCSB_scrollTools"),y=v.children(".mCSB_draggerContainer"),s=y.children(".mCSB_dragger"),k=draggerSpeed=r.scrollInertia,w,c,b,l;if(!f.hasClass("mCS_no_scrollbar")&&(u.data({mCS_trigger:r.trigger}),u.data("mCS_Init")&&(r.callbacks=!1),i||i===0)){if(typeof i=="number")r.moveDragger?(e=i,i=u.data("horizontalScroll")?s.position().left*u.data("scrollAmount"):s.position().top*u.data("scrollAmount"),draggerSpeed=0):e=i/u.data("scrollAmount");else if(typeof i=="string"){var p;p=i==="top"?0:i!=="bottom"||u.data("horizontalScroll")?i==="left"?0:i==="right"&&u.data("horizontalScroll")?f.outerWidth()-o.width():i==="first"?u.find(".mCSB_container").find(":first"):i==="last"?u.find(".mCSB_container").find(":last"):u.find(i):f.outerHeight()-o.height();p.length===1?(i=u.data("horizontalScroll")?p.position().left:p.position().top,e=i/u.data("scrollAmount")):e=i=p}if(u.data("horizontalScroll")){u.data("onTotalScrollBack_Offset")&&(c=-u.data("onTotalScrollBack_Offset"));u.data("onTotalScroll_Offset")&&(l=o.width()-f.outerWidth()+u.data("onTotalScroll_Offset"));e<0?(e=i=0,clearInterval(u.data("mCSB_buttonScrollLeft")),c||(w=!0)):e>=y.width()-s.width()?(e=y.width()-s.width(),i=o.width()-f.outerWidth(),clearInterval(u.data("mCSB_buttonScrollRight")),l||(b=!0)):i=-i;var a=u.data("snapAmount");a&&(i=Math.round(i/a)*a-u.data("snapOffset"));t.mTweenAxis.call(this,s[0],"left",Math.round(e),draggerSpeed,r.scrollEasing);t.mTweenAxis.call(this,f[0],"left",Math.round(i),k,r.scrollEasing,{onStart:function(){r.callbacks&&!u.data("mCS_tweenRunning")&&h("onScrollStart");u.data("autoHideScrollbar")&&t.showScrollbar.call(v)},onUpdate:function(){r.callbacks&&h("whileScrolling")},onComplete:function(){r.callbacks&&(h("onScroll"),(w||c&&f.position().left>=c)&&h("onTotalScrollBack"),(b||l&&f.position().left<=l)&&h("onTotalScroll"));s.data("preventAction",!1);u.data("mCS_tweenRunning",!1);u.data("autoHideScrollbar")&&(o.hasClass("mCS-mouse-over")||t.hideScrollbar.call(v))}})}else{u.data("onTotalScrollBack_Offset")&&(c=-u.data("onTotalScrollBack_Offset"));u.data("onTotalScroll_Offset")&&(l=o.height()-f.outerHeight()+u.data("onTotalScroll_Offset"));e<0?(e=i=0,clearInterval(u.data("mCSB_buttonScrollUp")),c||(w=!0)):e>=y.height()-s.height()?(e=y.height()-s.height(),i=o.height()-f.outerHeight(),clearInterval(u.data("mCSB_buttonScrollDown")),l||(b=!0)):i=-i;var a=u.data("snapAmount");a&&(i=Math.round(i/a)*a-u.data("snapOffset"));t.mTweenAxis.call(this,s[0],"top",Math.round(e),draggerSpeed,r.scrollEasing);t.mTweenAxis.call(this,f[0],"top",Math.round(i),k,r.scrollEasing,{onStart:function(){r.callbacks&&!u.data("mCS_tweenRunning")&&h("onScrollStart");u.data("autoHideScrollbar")&&t.showScrollbar.call(v)},onUpdate:function(){r.callbacks&&h("whileScrolling")},onComplete:function(){r.callbacks&&(h("onScroll"),(w||c&&f.position().top>=c)&&h("onTotalScrollBack"),(b||l&&f.position().top<=l)&&h("onTotalScroll"));s.data("preventAction",!1);u.data("mCS_tweenRunning",!1);u.data("autoHideScrollbar")&&(o.hasClass("mCS-mouse-over")||t.hideScrollbar.call(v))}})}u.data("mCS_Init")&&u.data({mCS_Init:!1})}function h(n){this.mcs={top:f.position().top,left:f.position().left,draggerTop:s.position().top,draggerLeft:s.position().left,topPct:Math.round(100*Math.abs(f.position().top)/Math.abs(f.outerHeight()-o.height())),leftPct:Math.round(100*Math.abs(f.position().left)/Math.abs(f.outerWidth()-o.width()))};switch(n){case"onScrollStart":u.data("mCS_tweenRunning",!0).data("onScrollStart_Callback").call(u,this.mcs);break;case"whileScrolling":u.data("whileScrolling_Callback").call(u,this.mcs);break;case"onScroll":u.data("onScroll_Callback").call(u,this.mcs);break;case"onTotalScrollBack":u.data("onTotalScrollBack_Callback").call(u,this.mcs);break;case"onTotalScroll":u.data("onTotalScroll_Callback").call(u,this.mcs)}}},stop:function(){var i=n(this),r=i.children().children(".mCSB_container"),u=i.children().children().children().children(".mCSB_dragger");t.mTweenAxisStop.call(this,r[0]);t.mTweenAxisStop.call(this,u[0])},disable:function(t){var r=n(this),u=r.children(".mCustomScrollBox"),i=u.children(".mCSB_container"),f=u.children(".mCSB_scrollTools"),e=f.children().children(".mCSB_dragger");u.unbind("mousewheel focusin mouseenter mouseleave touchend");i.unbind("touchstart touchmove");t&&(r.data("horizontalScroll")?e.add(i).css("left",0):e.add(i).css("top",0));f.css("display","none");i.addClass("mCS_no_scrollbar");r.data({bindEvent_mousewheel:!1,bindEvent_focusin:!1,bindEvent_content_touch:!1,bindEvent_autoHideScrollbar:!1}).addClass("mCS_disabled")},destroy:function(){var t=n(this);t.removeClass("mCustomScrollbar _mCS_"+t.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();n(document).unbind("mousemove."+t.data("mCustomScrollbarIndex")+" mouseup."+t.data("mCustomScrollbarIndex")+" MSPointerMove."+t.data("mCustomScrollbarIndex")+" MSPointerUp."+t.data("mCustomScrollbarIndex"));n(i).unbind("resize."+t.data("mCustomScrollbarIndex"))}},t={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(n,t,r,u,f,e){var e=e||{},y=e.onStart||function(){},p=e.onUpdate||function(){},w=e.onComplete||function(){},b=l(),s,o=0,h=n.offsetTop,c=n.style;t==="left"&&(h=n.offsetLeft);var k=r-h;g();d();function l(){return i.performance&&i.performance.now?i.performance.now():i.performance&&i.performance.webkitNow?i.performance.webkitNow():Date.now?Date.now():(new Date).getTime()}function a(){o||y.call();o=l()-b;v();o>=n._time&&(n._time=o>n._time?o+s-(o-n._time):o+s-1,n._time<o+1&&(n._time=o+1));n._time<u?n._id=_request(a):w.call()}function v(){u>0?(n.currVal=nt(n._time,h,k,u,f),c[t]=Math.round(n.currVal)+"px"):c[t]=r+"px";p.call()}function d(){s=1e3/60;n._time=o+s;_request=i.requestAnimationFrame?i.requestAnimationFrame:function(n){return v(),setTimeout(n,.01)};n._id=_request(a)}function g(){n._id!=null&&(i.requestAnimationFrame?i.cancelAnimationFrame(n._id):clearTimeout(n._id),n._id=null)}function nt(n,t,i,r,u){switch(u){case"linear":return i*n/r+t;case"easeOutQuad":return n/=r,-i*n*(n-2)+t;case"easeInOutQuad":return(n/=r/2,n<1)?i/2*n*n+t:(n--,-i/2*(n*(n-2)-1)+t);case"easeOutCubic":return n/=r,n--,i*(n*n*n+1)+t;case"easeOutQuart":return n/=r,n--,-i*(n*n*n*n-1)+t;case"easeOutQuint":return n/=r,n--,i*(n*n*n*n*n+1)+t;case"easeOutCirc":return n/=r,n--,i*Math.sqrt(1-n*n)+t;case"easeOutSine":return i*Math.sin(n/r*(Math.PI/2))+t;case"easeOutExpo":return i*(-Math.pow(2,-10*n/r)+1)+t;case"mcsEaseOut":var f=(n/=r)*n,e=f*n;return t+i*(.499999999999997*e*f+-2.5*f*f+5.5*e+-6.5*f+4*n);case"draggerRailEase":return(n/=r/2,n<1)?i/2*n*n*n+t:(n-=2,i/2*(n*n*n+2)+t)}}},mTweenAxisStop:function(n){n._id!=null&&(i.requestAnimationFrame?i.cancelAnimationFrame(n._id):clearTimeout(n._id),n._id=null)},rafPolyfill:function(){for(var n=["ms","moz","webkit","o"],t=n.length;--t>-1&&!i.requestAnimationFrame;)i.requestAnimationFrame=i[n[t]+"RequestAnimationFrame"],i.cancelAnimationFrame=i[n[t]+"CancelAnimationFrame"]||i[n[t]+"CancelRequestAnimationFrame"]}};t.rafPolyfill.call();n.support.touch=!!("ontouchstart"in i);n.support.msPointer=i.navigator.msPointerEnabled;var u="https:"==document.location.protocol?"https:":"http:";n.event.special.mousewheel||document.write('<script src="'+u+'//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.0.6/jquery.mousewheel.min.js"><\/script>');n.fn.mCustomScrollbar=function(t){if(r[t])return r[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t!="object"&&t)n.error("Method "+t+" does not exist");else return r.init.apply(this,arguments)}})(n)}(asljQuery,asljQuery,window),function(n,t,i){
15
+ /*! Ajax Search Lite 4.6 js */
16
+ (function(n){var r={init:function(t,i){var r=this;this.elem=i;this.$elem=n(i);r.searching=!1;r.o=n.extend({},t);r.n={};r.n.container=n(this.elem);r.o.rid=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.o.id=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.n.probox=n(".probox",r.n.container);r.n.proinput=n(".proinput",r.n.container);r.n.text=n(".proinput input.orig",r.n.container);r.n.textAutocomplete=n(".proinput input.autocomplete",r.n.container);r.n.loading=n(".proinput .loading",r.n.container);r.n.proloading=n(".proloading",r.n.container);r.n.proclose=n(".proclose",r.n.container);r.n.promagnifier=n(".promagnifier",r.n.container);r.n.prosettings=n(".prosettings",r.n.container);r.n.searchsettings=n("#ajaxsearchlitesettings"+r.o.rid);r.n.resultsDiv=n("#ajaxsearchliteres"+r.o.rid);r.n.hiddenContainer=n("#asl_hidden_data");r.n.aslItemOverlay=n(".asl_item_overlay",r.n.hiddenContainer);r.resizeTimeout=null;r.n.showmore=n(".showmore a",r.n.resultsDiv);r.n.items=n(".item",r.n.resultsDiv);r.n.results=n(".results",r.n.resultsDiv);r.n.resdrg=n(".resdrg",r.n.resultsDiv);r.il={columns:3,itemsPerPage:6};r.firstClick=!0;r.post=null;r.postAuto=null;r.cleanUp();r.n.textAutocomplete.val("");r.o.resultitemheight=parseInt(r.o.resultitemheight);r.scroll={};r.settScroll=null;r.n.resultsAppend=n("#wpdreams_asl_results_"+r.o.id);r.currentPage=1;r.isotopic=null;r.animation="bounceIn";switch(r.o.resultstype){case"vertical":r.animation=r.o.vresultanimation;break;default:r.animation=r.o.hresultanimation}return r.filterFns={number:function(){for(var t=n(this).parent();!t.hasClass("isotopic");)t=t.parent();var i=n(this).attr("data-itemnum"),u=r.currentPage,f=r.il.itemsPerPage;return parseInt(i,10)<f*u&&parseInt(i,10)>=f*(u-1)}},r.disableMobileScroll=!1,r.n.searchsettings.detach().appendTo("body"),r.o.resultsposition=="hover"?r.n.resultsDiv.detach().appendTo("body"):r.n.resultsAppend.length>0&&r.n.resultsDiv.detach().appendTo(r.n.resultsAppend),r.createVerticalScroll(),f()&&r.n.container.addClass("asl_msie"),r.initSettingsAnimations(),r.initResultsAnimations(),r.initEvents(),this},duplicateCheck:function(){var i=this,t={};n("div[id*=ajaxsearchlite]").each(function(){t.hasOwnProperty(this.id)?n(this).remove():t[this.id]="true"})},analytics:function(n){var t=this;t.o.analytics&&t.o.analyticsString!=""&&typeof ga=="function"&&ga("send","pageview",{page:"/"+t.o.analyticsString.replace("{asl_term}",n),title:"Ajax Search"})},createVerticalScroll:function(){var i=this;i.scroll=i.n.results.mCustomScrollbar({contentTouchScroll:!0,scrollButtons:{enable:!0},callbacks:{onScroll:function(){if(!t()){var s=parseInt(n(".mCSB_container",i.n.results).position().top),h=n(".mCSB_container .resdrg").children(),f=0,o=3e3,u=4e3,c=1e4,e=1e4,r=null;h.each(function(){u=Math.abs(Math.abs(s)-f);u<o&&(c=u,e=f,r=n(this));f+=n(this).outerHeight(!0);o=u});r.hasClass("group")&&(e=e+(r.outerHeight(!0)-r.outerHeight(!1)));i.scroll.mCustomScrollbar("scrollTo",r,{scrollInertia:200,callbacks:!1})}}}})},createHorizontalScroll:function(){var n=this;n.scroll=n.n.results.mCustomScrollbar({horizontalScroll:!0,contentTouchScroll:!0,scrollButtons:{enable:!0,scrollType:"pixels",scrollSpeed:"auto",scrollAmount:100}})},initEvents:function(){var t=this;n(t.n.text.parent()).submit(function(n){n.preventDefault();t.n.text.keyup()});t.n.text.click(function(){t.firstClick&&(n(this).val(""),t.firstClick=!1)});t.n.resultsDiv.css({opacity:0});n(document).bind("click touchend",function(){(t.hideSettings(),t.opened!=!1&&t.o.closeOnDocClick==1)&&t.hideResults()});t.n.proclose.bind("click touchend",function(){t.opened!=!1&&(t.n.text.val(""),t.n.textAutocomplete.val(""),t.hideResults(),t.n.text.focus())});n(t.elem).bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.resultsDiv.bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.searchsettings.bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.prosettings.on("click",function(){t.n.prosettings.data("opened")==0?t.showSettings():t.hideSettings()});n(document).bind("touchmove",function(n){t.disableMobileScroll==!0&&n.preventDefault()});var r;n(i).on("resize",function(){clearTimeout(r);r=setTimeout(function(){t.resize()},250)});var u;n(i).on("scroll",function(){clearTimeout(u);u=setTimeout(function(){t.scrolling(!1)},250)});t.initNavigationEvent();n(i).trigger("resize");n(i).trigger("scroll");t.initMagnifierEvent();t.initAutocompleteEvent();t.initFacetEvents()},initNavigationEvent:function(){var t=this;n(t.n.resultsDiv).on("mouseenter",".item",function(){n(".item",t.n.resultsDiv).removeClass("hovered");n(this).addClass("hovered")});n(t.n.resultsDiv).on("mouseleave",".item",function(){n(".item",t.n.resultsDiv).removeClass("hovered")});n(document).keydown(function(r){if(i.event)var u=i.event.keyCode,f=i.event.type;else if(r)var u=r.which,f=r.type;n(".item",t.n.resultsDiv).length>0&&t.n.resultsDiv.css("display")!="none"&&(u==40&&(r.stopPropagation(),r.preventDefault(),t.n.text.blur(),t.post!=null&&t.post.abort(),n(".item.hovered",t.n.resultsDiv).length==0?n(".item",t.n.resultsDiv).first().addClass("hovered"):n(".item.hovered",t.n.resultsDiv).removeClass("hovered").next().next(".item").addClass("hovered"),t.scroll.mCustomScrollbar("scrollTo",".resdrg .item.hovered",{scrollInertia:200,callbacks:!1})),u==38&&(r.stopPropagation(),r.preventDefault(),t.n.text.blur(),t.post!=null&&t.post.abort(),n(".item.hovered",t.n.resultsDiv).length==0?n(".item",t.n.resultsDiv).last().addClass("hovered"):n(".item.hovered",t.n.resultsDiv).removeClass("hovered").prev().prev(".item").addClass("hovered"),t.scroll.mCustomScrollbar("scrollTo",".resdrg .item.hovered",{scrollInertia:200,callbacks:!1})),u==13&&n(".item.hovered",t.n.resultsDiv).length>0&&(r.stopPropagation(),r.preventDefault(),n(".item.hovered a.asl_res_url",t.n.resultsDiv).get(0).click()))})},initMagnifierEvent:function(){var t=this,r;t.n.promagnifier.add(t.n.text).bind("click keyup",function(f){i.event?(t.keycode=i.event.keyCode,t.ktype=i.event.type):f&&(t.keycode=f.which,t.ktype=f.type);var e=n(this).hasClass("orig");if(t.n.text.val().length<t.o.charcount){t.n.proloading.css("display","none");t.hideResults();t.post!=null&&t.post.abort();clearTimeout(r);return}if(!e&&t.o.redirectonclick==1&&t.ktype=="click"&&t.o.redirectClickTo=="results_page"||e&&t.o.redirect_on_enter==1&&t.ktype=="keyup"&&t.keycode==13&&t.o.redirectEnterTo=="results_page"){var o="?s="+t.n.text.val();t.o.overridewpdefault?u(t.o.homeurl+o+"&asl_active=1","post",{p_asl_data:n("form",t.n.searchsettings).serialize()}):u(t.o.homeurl+o,"post",{np_asl_data:n("form",t.n.searchsettings).serialize()});t.n.proloading.css("display","none");t.hideResults();t.post!=null&&t.post.abort();clearTimeout(r);return}t.keycode>=37&&t.keycode<=40||n(this).hasClass("orig")&&t.ktype=="click"||(t.o.triggeronclick!=0||t.ktype!="click")&&(t.o.triggerontype!=0||t.ktype!="keyup")&&(t.post!=null&&t.post.abort(),clearTimeout(r),r=setTimeout(function(){t.search()},300))})},initFacetEvents:function(){var t=this;t.o.trigger_on_facet_change==1&&n("input",t.n.searchsettings).change(function(){t.n.text.val().length<t.o.charcount||(t.post!=null&&t.post.abort(),t.search())})},destroy:function(){return this.each(function(){var t=n.extend({},this,r);n(i).unbind(t)})},searchfor:function(t){n(".proinput input",this).val(t).trigger("keyup")},initAutocompleteEvent:function(){var r=this;r.o.autocomplete.enabled!=1||t()||r.n.text.keyup(function(t){i.event?(r.keycode=i.event.keyCode,r.ktype=i.event.type):t&&(r.keycode=t.which,r.ktype=t.type);var u=39;n("body").hasClass("rtl")&&(u=37);r.keycode==u&&r.n.textAutocomplete.val()!=""?(t.preventDefault(),r.n.text.val(r.n.textAutocomplete.val()),r.post!=null&&r.post.abort(),r.search()):(r.postAuto!=null&&r.postAuto.abort(),r.autocompleteGoogleOnly())})},autocompleteGoogleOnly:function(){var t=this,i=t.n.text.val();if(t.n.text.val()==""){t.n.textAutocomplete.val("");return}var r=t.n.textAutocomplete.val();(r==""||r.indexOf(i)!=0)&&(t.n.textAutocomplete.val(""),n.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:i,hl:t.o.autocomplete.lang,nolabels:"t",client:"hp",ds:""},success:function(r){r[1].length>0&&(response=r[1][0][0].replace(/(<([^>]+)>)/ig,""),response=n("<textarea />").html(response).text(),response=response.substr(i.length),t.n.textAutocomplete.val(i+response))}}))},search:function(){var t=this;if((!t.searching||!0)&&!(t.n.text.val().length<t.o.charcount)){t.searching=!0;t.n.proloading.css({display:"block"});t.n.proclose.css({display:"none"});t.hideSettings();var i={action:"ajaxsearchlite_search",aslp:t.n.text.val(),asid:t.o.id,options:n("form",t.n.searchsettings).serialize()};t.analytics(t.n.text.val());t.post=n.post(ajaxsearchlite.ajaxurl,i,function(i){if(i=i.replace(/^\s*[\r\n]/gm,""),i=i.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1],t.n.resdrg.html(""),t.n.resdrg.html(i),n(".asl_keyword",t.n.resdrg).bind("click",function(){t.n.text.val(n(this).html());n("input.orig",t.n.container).val(n(this).html()).keydown();n("form",t.n.container).trigger("submit","ajax");t.search()}),t.n.items=n(".item",t.n.resultsDiv),n(".asl_res_url",t.n.resultsDiv).length>0&&t.o.redirectonclick==1&&t.ktype=="click"&&t.o.redirectClickTo!="results_page"||t.o.redirect_on_enter==1&&t.ktype=="keyup"&&t.keycode==13&&t.o.redirectEnterTo!="results_page")return location.href=n(n(".asl_res_url",t.n.resultsDiv).get(0)).attr("href"),!1;t.showResults();t.scrollToResults();t.n.items.length==0?t.n.showmore!=null&&t.n.showmore.css("display","none"):t.n.showmore!=null&&(t.n.showmore.css("display","block"),t.n.showmore.attr("href",t.o.homeurl+"?s="+t.n.text.val()))},"text")}},showLoader:function(){var n=this;n.n.proloading.css({display:"block"})},hideLoader:function(){var n=this;n.n.proloading.css({display:"none"});n.n.results.css("display","")},showResultsBox:function(){var n=this;n.n.resultsDiv.css({display:"block",height:"auto"});n.n.items.addClass(n.animationOpacity);n.scrolling(!0);n.n.resultsDiv.css(n.resAnim.showCSS);n.n.resultsDiv.removeClass(n.resAnim.hideClass).addClass(n.resAnim.showClass)},showResults:function(){var n=this;switch(n.o.resultstype){case"vertical":n.showVerticalResults();break;default:n.showHorizontalResults()}n.hideLoader();n.n.proclose.css({display:"block"});n.n.showmore!=null&&(n.n.items.length>0?n.n.showmore.css({display:"block"}):n.n.showmore.css({display:"none"}));t()&&n.o.mobile.hide_keyboard&&document.activeElement.blur();n.resultsOpened=!0},hideResults:function(){var n=this;if(!n.resultsOpened)return!1;n.n.resultsDiv.removeClass(n.resAnim.showClass).addClass(n.resAnim.hideClass);setTimeout(function(){n.n.resultsDiv.css(n.resAnim.hideCSS)},n.resAnim.duration);n.n.proclose.css({display:"none"});n.n.showmore!=null&&n.n.showmore.css({display:"none"});t()&&document.activeElement.blur();n.resultsOpened=!1},scrollToResults:function(){if(($this=this,this.o.scrollToResults==1)&&!this.$elem.parent().hasClass("asl_preview_data")){if($this.o.resultsposition=="hover")var t=$this.n.probox.offset().top-20;else var t=$this.n.resultsDiv.offset().top-20;n("#wpadminbar").length>0&&(t-=n("#wpadminbar").height());t=t<0?0:t;n("body, html").animate({scrollTop:t},{duration:500})}},createGroup:function(n){return"<div class='group'>"+n+"<\/div>"},showVerticalResults:function(){var t=this;if(t.showResultsBox(),t.n.items.length>0){var f=t.n.items.length<t.o.itemscount?t.n.items.length:t.o.itemscount,o=n(".group",t.n.resultsDiv);if(t.n.items.length<=t.o.itemscount)t.n.results.css({height:"auto"});else{t.n.results.css({height:30});t.scroll.mCustomScrollbar("update");t.resize();var r=0,u=0;t.n.items.each(function(){u+=n(this).outerHeight(!0);r++});r=r<1?1:r;u=u/r*f;t.n.results.css({height:u})}if(i.sscroll=t.scroll,t.scroll.mCustomScrollbar("disable",!0),t.scroll.mCustomScrollbar("update"),t.resize(),t.scroll.mCustomScrollbar("scrollTo",0),t.o.highlight==1){var e=t.o.highlightwholewords==1?!0:!1;n("div.item",t.n.resultsDiv).highlight(t.n.text.val().split(" "),{element:"span",className:"highlighted",wordsOnly:e})}}if(t.resize(),t.n.items.length==0){var u=n(".nores",t.n.results).outerHeight(!0)>t.o.resultitemheight?t.o.resultitemheight:n(".nores",t.n.results).outerHeight(!0);t.n.results.css({height:11110});t.scroll.mCustomScrollbar("update");t.n.results.css({height:"auto"})}t.addAnimation();t.scrolling(!0);t.searching=!1},hideVerticalResults:function(){var t=this;t.disableMobileScroll=!1;t.n.resultsDiv.animate({opacity:0,height:0},{duration:120,complete:function(){n(this).css({visibility:"hidden",display:"none"})}})},addAnimation:function(){var i=this,t=0,r=1;i.n.items.each(function(){var u=this;setTimeout(function(){n(u).addClass(i.animation)},t);t=t+60;r++})},removeAnimation:function(){var t=this;t.n.items.each(function(){var i=this;n(i).removeClass(t.animation)})},initSettingsAnimations:function(){var n=this,t=300;n.settAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":t},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:t};n.n.searchsettings.css({"-webkit-animation-duration":n.settAnim.duration+"ms","animation-duration":n.settAnim.duration+"ms"})},initResultsAnimations:function(){var t=this,n=300;t.resAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":n},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:n};t.n.resultsDiv.css({"-webkit-animation-duration":n+"ms","animation-duration":n+"ms"})},showSettings:function(){var t=this;t.scrolling(!0);t.n.searchsettings.css(t.settAnim.showCSS);t.n.searchsettings.removeClass(t.settAnim.hideClass).addClass(t.settAnim.showClass);t.settScroll==null&&(t.settScroll=n(".asl_sett_scroll",t.n.searchsettings).mCustomScrollbar({contentTouchScroll:!0}));t.n.prosettings.data("opened",1)},hideSettings:function(){var n=this;n.n.searchsettings.removeClass(n.settAnim.showClass).addClass(n.settAnim.hideClass);setTimeout(function(){n.n.searchsettings.css(n.settAnim.hideCSS)},n.settAnim.duration);n.n.prosettings.data("opened",0)},cleanUp:function(){var t=this;n(".searchsettings",t.n.container).length>0&&(n("body>#ajaxsearchlitesettings"+t.o.rid).remove(),n("body>#ajaxsearchliteres"+t.o.rid).remove())},resize:function(){var t=this,i=0;if(n("body").css("position")!="static"&&(i=n("body").offset().top),f()&&0&&(t.n.proinput.css({width:t.n.probox.width()-8-(t.n.proinput.outerWidth(!1)-t.n.proinput.width())-t.n.proloading.outerWidth(!0)-t.n.prosettings.outerWidth(!0)-t.n.promagnifier.outerWidth(!0)-10}),t.n.text.css({width:t.n.proinput.width()-2+t.n.proloading.outerWidth(!0),position:"absolute",zIndex:2}),t.n.textAutocomplete.css({width:t.n.proinput.width()-2+t.n.proloading.outerWidth(!0),opacity:.25,zIndex:1})),t.n.prosettings.attr("opened")!=0&&(t.o.settingsimagepos=="left"?t.n.searchsettings.css({display:"block",top:t.n.prosettings.offset().top+t.n.prosettings.height()-2-i,left:t.n.prosettings.offset().left}):t.n.searchsettings.css({display:"block",top:t.n.prosettings.offset().top+t.n.prosettings.height()-2-i,left:t.n.prosettings.offset().left+t.n.prosettings.width()-t.n.searchsettings.width()})),t.n.resultsDiv.css("visibility")!="hidden"&&t.o.resultsposition!="block"){var r=t.n.container.width()-(t.n.resultsDiv.outerWidth(!0)-t.n.resultsDiv.width()),u=r<240?240:r;t.n.resultsDiv.css({width:u,top:t.n.container.offset().top+t.n.container.outerHeight(!0)+10-i,left:t.n.container.offset().left+(r-u)})}},scrolling:function(t){var i=this,r=0;if(n("body").css("position")!="static"&&(r=n("body").offset().top),(t==!0||i.n.searchsettings.css("visibility")=="visible")&&(i.o.settingsimagepos=="left"?i.n.searchsettings.css({display:"block",top:i.n.prosettings.offset().top+i.n.prosettings.height()-2-r,left:i.n.prosettings.offset().left}):i.n.searchsettings.css({display:"block",top:i.n.prosettings.offset().top+i.n.prosettings.height()-2-r,left:i.n.prosettings.offset().left+i.n.prosettings.width()-i.n.searchsettings.width()})),t==!0||i.n.resultsDiv.css("visibility")=="visible"){var u=i.n.container.width()-(i.n.resultsDiv.outerWidth(!0)-i.n.resultsDiv.width()),f=u<240?240:u;(i.o.resultsposition!="hover"&&i.n.resultsAppend.length>0||i.n.container.hasClass("hiddend"))&&(f="auto");i.n.resultsDiv.css({width:f,top:i.n.container.offset().top+i.n.container.outerHeight(!0)+10-r,left:i.n.container.offset().left+(u-f)})}}};function t(){try{return document.createEvent("TouchEvent"),!0}catch(n){return!1}}function u(t,i,r){"use strict";var u;u=n("<form />",{action:t,method:i,style:"display: none;"});typeof r!="undefined"&&r!==null&&n.each(r,function(t,i){n("<input />",{type:"hidden",name:t,value:i}).appendTo(u)});u.appendTo("body").submit()}function f(){var n=i.navigator.userAgent,t=n.indexOf("MSIE "),r=n.indexOf("Trident/");return t>0||r>0?!0:!1}typeof Object.create!="function"&&(Object.create=function(n){function t(){}return t.prototype=n,new t});n.plugin=function(t,i){n.fn[t]=function(r){return this.each(function(){n.data(this,t)||n.data(this,t,Object.create(i).init(r,this))})}};n.plugin("ajaxsearchlite",r)})(n)}(asljQuery,asljQuery,window),function(n,t,i){i.ASL=i.ASL||{};i.ASL.getScope=function(){return typeof n!="undefined"?n:typeof i[ASL.js_scope]!="undefined"?i[ASL.js_scope]:eval(ASL.js_scope)};i.ASL.initialize=function(n){var t=i.ASL.getScope(),r=".asl_init_data";typeof ASL_INSTANCES!="undefined"&&Object.keys(ASL_INSTANCES).length>0?t.each(ASL_INSTANCES,function(n,i){return typeof i=="undefined"?!1:t("#ajaxsearchlite"+n).hasClass("hasASL")?!1:(t("#ajaxsearchlite"+n).addClass("hasASL"),t("#ajaxsearchlite"+n).ajaxsearchlite(i))}):(typeof n!="undefined"&&(r="div[id*=asl_init_id_"+n+"]"),t(r).each(function(){var i=t(this).attr("id").match(/^asl_init_id_(.*)/)[1],n=t(this).html();if(typeof n=="undefined")return!1;var r=JSON.parse(n);return t("#ajaxsearchlite"+i).ajaxsearchlite(r)}))};i.ASL.ready=function(){var n=this,t=n.getScope(),i=null;t(document).ready(function(){n.initialize()});typeof ASL.detect_ajax!="undefined"&&ASL.detect_ajax==1&&t("body").bind("DOMSubtreeModified",function(){clearTimeout(i);i=setTimeout(function(){n.initialize()},500)})};i._ASL=ASL;i._ASL.ready()}(asljQuery,asljQuery,window);
js/min/jquery.ajaxsearchlite.min.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function(n){typeof define=="function"&&define.amd&&define.amd.jQuery?define(["jquery"],n):typeof module!="undefined"&&module.exports?n(require("jquery")):n(jQuery)})(function(n){var r="left",u="right",f="up",e="down",v="in",y="out",p="none",nt="auto",w="swipe",b="pinch",k="tap",tt="doubletap",it="longtap",d="horizontal",g="vertical",l="all",ut=10,rt="start",o="move",t="end",i="cancel",c="ontouchstart"in window,a=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!c,s=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!c,h="TouchSwipe";n.fn.swipe=function(t){var r=n(this),i=r.data(h);if(i&&typeof t=="string"){if(i[t])return i[t].apply(this,Array.prototype.slice.call(arguments,1));n.error("Method "+t+" does not exist on jQuery.swipe")}else if(i&&typeof t=="object")i.option.apply(this,arguments);else if(!i&&(typeof t=="object"||!t))return ft.apply(this,arguments);return r};n.fn.swipe.version="1.6.15";n.fn.swipe.defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:!0};n.fn.swipe.phases={PHASE_START:rt,PHASE_MOVE:o,PHASE_END:t,PHASE_CANCEL:i};n.fn.swipe.directions={LEFT:r,RIGHT:u,UP:f,DOWN:e,IN:v,OUT:y};n.fn.swipe.pageScroll={NONE:p,HORIZONTAL:d,VERTICAL:g,AUTO:nt};n.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:l};function ft(t){return t&&t.allowPageScroll===undefined&&(t.swipe!==undefined||t.swipeStatus!==undefined)&&(t.allowPageScroll=p),t.click!==undefined&&t.tap===undefined&&(t.tap=t.click),t||(t={}),t=n.extend({},n.fn.swipe.defaults,t),this.each(function(){var r=n(this),i=r.data(h);i||(i=new et(this,t),r.data(h,i))})}function et(ft,et){var et=n.extend({},et),si=c||s||!et.fallbackToMouseEvents,hi=si?s?a?"MSPointerDown":"pointerdown":"touchstart":"mousedown",ki=si?s?a?"MSPointerMove":"pointermove":"touchmove":"mousemove",di=si?s?a?"MSPointerUp":"pointerup":"touchend":"mouseup",ri=si?s?"mouseleave":null:"mouseleave",ci=s?a?"MSPointerCancel":"pointercancel":"touchcancel",at=0,vt=null,yt=null,lt=0,gt=0,ni=0,pt=1,bt=0,kt=0,li=null,ot=n(ft),st="start",ct=0,ht={},gi=0,ai=0,vi=0,nr=0,ti=0,fi=null,ei=null;try{ot.bind(hi,tr);ot.bind(ci,ui)}catch(ff){n.error("events not supported "+hi+","+ci+" on jQuery.swipe")}this.enable=function(){return ot.bind(hi,tr),ot.bind(ci,ui),ot};this.disable=function(){return lr(),ot};this.destroy=function(){lr();ot.data(h,null);ot=null};this.option=function(t,i){if(typeof t=="object")et=n.extend(et,t);else if(et[t]!==undefined){if(i===undefined)return et[t];et[t]=i}else if(t)n.error("Option "+t+" does not exist on jQuery.swipe.options");else return et;return null};function tr(t){if(!pu()&&!(n(t.target).closest(et.excludedElements,ot).length>0)){var r=t.originalEvent?t.originalEvent:t,f,u=r.touches,e=u?u[0]:r;return(st=rt,u?ct=u.length:et.preventDefaultEvents!==!1&&t.preventDefault(),at=0,vt=null,yt=null,kt=null,lt=0,gt=0,ni=0,pt=1,bt=0,li=ku(),dr(),wi(0,e),!u||ct===et.fingers||et.fingers===l||oi()?(gi=ii(),ct==2&&(wi(1,u[1]),gt=ni=cr(ht[0].start,ht[1].start)),(et.swipeStatus||et.pinchStatus)&&(f=wt(r,st))):f=!1,f===!1)?(st=i,wt(r,st),f):(et.hold&&(ei=setTimeout(n.proxy(function(){ot.trigger("hold",[r.target]);et.hold&&(f=et.hold.call(ot,r,r.target))},this),et.longTapThreshold)),pi(!0),null)}}function ir(n){var f=n.originalEvent?n.originalEvent:n;if(st!==t&&st!==i&&!yi()){var s,r=f.touches,h=r?r[0]:f,u=gr(h);if(ai=ii(),r&&(ct=r.length),et.hold&&clearTimeout(ei),st=o,ct==2&&(gt==0?(wi(1,r[1]),gt=ni=cr(ht[0].start,ht[1].start)):(gr(r[1]),ni=cr(ht[0].end,ht[1].end),kt=gu(ht[0].end,ht[1].end)),pt=du(gt,ni),bt=Math.abs(gt-ni)),ct===et.fingers||et.fingers===l||!r||oi()){if(vt=iu(u.start,u.end),yt=iu(u.last,u.end),uu(n,yt),at=nf(u.start,u.end),lt=tu(),bu(vt,at),s=wt(f,st),!et.triggerOnTouchEnd||et.triggerOnTouchLeave){var e=!0;if(et.triggerOnTouchLeave){var c=rf(this);e=uf(u.end,c)}!et.triggerOnTouchEnd&&e?st=fr(o):et.triggerOnTouchLeave&&!e&&(st=fr(t));(st==i||st==t)&&wt(f,st)}}else st=i,wt(f,st);s===!1&&(st=i,wt(f,st))}}function rr(n){var r=n.originalEvent?n.originalEvent:n,u=r.touches;if(u){if(u.length&&!yi())return yu(r),!0;if(u.length&&yi())return!0}return yi()&&(ct=nr),ai=ii(),lt=tu(),or()||!er()?(st=i,wt(r,st)):et.triggerOnTouchEnd||et.triggerOnTouchEnd==!1&&st===o?(et.preventDefaultEvents!==!1&&n.preventDefault(),st=t,wt(r,st)):!et.triggerOnTouchEnd&&br()?(st=t,dt(r,st,k)):st===o&&(st=i,wt(r,st)),pi(!1),null}function ui(){ct=0;ai=0;gi=0;gt=0;ni=0;pt=1;dr();pi(!1)}function ur(n){var i=n.originalEvent?n.originalEvent:n;et.triggerOnTouchLeave&&(st=fr(t),wt(i,st))}function lr(){ot.unbind(hi,tr);ot.unbind(ci,ui);ot.unbind(ki,ir);ot.unbind(di,rr);ri&&ot.unbind(ri,ur);pi(!1)}function fr(n){var r=n,f=ar(),u=er(),e=or();return!f||e?r=i:u&&n==o&&(!et.triggerOnTouchEnd||et.triggerOnTouchLeave)?r=t:!u&&n==t&&et.triggerOnTouchLeave&&(r=i),r}function wt(n,r){var u,f=n.touches;return(eu()||sr())&&(u=dt(n,r,w)),(fu()||oi())&&u!==!1&&(u=dt(n,r,b)),au()&&u!==!1?u=dt(n,r,tt):vu()&&u!==!1?u=dt(n,r,it):lu()&&u!==!1&&(u=dt(n,r,k)),r===i&&(sr()&&(u=dt(n,r,w)),oi()&&(u=dt(n,r,b)),ui(n)),r===t&&(f?f.length||ui(n):ui(n)),u}function dt(o,s,h){var c;if(h==w){if(ot.trigger("swipeStatus",[s,vt||null,at||0,lt||0,ct,ht,yt]),et.swipeStatus&&(c=et.swipeStatus.call(ot,o,s,vt||null,at||0,lt||0,ct,ht,yt),c===!1))return!1;if(s==t&&yr()){if(clearTimeout(fi),clearTimeout(ei),ot.trigger("swipe",[vt,at,lt,ct,ht,yt]),et.swipe&&(c=et.swipe.call(ot,o,vt,at,lt,ct,ht,yt),c===!1))return!1;switch(vt){case r:ot.trigger("swipeLeft",[vt,at,lt,ct,ht,yt]);et.swipeLeft&&(c=et.swipeLeft.call(ot,o,vt,at,lt,ct,ht,yt));break;case u:ot.trigger("swipeRight",[vt,at,lt,ct,ht,yt]);et.swipeRight&&(c=et.swipeRight.call(ot,o,vt,at,lt,ct,ht,yt));break;case f:ot.trigger("swipeUp",[vt,at,lt,ct,ht,yt]);et.swipeUp&&(c=et.swipeUp.call(ot,o,vt,at,lt,ct,ht,yt));break;case e:ot.trigger("swipeDown",[vt,at,lt,ct,ht,yt]);et.swipeDown&&(c=et.swipeDown.call(ot,o,vt,at,lt,ct,ht,yt))}}}if(h==b){if(ot.trigger("pinchStatus",[s,kt||null,bt||0,lt||0,ct,pt,ht]),et.pinchStatus&&(c=et.pinchStatus.call(ot,o,s,kt||null,bt||0,lt||0,ct,pt,ht),c===!1))return!1;if(s==t&&vr())switch(kt){case v:ot.trigger("pinchIn",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchIn&&(c=et.pinchIn.call(ot,o,kt||null,bt||0,lt||0,ct,pt,ht));break;case y:ot.trigger("pinchOut",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchOut&&(c=et.pinchOut.call(ot,o,kt||null,bt||0,lt||0,ct,pt,ht))}}return h==k?(s===i||s===t)&&(clearTimeout(fi),clearTimeout(ei),hr()&&!su()?(ti=ii(),fi=setTimeout(n.proxy(function(){ti=null;ot.trigger("tap",[o.target]);et.tap&&(c=et.tap.call(ot,o,o.target))},this),et.doubleTapThreshold)):(ti=null,ot.trigger("tap",[o.target]),et.tap&&(c=et.tap.call(ot,o,o.target)))):h==tt?(s===i||s===t)&&(clearTimeout(fi),clearTimeout(ei),ti=null,ot.trigger("doubletap",[o.target]),et.doubleTap&&(c=et.doubleTap.call(ot,o,o.target))):h==it&&(s===i||s===t)&&(clearTimeout(fi),ti=null,ot.trigger("longtap",[o.target]),et.longTap&&(c=et.longTap.call(ot,o,o.target))),c}function er(){var n=!0;return et.threshold!==null&&(n=at>=et.threshold),n}function or(){var n=!1;return et.cancelThreshold!==null&&vt!==null&&(n=nu(vt)-at>=et.cancelThreshold),n}function ru(){return et.pinchThreshold!==null?bt>=et.pinchThreshold:!0}function ar(){return et.maxTimeThreshold?lt>=et.maxTimeThreshold?!1:!0:!0}function uu(n,t){if(et.preventDefaultEvents!==!1)if(et.allowPageScroll===p)n.preventDefault();else{var i=et.allowPageScroll===nt;switch(t){case r:(et.swipeLeft&&i||!i&&et.allowPageScroll!=d)&&n.preventDefault();break;case u:(et.swipeRight&&i||!i&&et.allowPageScroll!=d)&&n.preventDefault();break;case f:(et.swipeUp&&i||!i&&et.allowPageScroll!=g)&&n.preventDefault();break;case e:(et.swipeDown&&i||!i&&et.allowPageScroll!=g)&&n.preventDefault()}}}function vr(){var n=pr(),t=wr(),i=ru();return n&&t&&i}function oi(){return!!(et.pinchStatus||et.pinchIn||et.pinchOut)}function fu(){return!!(vr()&&oi())}function yr(){var n=ar(),t=er(),i=pr(),r=wr(),u=or();return!u&&r&&i&&t&&n}function sr(){return!!(et.swipe||et.swipeStatus||et.swipeLeft||et.swipeRight||et.swipeUp||et.swipeDown)}function eu(){return!!(yr()&&sr())}function pr(){return ct===et.fingers||et.fingers===l||!c}function wr(){return ht[0].end.x!==0}function br(){return!!et.tap}function hr(){return!!et.doubleTap}function ou(){return!!et.longTap}function kr(){if(ti==null)return!1;var n=ii();return hr()&&n-ti<=et.doubleTapThreshold}function su(){return kr()}function hu(){return(ct===1||!c)&&(isNaN(at)||at<et.threshold)}function cu(){return lt>et.longTapThreshold&&at<ut}function lu(){return!!(hu()&&br())}function au(){return!!(kr()&&hr())}function vu(){return!!(cu()&&ou())}function yu(n){vi=ii();nr=n.touches.length+1}function dr(){vi=0;nr=0}function yi(){var n=!1;if(vi){var t=ii()-vi;t<=et.fingerReleaseThreshold&&(n=!0)}return n}function pu(){return!!(ot.data(h+"_intouch")===!0)}function pi(n){ot&&(n===!0?(ot.bind(ki,ir),ot.bind(di,rr),ri&&ot.bind(ri,ur)):(ot.unbind(ki,ir,!1),ot.unbind(di,rr,!1),ri&&ot.unbind(ri,ur,!1)),ot.data(h+"_intouch",n===!0))}function wi(n,t){var i={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return i.start.x=i.last.x=i.end.x=t.pageX||t.clientX,i.start.y=i.last.y=i.end.y=t.pageY||t.clientY,ht[n]=i,i}function gr(n){var i=n.identifier!==undefined?n.identifier:0,t=wu(i);return t===null&&(t=wi(i,n)),t.last.x=t.end.x,t.last.y=t.end.y,t.end.x=n.pageX||n.clientX,t.end.y=n.pageY||n.clientY,t}function wu(n){return ht[n]||null}function bu(n,t){t=Math.max(t,nu(n));li[n].distance=t}function nu(n){return li[n]?li[n].distance:undefined}function ku(){var n={};return n[r]=bi(r),n[u]=bi(u),n[f]=bi(f),n[e]=bi(e),n}function bi(n){return{direction:n,distance:0}}function tu(){return ai-gi}function cr(n,t){var i=Math.abs(n.x-t.x),r=Math.abs(n.y-t.y);return Math.round(Math.sqrt(i*i+r*r))}function du(n,t){var i=t/n*1;return i.toFixed(2)}function gu(){return pt<1?y:v}function nf(n,t){return Math.round(Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2)))}function tf(n,t){var r=n.x-t.x,u=t.y-n.y,f=Math.atan2(u,r),i=Math.round(f*180/Math.PI);return i<0&&(i=360-Math.abs(i)),i}function iu(n,t){var i=tf(n,t);return i<=45&&i>=0?r:i<=360&&i>=315?r:i>=135&&i<=225?u:i>45&&i<135?e:f}function ii(){var n=new Date;return n.getTime()}function rf(t){t=n(t);var i=t.offset();return{left:i.left,right:i.left+t.outerWidth(),top:i.top,bottom:i.top+t.outerHeight()}}function uf(n,t){return n.x>t.left&&n.x<t.right&&n.y>t.top&&n.y<t.bottom}}});
2
+ /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
3
+ * Licensed under the MIT License (LICENSE.txt).
4
+ *
5
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
6
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
7
+ * Thanks to: Seamus Leahy for adding deltaX and deltaY
8
+ *
9
+ * Version: 3.0.6
10
+ *
11
+ * Requires: 1.2.2+
12
+ */
13
+ (function(n){var t=["DOMMouseScroll","mousewheel"];if(n.event.fixHooks)for(var r=t.length;r;)n.event.fixHooks[t[--r]]=n.event.mouseHooks;n.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var n=t.length;n;)this.addEventListener(t[--n],i,!1);else this.onmousewheel=i},teardown:function(){if(this.removeEventListener)for(var n=t.length;n;)this.removeEventListener(t[--n],i,!1);else this.onmousewheel=null}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}});function i(t){var i=t||window.event,e=[].slice.call(arguments,1),r=0,f=0,u=0;return t=n.event.fix(i),t.type="mousewheel",i.wheelDelta&&(r=i.wheelDelta/120),i.detail&&(r=-i.detail/3),u=r,i.axis!==undefined&&i.axis===i.HORIZONTAL_AXIS&&(u=0,f=-1*r),i.wheelDeltaY!==undefined&&(u=i.wheelDeltaY/120),i.wheelDeltaX!==undefined&&(f=-1*i.wheelDeltaX/120),e.unshift(t,r,f,u),(n.event.dispatch||n.event.handle).apply(this,e)}})(jQuery),function(n){var i={init:function(t){var i={set_width:!1,set_height:!1,horizontalScroll:!1,scrollInertia:950,mouseWheel:!0,mouseWheelPixels:"auto",autoDraggerLength:!0,autoHideScrollbar:!1,snapAmount:null,snapOffset:0,scrollButtons:{enable:!1,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:!0,updateOnContentResize:!1,autoExpandHorizontalScroll:!1,autoScrollOnFocus:!0,normalizeMouseWheelDelta:!1},contentTouchScroll:!0,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},t=n.extend(!0,i,t);return this.each(function(){var i=n(this);if(t.set_width&&i.css("width",t.set_width),t.set_height&&i.css("height",t.set_height),n(document).data("mCustomScrollbar-index")){var y=parseInt(n(document).data("mCustomScrollbar-index"));n(document).data("mCustomScrollbar-index",y+1)}else n(document).data("mCustomScrollbar-index","1");i.wrapInner("<div class='mCustomScrollBox"+" mCS-"+t.theme+"' id='mCSB_"+n(document).data("mCustomScrollbar-index")+"' style='position:relative; height:100%; overflow:hidden; max-width:100%;' />").addClass("mCustomScrollbar _mCS_"+n(document).data("mCustomScrollbar-index"));var r=i.children(".mCustomScrollBox");if(t.horizontalScroll){r.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />");var c=r.children(".mCSB_h_wrapper");c.wrapInner("<div class='mCSB_container' style='position:absolute; left:0;' />").children(".mCSB_container").css({width:c.children().outerWidth(),position:"relative"}).unwrap()}else r.wrapInner("<div class='mCSB_container' style='position:relative; top:0;' />");var u=r.children(".mCSB_container");n.support.touch&&u.addClass("mCS_touch");u.after("<div class='mCSB_scrollTools' style='position:absolute;'><div class='mCSB_draggerContainer'><div class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' style='position:relative;'><\/div><\/div><div class='mCSB_draggerRail'><\/div><\/div><\/div>");var o=r.children(".mCSB_scrollTools"),p=o.children(".mCSB_draggerContainer"),f=p.children(".mCSB_dragger");if(t.horizontalScroll?f.data("minDraggerWidth",f.width()):f.data("minDraggerHeight",f.height()),t.scrollButtons.enable&&(t.horizontalScroll?o.prepend("<a class='mCSB_buttonLeft' oncontextmenu='return false;'><\/a>").append("<a class='mCSB_buttonRight' oncontextmenu='return false;'><\/a>"):o.prepend("<a class='mCSB_buttonUp' oncontextmenu='return false;'><\/a>").append("<a class='mCSB_buttonDown' oncontextmenu='return false;'><\/a>")),r.bind("scroll",function(){i.is(".mCS_disabled")||r.scrollTop(0).scrollLeft(0)}),i.data({mCS_Init:!0,mCustomScrollbarIndex:n(document).data("mCustomScrollbar-index"),horizontalScroll:t.horizontalScroll,scrollInertia:t.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:t.mouseWheel,mouseWheelPixels:t.mouseWheelPixels,autoDraggerLength:t.autoDraggerLength,autoHideScrollbar:t.autoHideScrollbar,snapAmount:t.snapAmount,snapOffset:t.snapOffset,scrollButtons_enable:t.scrollButtons.enable,scrollButtons_scrollType:t.scrollButtons.scrollType,scrollButtons_scrollSpeed:t.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:t.scrollButtons.scrollAmount,autoExpandHorizontalScroll:t.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:t.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:t.advanced.normalizeMouseWheelDelta,contentTouchScroll:t.contentTouchScroll,onScrollStart_Callback:t.callbacks.onScrollStart,onScroll_Callback:t.callbacks.onScroll,onTotalScroll_Callback:t.callbacks.onTotalScroll,onTotalScrollBack_Callback:t.callbacks.onTotalScrollBack,onTotalScroll_Offset:t.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:t.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:t.callbacks.whileScrolling,bindEvent_scrollbar_drag:!1,bindEvent_content_touch:!1,bindEvent_scrollbar_click:!1,bindEvent_mousewheel:!1,bindEvent_buttonsContinuous_y:!1,bindEvent_buttonsContinuous_x:!1,bindEvent_buttonsPixels_y:!1,bindEvent_buttonsPixels_x:!1,bindEvent_focusin:!1,bindEvent_autoHideScrollbar:!1,mCSB_buttonScrollRight:!1,mCSB_buttonScrollLeft:!1,mCSB_buttonScrollDown:!1,mCSB_buttonScrollUp:!1}),t.horizontalScroll)i.css("max-width")!=="none"&&(t.advanced.updateOnContentResize||(t.advanced.updateOnContentResize=!0));else if(i.css("max-height")!=="none"){var e=!1,s=parseInt(i.css("max-height"));i.css("max-height").indexOf("%")>=0&&(e=s,s=i.parent().height()*e/100);i.css("overflow","hidden");r.css("max-height",s)}if(i.mCustomScrollbar("update"),t.advanced.updateOnBrowserResize){var h,l=n(window).width(),a=n(window).height();n(window).bind("resize."+i.data("mCustomScrollbarIndex"),function(){h&&clearTimeout(h);h=setTimeout(function(){if(!i.is(".mCS_disabled")&&!i.is(".mCS_destroyed")){var t=n(window).width(),u=n(window).height();(l!==t||a!==u)&&(i.css("max-height")!=="none"&&e&&r.css("max-height",i.parent().height()*e/100),i.mCustomScrollbar("update"),l=t,a=u)}},150)})}if(t.advanced.updateOnContentResize){var w;if(t.horizontalScroll)var v=u.outerWidth();else var v=u.outerHeight();w=setInterval(function(){if(t.horizontalScroll){t.advanced.autoExpandHorizontalScroll&&u.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:u.outerWidth(),position:"relative"}).unwrap();var n=u.outerWidth()}else var n=u.outerHeight();n!=v&&(i.mCustomScrollbar("update"),v=n)},300)}})},update:function(){var i=n(this),u=i.children(".mCustomScrollBox"),r=u.children(".mCSB_container");r.removeClass("mCS_no_scrollbar");i.removeClass("mCS_disabled mCS_destroyed");u.scrollTop(0).scrollLeft(0);var f=u.children(".mCSB_scrollTools"),e=f.children(".mCSB_draggerContainer"),t=e.children(".mCSB_dragger");if(i.data("horizontalScroll")){var p=f.children(".mCSB_buttonLeft"),w=f.children(".mCSB_buttonRight"),h=u.width();i.data("autoExpandHorizontalScroll")&&r.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:r.outerWidth(),position:"relative"}).unwrap();var c=r.outerWidth()}else var b=f.children(".mCSB_buttonUp"),k=f.children(".mCSB_buttonDown"),l=u.height(),a=r.outerHeight();if(a>l&&!i.data("horizontalScroll")){f.css("display","block");var o=e.height();if(i.data("autoDraggerLength")){var v=Math.round(l/a*o),d=t.data("minDraggerHeight");if(v<=d)t.css({height:d});else if(v>=o-10){var it=o-10;t.css({height:it})}else t.css({height:v});t.children(".mCSB_dragger_bar").css({"line-height":t.height()+"px"})}var rt=t.height(),g=(a-l)/(o-rt);i.data("scrollAmount",g).mCustomScrollbar("scrolling",u,r,e,t,b,k,p,w);var nt=Math.abs(r.position().top);i.mCustomScrollbar("scrollTo",nt,{scrollInertia:0,trigger:"internal"})}else if(c>h&&i.data("horizontalScroll")){f.css("display","block");var s=e.width();if(i.data("autoDraggerLength")){var y=Math.round(h/c*s),tt=t.data("minDraggerWidth");if(y<=tt)t.css({width:tt});else if(y>=s-10){var ut=s-10;t.css({width:ut})}else t.css({width:y})}var ft=t.width(),g=(c-h)/(s-ft);i.data("scrollAmount",g).mCustomScrollbar("scrolling",u,r,e,t,b,k,p,w);var nt=Math.abs(r.position().left);i.mCustomScrollbar("scrollTo",nt,{scrollInertia:0,trigger:"internal"})}else u.unbind("mousewheel focusin"),i.data("horizontalScroll")?t.add(r).css("left",0):t.add(r).css("top",0),f.css("display","none"),r.addClass("mCS_no_scrollbar"),i.data({bindEvent_mousewheel:!1,bindEvent_focusin:!1})},scrolling:function(i,r,u,f,e,o,s,h){var c=n(this);if(!c.data("bindEvent_scrollbar_drag")){var v,y;n.support.msPointer?(f.bind("MSPointerDown",function(t){t.preventDefault();c.data({on_drag:!0});f.addClass("mCSB_dragger_onDrag");var i=n(this),e=i.offset(),r=t.originalEvent.pageX-e.left,u=t.originalEvent.pageY-e.top;r<i.width()&&r>0&&u<i.height()&&u>0&&(v=u,y=r)}),n(document).bind("MSPointerMove."+c.data("mCustomScrollbarIndex"),function(n){if(n.preventDefault(),c.data("on_drag")){var i=f,t=i.offset(),r=n.originalEvent.pageX-t.left,u=n.originalEvent.pageY-t.top;g(v,y,u,r)}}).bind("MSPointerUp."+c.data("mCustomScrollbarIndex"),function(){c.data({on_drag:!1});f.removeClass("mCSB_dragger_onDrag")})):(f.bind("mousedown touchstart",function(t){t.preventDefault();t.stopImmediatePropagation();var e=n(this),u=e.offset(),i,r;if(t.type==="touchstart"){var o=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0];i=o.pageX-u.left;r=o.pageY-u.top}else c.data({on_drag:!0}),f.addClass("mCSB_dragger_onDrag"),i=t.pageX-u.left,r=t.pageY-u.top;i<e.width()&&i>0&&r<e.height()&&r>0&&(v=r,y=i)}).bind("touchmove",function(t){t.preventDefault();t.stopImmediatePropagation();var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],u=n(this),r=u.offset(),f=i.pageX-r.left,e=i.pageY-r.top;g(v,y,e,f)}),n(document).bind("mousemove."+c.data("mCustomScrollbarIndex"),function(n){if(c.data("on_drag")){var i=f,t=i.offset(),r=n.pageX-t.left,u=n.pageY-t.top;g(v,y,u,r)}}).bind("mouseup."+c.data("mCustomScrollbarIndex"),function(){c.data({on_drag:!1});f.removeClass("mCSB_dragger_onDrag")}));c.data({bindEvent_scrollbar_drag:!0})}function g(n,t,i,r){c.data("horizontalScroll")?c.mCustomScrollbar("scrollTo",f.position().left-t+r,{moveDragger:!0,trigger:"internal"}):c.mCustomScrollbar("scrollTo",f.position().top-n+i,{moveDragger:!0,trigger:"internal"})}if(n.support.touch&&c.data("contentTouchScroll")&&!c.data("bindEvent_content_touch")){var l,p,a,w,b,it,rt;r.bind("touchstart",function(t){t.stopImmediatePropagation();l=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0];p=n(this);a=p.offset();b=l.pageX-a.left;w=l.pageY-a.top;it=w;rt=b});r.bind("touchmove",function(t){t.preventDefault();t.stopImmediatePropagation();l=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0];p=n(this).parent();a=p.offset();b=l.pageX-a.left;w=l.pageY-a.top;c.data("horizontalScroll")?c.mCustomScrollbar("scrollTo",rt-b,{trigger:"internal"}):c.mCustomScrollbar("scrollTo",it-w,{trigger:"internal"})})}if(c.data("bindEvent_scrollbar_click")||(u.bind("click",function(t){var i=(t.pageY-u.offset().top)*c.data("scrollAmount"),r=n(t.target);c.data("horizontalScroll")&&(i=(t.pageX-u.offset().left)*c.data("scrollAmount"));(r.hasClass("mCSB_draggerContainer")||r.hasClass("mCSB_draggerRail"))&&c.mCustomScrollbar("scrollTo",i,{trigger:"internal",scrollEasing:"draggerRailEase"})}),c.data({bindEvent_scrollbar_click:!0})),c.data("mouseWheel")&&(c.data("bindEvent_mousewheel")||(i.bind("mousewheel",function(n,t){var o,i=c.data("mouseWheelPixels"),s=Math.abs(r.position().top),e=f.position().top,h=u.height()-f.height();c.data("normalizeMouseWheelDelta")&&(t=t<0?-1:1);i==="auto"&&(i=100+Math.round(c.data("scrollAmount")/2));c.data("horizontalScroll")&&(e=f.position().left,h=u.width()-f.width(),s=Math.abs(r.position().left));(t>0&&e!==0||t<0&&e!==h)&&(n.preventDefault(),n.stopImmediatePropagation());o=s-t*i;c.mCustomScrollbar("scrollTo",o,{trigger:"internal"})}),c.data({bindEvent_mousewheel:!0}))),c.data("scrollButtons_enable"))if(c.data("scrollButtons_scrollType")==="pixels"){c.data("horizontalScroll")?(h.add(s).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",nt,tt),c.data({bindEvent_buttonsContinuous_x:!1}),c.data("bindEvent_buttonsPixels_x")||(h.bind("click",function(n){n.preventDefault();k(Math.abs(r.position().left)+c.data("scrollButtons_scrollAmount"))}),s.bind("click",function(n){n.preventDefault();k(Math.abs(r.position().left)-c.data("scrollButtons_scrollAmount"))}),c.data({bindEvent_buttonsPixels_x:!0}))):(o.add(e).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",nt,tt),c.data({bindEvent_buttonsContinuous_y:!1}),c.data("bindEvent_buttonsPixels_y")||(o.bind("click",function(n){n.preventDefault();k(Math.abs(r.position().top)+c.data("scrollButtons_scrollAmount"))}),e.bind("click",function(n){n.preventDefault();k(Math.abs(r.position().top)-c.data("scrollButtons_scrollAmount"))}),c.data({bindEvent_buttonsPixels_y:!0})));function k(n){f.data("preventAction")||(f.data("preventAction",!0),c.mCustomScrollbar("scrollTo",n,{trigger:"internal"}))}}else{if(c.data("horizontalScroll")){if(h.add(s).unbind("click"),c.data({bindEvent_buttonsPixels_x:!1}),!c.data("bindEvent_buttonsContinuous_x")){h.bind("mousedown touchstart MSPointerDown",function(n){n.preventDefault();var t=d();c.data({mCSB_buttonScrollRight:setInterval(function(){c.mCustomScrollbar("scrollTo",Math.abs(r.position().left)+t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var nt=function(n){n.preventDefault();clearInterval(c.data("mCSB_buttonScrollRight"))};h.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",nt);s.bind("mousedown touchstart MSPointerDown",function(n){n.preventDefault();var t=d();c.data({mCSB_buttonScrollLeft:setInterval(function(){c.mCustomScrollbar("scrollTo",Math.abs(r.position().left)-t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var tt=function(n){n.preventDefault();clearInterval(c.data("mCSB_buttonScrollLeft"))};s.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",tt);c.data({bindEvent_buttonsContinuous_x:!0})}}else if(o.add(e).unbind("click"),c.data({bindEvent_buttonsPixels_y:!1}),!c.data("bindEvent_buttonsContinuous_y")){o.bind("mousedown touchstart MSPointerDown",function(n){n.preventDefault();var t=d();c.data({mCSB_buttonScrollDown:setInterval(function(){c.mCustomScrollbar("scrollTo",Math.abs(r.position().top)+t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var ut=function(n){n.preventDefault();clearInterval(c.data("mCSB_buttonScrollDown"))};o.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",ut);e.bind("mousedown touchstart MSPointerDown",function(n){n.preventDefault();var t=d();c.data({mCSB_buttonScrollUp:setInterval(function(){c.mCustomScrollbar("scrollTo",Math.abs(r.position().top)-t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var ft=function(n){n.preventDefault();clearInterval(c.data("mCSB_buttonScrollUp"))};e.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",ft);c.data({bindEvent_buttonsContinuous_y:!0})}function d(){var n=c.data("scrollButtons_scrollSpeed");return c.data("scrollButtons_scrollSpeed")==="auto"&&(n=Math.round((c.data("scrollInertia")+100)/40)),n}}c.data("autoScrollOnFocus")&&(c.data("bindEvent_focusin")||(i.bind("focusin",function(){i.scrollTop(0).scrollLeft(0);var t=n(document.activeElement);if(t.is("input,textarea,select,button,a[tabindex],area,object")){var f=r.position().top,u=t.position().top,e=i.height()-t.outerHeight();c.data("horizontalScroll")&&(f=r.position().left,u=t.position().left,e=i.width()-t.outerWidth());(f+u<0||f+u>e)&&c.mCustomScrollbar("scrollTo",u,{trigger:"internal"})}}),c.data({bindEvent_focusin:!0})));c.data("autoHideScrollbar")&&(c.data("bindEvent_autoHideScrollbar")||(i.bind("mouseenter",function(){i.addClass("mCS-mouse-over");t.showScrollbar.call(i.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(n){i.removeClass("mCS-mouse-over");n.type==="mouseleave"&&t.hideScrollbar.call(i.children(".mCSB_scrollTools"))}),c.data({bindEvent_autoHideScrollbar:!0})))},scrollTo:function(i,r){var u=n(this),d={moveDragger:!1,trigger:"external",callbacks:!0,scrollInertia:u.data("scrollInertia"),scrollEasing:u.data("scrollEasing")},r=n.extend(d,r),e,o=u.children(".mCustomScrollBox"),f=o.children(".mCSB_container"),v=o.children(".mCSB_scrollTools"),y=v.children(".mCSB_draggerContainer"),s=y.children(".mCSB_dragger"),k=draggerSpeed=r.scrollInertia,w,c,b,l;if(!f.hasClass("mCS_no_scrollbar")&&(u.data({mCS_trigger:r.trigger}),u.data("mCS_Init")&&(r.callbacks=!1),i||i===0)){if(typeof i=="number")r.moveDragger?(e=i,i=u.data("horizontalScroll")?s.position().left*u.data("scrollAmount"):s.position().top*u.data("scrollAmount"),draggerSpeed=0):e=i/u.data("scrollAmount");else if(typeof i=="string"){var p;p=i==="top"?0:i!=="bottom"||u.data("horizontalScroll")?i==="left"?0:i==="right"&&u.data("horizontalScroll")?f.outerWidth()-o.width():i==="first"?u.find(".mCSB_container").find(":first"):i==="last"?u.find(".mCSB_container").find(":last"):u.find(i):f.outerHeight()-o.height();p.length===1?(i=u.data("horizontalScroll")?p.position().left:p.position().top,e=i/u.data("scrollAmount")):e=i=p}if(u.data("horizontalScroll")){u.data("onTotalScrollBack_Offset")&&(c=-u.data("onTotalScrollBack_Offset"));u.data("onTotalScroll_Offset")&&(l=o.width()-f.outerWidth()+u.data("onTotalScroll_Offset"));e<0?(e=i=0,clearInterval(u.data("mCSB_buttonScrollLeft")),c||(w=!0)):e>=y.width()-s.width()?(e=y.width()-s.width(),i=o.width()-f.outerWidth(),clearInterval(u.data("mCSB_buttonScrollRight")),l||(b=!0)):i=-i;var a=u.data("snapAmount");a&&(i=Math.round(i/a)*a-u.data("snapOffset"));t.mTweenAxis.call(this,s[0],"left",Math.round(e),draggerSpeed,r.scrollEasing);t.mTweenAxis.call(this,f[0],"left",Math.round(i),k,r.scrollEasing,{onStart:function(){r.callbacks&&!u.data("mCS_tweenRunning")&&h("onScrollStart");u.data("autoHideScrollbar")&&t.showScrollbar.call(v)},onUpdate:function(){r.callbacks&&h("whileScrolling")},onComplete:function(){r.callbacks&&(h("onScroll"),(w||c&&f.position().left>=c)&&h("onTotalScrollBack"),(b||l&&f.position().left<=l)&&h("onTotalScroll"));s.data("preventAction",!1);u.data("mCS_tweenRunning",!1);u.data("autoHideScrollbar")&&(o.hasClass("mCS-mouse-over")||t.hideScrollbar.call(v))}})}else{u.data("onTotalScrollBack_Offset")&&(c=-u.data("onTotalScrollBack_Offset"));u.data("onTotalScroll_Offset")&&(l=o.height()-f.outerHeight()+u.data("onTotalScroll_Offset"));e<0?(e=i=0,clearInterval(u.data("mCSB_buttonScrollUp")),c||(w=!0)):e>=y.height()-s.height()?(e=y.height()-s.height(),i=o.height()-f.outerHeight(),clearInterval(u.data("mCSB_buttonScrollDown")),l||(b=!0)):i=-i;var a=u.data("snapAmount");a&&(i=Math.round(i/a)*a-u.data("snapOffset"));t.mTweenAxis.call(this,s[0],"top",Math.round(e),draggerSpeed,r.scrollEasing);t.mTweenAxis.call(this,f[0],"top",Math.round(i),k,r.scrollEasing,{onStart:function(){r.callbacks&&!u.data("mCS_tweenRunning")&&h("onScrollStart");u.data("autoHideScrollbar")&&t.showScrollbar.call(v)},onUpdate:function(){r.callbacks&&h("whileScrolling")},onComplete:function(){r.callbacks&&(h("onScroll"),(w||c&&f.position().top>=c)&&h("onTotalScrollBack"),(b||l&&f.position().top<=l)&&h("onTotalScroll"));s.data("preventAction",!1);u.data("mCS_tweenRunning",!1);u.data("autoHideScrollbar")&&(o.hasClass("mCS-mouse-over")||t.hideScrollbar.call(v))}})}u.data("mCS_Init")&&u.data({mCS_Init:!1})}function h(n){this.mcs={top:f.position().top,left:f.position().left,draggerTop:s.position().top,draggerLeft:s.position().left,topPct:Math.round(100*Math.abs(f.position().top)/Math.abs(f.outerHeight()-o.height())),leftPct:Math.round(100*Math.abs(f.position().left)/Math.abs(f.outerWidth()-o.width()))};switch(n){case"onScrollStart":u.data("mCS_tweenRunning",!0).data("onScrollStart_Callback").call(u,this.mcs);break;case"whileScrolling":u.data("whileScrolling_Callback").call(u,this.mcs);break;case"onScroll":u.data("onScroll_Callback").call(u,this.mcs);break;case"onTotalScrollBack":u.data("onTotalScrollBack_Callback").call(u,this.mcs);break;case"onTotalScroll":u.data("onTotalScroll_Callback").call(u,this.mcs)}}},stop:function(){var i=n(this),r=i.children().children(".mCSB_container"),u=i.children().children().children().children(".mCSB_dragger");t.mTweenAxisStop.call(this,r[0]);t.mTweenAxisStop.call(this,u[0])},disable:function(t){var r=n(this),u=r.children(".mCustomScrollBox"),i=u.children(".mCSB_container"),f=u.children(".mCSB_scrollTools"),e=f.children().children(".mCSB_dragger");u.unbind("mousewheel focusin mouseenter mouseleave touchend");i.unbind("touchstart touchmove");t&&(r.data("horizontalScroll")?e.add(i).css("left",0):e.add(i).css("top",0));f.css("display","none");i.addClass("mCS_no_scrollbar");r.data({bindEvent_mousewheel:!1,bindEvent_focusin:!1,bindEvent_content_touch:!1,bindEvent_autoHideScrollbar:!1}).addClass("mCS_disabled")},destroy:function(){var t=n(this);t.removeClass("mCustomScrollbar _mCS_"+t.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();n(document).unbind("mousemove."+t.data("mCustomScrollbarIndex")+" mouseup."+t.data("mCustomScrollbarIndex")+" MSPointerMove."+t.data("mCustomScrollbarIndex")+" MSPointerUp."+t.data("mCustomScrollbarIndex"));n(window).unbind("resize."+t.data("mCustomScrollbarIndex"))}},t={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(n,t,i,r,u,f){var f=f||{},v=f.onStart||function(){},y=f.onUpdate||function(){},p=f.onComplete||function(){},w=c(),o,e=0,s=n.offsetTop,h=n.style;t==="left"&&(s=n.offsetLeft);var b=i-s;d();k();function c(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()}function l(){e||v.call();e=c()-w;a();e>=n._time&&(n._time=e>n._time?e+o-(e-n._time):e+o-1,n._time<e+1&&(n._time=e+1));n._time<r?n._id=_request(l):p.call()}function a(){r>0?(n.currVal=g(n._time,s,b,r,u),h[t]=Math.round(n.currVal)+"px"):h[t]=i+"px";y.call()}function k(){o=1e3/60;n._time=e+o;_request=window.requestAnimationFrame?window.requestAnimationFrame:function(n){return a(),setTimeout(n,.01)};n._id=_request(l)}function d(){n._id!=null&&(window.requestAnimationFrame?window.cancelAnimationFrame(n._id):clearTimeout(n._id),n._id=null)}function g(n,t,i,r,u){switch(u){case"linear":return i*n/r+t;case"easeOutQuad":return n/=r,-i*n*(n-2)+t;case"easeInOutQuad":return(n/=r/2,n<1)?i/2*n*n+t:(n--,-i/2*(n*(n-2)-1)+t);case"easeOutCubic":return n/=r,n--,i*(n*n*n+1)+t;case"easeOutQuart":return n/=r,n--,-i*(n*n*n*n-1)+t;case"easeOutQuint":return n/=r,n--,i*(n*n*n*n*n+1)+t;case"easeOutCirc":return n/=r,n--,i*Math.sqrt(1-n*n)+t;case"easeOutSine":return i*Math.sin(n/r*(Math.PI/2))+t;case"easeOutExpo":return i*(-Math.pow(2,-10*n/r)+1)+t;case"mcsEaseOut":var f=(n/=r)*n,e=f*n;return t+i*(.499999999999997*e*f+-2.5*f*f+5.5*e+-6.5*f+4*n);case"draggerRailEase":return(n/=r/2,n<1)?i/2*n*n*n+t:(n-=2,i/2*(n*n*n+2)+t)}}},mTweenAxisStop:function(n){n._id!=null&&(window.requestAnimationFrame?window.cancelAnimationFrame(n._id):clearTimeout(n._id),n._id=null)},rafPolyfill:function(){for(var n=["ms","moz","webkit","o"],t=n.length;--t>-1&&!window.requestAnimationFrame;)window.requestAnimationFrame=window[n[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[n[t]+"CancelAnimationFrame"]||window[n[t]+"CancelRequestAnimationFrame"]}};t.rafPolyfill.call();n.support.touch=!!("ontouchstart"in window);n.support.msPointer=window.navigator.msPointerEnabled;var r="https:"==document.location.protocol?"https:":"http:";n.event.special.mousewheel||document.write('<script src="'+r+'//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.0.6/jquery.mousewheel.min.js"><\/script>');n.fn.mCustomScrollbar=function(t){if(i[t])return i[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t!="object"&&t)n.error("Method "+t+" does not exist");else return i.init.apply(this,arguments)}}(jQuery);
14
+ /*! Ajax Search Lite 4.6 js */
15
+ (function(n){var i={init:function(t,i){var r=this;this.elem=i;this.$elem=n(i);r.searching=!1;r.o=n.extend({},t);r.n={};r.n.container=n(this.elem);r.o.rid=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.o.id=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.n.probox=n(".probox",r.n.container);r.n.proinput=n(".proinput",r.n.container);r.n.text=n(".proinput input.orig",r.n.container);r.n.textAutocomplete=n(".proinput input.autocomplete",r.n.container);r.n.loading=n(".proinput .loading",r.n.container);r.n.proloading=n(".proloading",r.n.container);r.n.proclose=n(".proclose",r.n.container);r.n.promagnifier=n(".promagnifier",r.n.container);r.n.prosettings=n(".prosettings",r.n.container);r.n.searchsettings=n("#ajaxsearchlitesettings"+r.o.rid);r.n.resultsDiv=n("#ajaxsearchliteres"+r.o.rid);r.n.hiddenContainer=n("#asl_hidden_data");r.n.aslItemOverlay=n(".asl_item_overlay",r.n.hiddenContainer);r.resizeTimeout=null;r.n.showmore=n(".showmore a",r.n.resultsDiv);r.n.items=n(".item",r.n.resultsDiv);r.n.results=n(".results",r.n.resultsDiv);r.n.resdrg=n(".resdrg",r.n.resultsDiv);r.il={columns:3,itemsPerPage:6};r.firstClick=!0;r.post=null;r.postAuto=null;r.cleanUp();r.n.textAutocomplete.val("");r.o.resultitemheight=parseInt(r.o.resultitemheight);r.scroll={};r.settScroll=null;r.n.resultsAppend=n("#wpdreams_asl_results_"+r.o.id);r.currentPage=1;r.isotopic=null;r.animation="bounceIn";switch(r.o.resultstype){case"vertical":r.animation=r.o.vresultanimation;break;default:r.animation=r.o.hresultanimation}return r.filterFns={number:function(){for(var t=n(this).parent();!t.hasClass("isotopic");)t=t.parent();var i=n(this).attr("data-itemnum"),u=r.currentPage,f=r.il.itemsPerPage;return parseInt(i,10)<f*u&&parseInt(i,10)>=f*(u-1)}},r.disableMobileScroll=!1,r.n.searchsettings.detach().appendTo("body"),r.o.resultsposition=="hover"?r.n.resultsDiv.detach().appendTo("body"):r.n.resultsAppend.length>0&&r.n.resultsDiv.detach().appendTo(r.n.resultsAppend),r.createVerticalScroll(),u()&&r.n.container.addClass("asl_msie"),r.initSettingsAnimations(),r.initResultsAnimations(),r.initEvents(),this},duplicateCheck:function(){var i=this,t={};n("div[id*=ajaxsearchlite]").each(function(){t.hasOwnProperty(this.id)?n(this).remove():t[this.id]="true"})},analytics:function(n){var t=this;t.o.analytics&&t.o.analyticsString!=""&&typeof ga=="function"&&ga("send","pageview",{page:"/"+t.o.analyticsString.replace("{asl_term}",n),title:"Ajax Search"})},createVerticalScroll:function(){var i=this;i.scroll=i.n.results.mCustomScrollbar({contentTouchScroll:!0,scrollButtons:{enable:!0},callbacks:{onScroll:function(){if(!t()){var s=parseInt(n(".mCSB_container",i.n.results).position().top),h=n(".mCSB_container .resdrg").children(),f=0,o=3e3,u=4e3,c=1e4,e=1e4,r=null;h.each(function(){u=Math.abs(Math.abs(s)-f);u<o&&(c=u,e=f,r=n(this));f+=n(this).outerHeight(!0);o=u});r.hasClass("group")&&(e=e+(r.outerHeight(!0)-r.outerHeight(!1)));i.scroll.mCustomScrollbar("scrollTo",r,{scrollInertia:200,callbacks:!1})}}}})},createHorizontalScroll:function(){var n=this;n.scroll=n.n.results.mCustomScrollbar({horizontalScroll:!0,contentTouchScroll:!0,scrollButtons:{enable:!0,scrollType:"pixels",scrollSpeed:"auto",scrollAmount:100}})},initEvents:function(){var t=this;n(t.n.text.parent()).submit(function(n){n.preventDefault();t.n.text.keyup()});t.n.text.click(function(){t.firstClick&&(n(this).val(""),t.firstClick=!1)});t.n.resultsDiv.css({opacity:0});n(document).bind("click touchend",function(){(t.hideSettings(),t.opened!=!1&&t.o.closeOnDocClick==1)&&t.hideResults()});t.n.proclose.bind("click touchend",function(){t.opened!=!1&&(t.n.text.val(""),t.n.textAutocomplete.val(""),t.hideResults(),t.n.text.focus())});n(t.elem).bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.resultsDiv.bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.searchsettings.bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.prosettings.on("click",function(){t.n.prosettings.data("opened")==0?t.showSettings():t.hideSettings()});n(document).bind("touchmove",function(n){t.disableMobileScroll==!0&&n.preventDefault()});var i;n(window).on("resize",function(){clearTimeout(i);i=setTimeout(function(){t.resize()},250)});var r;n(window).on("scroll",function(){clearTimeout(r);r=setTimeout(function(){t.scrolling(!1)},250)});t.initNavigationEvent();n(window).trigger("resize");n(window).trigger("scroll");t.initMagnifierEvent();t.initAutocompleteEvent();t.initFacetEvents()},initNavigationEvent:function(){var t=this;n(t.n.resultsDiv).on("mouseenter",".item",function(){n(".item",t.n.resultsDiv).removeClass("hovered");n(this).addClass("hovered")});n(t.n.resultsDiv).on("mouseleave",".item",function(){n(".item",t.n.resultsDiv).removeClass("hovered")});n(document).keydown(function(i){if(window.event)var r=window.event.keyCode,u=window.event.type;else if(i)var r=i.which,u=i.type;n(".item",t.n.resultsDiv).length>0&&t.n.resultsDiv.css("display")!="none"&&(r==40&&(i.stopPropagation(),i.preventDefault(),t.n.text.blur(),t.post!=null&&t.post.abort(),n(".item.hovered",t.n.resultsDiv).length==0?n(".item",t.n.resultsDiv).first().addClass("hovered"):n(".item.hovered",t.n.resultsDiv).removeClass("hovered").next().next(".item").addClass("hovered"),t.scroll.mCustomScrollbar("scrollTo",".resdrg .item.hovered",{scrollInertia:200,callbacks:!1})),r==38&&(i.stopPropagation(),i.preventDefault(),t.n.text.blur(),t.post!=null&&t.post.abort(),n(".item.hovered",t.n.resultsDiv).length==0?n(".item",t.n.resultsDiv).last().addClass("hovered"):n(".item.hovered",t.n.resultsDiv).removeClass("hovered").prev().prev(".item").addClass("hovered"),t.scroll.mCustomScrollbar("scrollTo",".resdrg .item.hovered",{scrollInertia:200,callbacks:!1})),r==13&&n(".item.hovered",t.n.resultsDiv).length>0&&(i.stopPropagation(),i.preventDefault(),n(".item.hovered a.asl_res_url",t.n.resultsDiv).get(0).click()))})},initMagnifierEvent:function(){var t=this,i;t.n.promagnifier.add(t.n.text).bind("click keyup",function(u){window.event?(t.keycode=window.event.keyCode,t.ktype=window.event.type):u&&(t.keycode=u.which,t.ktype=u.type);var f=n(this).hasClass("orig");if(t.n.text.val().length<t.o.charcount){t.n.proloading.css("display","none");t.hideResults();t.post!=null&&t.post.abort();clearTimeout(i);return}if(!f&&t.o.redirectonclick==1&&t.ktype=="click"&&t.o.redirectClickTo=="results_page"||f&&t.o.redirect_on_enter==1&&t.ktype=="keyup"&&t.keycode==13&&t.o.redirectEnterTo=="results_page"){var e="?s="+t.n.text.val();t.o.overridewpdefault?r(t.o.homeurl+e+"&asl_active=1","post",{p_asl_data:n("form",t.n.searchsettings).serialize()}):r(t.o.homeurl+e,"post",{np_asl_data:n("form",t.n.searchsettings).serialize()});t.n.proloading.css("display","none");t.hideResults();t.post!=null&&t.post.abort();clearTimeout(i);return}t.keycode>=37&&t.keycode<=40||n(this).hasClass("orig")&&t.ktype=="click"||(t.o.triggeronclick!=0||t.ktype!="click")&&(t.o.triggerontype!=0||t.ktype!="keyup")&&(t.post!=null&&t.post.abort(),clearTimeout(i),i=setTimeout(function(){t.search()},300))})},initFacetEvents:function(){var t=this;t.o.trigger_on_facet_change==1&&n("input",t.n.searchsettings).change(function(){t.n.text.val().length<t.o.charcount||(t.post!=null&&t.post.abort(),t.search())})},destroy:function(){return this.each(function(){var t=n.extend({},this,i);n(window).unbind(t)})},searchfor:function(t){n(".proinput input",this).val(t).trigger("keyup")},initAutocompleteEvent:function(){var i=this;i.o.autocomplete.enabled!=1||t()||i.n.text.keyup(function(t){window.event?(i.keycode=window.event.keyCode,i.ktype=window.event.type):t&&(i.keycode=t.which,i.ktype=t.type);var r=39;n("body").hasClass("rtl")&&(r=37);i.keycode==r&&i.n.textAutocomplete.val()!=""?(t.preventDefault(),i.n.text.val(i.n.textAutocomplete.val()),i.post!=null&&i.post.abort(),i.search()):(i.postAuto!=null&&i.postAuto.abort(),i.autocompleteGoogleOnly())})},autocompleteGoogleOnly:function(){var t=this,i=t.n.text.val();if(t.n.text.val()==""){t.n.textAutocomplete.val("");return}var r=t.n.textAutocomplete.val();(r==""||r.indexOf(i)!=0)&&(t.n.textAutocomplete.val(""),n.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:i,hl:t.o.autocomplete.lang,nolabels:"t",client:"hp",ds:""},success:function(r){r[1].length>0&&(response=r[1][0][0].replace(/(<([^>]+)>)/ig,""),response=n("<textarea />").html(response).text(),response=response.substr(i.length),t.n.textAutocomplete.val(i+response))}}))},search:function(){var t=this;if((!t.searching||!0)&&!(t.n.text.val().length<t.o.charcount)){t.searching=!0;t.n.proloading.css({display:"block"});t.n.proclose.css({display:"none"});t.hideSettings();var i={action:"ajaxsearchlite_search",aslp:t.n.text.val(),asid:t.o.id,options:n("form",t.n.searchsettings).serialize()};t.analytics(t.n.text.val());t.post=n.post(ajaxsearchlite.ajaxurl,i,function(i){if(i=i.replace(/^\s*[\r\n]/gm,""),i=i.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1],t.n.resdrg.html(""),t.n.resdrg.html(i),n(".asl_keyword",t.n.resdrg).bind("click",function(){t.n.text.val(n(this).html());n("input.orig",t.n.container).val(n(this).html()).keydown();n("form",t.n.container).trigger("submit","ajax");t.search()}),t.n.items=n(".item",t.n.resultsDiv),n(".asl_res_url",t.n.resultsDiv).length>0&&t.o.redirectonclick==1&&t.ktype=="click"&&t.o.redirectClickTo!="results_page"||t.o.redirect_on_enter==1&&t.ktype=="keyup"&&t.keycode==13&&t.o.redirectEnterTo!="results_page")return location.href=n(n(".asl_res_url",t.n.resultsDiv).get(0)).attr("href"),!1;t.showResults();t.scrollToResults();t.n.items.length==0?t.n.showmore!=null&&t.n.showmore.css("display","none"):t.n.showmore!=null&&(t.n.showmore.css("display","block"),t.n.showmore.attr("href",t.o.homeurl+"?s="+t.n.text.val()))},"text")}},showLoader:function(){var n=this;n.n.proloading.css({display:"block"})},hideLoader:function(){var n=this;n.n.proloading.css({display:"none"});n.n.results.css("display","")},showResultsBox:function(){var n=this;n.n.resultsDiv.css({display:"block",height:"auto"});n.n.items.addClass(n.animationOpacity);n.scrolling(!0);n.n.resultsDiv.css(n.resAnim.showCSS);n.n.resultsDiv.removeClass(n.resAnim.hideClass).addClass(n.resAnim.showClass)},showResults:function(){var n=this;switch(n.o.resultstype){case"vertical":n.showVerticalResults();break;default:n.showHorizontalResults()}n.hideLoader();n.n.proclose.css({display:"block"});n.n.showmore!=null&&(n.n.items.length>0?n.n.showmore.css({display:"block"}):n.n.showmore.css({display:"none"}));t()&&n.o.mobile.hide_keyboard&&document.activeElement.blur();n.resultsOpened=!0},hideResults:function(){var n=this;if(!n.resultsOpened)return!1;n.n.resultsDiv.removeClass(n.resAnim.showClass).addClass(n.resAnim.hideClass);setTimeout(function(){n.n.resultsDiv.css(n.resAnim.hideCSS)},n.resAnim.duration);n.n.proclose.css({display:"none"});n.n.showmore!=null&&n.n.showmore.css({display:"none"});t()&&document.activeElement.blur();n.resultsOpened=!1},scrollToResults:function(){if(($this=this,this.o.scrollToResults==1)&&!this.$elem.parent().hasClass("asl_preview_data")){if($this.o.resultsposition=="hover")var t=$this.n.probox.offset().top-20;else var t=$this.n.resultsDiv.offset().top-20;n("#wpadminbar").length>0&&(t-=n("#wpadminbar").height());t=t<0?0:t;n("body, html").animate({scrollTop:t},{duration:500})}},createGroup:function(n){return"<div class='group'>"+n+"<\/div>"},showVerticalResults:function(){var t=this;if(t.showResultsBox(),t.n.items.length>0){var u=t.n.items.length<t.o.itemscount?t.n.items.length:t.o.itemscount,e=n(".group",t.n.resultsDiv);if(t.n.items.length<=t.o.itemscount)t.n.results.css({height:"auto"});else{t.n.results.css({height:30});t.scroll.mCustomScrollbar("update");t.resize();var i=0,r=0;t.n.items.each(function(){r+=n(this).outerHeight(!0);i++});i=i<1?1:i;r=r/i*u;t.n.results.css({height:r})}if(window.sscroll=t.scroll,t.scroll.mCustomScrollbar("disable",!0),t.scroll.mCustomScrollbar("update"),t.resize(),t.scroll.mCustomScrollbar("scrollTo",0),t.o.highlight==1){var f=t.o.highlightwholewords==1?!0:!1;n("div.item",t.n.resultsDiv).highlight(t.n.text.val().split(" "),{element:"span",className:"highlighted",wordsOnly:f})}}if(t.resize(),t.n.items.length==0){var r=n(".nores",t.n.results).outerHeight(!0)>t.o.resultitemheight?t.o.resultitemheight:n(".nores",t.n.results).outerHeight(!0);t.n.results.css({height:11110});t.scroll.mCustomScrollbar("update");t.n.results.css({height:"auto"})}t.addAnimation();t.scrolling(!0);t.searching=!1},hideVerticalResults:function(){var t=this;t.disableMobileScroll=!1;t.n.resultsDiv.animate({opacity:0,height:0},{duration:120,complete:function(){n(this).css({visibility:"hidden",display:"none"})}})},addAnimation:function(){var i=this,t=0,r=1;i.n.items.each(function(){var u=this;setTimeout(function(){n(u).addClass(i.animation)},t);t=t+60;r++})},removeAnimation:function(){var t=this;t.n.items.each(function(){var i=this;n(i).removeClass(t.animation)})},initSettingsAnimations:function(){var n=this,t=300;n.settAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":t},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:t};n.n.searchsettings.css({"-webkit-animation-duration":n.settAnim.duration+"ms","animation-duration":n.settAnim.duration+"ms"})},initResultsAnimations:function(){var t=this,n=300;t.resAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":n},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:n};t.n.resultsDiv.css({"-webkit-animation-duration":n+"ms","animation-duration":n+"ms"})},showSettings:function(){var t=this;t.scrolling(!0);t.n.searchsettings.css(t.settAnim.showCSS);t.n.searchsettings.removeClass(t.settAnim.hideClass).addClass(t.settAnim.showClass);t.settScroll==null&&(t.settScroll=n(".asl_sett_scroll",t.n.searchsettings).mCustomScrollbar({contentTouchScroll:!0}));t.n.prosettings.data("opened",1)},hideSettings:function(){var n=this;n.n.searchsettings.removeClass(n.settAnim.showClass).addClass(n.settAnim.hideClass);setTimeout(function(){n.n.searchsettings.css(n.settAnim.hideCSS)},n.settAnim.duration);n.n.prosettings.data("opened",0)},cleanUp:function(){var t=this;n(".searchsettings",t.n.container).length>0&&(n("body>#ajaxsearchlitesettings"+t.o.rid).remove(),n("body>#ajaxsearchliteres"+t.o.rid).remove())},resize:function(){var t=this,i=0;if(n("body").css("position")!="static"&&(i=n("body").offset().top),u()&&0&&(t.n.proinput.css({width:t.n.probox.width()-8-(t.n.proinput.outerWidth(!1)-t.n.proinput.width())-t.n.proloading.outerWidth(!0)-t.n.prosettings.outerWidth(!0)-t.n.promagnifier.outerWidth(!0)-10}),t.n.text.css({width:t.n.proinput.width()-2+t.n.proloading.outerWidth(!0),position:"absolute",zIndex:2}),t.n.textAutocomplete.css({width:t.n.proinput.width()-2+t.n.proloading.outerWidth(!0),opacity:.25,zIndex:1})),t.n.prosettings.attr("opened")!=0&&(t.o.settingsimagepos=="left"?t.n.searchsettings.css({display:"block",top:t.n.prosettings.offset().top+t.n.prosettings.height()-2-i,left:t.n.prosettings.offset().left}):t.n.searchsettings.css({display:"block",top:t.n.prosettings.offset().top+t.n.prosettings.height()-2-i,left:t.n.prosettings.offset().left+t.n.prosettings.width()-t.n.searchsettings.width()})),t.n.resultsDiv.css("visibility")!="hidden"&&t.o.resultsposition!="block"){var r=t.n.container.width()-(t.n.resultsDiv.outerWidth(!0)-t.n.resultsDiv.width()),f=r<240?240:r;t.n.resultsDiv.css({width:f,top:t.n.container.offset().top+t.n.container.outerHeight(!0)+10-i,left:t.n.container.offset().left+(r-f)})}},scrolling:function(t){var i=this,r=0;if(n("body").css("position")!="static"&&(r=n("body").offset().top),(t==!0||i.n.searchsettings.css("visibility")=="visible")&&(i.o.settingsimagepos=="left"?i.n.searchsettings.css({display:"block",top:i.n.prosettings.offset().top+i.n.prosettings.height()-2-r,left:i.n.prosettings.offset().left}):i.n.searchsettings.css({display:"block",top:i.n.prosettings.offset().top+i.n.prosettings.height()-2-r,left:i.n.prosettings.offset().left+i.n.prosettings.width()-i.n.searchsettings.width()})),t==!0||i.n.resultsDiv.css("visibility")=="visible"){var u=i.n.container.width()-(i.n.resultsDiv.outerWidth(!0)-i.n.resultsDiv.width()),f=u<240?240:u;(i.o.resultsposition!="hover"&&i.n.resultsAppend.length>0||i.n.container.hasClass("hiddend"))&&(f="auto");i.n.resultsDiv.css({width:f,top:i.n.container.offset().top+i.n.container.outerHeight(!0)+10-r,left:i.n.container.offset().left+(u-f)})}}};function t(){try{return document.createEvent("TouchEvent"),!0}catch(n){return!1}}function r(t,i,r){"use strict";var u;u=n("<form />",{action:t,method:i,style:"display: none;"});typeof r!="undefined"&&r!==null&&n.each(r,function(t,i){n("<input />",{type:"hidden",name:t,value:i}).appendTo(u)});u.appendTo("body").submit()}function u(){var n=window.navigator.userAgent,t=n.indexOf("MSIE "),i=n.indexOf("Trident/");return t>0||i>0?!0:!1}typeof Object.create!="function"&&(Object.create=function(n){function t(){}return t.prototype=n,new t});n.plugin=function(t,i){n.fn[t]=function(r){return this.each(function(){n.data(this,t)||n.data(this,t,Object.create(i).init(r,this))})}};n.plugin("ajaxsearchlite",i)})(jQuery);window.ASL=window.ASL||{};window.ASL.getScope=function(){return typeof jQuery!="undefined"?jQuery:typeof window[ASL.js_scope]!="undefined"?window[ASL.js_scope]:eval(ASL.js_scope)};window.ASL.initialize=function(n){var t=window.ASL.getScope(),i=".asl_init_data";typeof ASL_INSTANCES!="undefined"&&Object.keys(ASL_INSTANCES).length>0?t.each(ASL_INSTANCES,function(n,i){return typeof i=="undefined"?!1:t("#ajaxsearchlite"+n).hasClass("hasASL")?!1:(t("#ajaxsearchlite"+n).addClass("hasASL"),t("#ajaxsearchlite"+n).ajaxsearchlite(i))}):(typeof n!="undefined"&&(i="div[id*=asl_init_id_"+n+"]"),t(i).each(function(){var i=t(this).attr("id").match(/^asl_init_id_(.*)/)[1],n=t(this).html();if(typeof n=="undefined")return!1;var r=JSON.parse(n);return t("#ajaxsearchlite"+i).ajaxsearchlite(r)}))};window.ASL.ready=function(){var n=this,t=n.getScope(),i=null;t(document).ready(function(){n.initialize()});typeof ASL.detect_ajax!="undefined"&&ASL.detect_ajax==1&&t("body").bind("DOMSubtreeModified",function(){clearTimeout(i);i=setTimeout(function(){n.initialize()},500)})};window._ASL=ASL;window._ASL.ready();
js/nomin-scoped/asl_wrapper.js CHANGED
@@ -1,32 +1,44 @@
1
- (function(jQuery, $, window){
2
- // INIT CODE
3
 
4
- // Use the window to make sure it is in the main scope, I do not trust IE
5
- window.ASL = window.ASL || {};
6
 
7
- window.ASL.getScope = function() {
8
- /**
9
- * Explanation:
10
- * If the sript is scoped, the first argument is always passed in a localized jQuery
11
- * variable, while the actual parameter can be aspjQuery or jQuery (or anything) as well.
12
- */
13
- if (typeof jQuery !== "undefined") return jQuery;
14
-
15
- // The code should never reach this point, but sometimes magic happens (unloaded or undefined jQuery??)
16
- // .. I am almost positive at this point this is going to fail anyways, but worth a try.
17
- if (typeof window[ASL.js_scope] !== "undefined")
18
- return window[ASL.js_scope];
19
- else
20
- return eval(ASL.js_scope);
21
- };
22
-
23
- // Call this function if you need to initialize an instance that is printed after an AJAX call
24
- // Calling without an argument initializes all instances found.
25
- window.ASL.initialize = function(id) {
26
- // Yeah I could use $ or jQuery as the scope variable, but I like to avoid magical errors..
27
- var scope = window.ASL.getScope();
28
- var selector = ".asl_init_data";
29
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  if (typeof id !== 'undefined')
31
  selector = "div[id*=asl_init_id_" + id + "]";
32
 
@@ -35,25 +47,40 @@
35
  * So these new, invisible divs contains a JSON object with the parameters.
36
  * Parse all of them and do the declaration.
37
  */
38
- scope(selector).each(function(index, value){
39
- var rid = scope(this).attr('id').match(/^asl_init_id_(.*)/)[1];
40
  var jsonData = scope(this).html();
41
  if (typeof jsonData === "undefined") return false;
42
  var args = JSON.parse(jsonData);
43
 
44
  return scope("#ajaxsearchlite" + rid).ajaxsearchlite(args);
45
  });
46
- };
 
 
 
 
 
 
47
 
48
- window.ASL.ready = function() {
49
- var scope = window.ASL.getScope();
 
50
 
51
- scope(document).ready(function () {
52
- window.ASL.initialize();
 
 
 
 
 
53
  });
54
- };
 
55
 
56
- // Do the init here
57
- window.ASL.ready();
58
 
 
 
59
  })(asljQuery, asljQuery, window);
1
+ (function(jQuery, $, window){
2
+ // INIT CODE
3
 
4
+ // Use the window to make sure it is in the main scope, I do not trust IE
5
+ window.ASL = window.ASL || {};
6
 
7
+ window.ASL.getScope = function() {
8
+ /**
9
+ * Explanation:
10
+ * If the sript is scoped, the first argument is always passed in a localized jQuery
11
+ * variable, while the actual parameter can be aspjQuery or jQuery (or anything) as well.
12
+ */
13
+ if (typeof jQuery !== "undefined") return jQuery;
14
+
15
+ // The code should never reach this point, but sometimes magic happens (unloaded or undefined jQuery??)
16
+ // .. I am almost positive at this point this is going to fail anyways, but worth a try.
17
+ if (typeof window[ASL.js_scope] !== "undefined")
18
+ return window[ASL.js_scope];
19
+ else
20
+ return eval(ASL.js_scope);
21
+ };
22
+
23
+ // Call this function if you need to initialize an instance that is printed after an AJAX call
24
+ // Calling without an argument initializes all instances found.
25
+ window.ASL.initialize = function(id) {
26
+ // Yeah I could use $ or jQuery as the scope variable, but I like to avoid magical errors..
27
+ var scope = window.ASL.getScope();
28
+ var selector = ".asl_init_data";
29
 
30
+ if ((typeof ASL_INSTANCES != "undefined") && Object.keys(ASL_INSTANCES).length > 0) {
31
+ scope.each(ASL_INSTANCES, function(k, v){
32
+ if ( typeof v == "undefined" ) return false;
33
+ // Return if it is already initialized
34
+ if ( scope("#ajaxsearchlite" + k).hasClass("hasASL") )
35
+ return false;
36
+ else
37
+ scope("#ajaxsearchlite" + k).addClass("hasASL");
38
+
39
+ return scope("#ajaxsearchlite" + k).ajaxsearchlite(v);
40
+ });
41
+ } else {
42
  if (typeof id !== 'undefined')
43
  selector = "div[id*=asl_init_id_" + id + "]";
44
 
47
  * So these new, invisible divs contains a JSON object with the parameters.
48
  * Parse all of them and do the declaration.
49
  */
50
+ scope(selector).each(function (index, value) {
51
+ var rid = scope(this).attr('id').match(/^asl_init_id_(.*)/)[1];
52
  var jsonData = scope(this).html();
53
  if (typeof jsonData === "undefined") return false;
54
  var args = JSON.parse(jsonData);
55
 
56
  return scope("#ajaxsearchlite" + rid).ajaxsearchlite(args);
57
  });
58
+ }
59
+ };
60
+
61
+ window.ASL.ready = function() {
62
+ var _this = this;
63
+ var scope = _this.getScope();
64
+ var t = null;
65
 
66
+ scope(document).ready(function () {
67
+ _this.initialize();
68
+ });
69
 
70
+ // DOM tree modification detection to re-initialize automatically if enabled
71
+ if (typeof(ASL.detect_ajax) != "undefined" && ASL.detect_ajax == 1) {
72
+ scope("body").bind("DOMSubtreeModified", function() {
73
+ clearTimeout(t);
74
+ t = setTimeout(function(){
75
+ _this.initialize();
76
+ }, 500);
77
  });
78
+ }
79
+ };
80
 
81
+ // Make a reference clone, just in case if an ajax page loader decides to override
82
+ window._ASL = ASL;
83
 
84
+ // Call the ready method
85
+ window._ASL.ready();
86
  })(asljQuery, asljQuery, window);
js/nomin-scoped/asljquery.js CHANGED
@@ -1,4 +1,4 @@
1
  /*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
2
  !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;
3
  if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")
4
- },cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("asljquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.asljQuery=ed),m},typeof b===K&&(a.asljQuery=a.$=m),m});
1
  /*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
2
  !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;
3
  if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")
4
+ },cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("asljQuery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.asljQuery=ed),m},typeof b===K&&(a.asljQuery=a.$=m),m});
js/nomin-scoped/jquery.ajaxsearchlite.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(jQuery, $, window){
2
- /*! Ajax Search pro 2.0 js */
3
  (function ($) {
4
 
5
  var methods = {
@@ -60,9 +60,6 @@
60
  case "vertical":
61
  $this.animation = $this.o.vresultanimation;
62
  break;
63
- case "isotopic":
64
- $this.animation = $this.o.iianimation;
65
- break;
66
  default:
67
  $this.animation = $this.o.hresultanimation;
68
  }
@@ -87,8 +84,6 @@
87
  };
88
 
89
  $this.disableMobileScroll = false;
90
-
91
-
92
  $this.n.searchsettings.detach().appendTo("body");
93
 
94
  if ($this.o.resultsposition == 'hover') {
@@ -97,17 +92,17 @@
97
  $this.n.resultsDiv.detach().appendTo($this.n.resultsAppend);
98
  }
99
 
100
- if ($this.o.resultstype == 'horizontal') {
101
- $this.createHorizontalScroll();
102
- } else if ($this.o.resultstype == 'vertical') {
103
- $this.createVerticalScroll();
104
- }
105
-
106
- if ($this.o.resultstype == 'polaroid')
107
- $this.n.results.addClass('photostack');
108
 
109
  if (detectIE())
110
  $this.n.container.addClass('asl_msie');
 
 
 
 
 
 
 
111
  $this.initEvents();
112
 
113
  return this;
@@ -139,17 +134,15 @@
139
 
140
  createVerticalScroll: function () {
141
  var $this = this;
 
142
  $this.scroll = $this.n.results.mCustomScrollbar({
143
  contentTouchScroll: true,
144
  scrollButtons: {
145
- enable: true,
146
- scrollType: "pixels",
147
- scrollSpeed: $this.o.resultitemheight,
148
- scrollAmount: $this.o.resultitemheight
149
  },
150
  callbacks: {
151
  onScroll: function () {
152
- if (is_touch_device()) return;
153
  var top = parseInt($('.mCSB_container', $this.n.results).position().top);
154
  var children = $('.mCSB_container .resdrg').children();
155
  var overall = 0;
@@ -170,8 +163,10 @@
170
  });
171
  if ($last.hasClass('group'))
172
  s_overall = s_overall + ($last.outerHeight(true) - $last.outerHeight(false));
173
- $(".mCSB_container", $this.n.resultsDiv).animate({
174
- top: -s_overall
 
 
175
  });
176
  }
177
  }
@@ -234,7 +229,7 @@
234
  });
235
 
236
  $this.n.prosettings.on("click", function () {
237
- if ($this.n.prosettings.attr('opened') == 0) {
238
  $this.showSettings();
239
  } else {
240
  $this.hideSettings();
@@ -270,10 +265,7 @@
270
 
271
  $this.initMagnifierEvent();
272
  $this.initAutocompleteEvent();
273
- $this.initPagerEvent();
274
- $this.initOverlayEvent();
275
  $this.initFacetEvents();
276
-
277
  },
278
 
279
  initNavigationEvent: function () {
@@ -361,6 +353,8 @@
361
  $this.ktype = e.type;
362
  }
363
 
 
 
364
  if ($this.n.text.val().length < $this.o.charcount) {
365
  $this.n.proloading.css('display', 'none');
366
  $this.hideResults();
@@ -369,13 +363,35 @@
369
  return;
370
  }
371
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
  // Ignore arrows
373
  if ($this.keycode >= 37 && $this.keycode <= 40) return;
374
  if ($(this).hasClass('orig') && $this.ktype == 'click') return;
375
- if ($this.o.redirectonclick == 1 && $this.ktype == 'click') {
376
- location.href = $this.o.homeurl + '?s=' + $this.n.text.val();
377
- return;
378
- }
379
  if ($this.o.triggeronclick == 0 && $this.ktype == 'click') return;
380
  if ($this.o.triggerontype == 0 && $this.ktype == 'keyup') return;
381
 
@@ -387,80 +403,6 @@
387
  });
388
  },
389
 
390
- initPagerEvent: function () {
391
- var $this = this;
392
- $this.n.resultsDiv.on('click', 'nav>a', function (e) {
393
- e.preventDefault();
394
- if ($(this).hasClass('asl_prev')) {
395
- $this.currentPage = $this.currentPage == 1 ? Math.ceil($this.n.items.length / $this.il.itemsPerPage) : --$this.currentPage;
396
- } else {
397
- $this.currentPage = $this.currentPage == Math.ceil($this.n.items.length / $this.il.itemsPerPage) ? 1 : ++$this.currentPage;
398
- }
399
- $('nav>ul li', $this.n.resultsDiv).removeClass('asl_active');
400
- $($('nav>ul li', $this.n.resultsDiv).get($this.currentPage - 1)).addClass('asl_active');
401
- $this.isotopic.arrange({filter: $this.filterFns['number']});
402
- $this.removeAnimation();
403
- });
404
- $this.n.resultsDiv.on('click', 'nav>ul li', function (e) {
405
- e.preventDefault();
406
- $this.currentPage = parseInt($('span', this).html(), 10);
407
- $('nav>ul li', $this.n.resultsDiv).removeClass('asl_active');
408
- $($('nav>ul li', $this.n.resultsDiv).get($this.currentPage - 1)).addClass('asl_active');
409
- $this.isotopic.arrange({filter: $this.filterFns['number']});
410
- $this.removeAnimation();
411
- });
412
- },
413
-
414
- initOverlayEvent: function () {
415
- var $this = this;
416
-
417
- if ($this.o.resultstype == "isotopic") {
418
- if ($this.o.iishowOverlay) {
419
- $this.n.resultsDiv.on('mouseenter', 'div.item', function (e) {
420
- $('.asl_item_overlay', this).fadeIn();
421
- if ($(".asl_item_img", this).length>0) {
422
- if ($this.o.iiblurOverlay)
423
- $('.asl_item_overlay_img', this).fadeIn();
424
- if ($this.o.iihideContent)
425
- $('.content', this).slideUp(100);
426
- }
427
- });
428
- $this.n.resultsDiv.on('mouseleave', 'div.item', function (e) {
429
- $('.asl_item_overlay', this).fadeOut();
430
- if ($(".asl_item_img", this).length>0) {
431
- if ($this.o.iiblurOverlay)
432
- $('.asl_item_overlay_img', this).fadeOut();
433
- if ($this.o.iihideContent && $(".asl_item_img", this).length>0)
434
- $('.content', this).slideDown(100);
435
- }
436
- });
437
- $this.n.resultsDiv.on('mouseenter', 'div.asl_item_inner', function (e) {
438
- $(this).addClass('animated pulse');
439
- });
440
- $this.n.resultsDiv.on('mouseleave', 'div.asl_item_inner', function (e) {
441
- $(this).removeClass('animated pulse');
442
- });
443
-
444
- $this.n.resultsDiv.on('click', '.asl_item_overlay', function(){
445
- var url = $('.content h3 a', $(this).parent()).attr('href');
446
- window.location = url;
447
- });
448
- }
449
-
450
- $(window).on('resize', function () {
451
- if ($this.resizeTimeout != null) clearTimeout($this.resizeTimeout);
452
- $this.resizeTimeout = setTimeout(function () {
453
- $this.calculateIsotopeRows();
454
- $this.showPagination();
455
- $this.removeAnimation();
456
- if ($this.isotopic != null)
457
- $this.isotopic.arrange({filter: $this.filterFns['number']});
458
- }, 200);
459
- });
460
- }
461
-
462
- },
463
-
464
  initFacetEvents: function() {
465
  var $this = this;
466
  if ($this.o.trigger_on_facet_change == 1)
@@ -485,7 +427,7 @@
485
  var $this = this;
486
  var tt;
487
 
488
- if ($this.o.autocomplete.enabled == 1 && !is_touch_device()) {
489
  $this.n.text.keyup(function (e) {
490
  if (window.event) {
491
  $this.keycode = window.event.keyCode;
@@ -591,6 +533,16 @@
591
 
592
  $this.n.items = $('.item', $this.n.resultsDiv);
593
 
 
 
 
 
 
 
 
 
 
 
594
  $this.showResults();
595
  $this.scrollToResults();
596
 
@@ -608,236 +560,94 @@
608
  }, "text");
609
  },
610
 
611
- showResults: function( ) {
612
  var $this = this;
613
- switch ($this.o.resultstype) {
614
- case 'horizontal':
615
- $this.showHorizontalResults();
616
- break;
617
- case 'vertical':
618
- $this.showVerticalResults();
619
- break;
620
- case 'polaroid':
621
- $this.showPolaroidResults();
622
- $this.disableMobileScroll = true;
623
- break;
624
- case 'isotopic':
625
- $this.showIsotopicResults();
626
- break;
627
- default:
628
- $this.showHorizontalResults();
629
- break;
630
- }
631
  $this.n.proloading.css({
632
- display: "none"
633
- });
634
- $this.n.proclose.css({
635
  display: "block"
636
  });
637
- if (is_touch_device())
638
- document.activeElement.blur();
639
  },
640
 
641
- hideResults: function( ) {
642
  var $this = this;
643
- switch ($this.o.resultstype) {
644
- case 'horizontal':
645
- $this.hideHorizontalResults();
646
- break;
647
- default:
648
- $this.hideVerticalResults()
649
- break;
650
- }
651
- $this.n.proclose.css({
652
  display: "none"
653
  });
 
654
  },
655
 
656
- /**
657
- * Chooses which creator to use: Vertical-Horizontal, Isotopic or Polaroid
658
- */
659
- createResult: function (r, i) {
660
  var $this = this;
661
 
662
- if ($this.o.resultstype == 'horizontal' || $this.o.resultstype == 'vertical')
663
- return $this.createVHResult(r);
664
- else if ($this.o.resultstype == 'isotopic')
665
- return $this.createIsotopicResult(r, i);
666
- else
667
- return $this.createPolaroidResult(r);
668
 
 
 
 
669
  },
670
 
671
-
672
- /**
673
- * Creates a result for Vertical and Horizontal types
674
- */
675
- createVHResult: function (r) {
676
  var $this = this;
677
-
678
- var imageDiv = "";
679
- var desc = "";
680
- var authorSpan = "";
681
- var dateSpan = "";
682
- var isImage = false;
683
- if (r.image != null && r.image != "") {
684
- imageDiv = "\
685
- <div class='image'>\
686
- <img src='" + r.image + "'> \
687
- <div class='void'></div>\
688
- </div>";
689
- isImage = true;
690
- }
691
- if ($this.o.showauthor == 1) {
692
- authorSpan = "<span class='author'>" + r.author + "</span>";
693
- }
694
- if ($this.o.showdate == 1) {
695
- dateSpan = "<span class='date'>" + r.date + "</span>";
696
- }
697
- if ($this.o.showdescription == 1) {
698
- desc = r.content;
699
- }
700
- if ($this.o.hresulthidedesc == 1 && $this.o.resultstype == 'horizontal' && isImage)
701
- desc = '';
702
- var id = 'item_' + $this.o.id;
703
- var clickable = ""
704
- if ($this.o.resultareaclickable == 1) {
705
- clickable = "<span class='overlap'></span>";
706
  }
707
- var result = "\
708
- <div class='item'> \
709
- " + imageDiv + " \
710
- <div class='content'> \
711
- <h3><a href='" + r.link + "'>" + r.title + clickable + "</a></h3> \
712
- <div class='etc'>" + authorSpan + " \
713
- " + dateSpan + "</div> \
714
- <p class='desc'>" + desc + "</p> \
715
- </div> \
716
- <div class='clear'></div> \
717
- </div>";
718
- return result;
719
- },
720
 
721
- /**
722
- * Creates a result for Isotopic types
723
- */
724
- createIsotopicResult: function (r, i) {
725
- var $this = this;
726
 
727
- //var imageStyle = "style='opacity:0;'";
728
- var image = "";
729
- var overlayImage = "";
730
- var desc = "";
731
- var authorSpan = "";
732
- var dateSpan = "";
733
- var overlay = "";
734
-
735
- if (r.image != null && r.image != "") {
736
- image = "<img class='asl_item_img' src=' " + r.image + "'>";
737
- if ($this.o.iiblurOverlay && !is_touch_device())
738
- var filter = "aslblur";
739
- else
740
- var filter = "no_aslblur";
741
- overlayImage = "<img filter='url(#" + filter + ")' style='filter: url(#" + filter + ");-webkit-filter: url(#" + filter + ");-moz-filter: url(#" + filter + ");-o-filter: url(#" + filter + ");-ms-filter: url(#" + filter + ");' class='asl_item_overlay_img' src=' " + r.image + "'>";
742
- //$this.n.aslItemOverlay.append(overlayImage);
743
- } else {
744
- switch ($this.o.iifNoImage) {
745
- case "description":
746
- desc = r.content;
747
- break;
748
- case "removeres":
749
- return null;
750
- break;
751
- case "defaultimage":
752
- if ($this.o.defaultImage != "") {
753
- image = "<img class='asl_item_img' src=' " + $this.o.defaultImage + "'>";
754
- if ($this.o.iiblurOverlay && !is_touch_device())
755
- var filter = "aslblur";
756
- else
757
- var filter = "no_aslblur";
758
- overlayImage = "<img filter='url(#" + filter + ")' style='filter: url(#" + filter + ");-webkit-filter: url(#" + filter + ");-moz-filter: url(#" + filter + ");-o-filter: url(#" + filter + ");-ms-filter: url(#" + filter + ");' class='asl_item_overlay_img' src=' " + $this.o.defaultImage + "'>";
759
- }
760
- break;
761
  }
762
  }
763
- if ($this.o.iishowOverlay)
764
- overlay = $this.n.aslItemOverlay[0].outerHTML;
765
- /*if (is_touch_device()) {
766
- overlay = "<span class='asl_item_overlay_m'></span>";
767
- } */
768
- if ($this.o.showauthor == 1) {
769
- authorSpan = "<span class='author'>" + r.author + "</span>";
770
- }
771
- if ($this.o.showdate == 1) {
772
- dateSpan = "<span class='date'>" + r.date + "</span>";
773
- }
774
- if ($this.o.showdescription == 1) {
775
- desc = r.content;
776
- }
777
 
778
- var id = 'item_' + $this.o.id;
779
- var clickable = ""
780
- if ($this.o.resultareaclickable == 1) {
781
- clickable = "<span class='overlap'></span>";
782
- }
783
- var result = "\
784
- <div data-itemnum='" + i + "' class='item'> \
785
- " + overlayImage + "\
786
- " + overlay + "\
787
- " + image + "\
788
- <div class='content'> \
789
- <h3><a href='" + r.link + "'>" + r.title + clickable + "</a></h3> \
790
- <div class='etc'>" + authorSpan + " \
791
- " + dateSpan + "</div> \
792
- <p class='desc'>" + desc + "</p> \
793
- </div> \
794
- <div class='clear'></div> \
795
- </div>";
796
- return result;
797
- },
798
 
799
- /**
800
- * Creates a result for Polaroid types
801
- */
802
 
803
- createPolaroidResult: function (r) {
804
  var $this = this;
805
 
806
- if (r.image != null) {
807
- var image = "<img alt='img' src='" + r.image + "'>";
808
- } else {
809
- var image = r.content;
810
- }
811
 
812
- var clickable = "";
813
- var authorSpan = "";
814
- var dateSpan = "";
815
- var backDiv = "";
816
- if ($this.o.resultareaclickable == 1) {
817
- clickable = "<span class='overlap'></span>";
818
- }
819
- if ($this.o.pshowsubtitle == 1) {
820
- if ($this.o.showauthor == 1) {
821
- authorSpan = "<span class='author'>" + r.author + "</span>";
822
- }
823
- if ($this.o.showdate == 1) {
824
- dateSpan = "<span class='date'>" + r.date + "</span>";
825
- }
826
- }
827
- if ($this.o.pshowdesc == 1) {
828
- backDiv = "<div class='photostack-back'>" + r.content + "</div>";
829
  }
830
- var result = "\
831
- <figure class='photostack-flip photostack-current'> \
832
- <a class='photostack-img etc' href='" + r.link + "'>" + image + "</a> \
833
- <figcaption> \
834
- <h2 class='photostack-title'><a href='" + r.link + "'>" + r.title + clickable + "</a></h2> \
835
- <div class='etc'>" + authorSpan + " \
836
- " + dateSpan + "</div> " + backDiv + " \
837
- </figcaption> \
838
- </figure>";
839
-
840
- return result;
841
  },
842
 
843
  scrollToResults: function( ) {
@@ -865,37 +675,8 @@
865
  showVerticalResults: function () {
866
  var $this = this;
867
 
868
- var adjustTop = 100;
869
-
870
- // Skip dropping animation if results are visible
871
- if ($this.n.resultsDiv.css('display') == "block")
872
- adjustTop = 0;
873
 
874
- $this.n.resultsDiv.css({
875
- display: 'block',
876
- height: 'auto'
877
- });
878
- $this.scrolling(true);
879
-
880
- var top = $this.n.resultsDiv.position().top;
881
-
882
- $this.n.resultsDiv.css({
883
- "top": top - adjustTop,
884
- opacity: 0,
885
- visibility: "visible"
886
- }).animate({
887
- "top": top,
888
- opacity: 1
889
- }, {
890
- complete: function () {
891
- $(".mCS_no_scrollbar", $this.n.resultsDiv).css({
892
- "top": 0
893
- });
894
- $(".mCSB_container", $this.n.resultsDiv).css({
895
- "top": 0
896
- });
897
- }
898
- });
899
  if ($this.n.items.length > 0) {
900
  var count = (($this.n.items.length < $this.o.itemscount) ? $this.n.items.length : $this.o.itemscount);
901
  var groups = $('.group', $this.n.resultsDiv);
@@ -907,12 +688,14 @@
907
  } else {
908
 
909
  // Set the height to a fictive value to refresh the scrollbar
 
910
  $this.n.results.css({
911
  height: 30
912
  });
913
  $this.scroll.mCustomScrollbar('update');
914
  $this.resize();
915
 
 
916
  var i = 0;
917
  var h = 0;
918
 
@@ -924,17 +707,22 @@
924
  // Count the average height * viewport size
925
  i = i < 1 ? 1 : i;
926
  h = h / i * count;
927
- if (groups.length > 0) {
928
- h += groups.outerHeight(true) * groups.length;
929
- }
930
 
931
  $this.n.results.css({
932
- height: h + 3
933
  });
934
  }
935
 
 
 
 
 
 
 
936
  $this.scroll.mCustomScrollbar('update');
 
937
  $this.resize();
 
938
  $this.scroll.mCustomScrollbar('scrollTo', 0);
939
 
940
  if ($this.o.highlight == 1) {
@@ -961,303 +749,6 @@
961
 
962
  },
963
 
964
- showHorizontalResults: function () {
965
- var $this = this;
966
-
967
- $this.n.resultsDiv.css('display', 'block');
968
-
969
- if ($('.nores', $this.n.results).size() > 0) {
970
- $(".mCSB_container", $this.n.resultsDiv).css({
971
- width: 'auto',
972
- left: 0
973
- });
974
- } else {
975
- $(".mCSB_container", $this.n.resultsDiv).css({
976
- width: ($this.n.resdrg.children().size() * $($this.n.resdrg.children()[0]).outerWidth(true)),
977
- left: 0
978
- });
979
- }
980
- if ($this.o.resultsposition == 'hover')
981
- $this.n.resultsDiv.css('width', $this.n.container.outerWidth(true));
982
- $this.scroll.data({
983
- "scrollButtons_scrollAmount": parseInt($this.n.items.outerWidth(true)),
984
- "mouseWheelPixels": parseInt($this.n.items.outerWidth(true))
985
- }).mCustomScrollbar("update");
986
-
987
- if ($this.n.resultsDiv.css('visibility') == 'visible') {
988
- var cssArgs = {
989
- height: 'auto'
990
- };
991
- var animArgs = {
992
- opacity: 1
993
- };
994
- } else {
995
- var autoHeight = $this.n.resultsDiv.css('height', 'auto').height();
996
-
997
- var cssArgs = {
998
- opacity: 0,
999
- visibility: "visible",
1000
- height: 0
1001
- };
1002
-
1003
- var animArgs = {
1004
- opacity: 1,
1005
- height: autoHeight
1006
- };
1007
- }
1008
-
1009
- $this.addAnimation();
1010
-
1011
- $this.n.resultsDiv.css(cssArgs).animate(
1012
- animArgs
1013
- , {
1014
- complete: function () {
1015
- $this.scrolling(true);
1016
- $this.searching = false;
1017
- }
1018
- });
1019
- },
1020
-
1021
- showIsotopicResults: function () {
1022
- var $this = this;
1023
- var itemsPerPage = $this.o.iitemsPerPage;
1024
-
1025
-
1026
- /*$this.n.items.each(function(){
1027
- if (parseInt($(this).attr('data-itemnum')) < itemsPerPage)
1028
- $(this).css({
1029
- opacity: 1,
1030
- display: "block"
1031
- });
1032
- });*/
1033
- $this.n.resultsDiv.css({
1034
- display: 'block',
1035
- height: 'auto'
1036
- });
1037
- $this.scrolling(true);
1038
- var top = $this.n.resultsDiv.position().top;
1039
- $this.n.resultsDiv.css({
1040
- "top": top - 100,
1041
- opacity: 0,
1042
- visibility: "visible"
1043
- }).animate({
1044
- "top": top,
1045
- opacity: 1
1046
- }, {
1047
-
1048
- });
1049
- if ($this.n.items.length > 0) {
1050
- $this.n.results.css({
1051
- height: "auto"
1052
- });
1053
- if ($this.o.highlight == 1) {
1054
- var wholew = (($this.o.highlightwholewords == 1) ? true : false);
1055
- $("div.item", $this.n.resultsDiv).highlight($this.n.text.val().split(" "), { element: 'span', className: 'highlighted', wordsOnly: wholew });
1056
- }
1057
-
1058
- }
1059
- //$this.resize();
1060
- $this.calculateIsotopeRows();
1061
- $this.showPagination();
1062
- if ($this.n.items.length == 0) {
1063
- var h = ($('.nores', $this.n.results).outerHeight(true) > ($this.o.resultitemheight) ? ($this.o.resultitemheight) : $('.nores', $this.n.results).outerHeight(true));
1064
- $this.n.results.css({
1065
- height: 11110
1066
- });
1067
- $this.n.results.css({
1068
- height: 'auto'
1069
- });
1070
- $this.n.resdrg.css({
1071
- height: 'auto'
1072
- });
1073
- } else {
1074
- $this.isotopic = new rpp_isotope('#ajaxsearchliteres' + $this.o.rid + " .resdrg", {
1075
- // options
1076
- itemSelector: 'div.item',
1077
- layoutMode: 'masonry',
1078
- filter: $this.filterFns['number']
1079
- });
1080
- }
1081
-
1082
- $this.addAnimation();
1083
- //$this.removeAnimation();
1084
- //$this.scrolling(true);
1085
- $this.searching = false;
1086
-
1087
- },
1088
-
1089
-
1090
- showPagination: function () {
1091
- var $this = this;
1092
-
1093
- $('nav.asl_navigation ul li', $this.n.resultsDiv).remove();
1094
- $('nav.asl_navigation', $this.n.resultsDiv).css('display', 'none');
1095
-
1096
- if ($this.n.items.length > 0) {
1097
- var pages = Math.ceil($this.n.items.length / $this.il.itemsPerPage);
1098
- if (pages > 1) {
1099
- for (var i = 1; i <= pages; i++) {
1100
- if (i == 1)
1101
- $('nav.asl_navigation ul', $this.n.resultsDiv).append("<li class='asl_active'><span>" + i + "</span></li>");
1102
- else
1103
- $('nav.asl_navigation ul', $this.n.resultsDiv).append("<li><span>" + i + "</span></li>");
1104
- }
1105
- $('nav.asl_navigation', $this.n.resultsDiv).css('display', 'block');
1106
- }
1107
- }
1108
- },
1109
-
1110
-
1111
- calculateIsotopeRows: function () {
1112
- var $this = this;
1113
- var containerWidth = parseFloat($this.n.results.innerWidth());
1114
- var realColumnCount = containerWidth / $this.o.iitemsWidth;
1115
- var floorColumnCount = Math.floor(realColumnCount);
1116
- if (floorColumnCount <= 0)
1117
- floorColumnCount = 1;
1118
- /*if ((realColumnCount - floorColumnCount) > 0.8)
1119
- floorColumnCount++;*/
1120
- if (Math.abs(containerWidth / floorColumnCount - $this.o.iitemsWidth) >
1121
- Math.abs(containerWidth / (floorColumnCount + 1) - $this.o.iitemsWidth)) {
1122
- floorColumnCount++;
1123
- }
1124
-
1125
- var newItemW = containerWidth / floorColumnCount - 2 * ($this.n.items.outerWidth(true) - $this.n.items.innerWidth());
1126
- var newItemH = (newItemW / $this.o.iitemsWidth) * $this.o.iitemsHeight;
1127
-
1128
- $this.il.columns = floorColumnCount;
1129
- $this.il.itemsPerPage = floorColumnCount * $this.o.iiRows;
1130
-
1131
- // This data needs do be written to the DOM, because the isotope arrange can't see the changes
1132
- $this.n.resultsDiv.data({
1133
- "colums": $this.il.columns,
1134
- "itemsperpage": $this.il.itemsPerPage
1135
- });
1136
-
1137
- $this.currentPage = 1;
1138
-
1139
- $this.n.items.css({
1140
- width: Math.floor(newItemW),
1141
- height: Math.floor(newItemH)
1142
- });
1143
- },
1144
-
1145
- showPolaroidResults: function () {
1146
- var $this = this;
1147
-
1148
- $('.photostack>nav', $this.n.resultsDiv).remove();
1149
- var figures = $('figure', $this.n.resultsDiv);
1150
- $this.n.resultsDiv.css({
1151
- display: 'block',
1152
- height: 'auto'
1153
- });
1154
- $this.scrolling(true);
1155
- var top = $this.n.resultsDiv.position().top;
1156
- $this.n.resultsDiv.css({
1157
- "top": top - 100,
1158
- opacity: 0,
1159
- visibility: "visible"
1160
- }).animate({
1161
- "top": top,
1162
- opacity: 1
1163
- }, {
1164
- complete: function () {
1165
-
1166
- }
1167
- });
1168
-
1169
- if (figures.length > 0) {
1170
- $this.n.results.css({
1171
- height: $this.o.prescontainerheight
1172
- });
1173
-
1174
- if ($this.o.highlight == 1) {
1175
- var wholew = (($this.o.highlightwholewords == 1) ? true : false);
1176
- //$("div.item", $this.n.resultsDiv).highlight($this.n.text.val().split(" "), { element: 'span', className: 'highlighted', wordsOnly: wholew });
1177
- //TODO
1178
- }
1179
- new Photostack($this.n.results.get(0), {
1180
- callback: function (item) {
1181
- }
1182
- });
1183
- }
1184
- //$this.resize();
1185
- if (figures.length == 0) {
1186
- var h = ($('.nores', $this.n.results).outerHeight(true) > ($this.o.resultitemheight) ? ($this.o.resultitemheight) : $('.nores', $this.n.results).outerHeight(true));
1187
- $this.n.results.css({
1188
- height: 11110
1189
- });
1190
- $this.n.results.css({
1191
- height: "auto"
1192
- });
1193
- }
1194
- $this.addAnimation();
1195
- $this.scrolling(true);
1196
- $this.searching = false;
1197
- $this.initPolaroidEvents(figures);
1198
-
1199
-
1200
- },
1201
-
1202
- initPolaroidEvents: function (figures) {
1203
- var $this = this;
1204
-
1205
- var i = 1;
1206
- figures.each(function () {
1207
- if (i > 1)
1208
- $(this).removeClass('photostack-current');
1209
- $(this).attr('idx', i);
1210
- i++;
1211
- });
1212
-
1213
- figures.click(function (e) {
1214
- if ($(this).hasClass("photostack-current")) return;
1215
- e.preventDefault();
1216
- var idx = $(this).attr('idx');
1217
- $('.photostack>nav span:nth-child(' + idx + ')', $this.n.resultsDiv).click();
1218
- });
1219
-
1220
- figures.bind('mousewheel', function (event, delta) {
1221
- event.preventDefault();
1222
- if (delta >= 1) {
1223
- if ($('.photostack>nav span.current', $this.n.resultsDiv).next().length > 0) {
1224
- $('.photostack>nav span.current', $this.n.resultsDiv).next().click();
1225
- } else {
1226
- $('.photostack>nav span:nth-child(1)', $this.n.resultsDiv).click();
1227
- }
1228
- } else {
1229
- if ($('.photostack>nav span.current', $this.n.resultsDiv).prev().length > 0) {
1230
- $('.photostack>nav span.current', $this.n.resultsDiv).prev().click();
1231
- } else {
1232
- $('.photostack>nav span:nth-last-child(1)', $this.n.resultsDiv).click();
1233
- }
1234
- }
1235
- });
1236
-
1237
- figures.bind("swipeone", function (e, originalEvent) {
1238
- e.preventDefault();
1239
- e.stopPropagation();
1240
- originalEvent.originalEvent.preventDefault();
1241
- originalEvent.originalEvent.stopPropagation()
1242
- if (originalEvent.delta != null && originalEvent.delta[0] != null && originalEvent.delta[0].lastX != null) {
1243
- if (originalEvent.delta[0].lastX >= 0) {
1244
- if ($('.photostack>nav span.current', $this.n.resultsDiv).next().length > 0) {
1245
- $('.photostack>nav span.current', $this.n.resultsDiv).next().click();
1246
- } else {
1247
- $('.photostack>nav span:nth-child(1)', $this.n.resultsDiv).click();
1248
- }
1249
- } else {
1250
- if ($('.photostack>nav span.current', $this.n.resultsDiv).prev().length > 0) {
1251
- $('.photostack>nav span.current', $this.n.resultsDiv).prev().click();
1252
- } else {
1253
- $('.photostack>nav span:nth-last-child(1)', $this.n.resultsDiv).click();
1254
- }
1255
- }
1256
- }
1257
- });
1258
- $this.disableMobileScroll = true;
1259
- },
1260
-
1261
  hideVerticalResults: function () {
1262
  var $this = this;
1263
 
@@ -1278,46 +769,11 @@
1278
  });
1279
  },
1280
 
1281
- hideHorizontalResults: function (newSearch) {
1282
- //var $this = $.extend({}, this, methods);
1283
- var $this = this;
1284
-
1285
- $this.disableMobileScroll = false;
1286
-
1287
- newSearch = typeof newSearch !== 'undefined' ? newSearch : false;
1288
- if (!newSearch) {
1289
- $this.n.resultsDiv
1290
- .animate({
1291
- opacity: 0,
1292
- height: 0
1293
- }, {
1294
- duration: 120,
1295
- complete: function () {
1296
- $(this).css({
1297
- visibility: "hidden",
1298
- display: "none"
1299
- });
1300
- }
1301
- });
1302
- } else {
1303
- $this.n.resultsDiv
1304
- .animate({
1305
- opacity: 0.3
1306
- }, {
1307
- complete: function () {
1308
- return;
1309
- }
1310
- });
1311
- }
1312
- },
1313
-
1314
  addAnimation: function () {
1315
  var $this = this;
1316
  var i = 0;
1317
  var j = 1;
1318
  $this.n.items.each(function () {
1319
- if ($this.o.resultstype == 'isotopic' && j>$this.il.itemsPerPage)
1320
- return;
1321
  var x = this;
1322
  setTimeout(function () {
1323
  $(x).addClass($this.animation);
@@ -1335,40 +791,86 @@
1335
  });
1336
  },
1337
 
1338
- showSettings: function () {
1339
  var $this = this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1340
 
1341
- $this.scrolling(true);
1342
  $this.n.searchsettings.css({
1343
- opacity: 0,
1344
- visibility: "visible",
1345
- top: "-=50px"
1346
  });
1347
- $this.n.searchsettings.animate({
1348
- opacity: 1,
1349
- top: "+=50px"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1350
  });
1351
- $this.n.prosettings.attr('opened', 1);
 
 
 
 
 
 
 
 
1352
  if ($this.settScroll == null) {
1353
  $this.settScroll = $('.asl_sett_scroll', $this.n.searchsettings).mCustomScrollbar({
1354
  contentTouchScroll: true
1355
  });
1356
  }
 
1357
  },
 
1358
  hideSettings: function () {
1359
  var $this = this;
1360
 
1361
- $this.n.searchsettings.animate({
1362
- opacity: 0
1363
- }, {
1364
- complete: function () {
1365
- $(this).css({
1366
- visibility: "hidden"
1367
- });
1368
- }
1369
- });
1370
- $this.n.prosettings.attr('opened', 0);
1371
  },
 
1372
  cleanUp: function () {
1373
  var $this = this;
1374
 
@@ -1379,6 +881,10 @@
1379
  },
1380
  resize: function () {
1381
  var $this = this;
 
 
 
 
1382
 
1383
  if (detectIE() && 0) {
1384
  $this.n.proinput.css({
@@ -1391,9 +897,6 @@
1391
  });
1392
  $this.n.textAutocomplete.css({
1393
  width: $this.n.proinput.width() - 2 + $this.n.proloading.outerWidth(true),
1394
- position: 'absolute',
1395
- top: $this.n.text.position().top,
1396
- left: $this.n.text.position().left,
1397
  opacity: 0.25,
1398
  zIndex: 1
1399
  });
@@ -1404,33 +907,25 @@
1404
  if ($this.o.settingsimagepos == 'left') {
1405
  $this.n.searchsettings.css({
1406
  display: "block",
1407
- top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2,
1408
  left: $this.n.prosettings.offset().left
1409
  });
1410
  } else {
1411
  $this.n.searchsettings.css({
1412
  display: "block",
1413
- top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2,
1414
  left: $this.n.prosettings.offset().left + $this.n.prosettings.width() - $this.n.searchsettings.width()
1415
  });
1416
  }
1417
  }
1418
  if ($this.n.resultsDiv.css('visibility') != 'hidden') {
1419
-
1420
  if ($this.o.resultsposition != 'block') {
 
 
1421
  $this.n.resultsDiv.css({
1422
- width: $this.n.container.width() - ($this.n.resultsDiv.outerWidth(true) - $this.n.resultsDiv.width()),
1423
- top: $this.n.container.offset().top + $this.n.container.outerHeight(true) + 10,
1424
- left: $this.n.container.offset().left
1425
- });
1426
- }
1427
-
1428
- if ($this.o.resultstype != 'isotopic') {
1429
- $('.content', $this.n.items).each(function () {
1430
- var imageWidth = (($(this).prev().css('display') == "none") ? 0 : $(this).prev().outerWidth(true));
1431
- $(this).css({
1432
- width: ($(this.parentNode).width() - $(this).prev().outerWidth(true) - $(this).outerWidth(false) + $(this).width()) - 3
1433
- });
1434
  });
1435
  }
1436
 
@@ -1438,43 +933,38 @@
1438
  },
1439
  scrolling: function (ignoreVisibility) {
1440
  var $this = this;
 
 
 
 
1441
 
1442
  if (ignoreVisibility == true || $this.n.searchsettings.css('visibility') == 'visible') {
1443
 
1444
  if ($this.o.settingsimagepos == 'left') {
1445
  $this.n.searchsettings.css({
1446
  display: "block",
1447
- top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2,
1448
  left: $this.n.prosettings.offset().left
1449
  });
1450
  } else {
1451
  $this.n.searchsettings.css({
1452
  display: "block",
1453
- top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2,
1454
  left: $this.n.prosettings.offset().left + $this.n.prosettings.width() - $this.n.searchsettings.width()
1455
  });
1456
  }
1457
  }
1458
 
1459
  if ((ignoreVisibility == true || $this.n.resultsDiv.css('visibility') == 'visible')) {
1460
- var cwidth = $this.n.container.outerWidth(true);
1461
- if ($this.o.resultsposition != 'hover' && $this.n.resultsAppend.length > 0)
1462
- cwidth = 'auto';
1463
- else
1464
- cwidth = cwidth - (2 * parseInt($this.n.resultsDiv.css('paddingLeft')));
1465
  $this.n.resultsDiv.css({
1466
- width: cwidth,
1467
- top: $this.n.container.offset().top + $this.n.container.outerHeight(true) + 10,
1468
- left: $this.n.container.offset().left
1469
- });
1470
- if ($this.o.resultstype != 'vertical') return;
1471
- $('.content', $this.n.items).each(function () {
1472
- $(this).css({
1473
- width: ($(this.parentNode).width() - $(this).prev().outerWidth(true) - $(this).outerWidth(false) + $(this).width()) - 3
1474
- });
1475
- /*$(this).css({
1476
- width: ($(this.parentNode).width()-$(this).prev().outerWidth(true))
1477
- });*/
1478
  });
1479
  }
1480
  }
@@ -1484,6 +974,32 @@
1484
  return !!("ontouchstart" in window) ? 1 : 0;
1485
  }
1486
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1487
  function detectIE() {
1488
  var ua = window.navigator.userAgent;
1489
  var msie = ua.indexOf('MSIE ');
@@ -1521,8 +1037,5 @@
1521
  };
1522
 
1523
  $.plugin('ajaxsearchlite', methods);
1524
- })(jQuery);
1525
-
1526
-
1527
-
1528
  })(asljQuery, asljQuery, window);
1
+ (function(jQuery, $, window){
2
+ /*! Ajax Search Lite 4.6 js */
3
  (function ($) {
4
 
5
  var methods = {
60
  case "vertical":
61
  $this.animation = $this.o.vresultanimation;
62
  break;
 
 
 
63
  default:
64
  $this.animation = $this.o.hresultanimation;
65
  }
84
  };
85
 
86
  $this.disableMobileScroll = false;
 
 
87
  $this.n.searchsettings.detach().appendTo("body");
88
 
89
  if ($this.o.resultsposition == 'hover') {
92
  $this.n.resultsDiv.detach().appendTo($this.n.resultsAppend);
93
  }
94
 
95
+ $this.createVerticalScroll();
 
 
 
 
 
 
 
96
 
97
  if (detectIE())
98
  $this.n.container.addClass('asl_msie');
99
+
100
+ // Calculates the settings animation attributes
101
+ $this.initSettingsAnimations();
102
+
103
+ // Calculates the results animation attributes
104
+ $this.initResultsAnimations();
105
+
106
  $this.initEvents();
107
 
108
  return this;
134
 
135
  createVerticalScroll: function () {
136
  var $this = this;
137
+
138
  $this.scroll = $this.n.results.mCustomScrollbar({
139
  contentTouchScroll: true,
140
  scrollButtons: {
141
+ enable: true
 
 
 
142
  },
143
  callbacks: {
144
  onScroll: function () {
145
+ if (isMobile()) return;
146
  var top = parseInt($('.mCSB_container', $this.n.results).position().top);
147
  var children = $('.mCSB_container .resdrg').children();
148
  var overall = 0;
163
  });
164
  if ($last.hasClass('group'))
165
  s_overall = s_overall + ($last.outerHeight(true) - $last.outerHeight(false));
166
+
167
+ $this.scroll.mCustomScrollbar("scrollTo", $last,{
168
+ scrollInertia: 200,
169
+ callbacks: false
170
  });
171
  }
172
  }
229
  });
230
 
231
  $this.n.prosettings.on("click", function () {
232
+ if ($this.n.prosettings.data('opened') == 0) {
233
  $this.showSettings();
234
  } else {
235
  $this.hideSettings();
265
 
266
  $this.initMagnifierEvent();
267
  $this.initAutocompleteEvent();
 
 
268
  $this.initFacetEvents();
 
269
  },
270
 
271
  initNavigationEvent: function () {
353
  $this.ktype = e.type;
354
  }
355
 
356
+ var isInput = $(this).hasClass("orig");
357
+
358
  if ($this.n.text.val().length < $this.o.charcount) {
359
  $this.n.proloading.css('display', 'none');
360
  $this.hideResults();
363
  return;
364
  }
365
 
366
+ // If redirection is set to the results page, or custom URL
367
+ if (
368
+ (!isInput && $this.o.redirectonclick == 1 && $this.ktype == 'click' && $this.o.redirectClickTo == 'results_page' ) ||
369
+ (isInput && $this.o.redirect_on_enter == 1 && $this.ktype == 'keyup' && $this.keycode == 13 && $this.o.redirectEnterTo == 'results_page' )
370
+ ) {
371
+ var plus = '';
372
+ var url = '?s=' + $this.n.text.val();
373
+
374
+ if ($this.o.overridewpdefault) {
375
+ asp_submit_to_url($this.o.homeurl + url + "&asl_active=1", 'post', {
376
+ p_asl_data: $('form', $this.n.searchsettings).serialize()
377
+ });
378
+ } else {
379
+ asp_submit_to_url($this.o.homeurl + url, 'post', {
380
+ np_asl_data: $('form', $this.n.searchsettings).serialize()
381
+ });
382
+ }
383
+
384
+ $this.n.proloading.css('display', 'none');
385
+ $this.hideResults();
386
+ if ($this.post != null) $this.post.abort();
387
+ clearTimeout(t);
388
+ return;
389
+ }
390
+
391
  // Ignore arrows
392
  if ($this.keycode >= 37 && $this.keycode <= 40) return;
393
  if ($(this).hasClass('orig') && $this.ktype == 'click') return;
394
+
 
 
 
395
  if ($this.o.triggeronclick == 0 && $this.ktype == 'click') return;
396
  if ($this.o.triggerontype == 0 && $this.ktype == 'keyup') return;
397
 
403
  });
404
  },
405
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  initFacetEvents: function() {
407
  var $this = this;
408
  if ($this.o.trigger_on_facet_change == 1)
427
  var $this = this;
428
  var tt;
429
 
430
+ if ($this.o.autocomplete.enabled == 1 && !isMobile()) {
431
  $this.n.text.keyup(function (e) {
432
  if (window.event) {
433
  $this.keycode = window.event.keyCode;
533
 
534
  $this.n.items = $('.item', $this.n.resultsDiv);
535
 
536
+ // Redirect to the first result if enabled :)
537
+ if (
538
+ $('.asl_res_url', $this.n.resultsDiv).length > 0 &&
539
+ ($this.o.redirectonclick == 1 && $this.ktype == 'click' && $this.o.redirectClickTo != 'results_page' ) ||
540
+ ($this.o.redirect_on_enter == 1 && $this.ktype == 'keyup' && $this.keycode == 13 && $this.o.redirectEnterTo != 'results_page' )
541
+ ) {
542
+ location.href = $( $('.asl_res_url', $this.n.resultsDiv).get(0)).attr('href');
543
+ return false;
544
+ }
545
+
546
  $this.showResults();
547
  $this.scrollToResults();
548
 
560
  }, "text");
561
  },
562
 
563
+ showLoader: function( ) {
564
  var $this = this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565
  $this.n.proloading.css({
 
 
 
566
  display: "block"
567
  });
 
 
568
  },
569
 
570
+ hideLoader: function( ) {
571
  var $this = this;
572
+
573
+ $this.n.proloading.css({
 
 
 
 
 
 
 
574
  display: "none"
575
  });
576
+ $this.n.results.css("display", "");
577
  },
578
 
579
+ showResultsBox: function() {
 
 
 
580
  var $this = this;
581
 
582
+ $this.n.resultsDiv.css({
583
+ display: 'block',
584
+ height: 'auto'
585
+ });
586
+ $this.n.items.addClass($this.animationOpacity);
 
587
 
588
+ $this.scrolling(true);
589
+ $this.n.resultsDiv.css($this.resAnim.showCSS);
590
+ $this.n.resultsDiv.removeClass($this.resAnim.hideClass).addClass($this.resAnim.showClass);
591
  },
592
 
593
+ showResults: function( ) {
 
 
 
 
594
  var $this = this;
595
+ switch ($this.o.resultstype) {
596
+ case 'vertical':
597
+ $this.showVerticalResults();
598
+ break;
599
+ default:
600
+ $this.showHorizontalResults();
601
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
603
 
604
+ $this.hideLoader();
 
 
 
 
605
 
606
+ $this.n.proclose.css({
607
+ display: "block"
608
+ });
609
+
610
+ if ($this.n.showmore != null) {
611
+ if ($this.n.items.length > 0) {
612
+ $this.n.showmore.css({
613
+ 'display': 'block'
614
+ });
615
+ } else {
616
+ $this.n.showmore.css({
617
+ 'display': 'none'
618
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
619
  }
620
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
621
 
622
+ if (isMobile() && $this.o.mobile.hide_keyboard)
623
+ document.activeElement.blur();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
624
 
625
+ $this.resultsOpened = true;
626
+ },
 
627
 
628
+ hideResults: function( ) {
629
  var $this = this;
630
 
631
+ if ( !$this.resultsOpened ) return false;
 
 
 
 
632
 
633
+ $this.n.resultsDiv.removeClass($this.resAnim.showClass).addClass($this.resAnim.hideClass);
634
+ setTimeout(function(){
635
+ $this.n.resultsDiv.css($this.resAnim.hideCSS);
636
+ }, $this.resAnim.duration);
637
+
638
+ $this.n.proclose.css({
639
+ display: "none"
640
+ });
641
+ if ($this.n.showmore != null) {
642
+ $this.n.showmore.css({
643
+ 'display': 'none'
644
+ });
 
 
 
 
 
645
  }
646
+
647
+ if (isMobile())
648
+ document.activeElement.blur();
649
+
650
+ $this.resultsOpened = false;
 
 
 
 
 
 
651
  },
652
 
653
  scrollToResults: function( ) {
675
  showVerticalResults: function () {
676
  var $this = this;
677
 
678
+ $this.showResultsBox();
 
 
 
 
679
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
  if ($this.n.items.length > 0) {
681
  var count = (($this.n.items.length < $this.o.itemscount) ? $this.n.items.length : $this.o.itemscount);
682
  var groups = $('.group', $this.n.resultsDiv);
688
  } else {
689
 
690
  // Set the height to a fictive value to refresh the scrollbar
691
+ // .. otherwise the height is not calculated correctly, because of the scrollbar width.
692
  $this.n.results.css({
693
  height: 30
694
  });
695
  $this.scroll.mCustomScrollbar('update');
696
  $this.resize();
697
 
698
+ // Here now we have the correct item height values with the scrollbar enabled
699
  var i = 0;
700
  var h = 0;
701
 
707
  // Count the average height * viewport size
708
  i = i < 1 ? 1 : i;
709
  h = h / i * count;
 
 
 
710
 
711
  $this.n.results.css({
712
+ height: h
713
  });
714
  }
715
 
716
+ window.sscroll = $this.scroll;
717
+
718
+ // Disable the scrollbar first, to avoid glitches
719
+ $this.scroll.mCustomScrollbar('disable', true);
720
+
721
+ // After making the changes trigger an update to re-enable
722
  $this.scroll.mCustomScrollbar('update');
723
+ // ..then all the other math stuff from the resize event
724
  $this.resize();
725
+ // .. and finally scroll back to the first item nicely
726
  $this.scroll.mCustomScrollbar('scrollTo', 0);
727
 
728
  if ($this.o.highlight == 1) {
749
 
750
  },
751
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
752
  hideVerticalResults: function () {
753
  var $this = this;
754
 
769
  });
770
  },
771
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
772
  addAnimation: function () {
773
  var $this = this;
774
  var i = 0;
775
  var j = 1;
776
  $this.n.items.each(function () {
 
 
777
  var x = this;
778
  setTimeout(function () {
779
  $(x).addClass($this.animation);
791
  });
792
  },
793
 
794
+ initSettingsAnimations: function() {
795
  var $this = this;
796
+ var animDur = 300;
797
+
798
+ $this.settAnim = {
799
+ "showClass": "asl_an_fadeInDrop",
800
+ "showCSS": {
801
+ "visibility": "visible",
802
+ "display": "block",
803
+ "opacity": 1,
804
+ "animation-duration": animDur
805
+ },
806
+ "hideClass": "asl_an_fadeOutDrop",
807
+ "hideCSS": {
808
+ "visibility": "hidden",
809
+ "opacity": 0,
810
+ "display": "none"
811
+ },
812
+ "duration": animDur
813
+ };
814
 
 
815
  $this.n.searchsettings.css({
816
+ "-webkit-animation-duration": $this.settAnim.duration + "ms",
817
+ "animation-duration": $this.settAnim.duration + "ms"
 
818
  });
819
+ },
820
+
821
+ initResultsAnimations: function() {
822
+ var $this = this;
823
+ var animDur = 300;
824
+
825
+ $this.resAnim = {
826
+ "showClass": "asl_an_fadeInDrop",
827
+ "showCSS": {
828
+ "visibility": "visible",
829
+ "display": "block",
830
+ "opacity": 1,
831
+ "animation-duration": animDur
832
+ },
833
+ "hideClass": "asl_an_fadeOutDrop",
834
+ "hideCSS": {
835
+ "visibility": "hidden",
836
+ "opacity": 0,
837
+ "display": "none"
838
+ },
839
+ "duration": animDur
840
+ };
841
+
842
+ $this.n.resultsDiv.css({
843
+ "-webkit-animation-duration": animDur + "ms",
844
+ "animation-duration": animDur + "ms"
845
  });
846
+ },
847
+
848
+ showSettings: function () {
849
+ var $this = this;
850
+
851
+ $this.scrolling(true);
852
+ $this.n.searchsettings.css($this.settAnim.showCSS);
853
+ $this.n.searchsettings.removeClass($this.settAnim.hideClass).addClass($this.settAnim.showClass);
854
+
855
  if ($this.settScroll == null) {
856
  $this.settScroll = $('.asl_sett_scroll', $this.n.searchsettings).mCustomScrollbar({
857
  contentTouchScroll: true
858
  });
859
  }
860
+ $this.n.prosettings.data('opened', 1);
861
  },
862
+
863
  hideSettings: function () {
864
  var $this = this;
865
 
866
+ $this.n.searchsettings.removeClass($this.settAnim.showClass).addClass($this.settAnim.hideClass);
867
+ setTimeout(function(){
868
+ $this.n.searchsettings.css($this.settAnim.hideCSS);
869
+ }, $this.settAnim.duration);
870
+
871
+ $this.n.prosettings.data('opened', 0);
 
 
 
 
872
  },
873
+
874
  cleanUp: function () {
875
  var $this = this;
876
 
881
  },
882
  resize: function () {
883
  var $this = this;
884
+ var bodyTop = 0;
885
+
886
+ if ( $("body").css("position") != "static" )
887
+ bodyTop = $("body").offset().top;
888
 
889
  if (detectIE() && 0) {
890
  $this.n.proinput.css({
897
  });
898
  $this.n.textAutocomplete.css({
899
  width: $this.n.proinput.width() - 2 + $this.n.proloading.outerWidth(true),
 
 
 
900
  opacity: 0.25,
901
  zIndex: 1
902
  });
907
  if ($this.o.settingsimagepos == 'left') {
908
  $this.n.searchsettings.css({
909
  display: "block",
910
+ top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2 - bodyTop,
911
  left: $this.n.prosettings.offset().left
912
  });
913
  } else {
914
  $this.n.searchsettings.css({
915
  display: "block",
916
+ top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2 - bodyTop,
917
  left: $this.n.prosettings.offset().left + $this.n.prosettings.width() - $this.n.searchsettings.width()
918
  });
919
  }
920
  }
921
  if ($this.n.resultsDiv.css('visibility') != 'hidden') {
 
922
  if ($this.o.resultsposition != 'block') {
923
+ var cwidth = $this.n.container.width() - ($this.n.resultsDiv.outerWidth(true) - $this.n.resultsDiv.width());
924
+ var rwidth = cwidth < 240 ? 240 : cwidth;
925
  $this.n.resultsDiv.css({
926
+ width: rwidth,
927
+ top: $this.n.container.offset().top + $this.n.container.outerHeight(true) + 10 - bodyTop,
928
+ left: $this.n.container.offset().left + (cwidth - rwidth)
 
 
 
 
 
 
 
 
 
929
  });
930
  }
931
 
933
  },
934
  scrolling: function (ignoreVisibility) {
935
  var $this = this;
936
+ var bodyTop = 0;
937
+
938
+ if ( $("body").css("position") != "static" )
939
+ bodyTop = $("body").offset().top;
940
 
941
  if (ignoreVisibility == true || $this.n.searchsettings.css('visibility') == 'visible') {
942
 
943
  if ($this.o.settingsimagepos == 'left') {
944
  $this.n.searchsettings.css({
945
  display: "block",
946
+ top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2 - bodyTop,
947
  left: $this.n.prosettings.offset().left
948
  });
949
  } else {
950
  $this.n.searchsettings.css({
951
  display: "block",
952
+ top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2 - bodyTop,
953
  left: $this.n.prosettings.offset().left + $this.n.prosettings.width() - $this.n.searchsettings.width()
954
  });
955
  }
956
  }
957
 
958
  if ((ignoreVisibility == true || $this.n.resultsDiv.css('visibility') == 'visible')) {
959
+ var cwidth = $this.n.container.width() - ($this.n.resultsDiv.outerWidth(true) - $this.n.resultsDiv.width());
960
+ var rwidth = cwidth < 240 ? 240 : cwidth;
961
+ if ( ($this.o.resultsposition != 'hover' && $this.n.resultsAppend.length > 0) || $this.n.container.hasClass("hiddend"))
962
+ rwidth = 'auto';
963
+
964
  $this.n.resultsDiv.css({
965
+ width: rwidth,
966
+ top: $this.n.container.offset().top + $this.n.container.outerHeight(true) + 10 - bodyTop,
967
+ left: $this.n.container.offset().left + (cwidth - rwidth)
 
 
 
 
 
 
 
 
 
968
  });
969
  }
970
  }
974
  return !!("ontouchstart" in window) ? 1 : 0;
975
  }
976
 
977
+ /* Mobile detection - Touch desktop device safe! */
978
+ function isMobile() {
979
+ try{ document.createEvent("TouchEvent"); return true; }
980
+ catch(e){ return false; }
981
+ }
982
+
983
+ function asp_submit_to_url(action, method, input) {
984
+ 'use strict';
985
+ var form;
986
+ form = $('<form />', {
987
+ action: action,
988
+ method: method,
989
+ style: 'display: none;'
990
+ });
991
+ if (typeof input !== 'undefined' && input !== null) {
992
+ $.each(input, function (name, value) {
993
+ $('<input />', {
994
+ type: 'hidden',
995
+ name: name,
996
+ value: value
997
+ }).appendTo(form);
998
+ });
999
+ }
1000
+ form.appendTo('body').submit();
1001
+ }
1002
+
1003
  function detectIE() {
1004
  var ua = window.navigator.userAgent;
1005
  var msie = ua.indexOf('MSIE ');
1037
  };
1038
 
1039
  $.plugin('ajaxsearchlite', methods);
1040
+ })(jQuery);
 
 
 
1041
  })(asljQuery, asljQuery, window);
js/nomin-scoped/jquery.easing.compatibility.js DELETED
@@ -1,60 +0,0 @@
1
- (function(jQuery, $, window){
2
- /*!
3
- * jQuery Easing Compatibility v1 - http://gsgd.co.uk/sandbox/jquery.easing.php
4
- *
5
- * Adds compatibility for applications that use the pre 1.2 easing names
6
- *
7
- * Copyright (c) 2007 George Smith
8
- * Licensed under the MIT License:
9
- * http://www.opensource.org/licenses/mit-license.php
10
- */
11
-
12
- jQuery.extend( jQuery.easing,
13
- {
14
- easeIn: function (x, t, b, c, d) {
15
- return jQuery.easing.easeInQuad(x, t, b, c, d);
16
- },
17
- easeOut: function (x, t, b, c, d) {
18
- return jQuery.easing.easeOutQuad(x, t, b, c, d);
19
- },
20
- easeInOut: function (x, t, b, c, d) {
21
- return jQuery.easing.easeInOutQuad(x, t, b, c, d);
22
- },
23
- expoin: function(x, t, b, c, d) {
24
- return jQuery.easing.easeInExpo(x, t, b, c, d);
25
- },
26
- expoout: function(x, t, b, c, d) {
27
- return jQuery.easing.easeOutExpo(x, t, b, c, d);
28
- },
29
- expoinout: function(x, t, b, c, d) {
30
- return jQuery.easing.easeInOutExpo(x, t, b, c, d);
31
- },
32
- bouncein: function(x, t, b, c, d) {
33
- return jQuery.easing.easeInBounce(x, t, b, c, d);
34
- },
35
- bounceout: function(x, t, b, c, d) {
36
- return jQuery.easing.easeOutBounce(x, t, b, c, d);
37
- },
38
- bounceinout: function(x, t, b, c, d) {
39
- return jQuery.easing.easeInOutBounce(x, t, b, c, d);
40
- },
41
- elasin: function(x, t, b, c, d) {
42
- return jQuery.easing.easeInElastic(x, t, b, c, d);
43
- },
44
- elasout: function(x, t, b, c, d) {
45
- return jQuery.easing.easeOutElastic(x, t, b, c, d);
46
- },
47
- elasinout: function(x, t, b, c, d) {
48
- return jQuery.easing.easeInOutElastic(x, t, b, c, d);
49
- },
50
- backin: function(x, t, b, c, d) {
51
- return jQuery.easing.easeInBack(x, t, b, c, d);
52
- },
53
- backout: function(x, t, b, c, d) {
54
- return jQuery.easing.easeOutBack(x, t, b, c, d);
55
- },
56
- backinout: function(x, t, b, c, d) {
57
- return jQuery.easing.easeInOutBack(x, t, b, c, d);
58
- }
59
- });
60
- })(asljQuery, asljQuery, window);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/nomin-scoped/jquery.easing.js DELETED
@@ -1,174 +0,0 @@
1
- (function(jQuery, $, window){
2
- /*
3
- * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
4
- *
5
- * Uses the built in easing capabilities added In jQuery 1.1
6
- * to offer multiple easing options
7
- *
8
- * TERMS OF USE - jQuery Easing
9
- *
10
- * Open source under the BSD License.
11
- *
12
- * Copyright © 2008 George McGinley Smith
13
- * All rights reserved.
14
- *
15
- * Redistribution and use in source and binary forms, with or without modification,
16
- * are permitted provided that the following conditions are met:
17
- *
18
- * Redistributions of source code must retain the above copyright notice, this list of
19
- * conditions and the following disclaimer.
20
- * Redistributions in binary form must reproduce the above copyright notice, this list
21
- * of conditions and the following disclaimer in the documentation and/or other materials
22
- * provided with the distribution.
23
- *
24
- * Neither the name of the author nor the names of contributors may be used to endorse
25
- * or promote products derived from this software without specific prior written permission.
26
- *
27
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
28
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
29
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
30
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
32
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
33
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
35
- * OF THE POSSIBILITY OF SUCH DAMAGE.
36
- *
37
- */
38
-
39
- // t: current time, b: begInnIng value, c: change In value, d: duration
40
- jQuery.easing['jswing'] = jQuery.easing['swing'];
41
-
42
- jQuery.extend( jQuery.easing,
43
- {
44
- def: 'easeOutQuad',
45
- swing: function (x, t, b, c, d) {
46
- //alert(jQuery.easing.default);
47
- return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
48
- },
49
- easeInQuad: function (x, t, b, c, d) {
50
- return c*(t/=d)*t + b;
51
- },
52
- easeOutQuad: function (x, t, b, c, d) {
53
- return -c *(t/=d)*(t-2) + b;
54
- },
55
- easeInOutQuad: function (x, t, b, c, d) {
56
- if ((t/=d/2) < 1) return c/2*t*t + b;
57
- return -c/2 * ((--t)*(t-2) - 1) + b;
58
- },
59
- easeInCubic: function (x, t, b, c, d) {
60
- return c*(t/=d)*t*t + b;
61
- },
62
- easeOutCubic: function (x, t, b, c, d) {
63
- return c*((t=t/d-1)*t*t + 1) + b;
64
- },
65
- easeInOutCubic: function (x, t, b, c, d) {
66
- if ((t/=d/2) < 1) return c/2*t*t*t + b;
67
- return c/2*((t-=2)*t*t + 2) + b;
68
- },
69
- easeInQuart: function (x, t, b, c, d) {
70
- return c*(t/=d)*t*t*t + b;
71
- },
72
- easeOutQuart: function (x, t, b, c, d) {
73
- return -c * ((t=t/d-1)*t*t*t - 1) + b;
74
- },
75
- easeInOutQuart: function (x, t, b, c, d) {
76
- if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
77
- return -c/2 * ((t-=2)*t*t*t - 2) + b;
78
- },
79
- easeInQuint: function (x, t, b, c, d) {
80
- return c*(t/=d)*t*t*t*t + b;
81
- },
82
- easeOutQuint: function (x, t, b, c, d) {
83
- return c*((t=t/d-1)*t*t*t*t + 1) + b;
84
- },
85
- easeInOutQuint: function (x, t, b, c, d) {
86
- if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
87
- return c/2*((t-=2)*t*t*t*t + 2) + b;
88
- },
89
- easeInSine: function (x, t, b, c, d) {
90
- return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
91
- },
92
- easeOutSine: function (x, t, b, c, d) {
93
- return c * Math.sin(t/d * (Math.PI/2)) + b;
94
- },
95
- easeInOutSine: function (x, t, b, c, d) {
96
- return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
97
- },
98
- easeInExpo: function (x, t, b, c, d) {
99
- return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
100
- },
101
- easeOutExpo: function (x, t, b, c, d) {
102
- return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
103
- },
104
- easeInOutExpo: function (x, t, b, c, d) {
105
- if (t==0) return b;
106
- if (t==d) return b+c;
107
- if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
108
- return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
109
- },
110
- easeInCirc: function (x, t, b, c, d) {
111
- return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
112
- },
113
- easeOutCirc: function (x, t, b, c, d) {
114
- return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
115
- },
116
- easeInOutCirc: function (x, t, b, c, d) {
117
- if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
118
- return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
119
- },
120
- easeInElastic: function (x, t, b, c, d) {
121
- var s=1.70158;var p=0;var a=c;
122
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
123
- if (a < Math.abs(c)) { a=c; var s=p/4; }
124
- else var s = p/(2*Math.PI) * Math.asin (c/a);
125
- return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
126
- },
127
- easeOutElastic: function (x, t, b, c, d) {
128
- var s=1.70158;var p=0;var a=c;
129
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
130
- if (a < Math.abs(c)) { a=c; var s=p/4; }
131
- else var s = p/(2*Math.PI) * Math.asin (c/a);
132
- return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
133
- },
134
- easeInOutElastic: function (x, t, b, c, d) {
135
- var s=1.70158;var p=0;var a=c;
136
- if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
137
- if (a < Math.abs(c)) { a=c; var s=p/4; }
138
- else var s = p/(2*Math.PI) * Math.asin (c/a);
139
- if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
140
- return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
141
- },
142
- easeInBack: function (x, t, b, c, d, s) {
143
- if (s == undefined) s = 1.70158;
144
- return c*(t/=d)*t*((s+1)*t - s) + b;
145
- },
146
- easeOutBack: function (x, t, b, c, d, s) {
147
- if (s == undefined) s = 1.70158;
148
- return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
149
- },
150
- easeInOutBack: function (x, t, b, c, d, s) {
151
- if (s == undefined) s = 1.70158;
152
- if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
153
- return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
154
- },
155
- easeInBounce: function (x, t, b, c, d) {
156
- return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
157
- },
158
- easeOutBounce: function (x, t, b, c, d) {
159
- if ((t/=d) < (1/2.75)) {
160
- return c*(7.5625*t*t) + b;
161
- } else if (t < (2/2.75)) {
162
- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
163
- } else if (t < (2.5/2.75)) {
164
- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
165
- } else {
166
- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
167
- }
168
- },
169
- easeInOutBounce: function (x, t, b, c, d) {
170
- if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
171
- return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
172
- }
173
- });
174
- })(asljQuery, asljQuery, window);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/nomin-scoped/jquery.gestures.js CHANGED
@@ -1,1535 +1,3 @@
1
- (function(jQuery, $, window){
2
- /*jslint undef: true, browser: true, continue: true, eqeq: true, vars: true, forin: true, white: true, newcap: false, nomen: true, plusplus: true, maxerr: 50, indent: 4 */
3
-
4
- /**
5
- * jGestures: a jQuery plugin for gesture events
6
- * Copyright 2010-2011 Neue Digitale / Razorfish GmbH
7
- * Copyright 2011-2012, Razorfish GmbH
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- *
18
- * @fileOverview
19
- * Razorfish GmbH javascript library: add touch events such as 'pinch',
20
- * 'rotate', 'swipe', 'tap' and 'orientationchange' on capable user agents.
21
- * For incapable devices there's a basic event substitution: a "tapone" event
22
- * can be triggered by "clicking", a "swipeone" by performing a swipe-ish
23
- * gesture using the mouse (buttondown - mousemove - buttonup).
24
- *
25
- * This is still a beta version, bugfixes and improvements appreciated.
26
- *
27
- * @author martin.krause@razorfish.de
28
- * @version 0.90-shake
29
- *
30
- * @requires
31
- * jQuery JavaScript Library v1.4.2 - http://jquery.com/
32
- * Copyright 2010, John Resig
33
- * Dual licensed under the MIT or GPL Version 2 licenses.
34
- * http://jquery.org/license
35
- *
36
- * @example jQuery('#swipe').bind('swipeone',eventHandler);
37
- *
38
- * Notification on native events:
39
- * On every native touchstart, touchend, gesturestart and gestureend-event,
40
- * jgestures triggers a corresponding custom event
41
- * ('jGestures.touchstart', 'jGestures.touchend;start', 'jGestures.touchend;processed',
42
- * 'jGestures.gesturestart', 'jGestures.gestureend;start', 'jGestures.gestureend;processed') on the event-element.
43
- * The eventhandler's second argument represents the original touch event (yes: including all touchpoints).
44
- * Use this if you need very detailed control e.g. kinetic scrolling or implementing additional gestures.
45
- *
46
- * Every jGesture-eventhandler receives a custom object as second argument
47
- * containing the original event (originalEvent property) and processed
48
- * information (such as delta values and timesptamp).
49
- * Example:{
50
- * type: eventtype e.g. "swipe","pinch",
51
- * originalEvent: {DOM-Event},
52
- * // default: just one entry on the delta-array - the first touchpoint
53
- * // the first touchpoint is the reference point for every gesture,
54
- * // because moving touchpoints in various directions would result in
55
- * // a gesture.
56
- * // delta and direction details are just provided for touch not for gesture / motion events
57
- * delta : [
58
- * {
59
- * lastX:{Number} , // x-axis: relative to the last touchevent (e.g. touchmove!)
60
- * lastY:{Number}, // y-axis: relative to the last touchevent (e.g. touchmove!)
61
- * moved: {Number}, // distance: relative to the original touchpoint
62
- * startX: {Number} , // relative to the original touchpoint
63
- * startY: {Number} ,// relative to the original touchpoint
64
- * } ],
65
- * // based on the first touchpoint
66
- * direction : { // relative to the last touchevent (e.g. touchmove!)
67
- * vector: {Number}, // -1|+1, indicates the direction if necessary(pinch/rotate)
68
- * orientation: {Number} // window.orientation: -90,0,90,180 || null (window.orienntation)
69
- * lastX : {Number}, // -1,0,+1 || null (orientationchange) // relative to the last touchevent (e.g. touchmove!)
70
- * lastY : {Number}, // -1,0,+1 || null (orientationchange)// relative to the last touchevent (e.g. touchmove!)
71
- * startX: {Number} , // relative to the original touchpoint
72
- * startY: {Number} ,// relative to the original touchpoint
73
- * },
74
- * rotation: {Number} || null, // gestureonly: amount of rotation relative to the current position NOT the original
75
- * scale: {Number} || null, // gestureonly: amount of scaling relative to the current position NOT the original
76
- * duration: {Number}, // ms: relative to the original touchpoint
77
- * description : {String} // details as String: {TYPE *}:{TOUCHES 1|2|3|4}:{X-AXIS 'right'|'left'|'steady'}:{Y-AXIS 'down'|'up'|'steady'} e.g. "swipe:1:left:steady" relative to the last touchpoint
78
- * };
79
- *
80
- * Available jGesture-events can be grouped into:
81
- *
82
- *
83
- * Device events:
84
- * The jGesture-Events in this group are triggered by the device.
85
- *
86
- * @event 'orientationchange'
87
- * The device is turned clockwise or counterclockwise. This event is triggered
88
- * by the device and might use an internal gyroscope.
89
- * obj.description:
90
- * orientationchange:landscape:clockwise:-90
91
- * orientationchange:portrait:default:0
92
- * orientationchange:landscape:counterclockwise|portrait:90
93
- * orientationchange:portrait:upsidedown:180
94
- *
95
- *
96
- * Move events:
97
- * The jGesture-Events in this group are triggered during the touch/gesture
98
- * execution whenever a touchpoint changes.
99
- * In contrast to touchend/gestureend-events which are triggered after
100
- * the touch/gesture has completed.
101
- *
102
- * @event 'pinch'
103
- * Is triggered during a pinch gesture (two fingers moving away from or
104
- * towards each other).
105
- * obj.description:
106
- * pinch:-1:close
107
- * pinch:+1:open
108
- *
109
- * @event 'rotate'
110
- * Is triggered during a rotation gesture (two fingers rotating clockwise
111
- * or counterclockwise).
112
- * obj.description:
113
- * rotate:-1:counterclockwise
114
- * rotate:+1:+clockwise
115
- *
116
- * @event 'swipemove'
117
- * Is triggered during a swipe move gesture (finger(s) being moved around
118
- * the device, e.g. dragging)
119
- * obj.description:
120
- * swipemove:1:left:down
121
- * swipemove:1:left:up
122
- * swipemove:1:left:steady
123
- * swipemove:1:right:down
124
- * swipemove:1:right:up
125
- * swipemove:1:right:steady
126
- * swipemove:2:left:down
127
- * swipemove:2:left:up
128
- * swipemove:2:left:steady
129
- * swipemove:2:right:down
130
- * swipemove:2:right:up
131
- * swipemove:2:right:steady
132
- * swipemove:2:left:down
133
- * swipemove:3:left:up
134
- * swipemove:3:left:steady
135
- * swipemove:3:right:down
136
- * swipemove:3:right:up
137
- * swipemove:3:right:steady
138
- * swipemove:3:left:down
139
- * swipemove:4:left:up
140
- * swipemove:4:left:steady
141
- * swipemove:4:right:down
142
- * swipemove:4:right:up
143
- * swipemove:4:right:steady
144
- *
145
- *
146
- * Toucheend events:
147
- * The jGesture-Events in this group are triggered after the touch/gesture
148
- * has completed.
149
- * In contrast to touchmove-events which are triggered during the touch/gesture
150
- * execution whenever a touchpoint changes.
151
- *
152
- * @event 'swipeone'
153
- * Is triggered after a swipe move gesture with one touchpoint (one finger
154
- * was moved around the device)
155
- * obj.description:
156
- * swipeone:1:left:down
157
- * swipeone:1:left:up
158
- * swipeone:1:left:steady
159
- * swipeone:1:right:down
160
- * swipeone:1:right:up
161
- * swipeone:1:right:steady
162
- *
163
- * @event 'swipetwo'
164
- * Is triggered after a swipe move gesture with two touchpoints (two fingers
165
- * were moved around the device)
166
- * obj.description:
167
- * swipetwo:2:left:down
168
- * swipetwo:2:left:up
169
- * swipetwo:2:left:steady
170
- * swipetwo:2:right:down
171
- * swipetwo:2:right:up
172
- * swipetwo:2:right:steady
173
- *
174
- * @event 'swipethree'
175
- * Is triggered after a swipe move gesture with three touchpoints (three
176
- * fingers were moved around the device)
177
- * obj.description:
178
- * swipethree:3:left:down
179
- * swipethree:3:left:up
180
- * swipethree:3:left:steady
181
- * swipethree:3:right:down
182
- * swipethree:3:right:up
183
- * swipethree:3:right:steady
184
- *
185
- * @event 'swipefour'
186
- * Is triggered after a swipe move gesture with four touchpoints (four
187
- * fingers were moved around the device)
188
- * obj.description:
189
- * swipefour:4:left:down
190
- * swipefour:4:left:up
191
- * swipefour:4:left:steady
192
- * swipefour:4:right:down
193
- * swipefour:4:right:up
194
- * swipefour:4:right:steady
195
- *
196
- *
197
- * @event 'swipeup'
198
- * Is triggered after an strict upwards swipe move gesture
199
- * obj.description:
200
- * swipe:1:steady:up
201
- * swipe:2:steady:up
202
- * swipe:3:steady:up
203
- * swipe:4:steady:up
204
- *
205
- * @event 'swiperightup'
206
- * Is triggered after a rightwards and upwards swipe move gesture
207
- * obj.description:
208
- * swipe:1:right:up
209
- * swipe:2:right:up
210
- * swipe:3:right:up
211
- * swipe:4:right:up
212
- *
213
- * @event 'swiperight'
214
- * Is triggered after a strict rightwards swipe move gesture
215
- * obj.description:
216
- * swipe:1:right:steady
217
- * swipe:2:right:steady
218
- * swipe:3:right:steady
219
- * swipe:4:right:steady
220
- *
221
- * @event 'swiperightdown'
222
- * Is triggered after a rightwards and downwards swipe move gesture
223
- * obj.description:
224
- * swipe:1:right:down
225
- * swipe:2:right:down
226
- * swipe:3:right:down
227
- * swipe:4:right:down
228
- *
229
- * @event 'swipedown'
230
- * Is triggered after a strict downwards swipe move gesture
231
- * obj.description:
232
- * swipe:1:steady:down
233
- * swipe:2:steady:down
234
- * swipe:3:steady:down
235
- * swipe:4:steady:down
236
- *
237
- * @event 'swipeleftdown'
238
- * Is triggered after a leftwards and downwards swipe move gesture
239
- * obj.description:
240
- * swipe:1:left:down
241
- * swipe:2:left:down
242
- * swipe:3:left:down
243
- * swipe:4:left:down
244
- *
245
- * @event 'swipeleft'
246
- * Is triggered after a strict leftwards swipe move gesture
247
- * obj.description:
248
- * swipe:1:left:steady
249
- * swipe:2:left:steady
250
- * swipe:3:left:steady
251
- * swipe:4:left:steady
252
- *
253
- * @event 'swipeleftup'
254
- * Is triggered after a leftwards and upwards swipe move gesture
255
- * obj.description:
256
- * swipe:1:left:up
257
- * swipe:2:left:up
258
- * swipe:3:left:up
259
- * swipe:4:left:up
260
- *
261
- * @event 'tapone'
262
- * Is triggered after a single (one finger) tap gesture
263
- * obj.description:
264
- * tapone
265
- *
266
- * @event 'taptwo'
267
- * Is triggered after a double (two finger) tap gesture
268
- * obj.description:
269
- * taptwo
270
- * *
271
- * @event 'tapthree'
272
- * Is triggered after a tripple (three finger) tap gesture
273
- * obj.description:
274
- * tapthree
275
- *
276
- *
277
- * Gestureend events:
278
- * A gesture is an interpretation of different touchpoints.
279
- * The jGesture-Events in this group are triggered when a gesture has finished
280
- * and the touchpoints are removed from the device.
281
- *
282
- * @event 'pinchopen'
283
- * Is triggered when a pinchopen gesture (two fingers moving away from each
284
- * other) occured and the touchpoints (fingers) are removed the device.
285
- * obj.description:
286
- * pinch:+1:open
287
- *
288
- * @event 'pinchclose'
289
- * Is triggered when a pinchclose gesture (two fingers moving towards each
290
- * other) occured and the touchpoints (fingers) are removed the device.
291
- * obj.description:
292
- * pinch:-1:close
293
- *
294
- * @event 'rotatecw'
295
- * Is triggered when a clockwise rotation gesture (two fingers rotating
296
- * clockwise) occured and the touchpoints (fingers) are removed the device.
297
- * obj.description:
298
- * rotate:+1:+clockwise
299
- *
300
- * @event 'rotateccw'
301
- * Is triggered when a counterclockwise rotation gesture (two fingers
302
- * rotating counterclockwise) occured and the touchpoints (fingers) are
303
- * removed the device.
304
- * obj.description:
305
- * rotate:-1:+counterclockwise
306
- *
307
- *
308
- * Motion events:
309
- * A "motion event" is an interpretation of changes in space, e.g. a "shaking motion"
310
- * consists of a specified number of acceleration changes in a given interval.
311
- * For understanding "directions", place your mobile device on a table with the bottom
312
- * (home button) close to you:
313
- * - x-axis: horizontal left / right
314
- * - y-axis: horizontal front / back (through the home button)
315
- * - z-axis: vertical through your device
316
- *
317
- * Note: Devicemotion / deviceorientation don't send custom event (such as: jGestures.touchstart).
318
- * Note: Devicemotion should be bound on the "window-element" - because the whole device moves
319
- *
320
- * @event 'shake'
321
- * Is triggered when a shaking motion is detected
322
- * obj.description:
323
- * shake:leftright:x-axisfrontback:y-axis:updown:z-axis
324
- *
325
- * @event 'shakefrontback'
326
- * Is triggered when a shaking motion is detected and the gesture can be interpreted as a mainly front-back movement.
327
- * obj.description:
328
- * shakefrontback:shakefrontback:y-axis
329
- *
330
- * @event 'shakeleftright'
331
- * Is triggered when a shaking motion is detected and the gesture can be interpreted as a mainly left-right movement.
332
- * Additional major movements are mentioned in the obj.description.
333
- * obj.description:
334
- * shakeleftright:leftright:x-axis
335
- *
336
- * @event 'shakeupdown'
337
- * Is triggered when a shaking motion is detected and the gesture can be interpreted as a mainly up-down movement.
338
- * Additional major movements are mentioned in the obj.description.
339
- * obj.description:
340
- * shake:shakeupdown:updown:z-axis
341
- *
342
- * @example
343
- * .bind( eventType, [ eventData ], handler(eventObject) )
344
- * jQuery('body').bind('tapone',function(){alert(arguments[1].description);})
345
- *
346
- */
347
- (function($) {
348
-
349
- /**
350
- * General thresholds.
351
- */
352
- // @TODO: move to $...defaults
353
- // @TODO: shake to defaults freeze etc
354
- // change of x deg in y ms
355
-
356
-
357
- $.jGestures = {};
358
- $.jGestures.defaults = {};
359
- $.jGestures.defaults.thresholdShake = {
360
- requiredShakes : 10,
361
- freezeShakes: 100,
362
- frontback : {
363
- sensitivity: 10
364
- },
365
- leftright : {
366
- sensitivity: 10
367
- },
368
- updown : {
369
- sensitivity: 10
370
- }
371
- };
372
-
373
- $.jGestures.defaults.thresholdPinchopen = 0.05;
374
- $.jGestures.defaults.thresholdPinchmove = 0.05;
375
- $.jGestures.defaults.thresholdPinch = 0.05;
376
- $.jGestures.defaults.thresholdPinchclose = 0.05;
377
- $.jGestures.defaults.thresholdRotatecw = 5; //deg
378
- $.jGestures.defaults.thresholdRotateccw = 5; // deg
379
- // a tap becomes a swipe if x/y values changes are above this threshold
380
- $.jGestures.defaults.thresholdMove = 20;
381
- $.jGestures.defaults.thresholdSwipe = 100;
382
- // get capable user agents
383
- $.jGestures.data = {};
384
- $.jGestures.data.capableDevicesInUserAgentString = ['iPad','iPhone','iPod','Mobile Safari']; // basic functionality such as swipe, pinch, rotate, tap should work on every mobile safari, e.g. GalaxyTab
385
- $.jGestures.data.hasGestures = (function () { var _i; for(_i = 0; _i < $.jGestures.data.capableDevicesInUserAgentString.length; _i++ ) { if (navigator.userAgent.indexOf($.jGestures.data.capableDevicesInUserAgentString[_i]) !== -1 ) {return true;} } return false; } )();
386
- $.hasGestures = $.jGestures.data.hasGestures;
387
- $.jGestures.events = {
388
- touchstart : 'jGestures.touchstart',
389
- touchendStart: 'jGestures.touchend;start',
390
- touchendProcessed: 'jGestures.touchend;processed',
391
- gesturestart: 'jGestures.gesturestart',
392
- gestureendStart: 'jGestures.gestureend;start',
393
- gestureendProcessed: 'jGestures.gestureend;processed'
394
- };
395
-
396
- jQuery
397
- .each({
398
- // "first domevent necessary"_"touch event+counter" : "exposed as"
399
- // event: orientationchange
400
- orientationchange_orientationchange01: "orientationchange",
401
- // event: gestures
402
- gestureend_pinchopen01: "pinchopen",
403
- gestureend_pinchclose01: "pinchclose",
404
- gestureend_rotatecw01 : 'rotatecw',
405
- gestureend_rotateccw01 : 'rotateccw',
406
- // move events
407
- gesturechange_pinch01: 'pinch',
408
- gesturechange_rotate01: 'rotate',
409
- touchstart_swipe13: 'swipemove',
410
- // event: touches
411
- touchstart_swipe01: "swipeone",
412
- touchstart_swipe02: "swipetwo",
413
- touchstart_swipe03: "swipethree",
414
- touchstart_swipe04: "swipefour",
415
- touchstart_swipe05: 'swipeup',
416
- touchstart_swipe06: 'swiperightup',
417
- touchstart_swipe07: 'swiperight',
418
- touchstart_swipe08: 'swiperightdown',
419
- touchstart_swipe09: 'swipedown',
420
- touchstart_swipe10: 'swipeleftdown',
421
- touchstart_swipe11: 'swipeleft',
422
- touchstart_swipe12: 'swipeleftup',
423
- touchstart_tap01: 'tapone',
424
- touchstart_tap02: 'taptwo',
425
- touchstart_tap03: 'tapthree',
426
- touchstart_tap04: 'tapfour',
427
-
428
- devicemotion_shake01: 'shake',
429
- devicemotion_shake02: 'shakefrontback',
430
- devicemotion_shake03: 'shakeleftright',
431
- devicemotion_shake04: 'shakeupdown'
432
-
433
- },
434
-
435
- /**
436
- * Add gesture events inside the jQuery.event.special namespace
437
- */
438
- function( sInternal_, sPublicFN_ ) {
439
-
440
- // add as funciton to jQuery.event.special.sPublicFN_
441
- jQuery.event.special[ sPublicFN_ ] = {
442
-
443
- /**
444
- * When the first event handler is bound, jQuery executes the setup function.
445
- * This plugin just uses one eventhandler per element, regardless of the number of bound events.
446
- * All Events are stored internally as properties on the dom-element using the $.data api.
447
- * The setup-function adds the eventlistener, acting as a proxy function for the internal events.
448
- * $.data.ojQueryGestures[_sDOMEvent ('tap') ] = {Boolean}
449
- * @return {Void}
450
- */
451
- setup: function () {
452
- // split the arguments to necessary controll arguements
453
- var _aSplit = sInternal_.split('_');
454
- var _sDOMEvent = _aSplit[0]; //
455
- // get the associated gesture event and strip the counter: necessary for distinguisihng similliar events such as tapone-tapfour
456
- var _sGestureEvent = _aSplit[1].slice(0,_aSplit[1].length-2);
457
- var _$element = jQuery(this);
458
- var _oDatajQueryGestures ;
459
- var oObj;
460
- // bind the event handler on the first $.bind() for a gestureend-event, set marker
461
- if (!_$element.data('ojQueryGestures') || !_$element.data('ojQueryGestures')[_sDOMEvent]) {
462
- // setup pseudo event
463
- _oDatajQueryGestures = _$element.data('ojQueryGestures') || {};
464
- oObj = {};
465
- // marker for: domEvent being set on this element
466
- // e.g.: $.data.oGestureInternals['touchstart'] = true;
467
- // since they're grouped, i'm just marking the first one being added
468
- oObj[_sDOMEvent] = true;
469
- $.extend(true,_oDatajQueryGestures,oObj);
470
- _$element.data('ojQueryGestures' ,_oDatajQueryGestures);
471
- // add gesture events
472
- if($.hasGestures) {
473
- switch(_sGestureEvent) {
474
-
475
- // event: orientationchange
476
- case 'orientationchange':
477
- _$element.get(0).addEventListener('orientationchange', _onOrientationchange, false);
478
- break;
479
-
480
- // event:
481
- // - shake
482
- // - tilt
483
- case 'shake':
484
- case 'shakefrontback':
485
- case 'shakeleftright':
486
- case 'shakeupdown':
487
- case 'tilt':
488
- //$.hasGyroscope = true //!window.DeviceOrientationEvent;
489
- //_$element.get(0).addEventListener('devicemotion', _onDevicemotion, false);
490
- //_$element.get(0).addEventListener('deviceorientation', _onDeviceorientation, false);
491
- _$element.get(0).addEventListener('devicemotion', _onDevicemotion, false);
492
- break;
493
-
494
- // event:
495
- // - touchstart
496
- // - touchmove
497
- // - touchend
498
- case 'tap':
499
- case 'swipe':
500
- case 'swipeup':
501
- case 'swiperightup':
502
- case 'swiperight':
503
- case 'swiperightdown':
504
- case 'swipedown':
505
- case 'swipeleftdown':
506
- case 'swipeleft':
507
- _$element.get(0).addEventListener('touchstart', _onTouchstart, false);
508
- break;
509
-
510
- // event: gestureend
511
- case 'pinchopen':
512
- case 'pinchclose' :
513
- case 'rotatecw' :
514
- case 'rotateccw' :
515
- _$element.get(0).addEventListener('gesturestart', _onGesturestart, false);
516
- _$element.get(0).addEventListener('gestureend', _onGestureend, false);
517
- break;
518
-
519
- // event: gesturechange
520
- case 'pinch':
521
- case 'rotate':
522
- _$element.get(0).addEventListener('gesturestart', _onGesturestart, false);
523
- _$element.get(0).addEventListener('gesturechange', _onGesturechange, false);
524
- break;
525
- }
526
- }
527
- // create substitute for gesture events
528
- else {
529
- switch(_sGestureEvent) {
530
- // event substitutes:
531
- // - touchstart: mousedown
532
- // - touchmove: none
533
- // - touchend: mouseup
534
- case 'tap':
535
- case 'swipe':
536
- // _$element.get(0).addEventListener('mousedown', _onTouchstart, false);
537
- _$element.bind('mousedown', _onTouchstart);
538
- break;
539
-
540
- // no substitution
541
- case 'orientationchange':
542
- case 'pinchopen':
543
- case 'pinchclose' :
544
- case 'rotatecw' :
545
- case 'rotateccw' :
546
- case 'pinch':
547
- case 'rotate':
548
- case 'shake':
549
- case 'tilt':
550
-
551
- break;
552
- }
553
- }
554
-
555
- }
556
- return false;
557
- },
558
-
559
- /**
560
- * For every $.bind(GESTURE) the add-function will be called.
561
- * Instead of binding an actual eventlister, the event is stored as $.data on the element.
562
- * The handler will be triggered using $.triggerHandler(GESTURE) if the internal
563
- * eventhandler (proxy being bound on setup()) detects a GESTURE event
564
- * @param {Object} event_ jQuery-Event-Object being passed by $.bind()
565
- * @return {Void}
566
- */
567
- add : function(event_) {
568
- // add pseudo event: properties on $.data
569
- var _$element = jQuery(this);
570
- var _oDatajQueryGestures = _$element.data('ojQueryGestures');
571
- // _oDatajQueryGestures[event_.type] = { 'originalType' : event_.type , 'threshold' : event_.data.threshold, 'preventDefault' : event_.data.preventDefault } ;
572
- _oDatajQueryGestures[event_.type] = { 'originalType' : event_.type } ;
573
- return false;
574
- },
575
-
576
- /**
577
- * For every $.unbind(GESTURE) the remove-function will be called.
578
- * Instead of removing the actual eventlister, the event is removed from $.data on the element.
579
- * @param {Object} event_ jQuery-Event-Object being passed by $.bind()
580
- * @return {Void}
581
- */
582
- remove : function(event_) {
583
- // remove pseudo event: properties on $.data
584
- var _$element = jQuery(this);
585
- var _oDatajQueryGestures = _$element.data('ojQueryGestures');
586
- _oDatajQueryGestures[event_.type] = false;
587
- _$element.data('ojQueryGestures' ,_oDatajQueryGestures );
588
- return false;
589
- },
590
-
591
- /**
592
- * The last $.unbind()-call on the domElement triggers the teardown function
593
- * removing the eventlistener
594
- * @return {Void}
595
- */
596
- // @TODO: maybe rework teardown to work with event type?!
597
- teardown : function() {
598
- // split the arguments to necessary controll arguements
599
- var _aSplit = sInternal_.split('_');
600
- var _sDOMEvent = _aSplit[0]; //
601
- // get the associated gesture event and strip the counter: necessary for distinguisihng similliar events such as tapone-tapfour
602
- var _sGestureEvent = _aSplit[1].slice(0,_aSplit[1].length-2);
603
- var _$element = jQuery(this);
604
- var _oDatajQueryGestures;
605
- var oObj;
606
- // bind the event handler on the first $.bind() for a gestureend-event, set marker
607
- if (!_$element.data('ojQueryGestures') || !_$element.data('ojQueryGestures')[_sDOMEvent]) {
608
- // setup pseudo event
609
- _oDatajQueryGestures = _$element.data('ojQueryGestures') || {};
610
- oObj = {};
611
- // remove marker for: domEvent being set on this element
612
- oObj[_sDOMEvent] = false;
613
- $.extend(true,_oDatajQueryGestures,oObj);
614
- _$element.data('ojQueryGestures' ,_oDatajQueryGestures);
615
-
616
- // remove gesture events
617
- if($.hasGestures) {
618
- switch(_sGestureEvent) {
619
-
620
- // event: orientationchange
621
- case 'orientationchange':
622
- _$element.get(0).removeEventListener('orientationchange', _onOrientationchange, false);
623
- break;
624
-
625
- case 'shake':
626
- case 'shakefrontback':
627
- case 'shakeleftright':
628
- case 'shakeupdown':
629
- case 'tilt':
630
- _$element.get(0).removeEventListener('devicemotion', _onDevicemotion, false);
631
- break;
632
-
633
- // event :
634
- // - touchstart
635
- // - touchmove
636
- // - touchend
637
- case 'tap':
638
- case 'swipe':
639
- case 'swipeup':
640
- case 'swiperightup':
641
- case 'swiperight':
642
- case 'swiperightdown':
643
- case 'swipedown':
644
- case 'swipeleftdown':
645
- case 'swipeleft':
646
- case 'swipeleftup':
647
- _$element.get(0).removeEventListener('touchstart', _onTouchstart, false);
648
- _$element.get(0).removeEventListener('touchmove', _onTouchmove, false);
649
- _$element.get(0).removeEventListener('touchend', _onTouchend, false);
650
- break;
651
-
652
- // event: gestureend
653
- case 'pinchopen':
654
- case 'pinchclose' :
655
- case 'rotatecw' :
656
- case 'rotateccw' :
657
- _$element.get(0).removeEventListener('gesturestart', _onGesturestart, false);
658
- _$element.get(0).removeEventListener('gestureend', _onGestureend, false);
659
- break;
660
-
661
- // event: gesturechange
662
- case 'pinch':
663
- case 'rotate':
664
- _$element.get(0).removeEventListener('gesturestart', _onGesturestart, false);
665
- _$element.get(0).removeEventListener('gesturechange', _onGesturechange, false);
666
- break;
667
- }
668
- }
669
- // remove substitute for gesture events
670
- else {
671
- switch(_sGestureEvent) {
672
- // event substitutes:
673
- // - touchstart: mousedown
674
- // - touchmove: none
675
- // - touchend: mouseup
676
- case 'tap':
677
- case 'swipe':
678
- // _$element.get(0).removeEventListener('mousedown', _onTouchstart, false);
679
- // _$element.get(0).removeEventListener('mousemove', _onTouchmove, false);
680
- // _$element.get(0).removeEventListener('mouseup', _onTouchend, false);
681
- _$element.unbind('mousedown', _onTouchstart);
682
- _$element.unbind('mousemove', _onTouchmove);
683
- _$element.unbind('mouseup', _onTouchend);
684
- break;
685
-
686
- // no substitution
687
- case 'orientationchange':
688
- case 'pinchopen':
689
- case 'pinchclose' :
690
- case 'rotatecw' :
691
- case 'rotateccw' :
692
- case 'pinch':
693
- case 'rotate':
694
- case 'shake':
695
- case 'tilt':
696
-
697
- break;
698
- }
699
- }
700
-
701
- }
702
- return false;
703
- }
704
-
705
- };
706
- });
707
-
708
- /**
709
- * Creates the object that ist passed as second argument to the $element.triggerHandler function.
710
- * This object contains detailed informations about the gesture event.
711
- * @param {Object} oOptions_ {type: {String}, touches: {String}, deltaY: {String},deltaX : {String}, startMove: {Object}, event:{DOM-Event}, timestamp:{String},vector: {Number}}
712
- * @example _createOptions (
713
- * {
714
- * type: 'swipemove',
715
- * touches: '1',
716
- * deltaY: _iDeltaY,
717
- * deltaX : _iDeltaX,
718
- * startMove: _oDatajQueryGestures.oStartTouch,
719
- * event:event_,
720
- * timestamp:_oEventData.timestamp,
721
- * vector: -1
722
- * }
723
- * );
724
- * @returns {Object}
725
- * {
726
- * type: eventtype e.g. "swipe","pinch",
727
- * originalEvent: {DOM-Event},
728
- * // default: just one entry on the delta-array - the first touchpoint
729
- * // the first touchpoint is the reference point for every gesture,
730
- * // because moving touchpoints in various directions would result in
731
- * // a gesture.
732
- * // delta and direction details are just provided for touch not for gesture / motion events
733
- * delta : [
734
- * {
735
- * lastX:{Number} , // x-axis: relative to the last touchevent (e.g. touchmove!)
736
- * lastY:{Number}, // y-axis: relative to the last touchevent (e.g. touchmove!)
737
- * moved: {Number}, // distance: relative to the original touchpoint
738
- * startX: {Number} , // relative to the original touchpoint
739
- * startY: {Number} ,// relative to the original touchpoint
740
- * } ],
741
- * // based on the first touchpoint
742
- * direction : { // relative to the last touchevent (e.g. touchmove!)
743
- * vector: {Number}, // -1|+1, indicates the direction if necessary(pinch/rotate)
744
- * orientation: {Number} // window.orientation: -90,0,90,180 || null (window.orienntation)
745
- * lastX : {Number}, // -1,0,+1 relative to the last touchevent (e.g. touchmove!)
746
- * lastY : {Number}, // -1,0,+1 relative to the last touchevent (e.g. touchmove!)
747
- * startX: {Number} , //-1,0,+1 relative to the original touchpoint
748
- * startY: {Number} ,// -1,0,+1 relative to the original touchpoint
749
- * },
750
- * rotation: {Number} || null, // gestureonly: amount of rotation relative to the current position NOT the original
751
- * scale: {Number} || null, // gestureonly: amount of scaling relative to the current position NOT the original
752
- * duration: {Number}, // ms: relative to the original touchpoint
753
- * description : {String} // details as String: {TYPE *}:{TOUCHES 1|2|3|4}:{X-AXIS 'right'|'left'|'steady'}:{Y-AXIS 'down'|'up'|'steady'} e.g. "swipe:1:left:steady" relative to the last touchpoint
754
- * };
755
- */
756
- function _createOptions(oOptions_) {
757
- // force properties
758
- oOptions_.startMove = (oOptions_.startMove) ? oOptions_.startMove : {startX: null,startY:null,timestamp:null} ;
759
- var _iNow = new Date().getTime();
760
- var _oDirection;
761
- var _oDelta;
762
- // calculate touch differences
763
- if (oOptions_.touches) {
764
- // store delta values
765
- _oDelta = [
766
- {
767
- lastX: oOptions_.deltaX ,
768
- lastY: oOptions_.deltaY,
769
- moved: null,
770
- startX: oOptions_.screenX - oOptions_.startMove.screenX ,
771
- startY: oOptions_.screenY - oOptions_.startMove.screenY
772
- }
773
- ];
774
-
775
- _oDirection = {
776
- vector: oOptions_.vector || null,
777
- orientation : window.orientation || null,
778
- lastX : ((_oDelta[0].lastX > 0) ? +1 : ( (_oDelta[0].lastX < 0) ? -1 : 0 ) ),
779
- lastY : ((_oDelta[0].lastY > 0) ? +1 : ( (_oDelta[0].lastY < 0) ? -1 : 0 ) ),
780
- startX : ((_oDelta[0].startX > 0) ? +1 : ( (_oDelta[0].startX < 0) ? -1 : 0 ) ),
781
- startY : ((_oDelta[0].startY > 0) ? +1 : ( (_oDelta[0].startY < 0) ? -1 : 0 ) )
782
- };
783
-
784
- // calculate distance traveled using the pythagorean theorem
785
- _oDelta[0].moved = Math.sqrt(Math.pow(Math.abs(_oDelta[0].startX), 2) + Math.pow(Math.abs(_oDelta[0].startY), 2));
786
-
787
- }
788
- return {
789
- type: oOptions_.type || null,
790
- originalEvent: oOptions_.event || null,
791
- delta : _oDelta || null,
792
- direction : _oDirection || { orientation : window.orientation || null, vector: oOptions_.vector || null},
793
- duration: (oOptions_.duration) ? oOptions_.duration : ( oOptions_.startMove.timestamp ) ? _iNow - oOptions_.timestamp : null,
794
- rotation: oOptions_.rotation || null,
795
- scale: oOptions_.scale || null,
796
- description : oOptions_.description || [
797
- oOptions_.type,
798
- ':',
799
- oOptions_.touches,
800
- ':',
801
- ((_oDelta[0].lastX != 0) ? ((_oDelta[0].lastX > 0) ? 'right' : 'left') : 'steady'),
802
- ':',
803
- ((_oDelta[0].lastY != 0) ? ( (_oDelta[0].lastY > 0) ? 'down' : 'up') :'steady')
804
- ].join('')
805
- };
806
-
807
- }
808
-
809
-
810
-
811
- /**
812
- * DOM-event handlers
813
- */
814
-
815
- /**
816
- * Handler: orientationchange
817
- * Triggers the bound orientationchange handler on the window element
818
- * The "orientationchange" handler will receive an object with additional information
819
- * about the event.
820
- * {
821
- * direction : {
822
- * orientation: {-90|0|90|180}
823
- * },
824
- * description : [
825
- * 'orientationchange:{landscape:clockwise:|portrait:default|landscape:counterclockwise|portrait:upsidedown}:{-90|0|90|180}' // e.g. 'orientation:landscape:clockwise:-90
826
- * }
827
- * @param {DOM-Event} event_
828
- * @return {Void}
829
- */
830
- function _onOrientationchange(event_) {
831
-
832
- // window.orientation: -90,0,90,180
833
- var _aDict = ['landscape:clockwise:','portrait:default:','landscape:counterclockwise:','portrait:upsidedown:'];
834
-
835
- $(window).triggerHandler('orientationchange',
836
- {
837
- direction : {orientation: window.orientation},
838
- description : [
839
- 'orientationchange:',
840
- _aDict[( (window.orientation / 90) +1)],
841
- window.orientation
842
- ].join('')
843
- });
844
- }
845
-
846
-
847
- /**
848
- * Handler: devicemotion
849
- * Calculates "motion events" such as shake, tilt, wiggle by observing "changes in space"
850
- * For understanding "directions", place your mobile device on a table with the bottom
851
- * (home button) close to you:
852
- * - x-axis: horizontal left / right
853
- * - y-axis: horizontal front / back (through the home button)
854
- * - z-axis: vertical through your device
855
- * @param {DOM-Event} event_
856
- * @returns {Object}
857
- * {
858
- * type: eventtype e.g. "shake",
859
- * originalEvent: {DOM-Event},
860
- * // delta and direction details are just provided for touch not for gesture / motion events
861
- * delta : null,
862
- * direction :{
863
- * vector: null,
864
- * orientation: -90,0,90,180 || null (window.orienntation)
865
- * }
866
- * rotation: {Number} , // amount of rotation relative to the current position NOT the original
867
- * scale: {Number} , // amount of scaling relative to the current position NOT the original
868
- * duration: {Number}, // ms: duration of the motion
869
- * description : {String} // details as String: pinch:{'close'|'open'} e.g. "pinch:-1:close" || rotate:{'counterclockwise'|'clockwise'} e.g. "rotate:-1:counterclockwise"
870
- * };
871
- * @param {DOM-Event} event_
872
- * @return {Void}
873
- */
874
- function _onDevicemotion(event_) {
875
-
876
- var _sType;
877
- var _$element = jQuery(window);
878
- //var _bHasGyroscope = $.hasGyroscope;
879
-
880
- // skip custom notification: devicemotion is triggered every 0.05s regardlesse of any gesture
881
-
882
- // get options
883
- var _oDatajQueryGestures = _$element.data('ojQueryGestures');
884
-
885
- var _oThreshold = $.jGestures.defaults.thresholdShake;
886
-
887
- // get last position or set initital values
888
- var _oLastDevicePosition = _oDatajQueryGestures.oDeviceMotionLastDevicePosition || {
889
- accelerationIncludingGravity : {
890
- x: 0,
891
- y: 0,
892
- z: 0
893
- },
894
- shake : {
895
- eventCount: 0,
896
- intervalsPassed: 0,
897
- intervalsFreeze: 0
898
- },
899
- shakeleftright : {
900
- eventCount: 0,
901
- intervalsPassed: 0,
902
- intervalsFreeze: 0
903
- },
904
- shakefrontback : {
905
- eventCount: 0,
906
- intervalsPassed: 0,
907
- intervalsFreeze: 0
908
- },
909
- shakeupdown : {
910
- eventCount: 0,
911
- intervalsPassed: 0,
912
- intervalsFreeze: 0
913
- }
914
- };
915
-
916
- // cache current values
917
- var _oCurrentDevicePosition = {
918
- accelerationIncludingGravity : {
919
- x: event_.accelerationIncludingGravity.x,
920
- y: event_.accelerationIncludingGravity.y,
921
- z: event_.accelerationIncludingGravity.z
922
- },
923
- shake: {
924
- eventCount: _oLastDevicePosition.shake.eventCount,
925
- intervalsPassed: _oLastDevicePosition.shake.intervalsPassed,
926
- intervalsFreeze: _oLastDevicePosition.shake.intervalsFreeze
927
- },
928
- shakeleftright: {
929
- eventCount: _oLastDevicePosition.shakeleftright.eventCount,
930
- intervalsPassed: _oLastDevicePosition.shakeleftright.intervalsPassed,
931
- intervalsFreeze: _oLastDevicePosition.shakeleftright.intervalsFreeze
932
- },
933
- shakefrontback: {
934
- eventCount: _oLastDevicePosition.shakefrontback.eventCount,
935
- intervalsPassed: _oLastDevicePosition.shakefrontback.intervalsPassed,
936
- intervalsFreeze: _oLastDevicePosition.shakefrontback.intervalsFreeze
937
- },
938
- shakeupdown: {
939
- eventCount: _oLastDevicePosition.shakeupdown.eventCount,
940
- intervalsPassed: _oLastDevicePosition.shakeupdown.intervalsPassed,
941
- intervalsFreeze: _oLastDevicePosition.shakeupdown.intervalsFreeze
942
- }
943
-
944
- };
945
-
946
-
947
- // options
948
- var _aType;
949
- var _aDescription;
950
- var _oObj;
951
-
952
-
953
- // trigger events for all bound pseudo events on this element
954
- for (_sType in _oDatajQueryGestures) {
955
- // get current pseudo event
956
-
957
-
958
- // trigger bound events on this element
959
- switch(_sType) {
960
-
961
- case 'shake':
962
- case 'shakeleftright':
963
- case 'shakefrontback':
964
- case 'shakeupdown':
965
-
966
- // options
967
- _aType = [];
968
- _aDescription = [];
969
-
970
- _aType.push(_sType);
971
-
972
- // freeze shake - prevent multiple shake events on one shaking motion (user won't stop shaking immediately)
973
- if (++_oCurrentDevicePosition[_sType].intervalsFreeze > _oThreshold.freezeShakes && _oCurrentDevicePosition[_sType].intervalsFreeze < (2*_oThreshold.freezeShakes) ) { break; }
974
-
975
- // set control values
976
- _oCurrentDevicePosition[_sType].intervalsFreeze = 0;
977
- _oCurrentDevicePosition[_sType].intervalsPassed++;
978
-
979
- // check for shaking motions: massive acceleration changes in every direction
980
- if ( ( _sType === 'shake' ||_sType === 'shakeleftright' ) && ( _oCurrentDevicePosition.accelerationIncludingGravity.x > _oThreshold.leftright.sensitivity || _oCurrentDevicePosition.accelerationIncludingGravity.x < (-1* _oThreshold.leftright.sensitivity) ) ) {
981
- _aType.push('leftright');
982
- _aType.push('x-axis');
983
- }
984
-
985
- if ( ( _sType === 'shake' ||_sType === 'shakefrontback' ) && (_oCurrentDevicePosition.accelerationIncludingGravity.y > _oThreshold.frontback.sensitivity || _oCurrentDevicePosition.accelerationIncludingGravity.y < (-1 * _oThreshold.frontback.sensitivity) ) ) {
986
- _aType.push('frontback');
987
- _aType.push('y-axis');
988
- }
989
-
990
- if ( ( _sType === 'shake' ||_sType === 'shakeupdown' ) && ( _oCurrentDevicePosition.accelerationIncludingGravity.z+9.81 > _oThreshold.updown.sensitivity || _oCurrentDevicePosition.accelerationIncludingGravity.z+9.81 < (-1 * _oThreshold.updown.sensitivity) ) ) {
991
- _aType.push('updown');
992
- _aType.push('z-axis');
993
- }
994
-
995
- // at least one successful shaking event
996
- if (_aType.length > 1) {
997
- // minimum number of shaking motions during the defined "time" (messured by events - device event interval: 0.05s)
998
- if (++_oCurrentDevicePosition[_sType].eventCount == _oThreshold.requiredShakes && (_oCurrentDevicePosition[_sType].intervalsPassed) < _oThreshold.freezeShakes ) {
999
- // send event
1000
- _$element.triggerHandler(_sType, _createOptions ({type: _sType, description: _aType.join(':'), event:event_,duration:_oCurrentDevicePosition[_sType].intervalsPassed*5 }) );
1001
- // reset
1002
- _oCurrentDevicePosition[_sType].eventCount = 0;
1003
- _oCurrentDevicePosition[_sType].intervalsPassed = 0;
1004
- // freeze shake
1005
- _oCurrentDevicePosition[_sType].intervalsFreeze = _oThreshold.freezeShakes+1;
1006
- }
1007
- // too slow, reset
1008
- else if (_oCurrentDevicePosition[_sType].eventCount == _oThreshold.requiredShakes && (_oCurrentDevicePosition[_sType].intervalsPassed) > _oThreshold.freezeShakes ) {
1009
- _oCurrentDevicePosition[_sType].eventCount = 0 ;
1010
- _oCurrentDevicePosition[_sType].intervalsPassed = 0;
1011
- }
1012
- }
1013
- break;
1014
-
1015
- }
1016
-
1017
- // refresh pseudo events
1018
- _oObj = {};
1019
- _oObj.oDeviceMotionLastDevicePosition = _oCurrentDevicePosition;
1020
- _$element.data('ojQueryGestures',$.extend(true,_oDatajQueryGestures,_oObj));
1021
-
1022
- }
1023
- }
1024
-
1025
-
1026
- /**
1027
- * Handler: touchstart or mousedown
1028
- * Setup pseudo-event by storing initial values such as :
1029
- * screenX : {Number}
1030
- * screenY : {Number}
1031
- * timestamp: {Number}
1032
- * on the pseudo gesture event and
1033
- * sets up additional eventlisteners for handling touchmove events.
1034
- * @param {DOM-Event} event_
1035
- * @return {Void}
1036
- */
1037
- function _onTouchstart(event_) {
1038
-
1039
- // ignore bubbled handlers
1040
- // if ( event_.currentTarget !== event_.target ) { return; }
1041
-
1042
- var _$element = jQuery(event_.currentTarget);
1043
- // var _$element = jQuery(event_.target);
1044
-
1045
- // trigger custom notification
1046
- _$element.triggerHandler($.jGestures.events.touchstart,event_);
1047
-
1048
-
1049
- // set the necessary touch events
1050
- if($.hasGestures) {
1051
- event_.currentTarget.addEventListener('touchmove', _onTouchmove, false);
1052
- event_.currentTarget.addEventListener('touchend', _onTouchend, false);
1053
- }
1054
- // event substitution
1055
- else {
1056
- // event_.currentTarget.addEventListener('mousemove', _onTouchmove, false);
1057
- // event_.currentTarget.addEventListener('mouseup', _onTouchend, false);
1058
- _$element.bind('mousemove', _onTouchmove);
1059
- _$element.bind('mouseup', _onTouchend);
1060
- }
1061
-
1062
- // get stored pseudo event
1063
- var _oDatajQueryGestures = _$element.data('ojQueryGestures');
1064
-
1065
- // var _oEventData = _oDatajQueryGestures[_sType];
1066
- var _eventBase = (event_.touches) ? event_.touches[0] : event_;
1067
- // store current values for calculating relative values (changes between touchmoveevents)
1068
- var _oObj = {};
1069
- _oObj.oLastSwipemove = { screenX : _eventBase.screenX, screenY : _eventBase.screenY, timestamp:new Date().getTime()};
1070
- _oObj.oStartTouch = { screenX : _eventBase.screenX, screenY : _eventBase.screenY, timestamp:new Date().getTime()};
1071
-
1072
- _$element.data('ojQueryGestures',$.extend(true,_oDatajQueryGestures,_oObj));
1073
- }
1074
-
1075
-
1076
- /**
1077
- * Handler: touchmove or mousemove
1078
- * Calculates the x/y changes since the last event,
1079
- * compares it to $.jGestures.defaults.thresholdMove and triggers
1080
- * an swipemove event if the distance exceed the
1081
- * threshold.
1082
- * Custom-event argument object:
1083
- * {Object}
1084
- * {
1085
- * type: e.g. 'swipemove',
1086
- * ≈: {DOM-Event},
1087
- * // default: just one entry on the delta-array - the first touchpoint
1088
- * // the first touchpoint is the reference point for every gesture,
1089
- * // because moving touchpoints in various directions would result in
1090
- * // a gesture.
1091
- * // delta and direction details are just provided for touch not for gesture / motion events
1092
- * delta : [
1093
- * {
1094
- * lastX:{Number} , // x-axis: relative to the last touchevent (e.g. touchmove!)
1095
- * lastY:{Number}, // y-axis: relative to the last touchevent (e.g. touchmove!)
1096
- * moved: {Number}, // distance: relative to the original touchpoint
1097
- * startX: {Number} , // relative to the original touchpoint
1098
- * startY: {Number} ,// relative to the original touchpoint
1099
- * } ],
1100
- * // based on the first touchpoint
1101
- * direction : { // relative to the last touchevent (e.g. touchmove!)
1102
- * vector: {Number}, // -1|+1, indicates the direction if necessary(pinch/rotate)
1103
- * orientation: {Number} // window.orientation: -90,0,90,180 || null (window.orienntation)
1104
- * lastX : {Number}, // -1,0,+1 relative to the last touchevent (e.g. touchmove!)
1105
- * lastY : {Number}, // -1,0,+1 relative to the last touchevent (e.g. touchmove!)
1106
- * startX: {Number} , //-1,0,+1 relative to the original touchpoint
1107
- * startY: {Number} ,// -1,0,+1 relative to the original touchpoint
1108
- * },
1109
- * rotation: null, // gestureonly: amount of rotation relative to the current position NOT the original
1110
- * scale: null, // gestureonly: amount of scaling relative to the current position NOT the original
1111
- * duration: {Number}, // ms: relative to the original touchpoint
1112
- * description : {String} // details as String: {TYPE *}:{TOUCHES 1|2|3|4}:{X-AXIS 'right'|'left'|'steady'}:{Y-AXIS 'down'|'up'|'steady'} e.g. "swipe:1:left:steady" relative to the last touchpoint
1113
- * };
1114
- *
1115
- * @param {DOM-Event} event_
1116
- * @return {Void}
1117
- */
1118
- function _onTouchmove(event_) {
1119
-
1120
- var _$element = jQuery(event_.currentTarget);
1121
- // var _$element = jQuery(event_.target);
1122
-
1123
- // get stored pseudo event
1124
- var _oDatajQueryGestures = _$element.data('ojQueryGestures');
1125
-
1126
- var _bHasTouches = !!event_.touches;
1127
- var _iScreenX = (_bHasTouches) ? event_.changedTouches[0].screenX : event_.screenX;
1128
- var _iScreenY = (_bHasTouches) ? event_.changedTouches[0].screenY : event_.screenY;
1129
-
1130
- //relative to the last event
1131
- var _oEventData = _oDatajQueryGestures.oLastSwipemove;
1132
- var _iDeltaX = _iScreenX - _oEventData.screenX ;
1133
- var _iDeltaY = _iScreenY - _oEventData.screenY;
1134
-
1135
- var _oDetails;
1136
-
1137
- // there's a swipemove set (not the first occurance), trigger event
1138
- if (!!_oDatajQueryGestures.oLastSwipemove) {
1139
- // check
1140
- _oDetails = _createOptions({type: 'swipemove', touches: (_bHasTouches) ? event_.touches.length: '1', screenY: _iScreenY,screenX:_iScreenX ,deltaY: _iDeltaY,deltaX : _iDeltaX, startMove:_oEventData, event:event_, timestamp:_oEventData.timestamp});
1141
- _$element.triggerHandler(_oDetails.type,_oDetails);
1142
- }
1143
- // store the new values
1144
- var _oObj = {};
1145
- var _eventBase = (event_.touches) ? event_.touches[0] : event_;
1146
- _oObj.oLastSwipemove = { screenX : _eventBase.screenX, screenY : _eventBase.screenY, timestamp:new Date().getTime()};
1147
- _$element.data('ojQueryGestures',$.extend(true,_oDatajQueryGestures,_oObj));
1148
- }
1149
-
1150
-
1151
- /**
1152
- * Handler: touchend or mouseup
1153
- * Removes the additional handlers (move/end)
1154
- * Calculates the x/y changes since the touchstart event
1155
- * not in relation to the last move event.
1156
- * Triggers the
1157
- * swipeone|swipetwo|swipethree|swipefour|
1158
- * swipeup|swiperightup|swiperight|swiperightdown|swipedown|
1159
- * swipeleftdown|swipeleft|swipeleftup|
1160
- * tapone|taptwo|tapthree|tapfour
1161
- * event.
1162
- * {Object}
1163
- * {
1164
- * type: eventtype e.g. "swipeone","swipeleftdown",
1165
- * originalEvent: {DOM-Event},
1166
- * // default: just one entry on the delta-array - the first touchpoint
1167
- * // the first touchpoint is the reference point for every gesture,
1168
- * // because moving touchpoints in various directions would result in
1169
- * // a gesture.
1170
- * // delta and direction details are just provided for touch not for gesture / motion events
1171
- * delta : [
1172
- * {
1173
- * lastX:{Number} , // x-axis: relative to the last touchevent (e.g. touchmove!)
1174
- * lastY:{Number}, // y-axis: relative to the last touchevent (e.g. touchmove!)
1175
- * moved: {Number}, // distance: relative to the original touchpoint
1176
- * startX: {Number} , // relative to the original touchpoint
1177
- * startY: {Number} ,// relative to the original touchpoint
1178
- * } ],
1179
- * // based on the first touchpoint
1180
- * direction : { // relative to the last touchevent (e.g. touchmove!)
1181
- * vector: {Number}, // -1|+1, indicates the direction if necessary(pinch/rotate)
1182
- * orientation: {Number} // window.orientation: -90,0,90,180 || null (window.orienntation)
1183
- * lastX : {Number}, // -1,0,+1 relative to the last touchevent (e.g. touchmove!)
1184
- * lastY : {Number}, // -1,0,+1 relative to the last touchevent (e.g. touchmove!)
1185
- * startX: {Number} , //-1,0,+1 relative to the original touchpoint
1186
- * startY: {Number} ,// -1,0,+1 relative to the original touchpoint
1187
- * },
1188
- * rotation: null,
1189
- * scale: null ,
1190
- * duration: {Number}, // ms: relative to the original touchpoint
1191
- * description : {String} // details as String: {TYPE *}:{TOUCHES 1|2|3|4}:{X-AXIS 'right'|'left'|'steady'}:{Y-AXIS 'down'|'up'|'steady'} e.g. "swipe:1:left:steady" relative to the last touchpoint
1192
- * };
1193
- * @param {DOM-Event} event_
1194
- * @return {Void}
1195
- */
1196
- function _onTouchend(event_) {
1197
-
1198
- // ignore bubbled handlers
1199
- // if ( event_.currentTarget !== event_.target ) { return; }
1200
-
1201
- var _$element = jQuery(event_.currentTarget);
1202
- var _bHasTouches = !!event_.changedTouches;
1203
- var _iTouches = (_bHasTouches) ? event_.changedTouches.length : '1';
1204
- var _iScreenX = (_bHasTouches) ? event_.changedTouches[0].screenX : event_.screenX;
1205
- var _iScreenY = (_bHasTouches) ? event_.changedTouches[0].screenY : event_.screenY;
1206
-
1207
- // trigger custom notification
1208
- _$element.triggerHandler($.jGestures.events.touchendStart,event_);
1209
-
1210
- // var _$element = jQuery(event_.target);
1211
- // remove events
1212
- if($.hasGestures) {
1213
- event_.currentTarget.removeEventListener('touchmove', _onTouchmove, false);
1214
- event_.currentTarget.removeEventListener('touchend', _onTouchend, false);
1215
- }
1216
- // event substitution
1217
- else {
1218
- // event_.currentTarget.removeEventListener('mousemove', _onTouchmove, false);
1219
- // event_.currentTarget.removeEventListener('mouseup', _onTouchend, false);
1220
- _$element.unbind('mousemove', _onTouchmove);
1221
- _$element.unbind('mouseup', _onTouchend);
1222
- }
1223
- // get all bound pseudo events
1224
- var _oDatajQueryGestures = _$element.data('ojQueryGestures');
1225
-
1226
- // if the current change on the x/y position is above the defined threshold for moving an element set the moved flag
1227
- // to distinguish between a moving gesture and a shaking finger trying to tap
1228
- var _bHasMoved = (
1229
- Math.abs(_oDatajQueryGestures.oStartTouch.screenX - _iScreenX) > $.jGestures.defaults.thresholdMove ||
1230
- Math.abs(_oDatajQueryGestures.oStartTouch.screenY - _iScreenY) > $.jGestures.defaults.thresholdMove
1231
- ) ? true : false;
1232
-
1233
- // if the current change on the x/y position is above the defined threshold for swiping set the moved flag
1234
- // to indicate we're dealing with a swipe gesture
1235
- var _bHasSwipeGesture = (
1236
- Math.abs(_oDatajQueryGestures.oStartTouch.screenX - _iScreenX) > $.jGestures.defaults.thresholdSwipe ||
1237
- Math.abs(_oDatajQueryGestures.oStartTouch.screenY - _iScreenY) > $.jGestures.defaults.thresholdSwipe
1238
- ) ? true : false;
1239
-
1240
-
1241
- var _sType;
1242
- var _oEventData ;
1243
-
1244
- var _oDelta;
1245
-
1246
- // calculate distances in relation to the touchstart position not the last touchmove event!
1247
- var _iDeltaX;
1248
- var _iDeltaY;
1249
- var _oDetails;
1250
-
1251
- var _aDict = ['zero','one','two','three','four'];
1252
-
1253
- // swipe marker
1254
- var _bIsSwipe;
1255
-
1256
-
1257
- // trigger events for all bound pseudo events on this element
1258
- for (_sType in _oDatajQueryGestures) {
1259
-
1260
- // get current pseudo event
1261
- _oEventData = _oDatajQueryGestures.oStartTouch;
1262
-
1263
- _oDelta = {};
1264
- _iScreenX = (_bHasTouches) ? event_.changedTouches[0].screenX : event_.screenX;
1265
- _iScreenY = (_bHasTouches) ? event_.changedTouches[0].screenY : event_.screenY;
1266
- // calculate distances in relation to the touchstart position not the last touchmove event!
1267
- _iDeltaX = _iScreenX - _oEventData.screenX ;
1268
- _iDeltaY = _iScreenY - _oEventData.screenY;
1269
- _oDetails = _createOptions({type: 'swipe', touches: _iTouches, screenY: _iScreenY,screenX:_iScreenX ,deltaY: _iDeltaY,deltaX : _iDeltaX, startMove:_oEventData, event:event_, timestamp: _oEventData.timestamp });
1270
-
1271
-
1272
- // swipe marker
1273
- _bIsSwipe = false;
1274
-
1275
- // trigger bound events on this element
1276
- switch(_sType) {
1277
- case 'swipeone':
1278
-
1279
- if( _bHasTouches === false && _iTouches == 1 && _bHasMoved === false){
1280
- // trigger tapone!
1281
- break;
1282
- }
1283
- if (_bHasTouches===false || ( _iTouches == 1 && _bHasMoved === true && _bHasSwipeGesture===true)) {
1284
- _bIsSwipe = true;
1285
-
1286
- _oDetails.type = ['swipe',_aDict[_iTouches]].join('');
1287
- _$element.triggerHandler(_oDetails.type,_oDetails);
1288
- }
1289
- break;
1290
-
1291
- case 'swipetwo':
1292
- if (( _bHasTouches && _iTouches== 2 && _bHasMoved === true && _bHasSwipeGesture===true)) {
1293
- _bIsSwipe = true;
1294
- _oDetails.type = ['swipe',_aDict[_iTouches]].join('');
1295
- _$element.triggerHandler(_oDetails.type,_oDetails);
1296
- }
1297
- break;
1298
-
1299
- case 'swipethree':
1300
- if ( ( _bHasTouches && _iTouches == 3 && _bHasMoved === true && _bHasSwipeGesture===true)) {
1301
- _bIsSwipe = true;
1302
- _oDetails.type = ['swipe',_aDict[_iTouches]].join('');
1303
- _$element.triggerHandler(_oDetails.type,_oDetails);
1304
- }
1305
- break;
1306
-
1307
- case 'swipefour':
1308
- if ( ( _bHasTouches && _iTouches == 4 && _bHasMoved === true && _bHasSwipeGesture===true)) {
1309
- _bIsSwipe = true;
1310
- _oDetails.type = ['swipe',_aDict[_iTouches]].join('');
1311
- _$element.triggerHandler(_oDetails.type,_oDetails);
1312
- }
1313
- break;
1314
-
1315
- case 'swipeup':
1316
- case 'swiperightup':
1317
- case 'swiperight':
1318
- case 'swiperightdown':
1319
- case 'swipedown':
1320
- case 'swipeleftdown':
1321
- case 'swipeleft':
1322
- case 'swipeleftup':
1323
- if ( _bHasTouches && _bHasMoved === true && _bHasSwipeGesture===true) {
1324
- _bIsSwipe = true;
1325
- _oDetails.type = [
1326
- 'swipe',
1327
- ((_oDetails.delta[0].lastX != 0) ? ((_oDetails.delta[0].lastX > 0) ? 'right' : 'left') : ''),
1328
- ((_oDetails.delta[0].lastY != 0) ? ((_oDetails.delta[0].lastY > 0) ? 'down' : 'up') :'')
1329
- ].join('');
1330
- _$element.triggerHandler(_oDetails.type, _oDetails);
1331
- }
1332
- break;
1333
-
1334
- case 'tapone':
1335
- case 'taptwo':
1336
- case 'tapthree':
1337
- case 'tapfour':
1338
- if (( /* _bHasTouches && */ _bHasMoved !== true && _bIsSwipe !==true) && (_aDict[_iTouches] ==_sType.slice(3)) ) {
1339
- _oDetails.description = ['tap',_aDict[_iTouches]].join('');
1340
- _oDetails.type = ['tap',_aDict[_iTouches]].join('');
1341
- _$element.triggerHandler(_oDetails.type,_oDetails);
1342
- }
1343
- break;
1344
-
1345
- }
1346
-
1347
- // refresh pseudo events
1348
- var _oObj = {};
1349
- // _oObj[_sType] = false;
1350
- // _oObj.hasTouchmoved = false;
1351
- _$element.data('ojQueryGestures',$.extend(true,_oDatajQueryGestures,_oObj));
1352
- _$element.data('ojQueryGestures',$.extend(true,_oDatajQueryGestures,_oObj));
1353
-
1354
- }
1355
- _$element.triggerHandler($.jGestures.events.touchendProcessed,event_);
1356
- }
1357
-
1358
-
1359
- /**
1360
- * Handler: gesturestart
1361
- * Setup pseudo-event by storing initial values such as :
1362
- * timestamp: {Number}
1363
- * on the pseudo gesture event
1364
- * Since the gesture-event doesn't supply event.touches no tuchpoints will be calculated
1365
- * @param {DOM-Event} event_
1366
- * @return {Void}
1367
- */
1368
- function _onGesturestart(event_) {
1369
-
1370
- // ignore bubbled handlers
1371
- // if ( event_.currentTarget !== event_.target ) { return; }
1372
-
1373
- var _$element = jQuery(event_.currentTarget);
1374
- // var _$element = jQuery(event_.target);
1375
-
1376
- // trigger custom notification
1377
- _$element.triggerHandler($.jGestures.events.gesturestart,event_);
1378
-
1379
-
1380
- // get stored pseudo event
1381
- var _oDatajQueryGestures = _$element.data('ojQueryGestures');
1382
-
1383
- // var _oEventData = _oDatajQueryGestures[_sType];
1384
- // store current values for calculating relative values (changes between touchmoveevents)
1385
- var _oObj = {};
1386
- _oObj.oStartTouch = {timestamp:new Date().getTime()};
1387
- _$element.data('ojQueryGestures',$.extend(true,_oDatajQueryGestures,_oObj));
1388
- }
1389
-
1390
- /**
1391
- * Handler: gesturechange
1392
- * Read the event_.scale / event_.rotate values,
1393
- * an triggers a pinch|rotate event if necessary.
1394
- * Since the gesture-event doesn't supply event.touches no tuchpoints will be calculated
1395
- * @returns {Object}
1396
- * {
1397
- * type: eventtype e.g. "pinch","rotate",
1398
- * originalEvent: {DOM-Event},
1399
- * // delta and direction details are just provided for touch not for gesture / motion events
1400
- * delta : null,
1401
- * direction : {
1402
- * vector: {Number}, // -1|+1, indicates the direction if necessary(pinch/rotate)
1403
- * orientation: {Number} // window.orientation: -90,0,90,180 || null (window.orienntation)
1404
- * },
1405
- * rotation: {Number} , // amount of rotation relative to the current position NOT the original
1406
- * scale: {Number} , // amount of scaling relative to the current position NOT the original
1407
- * duration: {Number}, // ms: relative to the original touchpoint
1408
- * description : {String} // details as String: pinch:{'close'|'open'} e.g. "pinch:-1:close" || rotate:{'counterclockwise'|'clockwise'} e.g. "rotate:-1:counterclockwise"
1409
- * };
1410
- * @param {DOM-Event} event_
1411
- * @return {Void}
1412
- */
1413
- function _onGesturechange(event_) {
1414
-
1415
- // ignore bubbled handlers
1416
- // if ( event_.currentTarget !== event_.target ) { return; }
1417
-
1418
- var _$element = jQuery(event_.currentTarget);
1419
- // var _$element = jQuery(event_.target);
1420
- var _iDelta,_iDirection,_sDesc,_oDetails;
1421
- // get all pseudo events
1422
- var _oDatajQueryGestures = _$element.data('ojQueryGestures');
1423
-
1424
- // trigger events for all bound pseudo events on this element
1425
- var _sType;
1426
- for (_sType in _oDatajQueryGestures) {
1427
-
1428
- // trigger a specific bound event
1429
- switch(_sType) {
1430
-
1431
- case 'pinch':
1432
- _iDelta = event_.scale;
1433
- if ( ( ( _iDelta < 1 ) && (_iDelta % 1) < (1 - $.jGestures.defaults.thresholdPinchclose) ) || ( ( _iDelta > 1 ) && (_iDelta % 1) > ($.jGestures.defaults.thresholdPinchopen) ) ) {
1434
- _iDirection = (_iDelta < 1 ) ? -1 : +1 ;
1435
- _oDetails = _createOptions({type: 'pinch', scale: _iDelta, touches: null,startMove:_oDatajQueryGestures.oStartTouch, event:event_, timestamp: _oDatajQueryGestures.oStartTouch.timestamp, vector:_iDirection, description: ['pinch:',_iDirection,':' , ( (_iDelta < 1 ) ? 'close' : 'open' )].join('') });
1436
- _$element.triggerHandler(_oDetails.type, _oDetails);
1437
- }
1438
- break;
1439
-
1440
- case 'rotate':
1441
- _iDelta = event_.rotation;
1442
- if ( ( ( _iDelta < 1 ) && ( -1*(_iDelta) > $.jGestures.defaults.thresholdRotateccw ) ) || ( ( _iDelta > 1 ) && (_iDelta > $.jGestures.defaults.thresholdRotatecw) ) ) {
1443
- _iDirection = (_iDelta < 1 ) ? -1 : +1 ;
1444
- _oDetails = _createOptions({type: 'rotate', rotation: _iDelta, touches: null, startMove:_oDatajQueryGestures.oStartTouch, event:event_, timestamp: _oDatajQueryGestures.oStartTouch.timestamp, vector:_iDirection, description: ['rotate:',_iDirection,':' , ( (_iDelta < 1 ) ? 'counterclockwise' : 'clockwise' )].join('') });
1445
- _$element.triggerHandler(_oDetails.type, _oDetails);
1446
- }
1447
- break;
1448
-
1449
- }
1450
- }
1451
-
1452
- }
1453
-
1454
-
1455
- /**
1456
- * Handler: gestureend
1457
- * Read the event_.scale / event_.rotate values,
1458
- * compares it to $.jGestures.defaults.threshold* and triggers
1459
- * a pinchclose|pinchclose|rotatecw|rotateccw event if the distance exceed the
1460
- * Since the gesture-event doesn't supply event.touches no tuchpoints will be calculated
1461
- * * Custom-event argument object:
1462
- * @returns {Object}
1463
- * {
1464
- * type: eventtype e.g. "pinchclose","pinchopen", "rotatecw", "rotateccw",
1465
- * originalEvent: {DOM-Event},
1466
- * // delta and direction details are just provided for touch not for gesture / motion events
1467
- * delta : null,
1468
- * // based on the first touchpoint
1469
- * direction : {
1470
- * vector: {Number}, // -1|+1, indicates the direction if necessary(pinch/rotate)
1471
- * orientation: {Number} // window.orientation: -90,0,90,180 || null (window.orienntation)
1472
- * },
1473
- * rotation: {Number} , // amount of rotation relative to the current position NOT the original
1474
- * scale: {Number} , // amount of scaling relative to the current position NOT the original
1475
- * duration: {Number}, // ms: relative to the original touchpoint
1476
- * description : {String} // details as String: pinch:{'close'|'open'} e.g. "pinch:-1:close" || rotate:{'counterclockwise'|'clockwise'} e.g. "rotate:-1:counterclockwise"
1477
- * };
1478
- * @param {DOM-Event} event_
1479
- * @return {Void}
1480
- */
1481
- function _onGestureend(event_) {
1482
- // ignore bubbled handlers
1483
- // if ( event_.currentTarget !== event_.target ) { return; }
1484
-
1485
- var _$element = jQuery(event_.currentTarget);
1486
- // var _$element = jQuery(event_.target);
1487
-
1488
- // trigger custom notification
1489
- _$element.triggerHandler($.jGestures.events.gestureendStart,event_);
1490
-
1491
- var _iDelta;
1492
- var _oDatajQueryGestures = _$element.data('ojQueryGestures');
1493
-
1494
- // trigger handler for every bound event
1495
- var _sType;
1496
- for (_sType in _oDatajQueryGestures) {
1497
-
1498
- switch(_sType) {
1499
-
1500
- case 'pinchclose':
1501
- _iDelta = event_.scale;
1502
- if (( _iDelta < 1 ) && (_iDelta % 1) < (1 - $.jGestures.defaults.thresholdPinchclose)) {
1503
- _$element.triggerHandler('pinchclose', _createOptions ({type: 'pinchclose', scale:_iDelta, vector: -1, touches: null, startMove: _oDatajQueryGestures.oStartTouch, event:event_, timestamp:_oDatajQueryGestures.oStartTouch.timestamp,description: 'pinch:-1:close' }) );
1504
- }
1505
- break;
1506
-
1507
- case 'pinchopen':
1508
- _iDelta = event_.scale;
1509
- if ( ( _iDelta > 1 ) && (_iDelta % 1) > ($.jGestures.defaults.thresholdPinchopen) ) {
1510
- _$element.triggerHandler('pinchopen', _createOptions ({type: 'pinchopen', scale:_iDelta, vector: +1, touches: null, startMove: _oDatajQueryGestures.oStartTouch, event:event_, timestamp:_oDatajQueryGestures.oStartTouch.timestamp,description: 'pinch:+1:open'}) );
1511
- }
1512
- break;
1513
-
1514
- case 'rotatecw':
1515
- _iDelta = event_.rotation;
1516
- if ( ( _iDelta > 1 ) && (_iDelta > $.jGestures.defaults.thresholdRotatecw) ) {
1517
- _$element.triggerHandler('rotatecw', _createOptions ({type: 'rotatecw', rotation:_iDelta, vector: +1, touches: null, startMove: _oDatajQueryGestures.oStartTouch, event:event_, timestamp:_oDatajQueryGestures.oStartTouch.timestamp,description: 'rotate:+1:clockwise'}) );
1518
- }
1519
- break;
1520
-
1521
- case 'rotateccw':
1522
- _iDelta = event_.rotation;
1523
- if ( ( _iDelta < 1 ) && ( -1*(_iDelta) > $.jGestures.defaults.thresholdRotateccw ) ) {
1524
- _$element.triggerHandler('rotateccw', _createOptions ({type: 'rotateccw', rotation:_iDelta, vector: -1, touches: null, startMove: _oDatajQueryGestures.oStartTouch, event:event_, timestamp:_oDatajQueryGestures.oStartTouch.timestamp,description: 'rotate:-1:counterclockwise'}) );
1525
- }
1526
- break;
1527
-
1528
- }
1529
- }
1530
- _$element.triggerHandler($.jGestures.events.gestureendProcessed,event_);
1531
- }
1532
- }
1533
- )(jQuery);
1534
-
1535
  })(asljQuery, asljQuery, window);
1
+ (function(jQuery, $, window){
2
+ (function(a){if(typeof define==="function"&&define.amd&&define.amd.jQuery){define(["jquery"],a)}else{if(typeof module!=="undefined"&&module.exports){a(require("jquery"))}else{a(jQuery)}}}(function(f){var y="1.6.15",p="left",o="right",e="up",x="down",c="in",A="out",m="none",s="auto",l="swipe",t="pinch",B="tap",j="doubletap",b="longtap",z="hold",E="horizontal",u="vertical",i="all",r=10,g="start",k="move",h="end",q="cancel",a="ontouchstart" in window,v=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!a,d=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!a,C="TouchSwipe";var n={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:true};f.fn.swipe=function(H){var G=f(this),F=G.data(C);if(F&&typeof H==="string"){if(F[H]){return F[H].apply(this,Array.prototype.slice.call(arguments,1))}else{f.error("Method "+H+" does not exist on jQuery.swipe")}}else{if(F&&typeof H==="object"){F.option.apply(this,arguments)}else{if(!F&&(typeof H==="object"||!H)){return w.apply(this,arguments)}}}return G};f.fn.swipe.version=y;f.fn.swipe.defaults=n;f.fn.swipe.phases={PHASE_START:g,PHASE_MOVE:k,PHASE_END:h,PHASE_CANCEL:q};f.fn.swipe.directions={LEFT:p,RIGHT:o,UP:e,DOWN:x,IN:c,OUT:A};f.fn.swipe.pageScroll={NONE:m,HORIZONTAL:E,VERTICAL:u,AUTO:s};f.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:i};function w(F){if(F&&(F.allowPageScroll===undefined&&(F.swipe!==undefined||F.swipeStatus!==undefined))){F.allowPageScroll=m}if(F.click!==undefined&&F.tap===undefined){F.tap=F.click}if(!F){F={}}F=f.extend({},f.fn.swipe.defaults,F);return this.each(function(){var H=f(this);var G=H.data(C);if(!G){G=new D(this,F);H.data(C,G)}})}function D(a5,au){var au=f.extend({},au);var az=(a||d||!au.fallbackToMouseEvents),K=az?(d?(v?"MSPointerDown":"pointerdown"):"touchstart"):"mousedown",ax=az?(d?(v?"MSPointerMove":"pointermove"):"touchmove"):"mousemove",V=az?(d?(v?"MSPointerUp":"pointerup"):"touchend"):"mouseup",T=az?(d?"mouseleave":null):"mouseleave",aD=(d?(v?"MSPointerCancel":"pointercancel"):"touchcancel");var ag=0,aP=null,a2=null,ac=0,a1=0,aZ=0,H=1,ap=0,aJ=0,N=null;var aR=f(a5);var aa="start";var X=0;var aQ={};var U=0,a3=0,a6=0,ay=0,O=0;var aW=null,af=null;try{aR.bind(K,aN);aR.bind(aD,ba)}catch(aj){f.error("events not supported "+K+","+aD+" on jQuery.swipe")}this.enable=function(){aR.bind(K,aN);aR.bind(aD,ba);return aR};this.disable=function(){aK();return aR};this.destroy=function(){aK();aR.data(C,null);aR=null};this.option=function(bd,bc){if(typeof bd==="object"){au=f.extend(au,bd)}else{if(au[bd]!==undefined){if(bc===undefined){return au[bd]}else{au[bd]=bc}}else{if(!bd){return au}else{f.error("Option "+bd+" does not exist on jQuery.swipe.options")}}}return null};function aN(be){if(aB()){return}if(f(be.target).closest(au.excludedElements,aR).length>0){return}var bf=be.originalEvent?be.originalEvent:be;var bd,bg=bf.touches,bc=bg?bg[0]:bf;aa=g;if(bg){X=bg.length}else{if(au.preventDefaultEvents!==false){be.preventDefault()}}ag=0;aP=null;a2=null;aJ=null;ac=0;a1=0;aZ=0;H=1;ap=0;N=ab();S();ai(0,bc);if(!bg||(X===au.fingers||au.fingers===i)||aX()){U=ar();if(X==2){ai(1,bg[1]);a1=aZ=at(aQ[0].start,aQ[1].start)}if(au.swipeStatus||au.pinchStatus){bd=P(bf,aa)}}else{bd=false}if(bd===false){aa=q;P(bf,aa);return bd}else{if(au.hold){af=setTimeout(f.proxy(function(){aR.trigger("hold",[bf.target]);if(au.hold){bd=au.hold.call(aR,bf,bf.target)}},this),au.longTapThreshold)}an(true)}return null}function a4(bf){var bi=bf.originalEvent?bf.originalEvent:bf;if(aa===h||aa===q||al()){return}var be,bj=bi.touches,bd=bj?bj[0]:bi;var bg=aH(bd);a3=ar();if(bj){X=bj.length}if(au.hold){clearTimeout(af)}aa=k;if(X==2){if(a1==0){ai(1,bj[1]);a1=aZ=at(aQ[0].start,aQ[1].start)}else{aH(bj[1]);aZ=at(aQ[0].end,aQ[1].end);aJ=aq(aQ[0].end,aQ[1].end)}H=a8(a1,aZ);ap=Math.abs(a1-aZ)}if((X===au.fingers||au.fingers===i)||!bj||aX()){aP=aL(bg.start,bg.end);a2=aL(bg.last,bg.end);ak(bf,a2);ag=aS(bg.start,bg.end);ac=aM();aI(aP,ag);be=P(bi,aa);if(!au.triggerOnTouchEnd||au.triggerOnTouchLeave){var bc=true;if(au.triggerOnTouchLeave){var bh=aY(this);bc=F(bg.end,bh)}if(!au.triggerOnTouchEnd&&bc){aa=aC(k)}else{if(au.triggerOnTouchLeave&&!bc){aa=aC(h)}}if(aa==q||aa==h){P(bi,aa)}}}else{aa=q;P(bi,aa)}if(be===false){aa=q;P(bi,aa)}}function M(bc){var bd=bc.originalEvent?bc.originalEvent:bc,be=bd.touches;if(be){if(be.length&&!al()){G(bd);return true}else{if(be.length&&al()){return true}}}if(al()){X=ay}a3=ar();ac=aM();if(bb()||!am()){aa=q;P(bd,aa)}else{if(au.triggerOnTouchEnd||(au.triggerOnTouchEnd==false&&aa===k)){if(au.preventDefaultEvents!==false){bc.preventDefault()}aa=h;P(bd,aa)}else{if(!au.triggerOnTouchEnd&&a7()){aa=h;aF(bd,aa,B)}else{if(aa===k){aa=q;P(bd,aa)}}}}an(false);return null}function ba(){X=0;a3=0;U=0;a1=0;aZ=0;H=1;S();an(false)}function L(bc){var bd=bc.originalEvent?bc.originalEvent:bc;if(au.triggerOnTouchLeave){aa=aC(h);P(bd,aa)}}function aK(){aR.unbind(K,aN);aR.unbind(aD,ba);aR.unbind(ax,a4);aR.unbind(V,M);if(T){aR.unbind(T,L)}an(false)}function aC(bg){var bf=bg;var be=aA();var bd=am();var bc=bb();if(!be||bc){bf=q}else{if(bd&&bg==k&&(!au.triggerOnTouchEnd||au.triggerOnTouchLeave)){bf=h}else{if(!bd&&bg==h&&au.triggerOnTouchLeave){bf=q}}}return bf}function P(be,bc){var bd,bf=be.touches;if(J()||W()){bd=aF(be,bc,l)}if((Q()||aX())&&bd!==false){bd=aF(be,bc,t)}if(aG()&&bd!==false){bd=aF(be,bc,j)}else{if(ao()&&bd!==false){bd=aF(be,bc,b)}else{if(ah()&&bd!==false){bd=aF(be,bc,B)}}}if(bc===q){if(W()){bd=aF(be,bc,l)}if(aX()){bd=aF(be,bc,t)}ba(be)}if(bc===h){if(bf){if(!bf.length){ba(be)}}else{ba(be)}}return bd}function aF(bf,bc,be){var bd;if(be==l){aR.trigger("swipeStatus",[bc,aP||null,ag||0,ac||0,X,aQ,a2]);if(au.swipeStatus){bd=au.swipeStatus.call(aR,bf,bc,aP||null,ag||0,ac||0,X,aQ,a2);if(bd===false){return false}}if(bc==h&&aV()){clearTimeout(aW);clearTimeout(af);aR.trigger("swipe",[aP,ag,ac,X,aQ,a2]);if(au.swipe){bd=au.swipe.call(aR,bf,aP,ag,ac,X,aQ,a2);if(bd===false){return false}}switch(aP){case p:aR.trigger("swipeLeft",[aP,ag,ac,X,aQ,a2]);if(au.swipeLeft){bd=au.swipeLeft.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case o:aR.trigger("swipeRight",[aP,ag,ac,X,aQ,a2]);if(au.swipeRight){bd=au.swipeRight.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case e:aR.trigger("swipeUp",[aP,ag,ac,X,aQ,a2]);if(au.swipeUp){bd=au.swipeUp.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case x:aR.trigger("swipeDown",[aP,ag,ac,X,aQ,a2]);if(au.swipeDown){bd=au.swipeDown.call(aR,bf,aP,ag,ac,X,aQ,a2)}break}}}if(be==t){aR.trigger("pinchStatus",[bc,aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchStatus){bd=au.pinchStatus.call(aR,bf,bc,aJ||null,ap||0,ac||0,X,H,aQ);if(bd===false){return false}}if(bc==h&&a9()){switch(aJ){case c:aR.trigger("pinchIn",[aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchIn){bd=au.pinchIn.call(aR,bf,aJ||null,ap||0,ac||0,X,H,aQ)}break;case A:aR.trigger("pinchOut",[aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchOut){bd=au.pinchOut.call(aR,bf,aJ||null,ap||0,ac||0,X,H,aQ)}break}}}if(be==B){if(bc===q||bc===h){clearTimeout(aW);clearTimeout(af);if(Z()&&!I()){O=ar();aW=setTimeout(f.proxy(function(){O=null;aR.trigger("tap",[bf.target]);if(au.tap){bd=au.tap.call(aR,bf,bf.target)}},this),au.doubleTapThreshold)}else{O=null;aR.trigger("tap",[bf.target]);if(au.tap){bd=au.tap.call(aR,bf,bf.target)}}}}else{if(be==j){if(bc===q||bc===h){clearTimeout(aW);clearTimeout(af);O=null;aR.trigger("doubletap",[bf.target]);if(au.doubleTap){bd=au.doubleTap.call(aR,bf,bf.target)}}}else{if(be==b){if(bc===q||bc===h){clearTimeout(aW);O=null;aR.trigger("longtap",[bf.target]);if(au.longTap){bd=au.longTap.call(aR,bf,bf.target)}}}}}return bd}function am(){var bc=true;if(au.threshold!==null){bc=ag>=au.threshold}return bc}function bb(){var bc=false;if(au.cancelThreshold!==null&&aP!==null){bc=(aT(aP)-ag)>=au.cancelThreshold}return bc}function ae(){if(au.pinchThreshold!==null){return ap>=au.pinchThreshold}return true}function aA(){var bc;if(au.maxTimeThreshold){if(ac>=au.maxTimeThreshold){bc=false}else{bc=true}}else{bc=true}return bc}function ak(bc,bd){if(au.preventDefaultEvents===false){return}if(au.allowPageScroll===m){bc.preventDefault()}else{var be=au.allowPageScroll===s;switch(bd){case p:if((au.swipeLeft&&be)||(!be&&au.allowPageScroll!=E)){bc.preventDefault()}break;case o:if((au.swipeRight&&be)||(!be&&au.allowPageScroll!=E)){bc.preventDefault()}break;case e:if((au.swipeUp&&be)||(!be&&au.allowPageScroll!=u)){bc.preventDefault()}break;case x:if((au.swipeDown&&be)||(!be&&au.allowPageScroll!=u)){bc.preventDefault()}break}}}function a9(){var bd=aO();var bc=Y();var be=ae();return bd&&bc&&be}function aX(){return !!(au.pinchStatus||au.pinchIn||au.pinchOut)}function Q(){return !!(a9()&&aX())}function aV(){var bf=aA();var bh=am();var be=aO();var bc=Y();var bd=bb();var bg=!bd&&bc&&be&&bh&&bf;return bg}function W(){return !!(au.swipe||au.swipeStatus||au.swipeLeft||au.swipeRight||au.swipeUp||au.swipeDown)}function J(){return !!(aV()&&W())}function aO(){return((X===au.fingers||au.fingers===i)||!a)}function Y(){return aQ[0].end.x!==0}function a7(){return !!(au.tap)}function Z(){return !!(au.doubleTap)}function aU(){return !!(au.longTap)}function R(){if(O==null){return false}var bc=ar();return(Z()&&((bc-O)<=au.doubleTapThreshold))}function I(){return R()}function aw(){return((X===1||!a)&&(isNaN(ag)||ag<au.threshold))}function a0(){return((ac>au.longTapThreshold)&&(ag<r))}function ah(){return !!(aw()&&a7())}function aG(){return !!(R()&&Z())}function ao(){return !!(a0()&&aU())}function G(bc){a6=ar();ay=bc.touches.length+1}function S(){a6=0;ay=0}function al(){var bc=false;if(a6){var bd=ar()-a6;if(bd<=au.fingerReleaseThreshold){bc=true}}return bc}function aB(){return !!(aR.data(C+"_intouch")===true)}function an(bc){if(!aR){return}if(bc===true){aR.bind(ax,a4);aR.bind(V,M);if(T){aR.bind(T,L)}}else{aR.unbind(ax,a4,false);aR.unbind(V,M,false);if(T){aR.unbind(T,L,false)}}aR.data(C+"_intouch",bc===true)}function ai(be,bc){var bd={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};bd.start.x=bd.last.x=bd.end.x=bc.pageX||bc.clientX;bd.start.y=bd.last.y=bd.end.y=bc.pageY||bc.clientY;aQ[be]=bd;return bd}function aH(bc){var be=bc.identifier!==undefined?bc.identifier:0;var bd=ad(be);if(bd===null){bd=ai(be,bc)}bd.last.x=bd.end.x;bd.last.y=bd.end.y;bd.end.x=bc.pageX||bc.clientX;bd.end.y=bc.pageY||bc.clientY;return bd}function ad(bc){return aQ[bc]||null}function aI(bc,bd){bd=Math.max(bd,aT(bc));N[bc].distance=bd}function aT(bc){if(N[bc]){return N[bc].distance}return undefined}function ab(){var bc={};bc[p]=av(p);bc[o]=av(o);bc[e]=av(e);bc[x]=av(x);return bc}function av(bc){return{direction:bc,distance:0}}function aM(){return a3-U}function at(bf,be){var bd=Math.abs(bf.x-be.x);var bc=Math.abs(bf.y-be.y);return Math.round(Math.sqrt(bd*bd+bc*bc))}function a8(bc,bd){var be=(bd/bc)*1;return be.toFixed(2)}function aq(){if(H<1){return A}else{return c}}function aS(bd,bc){return Math.round(Math.sqrt(Math.pow(bc.x-bd.x,2)+Math.pow(bc.y-bd.y,2)))}function aE(bf,bd){var bc=bf.x-bd.x;var bh=bd.y-bf.y;var be=Math.atan2(bh,bc);var bg=Math.round(be*180/Math.PI);if(bg<0){bg=360-Math.abs(bg)}return bg}function aL(bd,bc){var be=aE(bd,bc);if((be<=45)&&(be>=0)){return p}else{if((be<=360)&&(be>=315)){return p}else{if((be>=135)&&(be<=225)){return o}else{if((be>45)&&(be<135)){return x}else{return e}}}}}function ar(){var bc=new Date();return bc.getTime()}function aY(bc){bc=f(bc);var be=bc.offset();var bd={left:be.left,right:be.left+bc.outerWidth(),top:be.top,bottom:be.top+bc.outerHeight()};return bd}function F(bc,bd){return(bc.x>bd.left&&bc.x<bd.right&&bc.y>bd.top&&bc.y<bd.bottom)}}}));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  })(asljQuery, asljQuery, window);
js/nomin-scoped/jquery.highlight.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(jQuery, $, window){
2
  /*
3
  * jQuery Highlight plugin
4
  *
@@ -104,6 +104,5 @@ jQuery.fn.highlight = function (words, options) {
104
  return this.each(function () {
105
  jQuery.highlight(this, re, settings.element, settings.className);
106
  });
107
- };
108
-
109
  })(asljQuery, asljQuery, window);
1
+ (function(jQuery, $, window){
2
  /*
3
  * jQuery Highlight plugin
4
  *
104
  return this.each(function () {
105
  jQuery.highlight(this, re, settings.element, settings.className);
106
  });
107
+ };
 
108
  })(asljQuery, asljQuery, window);
js/nomin/asl_wrapper.js ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // INIT CODE
2
+
3
+ // Use the window to make sure it is in the main scope, I do not trust IE
4
+ window.ASL = window.ASL || {};
5
+
6
+ window.ASL.getScope = function() {
7
+ /**
8
+ * Explanation:
9
+ * If the sript is scoped, the first argument is always passed in a localized jQuery
10
+ * variable, while the actual parameter can be aspjQuery or jQuery (or anything) as well.
11
+ */
12
+ if (typeof jQuery !== "undefined") return jQuery;
13
+
14
+ // The code should never reach this point, but sometimes magic happens (unloaded or undefined jQuery??)
15
+ // .. I am almost positive at this point this is going to fail anyways, but worth a try.
16
+ if (typeof window[ASL.js_scope] !== "undefined")
17
+ return window[ASL.js_scope];
18
+ else
19
+ return eval(ASL.js_scope);
20
+ };
21
+
22
+ // Call this function if you need to initialize an instance that is printed after an AJAX call
23
+ // Calling without an argument initializes all instances found.
24
+ window.ASL.initialize = function(id) {
25
+ // Yeah I could use $ or jQuery as the scope variable, but I like to avoid magical errors..
26
+ var scope = window.ASL.getScope();
27
+ var selector = ".asl_init_data";
28
+
29
+ if ((typeof ASL_INSTANCES != "undefined") && Object.keys(ASL_INSTANCES).length > 0) {
30
+ scope.each(ASL_INSTANCES, function(k, v){
31
+ if ( typeof v == "undefined" ) return false;
32
+ // Return if it is already initialized
33
+ if ( scope("#ajaxsearchlite" + k).hasClass("hasASL") )
34
+ return false;
35
+ else
36
+ scope("#ajaxsearchlite" + k).addClass("hasASL");
37
+
38
+ return scope("#ajaxsearchlite" + k).ajaxsearchlite(v);
39
+ });
40
+ } else {
41
+ if (typeof id !== 'undefined')
42
+ selector = "div[id*=asl_init_id_" + id + "]";
43
+
44
+ /**
45
+ * Getting around inline script declarations with this solution.
46
+ * So these new, invisible divs contains a JSON object with the parameters.
47
+ * Parse all of them and do the declaration.
48
+ */
49
+ scope(selector).each(function (index, value) {
50
+ var rid = scope(this).attr('id').match(/^asl_init_id_(.*)/)[1];
51
+ var jsonData = scope(this).html();
52
+ if (typeof jsonData === "undefined") return false;
53
+ var args = JSON.parse(jsonData);
54
+
55
+ return scope("#ajaxsearchlite" + rid).ajaxsearchlite(args);
56
+ });
57
+ }
58
+ };
59
+
60
+ window.ASL.ready = function() {
61
+ var _this = this;
62
+ var scope = _this.getScope();
63
+ var t = null;
64
+
65
+ scope(document).ready(function () {
66
+ _this.initialize();
67
+ });
68
+
69
+ // DOM tree modification detection to re-initialize automatically if enabled
70
+ if (typeof(ASL.detect_ajax) != "undefined" && ASL.detect_ajax == 1) {
71
+ scope("body").bind("DOMSubtreeModified", function() {
72
+ clearTimeout(t);
73
+ t = setTimeout(function(){
74
+ _this.initialize();
75
+ }, 500);
76
+ });
77
+ }
78
+ };
79
+
80
+ // Make a reference clone, just in case if an ajax page loader decides to override
81
+ window._ASL = ASL;
82
+
83
+ // Call the ready method
84
+ window._ASL.ready();
js/nomin/jquery.ajaxsearchlite.js ADDED
@@ -0,0 +1,1039 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! Ajax Search Lite 4.6 js */
2
+ (function ($) {
3
+
4
+ var methods = {
5
+
6
+ init: function (options, elem) {
7
+ var $this = this;
8
+
9
+ this.elem = elem;
10
+ this.$elem = $(elem);
11
+
12
+ $this.searching = false;
13
+ $this.o = $.extend({}, options);
14
+ $this.n = new Object();
15
+ $this.n.container = $(this.elem);
16
+ $this.o.rid = $this.n.container.attr('id').match(/^ajaxsearchlite(.*)/)[1];
17
+ $this.o.id = $this.n.container.attr('id').match(/^ajaxsearchlite(.*)/)[1];
18
+ $this.n.probox = $('.probox', $this.n.container);
19
+ $this.n.proinput = $('.proinput', $this.n.container);
20
+ $this.n.text = $('.proinput input.orig', $this.n.container);
21
+ $this.n.textAutocomplete = $('.proinput input.autocomplete', $this.n.container);
22
+ $this.n.loading = $('.proinput .loading', $this.n.container);
23
+ $this.n.proloading = $('.proloading', $this.n.container);
24
+ $this.n.proclose = $('.proclose', $this.n.container);
25
+ $this.n.promagnifier = $('.promagnifier', $this.n.container);
26
+ $this.n.prosettings = $('.prosettings', $this.n.container);
27
+ $this.n.searchsettings = $('#ajaxsearchlitesettings' + $this.o.rid);
28
+ $this.n.resultsDiv = $('#ajaxsearchliteres' + $this.o.rid);
29
+ $this.n.hiddenContainer = $('#asl_hidden_data');
30
+ $this.n.aslItemOverlay = $('.asl_item_overlay', $this.n.hiddenContainer);
31
+
32
+ $this.resizeTimeout = null;
33
+
34
+ $this.n.showmore = $('.showmore a', $this.n.resultsDiv);
35
+ $this.n.items = $('.item', $this.n.resultsDiv);
36
+ $this.n.results = $('.results', $this.n.resultsDiv);
37
+ $this.n.resdrg = $('.resdrg', $this.n.resultsDiv);
38
+
39
+ // Isotopic Layout variables
40
+ $this.il = {
41
+ columns: 3,
42
+ itemsPerPage: 6
43
+ };
44
+
45
+ $this.firstClick = true;
46
+ $this.post = null;
47
+ $this.postAuto = null;
48
+ $this.cleanUp();
49
+ $this.n.textAutocomplete.val('');
50
+ $this.o.resultitemheight = parseInt($this.o.resultitemheight);
51
+ $this.scroll = new Object();
52
+ $this.settScroll = null;
53
+ $this.n.resultsAppend = $('#wpdreams_asl_results_' + $this.o.id);
54
+ $this.currentPage = 1;
55
+ $this.isotopic = null;
56
+
57
+ $this.animation = "bounceIn";
58
+ switch ($this.o.resultstype) {
59
+ case "vertical":
60
+ $this.animation = $this.o.vresultanimation;
61
+ break;
62
+ default:
63
+ $this.animation = $this.o.hresultanimation;
64
+ }
65
+
66
+ $this.filterFns = {
67
+ number: function () {
68
+ var $parent = $(this).parent();
69
+ while (!$parent.hasClass('isotopic')) {
70
+ $parent = $parent.parent();
71
+ }
72
+ var number = $(this).attr('data-itemnum');
73
+ //var currentPage = parseInt($('nav>ul li.asl_active span', $parent).html(), 10);
74
+ var currentPage = $this.currentPage;
75
+ //var itemsPerPage = parseInt($parent.data("itemsperpage"));
76
+ var itemsPerPage = $this.il.itemsPerPage;
77
+
78
+ return (
79
+ (parseInt(number, 10) < itemsPerPage * currentPage) &&
80
+ (parseInt(number, 10) >= itemsPerPage * (currentPage - 1))
81
+ );
82
+ }
83
+ };
84
+
85
+ $this.disableMobileScroll = false;
86
+ $this.n.searchsettings.detach().appendTo("body");
87
+
88
+ if ($this.o.resultsposition == 'hover') {
89
+ $this.n.resultsDiv.detach().appendTo("body");
90
+ } else if ($this.n.resultsAppend.length > 0) {
91
+ $this.n.resultsDiv.detach().appendTo($this.n.resultsAppend);
92
+ }
93
+
94
+ $this.createVerticalScroll();
95
+
96
+ if (detectIE())
97
+ $this.n.container.addClass('asl_msie');
98
+
99
+ // Calculates the settings animation attributes
100
+ $this.initSettingsAnimations();
101
+
102
+ // Calculates the results animation attributes
103
+ $this.initResultsAnimations();
104
+
105
+ $this.initEvents();
106
+
107
+ return this;
108
+ },
109
+
110
+ duplicateCheck: function() {
111
+ var $this = this;
112
+ var duplicateChk = {};
113
+
114
+ $('div[id*=ajaxsearchlite]').each (function () {
115
+ if (duplicateChk.hasOwnProperty(this.id)) {
116
+ $(this).remove();
117
+ } else {
118
+ duplicateChk[this.id] = 'true';
119
+ }
120
+ });
121
+ },
122
+
123
+ analytics: function(term) {
124
+ var $this = this;
125
+ if ($this.o.analytics && $this.o.analyticsString != '' &&
126
+ typeof ga == "function") {
127
+ ga('send', 'pageview', {
128
+ 'page': '/' + $this.o.analyticsString.replace("{asl_term}", term),
129
+ 'title': 'Ajax Search'
130
+ });
131
+ }
132
+ },
133
+
134
+ createVerticalScroll: function () {
135
+ var $this = this;
136
+
137
+ $this.scroll = $this.n.results.mCustomScrollbar({
138
+ contentTouchScroll: true,
139
+ scrollButtons: {
140
+ enable: true
141
+ },
142
+ callbacks: {
143
+ onScroll: function () {
144
+ if (isMobile()) return;
145
+ var top = parseInt($('.mCSB_container', $this.n.results).position().top);
146
+ var children = $('.mCSB_container .resdrg').children();
147
+ var overall = 0;
148
+ var prev = 3000;
149
+ var diff = 4000;
150
+ var s_diff = 10000;
151
+ var s_overall = 10000;
152
+ var $last = null;
153
+ children.each(function () {
154
+ diff = Math.abs((Math.abs(top) - overall));
155
+ if (diff < prev) {
156
+ s_diff = diff;
157
+ s_overall = overall;
158
+ $last = $(this);
159
+ }
160
+ overall += $(this).outerHeight(true);
161
+ prev = diff;
162
+ });
163
+ if ($last.hasClass('group'))
164
+ s_overall = s_overall + ($last.outerHeight(true) - $last.outerHeight(false));
165
+
166
+ $this.scroll.mCustomScrollbar("scrollTo", $last,{
167
+ scrollInertia: 200,
168
+ callbacks: false
169
+ });
170
+ }
171
+ }
172
+ });
173
+
174
+ },
175
+
176
+ createHorizontalScroll: function () {
177
+ var $this = this;
178
+
179
+ $this.scroll = $this.n.results.mCustomScrollbar({
180
+ horizontalScroll: true,
181
+ contentTouchScroll: true,
182
+ scrollButtons: {
183
+ enable: true,
184
+ scrollType: 'pixels',
185
+ scrollSpeed: 'auto',
186
+ scrollAmount: 100
187
+ }
188
+ });
189
+
190
+ },
191
+
192
+ initEvents: function () {
193
+ var $this = this;
194
+
195
+ $($this.n.text.parent()).submit(function (e) {
196
+ e.preventDefault();
197
+ $this.n.text.keyup();
198
+ });
199
+ $this.n.text.click(function () {
200
+ if ($this.firstClick) {
201
+ $(this).val('');
202
+ $this.firstClick = false;
203
+ }
204
+ });
205
+ $this.n.resultsDiv.css({
206
+ opacity: 0
207
+ });
208
+ $(document).bind("click touchend", function () {
209
+ $this.hideSettings();
210
+ if ($this.opened == false || $this.o.closeOnDocClick != 1) return;
211
+ $this.hideResults();
212
+ });
213
+ $this.n.proclose.bind("click touchend", function () {
214
+ if ($this.opened == false) return;
215
+ $this.n.text.val("");
216
+ $this.n.textAutocomplete.val("");
217
+ $this.hideResults();
218
+ $this.n.text.focus();
219
+ });
220
+ $($this.elem).bind("click touchend", function (e) {
221
+ e.stopImmediatePropagation();
222
+ });
223
+ $this.n.resultsDiv.bind("click touchend", function (e) {
224
+ e.stopImmediatePropagation();
225
+ });
226
+ $this.n.searchsettings.bind("click touchend", function (e) {
227
+ e.stopImmediatePropagation();
228
+ });
229
+
230
+ $this.n.prosettings.on("click", function () {
231
+ if ($this.n.prosettings.data('opened') == 0) {
232
+ $this.showSettings();
233
+ } else {
234
+ $this.hideSettings();
235
+ }
236
+ });
237
+
238
+ // jQuery bind not working!
239
+ $(document).bind('touchmove', function (e) {
240
+ if ($this.disableMobileScroll == true)
241
+ e.preventDefault();
242
+ });
243
+
244
+ var resizeTimer;
245
+ $(window).on("resize", function () {
246
+ clearTimeout(resizeTimer);
247
+ resizeTimer = setTimeout(function() {
248
+ $this.resize();
249
+ }, 250);
250
+ });
251
+
252
+ var scrollTimer;
253
+ $(window).on("scroll", function () {
254
+ clearTimeout(scrollTimer);
255
+ scrollTimer = setTimeout(function() {
256
+ $this.scrolling(false);
257
+ }, 250);
258
+ });
259
+
260
+ $this.initNavigationEvent();
261
+
262
+ $(window).trigger('resize');
263
+ $(window).trigger('scroll');
264
+
265
+ $this.initMagnifierEvent();
266
+ $this.initAutocompleteEvent();
267
+ $this.initFacetEvents();
268
+ },
269
+
270
+ initNavigationEvent: function () {
271
+ var $this = this;
272
+
273
+ $($this.n.resultsDiv).on('mouseenter', '.item',
274
+ function () {
275
+ //alert("hover");
276
+ $('.item', $this.n.resultsDiv).removeClass('hovered');
277
+ $(this).addClass('hovered');
278
+ }
279
+ );
280
+ $($this.n.resultsDiv).on('mouseleave', '.item',
281
+ function () {
282
+ //alert("hover");
283
+ $('.item', $this.n.resultsDiv).removeClass('hovered');
284
+ }
285
+ );
286
+
287
+ $(document).keydown(function (e) {
288
+
289
+ if (window.event) {
290
+ var keycode = window.event.keyCode;
291
+ var ktype = window.event.type;
292
+ } else if (e) {
293
+ var keycode = e.which;
294
+ var ktype = e.type;
295
+ }
296
+ //$('.item', $this.n.resultsDiv).hover();
297
+
298
+ if ($('.item', $this.n.resultsDiv).length > 0 && $this.n.resultsDiv.css('display') != 'none') {
299
+ if (keycode == 40) {
300
+ e.stopPropagation();
301
+ e.preventDefault();
302
+ $this.n.text.blur();
303
+
304
+ if ($this.post != null) $this.post.abort();
305
+ if ($('.item.hovered', $this.n.resultsDiv).length == 0) {
306
+ $('.item', $this.n.resultsDiv).first().addClass('hovered');
307
+ } else {
308
+ $('.item.hovered', $this.n.resultsDiv).removeClass('hovered').next().next('.item').addClass('hovered');
309
+ }
310
+ $this.scroll.mCustomScrollbar("scrollTo", ".resdrg .item.hovered",{
311
+ scrollInertia: 200,
312
+ callbacks: false
313
+ });
314
+ }
315
+ if (keycode == 38) {
316
+ e.stopPropagation();
317
+ e.preventDefault();
318
+ $this.n.text.blur();
319
+
320
+ if ($this.post != null) $this.post.abort();
321
+ if ($('.item.hovered', $this.n.resultsDiv).length == 0) {
322
+ $('.item', $this.n.resultsDiv).last().addClass('hovered');
323
+ } else {
324
+ $('.item.hovered', $this.n.resultsDiv).removeClass('hovered').prev().prev('.item').addClass('hovered');
325
+ }
326
+ $this.scroll.mCustomScrollbar("scrollTo", ".resdrg .item.hovered",{
327
+ scrollInertia: 200,
328
+ callbacks: false
329
+ });
330
+ }
331
+
332
+ // Trigger click on return key
333
+ if ( keycode == 13 && $('.item.hovered', $this.n.resultsDiv).length > 0 ) {
334
+ e.stopPropagation();
335
+ e.preventDefault();
336
+ $('.item.hovered a.asl_res_url', $this.n.resultsDiv).get(0).click();
337
+ }
338
+ }
339
+ });
340
+ },
341
+
342
+ initMagnifierEvent: function () {
343
+ var $this = this;
344
+
345
+ var t;
346
+ $this.n.promagnifier.add($this.n.text).bind('click keyup', function (e) {
347
+ if (window.event) {
348
+ $this.keycode = window.event.keyCode;
349
+ $this.ktype = window.event.type;
350
+ } else if (e) {
351
+ $this.keycode = e.which;
352
+ $this.ktype = e.type;
353
+ }
354
+
355
+ var isInput = $(this).hasClass("orig");
356
+
357
+ if ($this.n.text.val().length < $this.o.charcount) {
358
+ $this.n.proloading.css('display', 'none');
359
+ $this.hideResults();
360
+ if ($this.post != null) $this.post.abort();
361
+ clearTimeout(t);
362
+ return;
363
+ }
364
+
365
+ // If redirection is set to the results page, or custom URL
366
+ if (
367
+ (!isInput && $this.o.redirectonclick == 1 && $this.ktype == 'click' && $this.o.redirectClickTo == 'results_page' ) ||
368
+ (isInput && $this.o.redirect_on_enter == 1 && $this.ktype == 'keyup' && $this.keycode == 13 && $this.o.redirectEnterTo == 'results_page' )
369
+ ) {
370
+ var plus = '';
371
+ var url = '?s=' + $this.n.text.val();
372
+
373
+ if ($this.o.overridewpdefault) {
374
+ asp_submit_to_url($this.o.homeurl + url + "&asl_active=1", 'post', {
375
+ p_asl_data: $('form', $this.n.searchsettings).serialize()
376
+ });
377
+ } else {
378
+ asp_submit_to_url($this.o.homeurl + url, 'post', {
379
+ np_asl_data: $('form', $this.n.searchsettings).serialize()
380
+ });
381
+ }
382
+
383
+ $this.n.proloading.css('display', 'none');
384
+ $this.hideResults();
385
+ if ($this.post != null) $this.post.abort();
386
+ clearTimeout(t);
387
+ return;
388
+ }
389
+
390
+ // Ignore arrows
391
+ if ($this.keycode >= 37 && $this.keycode <= 40) return;
392
+ if ($(this).hasClass('orig') && $this.ktype == 'click') return;
393
+
394
+ if ($this.o.triggeronclick == 0 && $this.ktype == 'click') return;
395
+ if ($this.o.triggerontype == 0 && $this.ktype == 'keyup') return;
396
+
397
+ if ($this.post != null) $this.post.abort();
398
+ clearTimeout(t);
399
+ t = setTimeout(function () {
400
+ $this.search();
401
+ }, 300);
402
+ });
403
+ },
404
+
405
+ initFacetEvents: function() {
406
+ var $this = this;
407
+ if ($this.o.trigger_on_facet_change == 1)
408
+ $('input', $this.n.searchsettings).change(function(){
409
+ if ($this.n.text.val().length < $this.o.charcount) return;
410
+ if ($this.post != null) $this.post.abort();
411
+ $this.search();
412
+ });
413
+ },
414
+
415
+ destroy: function () {
416
+ return this.each(function () {
417
+ var $this = $.extend({}, this, methods);
418
+ $(window).unbind($this);
419
+ })
420
+ },
421
+ searchfor: function (phrase) {
422
+ $(".proinput input", this).val(phrase).trigger("keyup");
423
+ },
424
+
425
+ initAutocompleteEvent: function () {
426
+ var $this = this;
427
+ var tt;
428
+
429
+ if ($this.o.autocomplete.enabled == 1 && !isMobile()) {
430
+ $this.n.text.keyup(function (e) {
431
+ if (window.event) {
432
+ $this.keycode = window.event.keyCode;
433
+ $this.ktype = window.event.type;
434
+ } else if (e) {
435
+ $this.keycode = e.which;
436
+ $this.ktype = e.type;
437
+ }
438
+
439
+ var thekey = 39;
440
+ // Lets change the keykode if the direction is rtl
441
+ if ($('body').hasClass('rtl'))
442
+ thekey = 37;
443
+ if ($this.keycode == thekey && $this.n.textAutocomplete.val() != "") {
444
+ e.preventDefault();
445
+ $this.n.text.val($this.n.textAutocomplete.val());
446
+ if ($this.post != null) $this.post.abort();
447
+ $this.search();
448
+ } else {
449
+ if ($this.postAuto != null) $this.postAuto.abort();
450
+ $this.autocompleteGoogleOnly();
451
+ }
452
+ });
453
+ }
454
+ },
455
+
456
+ // If only google source is used, this is much faster..
457
+ autocompleteGoogleOnly: function () {
458
+ var $this = this;
459
+
460
+ var val = $this.n.text.val();
461
+ if ($this.n.text.val() == '') {
462
+ $this.n.textAutocomplete.val('');
463
+ return;
464
+ }
465
+ var autocompleteVal = $this.n.textAutocomplete.val();
466
+ if (autocompleteVal != '' && autocompleteVal.indexOf(val) == 0) {
467
+ return;
468
+ } else {
469
+ $this.n.textAutocomplete.val('');
470
+ }
471
+
472
+ $.ajax({
473
+ url: 'https://clients1.google.com/complete/search',
474
+ dataType: 'jsonp',
475
+ data: {
476
+ q: val,
477
+ hl: $this.o.autocomplete.lang,
478
+ nolabels: 't',
479
+ client: 'hp',
480
+ ds: ''
481
+ },
482
+ success: function(data) {
483
+ if (data[1].length > 0) {
484
+ response = data[1][0][0].replace(/(<([^>]+)>)/ig,"");
485
+ response = $('<textarea />').html(response).text();
486
+ response = response.substr(val.length);
487
+ $this.n.textAutocomplete.val(val + response);
488
+ }
489
+ }
490
+ });
491
+ },
492
+
493
+ search: function () {
494
+ var $this = this;
495
+
496
+ if ($this.searching && 0) return;
497
+ if ($this.n.text.val().length < $this.o.charcount) return;
498
+
499
+ $this.searching = true;
500
+ $this.n.proloading.css({
501
+ display: "block"
502
+ });
503
+ $this.n.proclose.css({
504
+ display: "none"
505
+ });
506
+ $this.hideSettings();
507
+ //$this.hideResults();
508
+ var data = {
509
+ action: 'ajaxsearchlite_search',
510
+ aslp: $this.n.text.val(),
511
+ asid: $this.o.id,
512
+ options: $('form', $this.n.searchsettings).serialize()
513
+ };
514
+ $this.analytics($this.n.text.val());
515
+
516
+ // New method without JSON
517
+ $this.post = $.post(ajaxsearchlite.ajaxurl, data, function (response) {
518
+ response = response.replace(/^\s*[\r\n]/gm, "");
519
+ response = response.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1];
520
+
521
+ // bye bye JSON
522
+
523
+ $this.n.resdrg.html("");
524
+ $this.n.resdrg.html(response);
525
+
526
+ $(".asl_keyword", $this.n.resdrg).bind('click', function () {
527
+ $this.n.text.val($(this).html());
528
+ $('input.orig', $this.n.container).val($(this).html()).keydown();
529
+ $('form', $this.n.container).trigger('submit', 'ajax');
530
+ $this.search();
531
+ });
532
+
533
+ $this.n.items = $('.item', $this.n.resultsDiv);
534
+
535
+ // Redirect to the first result if enabled :)
536
+ if (
537
+ $('.asl_res_url', $this.n.resultsDiv).length > 0 &&
538
+ ($this.o.redirectonclick == 1 && $this.ktype == 'click' && $this.o.redirectClickTo != 'results_page' ) ||
539
+ ($this.o.redirect_on_enter == 1 && $this.ktype == 'keyup' && $this.keycode == 13 && $this.o.redirectEnterTo != 'results_page' )
540
+ ) {
541
+ location.href = $( $('.asl_res_url', $this.n.resultsDiv).get(0)).attr('href');
542
+ return false;
543
+ }
544
+
545
+ $this.showResults();
546
+ $this.scrollToResults();
547
+
548
+ if ($this.n.items.length == 0) {
549
+ if ($this.n.showmore != null) {
550
+ $this.n.showmore.css('display', 'none');
551
+ }
552
+ } else {
553
+ if ($this.n.showmore != null) {
554
+ $this.n.showmore.css('display', 'block');
555
+ $this.n.showmore.attr('href', $this.o.homeurl + '?s=' + $this.n.text.val());
556
+ }
557
+ }
558
+
559
+ }, "text");
560
+ },
561
+
562
+ showLoader: function( ) {
563
+ var $this = this;
564
+ $this.n.proloading.css({
565
+ display: "block"
566
+ });
567
+ },
568
+
569
+ hideLoader: function( ) {
570
+ var $this = this;
571
+
572
+ $this.n.proloading.css({
573
+ display: "none"
574
+ });
575
+ $this.n.results.css("display", "");
576
+ },
577
+
578
+ showResultsBox: function() {
579
+ var $this = this;
580
+
581
+ $this.n.resultsDiv.css({
582
+ display: 'block',
583
+ height: 'auto'
584
+ });
585
+ $this.n.items.addClass($this.animationOpacity);
586
+
587
+ $this.scrolling(true);
588
+ $this.n.resultsDiv.css($this.resAnim.showCSS);
589
+ $this.n.resultsDiv.removeClass($this.resAnim.hideClass).addClass($this.resAnim.showClass);
590
+ },
591
+
592
+ showResults: function( ) {
593
+ var $this = this;
594
+ switch ($this.o.resultstype) {
595
+ case 'vertical':
596
+ $this.showVerticalResults();
597
+ break;
598
+ default:
599
+ $this.showHorizontalResults();
600
+ break;
601
+ }
602
+
603
+ $this.hideLoader();
604
+
605
+ $this.n.proclose.css({
606
+ display: "block"
607
+ });
608
+
609
+ if ($this.n.showmore != null) {
610
+ if ($this.n.items.length > 0) {
611
+ $this.n.showmore.css({
612
+ 'display': 'block'
613
+ });
614
+ } else {
615
+ $this.n.showmore.css({
616
+ 'display': 'none'
617
+ });
618
+ }
619
+ }
620
+
621
+ if (isMobile() && $this.o.mobile.hide_keyboard)
622
+ document.activeElement.blur();
623
+
624
+ $this.resultsOpened = true;
625
+ },
626
+
627
+ hideResults: function( ) {
628
+ var $this = this;
629
+
630
+ if ( !$this.resultsOpened ) return false;
631
+
632
+ $this.n.resultsDiv.removeClass($this.resAnim.showClass).addClass($this.resAnim.hideClass);
633
+ setTimeout(function(){
634
+ $this.n.resultsDiv.css($this.resAnim.hideCSS);
635
+ }, $this.resAnim.duration);
636
+
637
+ $this.n.proclose.css({
638
+ display: "none"
639
+ });
640
+ if ($this.n.showmore != null) {
641
+ $this.n.showmore.css({
642
+ 'display': 'none'
643
+ });
644
+ }
645
+
646
+ if (isMobile())
647
+ document.activeElement.blur();
648
+
649
+ $this.resultsOpened = false;
650
+ },
651
+
652
+ scrollToResults: function( ) {
653
+ $this = this;
654
+ if (this.o.scrollToResults!=1) return;
655
+ if (this.$elem.parent().hasClass("asl_preview_data")) return;
656
+ if ($this.o.resultsposition == "hover")
657
+ var stop = $this.n.probox.offset().top - 20;
658
+ else
659
+ var stop = $this.n.resultsDiv.offset().top - 20;
660
+ if ($("#wpadminbar").length > 0)
661
+ stop -= $("#wpadminbar").height();
662
+ stop = stop < 0 ? 0 : stop;
663
+ $('body, html').animate({
664
+ "scrollTop": stop
665
+ }, {
666
+ duration: 500
667
+ });
668
+ },
669
+
670
+ createGroup: function (r) {
671
+ return "<div class='group'>" + r + "</div>";
672
+ },
673
+
674
+ showVerticalResults: function () {
675
+ var $this = this;
676
+
677
+ $this.showResultsBox();
678
+
679
+ if ($this.n.items.length > 0) {
680
+ var count = (($this.n.items.length < $this.o.itemscount) ? $this.n.items.length : $this.o.itemscount);
681
+ var groups = $('.group', $this.n.resultsDiv);
682
+
683
+ if ($this.n.items.length <= $this.o.itemscount) {
684
+ $this.n.results.css({
685
+ height: 'auto'
686
+ });
687
+ } else {
688
+
689
+ // Set the height to a fictive value to refresh the scrollbar
690
+ // .. otherwise the height is not calculated correctly, because of the scrollbar width.
691
+ $this.n.results.css({
692
+ height: 30
693
+ });
694
+ $this.scroll.mCustomScrollbar('update');
695
+ $this.resize();
696
+
697
+ // Here now we have the correct item height values with the scrollbar enabled
698
+ var i = 0;
699
+ var h = 0;
700
+
701
+ $this.n.items.each(function () {
702
+ h += $(this).outerHeight(true);
703
+ i++;
704
+ });
705
+
706
+ // Count the average height * viewport size
707
+ i = i < 1 ? 1 : i;
708
+ h = h / i * count;
709
+
710
+ $this.n.results.css({
711
+ height: h
712
+ });
713
+ }
714
+
715
+ window.sscroll = $this.scroll;
716
+
717
+ // Disable the scrollbar first, to avoid glitches
718
+ $this.scroll.mCustomScrollbar('disable', true);
719
+
720
+ // After making the changes trigger an update to re-enable
721
+ $this.scroll.mCustomScrollbar('update');
722
+ // ..then all the other math stuff from the resize event
723
+ $this.resize();
724
+ // .. and finally scroll back to the first item nicely
725
+ $this.scroll.mCustomScrollbar('scrollTo', 0);
726
+
727
+ if ($this.o.highlight == 1) {
728
+ var wholew = (($this.o.highlightwholewords == 1) ? true : false);
729
+ $("div.item", $this.n.resultsDiv).highlight($this.n.text.val().split(" "), { element: 'span', className: 'highlighted', wordsOnly: wholew });
730
+ }
731
+
732
+ }
733
+ $this.resize();
734
+ if ($this.n.items.length == 0) {
735
+ var h = ($('.nores', $this.n.results).outerHeight(true) > ($this.o.resultitemheight) ? ($this.o.resultitemheight) : $('.nores', $this.n.results).outerHeight(true));
736
+ $this.n.results.css({
737
+ height: 11110
738
+ });
739
+ $this.scroll.mCustomScrollbar('update');
740
+ $this.n.results.css({
741
+ height: 'auto'
742
+ });
743
+ }
744
+ $this.addAnimation();
745
+ $this.scrolling(true);
746
+ $this.searching = false;
747
+
748
+
749
+ },
750
+
751
+ hideVerticalResults: function () {
752
+ var $this = this;
753
+
754
+ $this.disableMobileScroll = false;
755
+
756
+ $this.n.resultsDiv
757
+ .animate({
758
+ opacity: 0,
759
+ height: 0
760
+ }, {
761
+ duration: 120,
762
+ complete: function () {
763
+ $(this).css({
764
+ visibility: "hidden",
765
+ display: "none"
766
+ });
767
+ }
768
+ });
769
+ },
770
+
771
+ addAnimation: function () {
772
+ var $this = this;
773
+ var i = 0;
774
+ var j = 1;
775
+ $this.n.items.each(function () {
776
+ var x = this;
777
+ setTimeout(function () {
778
+ $(x).addClass($this.animation);
779
+ }, i);
780
+ i = i + 60;
781
+ j++;
782
+ });
783
+ },
784
+
785
+ removeAnimation: function () {
786
+ var $this = this;
787
+ $this.n.items.each(function () {
788
+ var x = this;
789
+ $(x).removeClass($this.animation);
790
+ });
791
+ },
792
+
793
+ initSettingsAnimations: function() {
794
+ var $this = this;
795
+ var animDur = 300;
796
+
797
+ $this.settAnim = {
798
+ "showClass": "asl_an_fadeInDrop",
799
+ "showCSS": {
800
+ "visibility": "visible",
801
+ "display": "block",
802
+ "opacity": 1,
803
+ "animation-duration": animDur
804
+ },
805
+ "hideClass": "asl_an_fadeOutDrop",
806
+ "hideCSS": {
807
+ "visibility": "hidden",
808
+ "opacity": 0,
809
+ "display": "none"
810
+ },
811
+ "duration": animDur
812
+ };
813
+
814
+ $this.n.searchsettings.css({
815
+ "-webkit-animation-duration": $this.settAnim.duration + "ms",
816
+ "animation-duration": $this.settAnim.duration + "ms"
817
+ });
818
+ },
819
+
820
+ initResultsAnimations: function() {
821
+ var $this = this;
822
+ var animDur = 300;
823
+
824
+ $this.resAnim = {
825
+ "showClass": "asl_an_fadeInDrop",
826
+ "showCSS": {
827
+ "visibility": "visible",
828
+ "display": "block",
829
+ "opacity": 1,
830
+ "animation-duration": animDur
831
+ },
832
+ "hideClass": "asl_an_fadeOutDrop",
833
+ "hideCSS": {
834
+ "visibility": "hidden",
835
+ "opacity": 0,
836
+ "display": "none"
837
+ },
838
+ "duration": animDur
839
+ };
840
+
841
+ $this.n.resultsDiv.css({
842
+ "-webkit-animation-duration": animDur + "ms",
843
+ "animation-duration": animDur + "ms"
844
+ });
845
+ },
846
+
847
+ showSettings: function () {
848
+ var $this = this;
849
+
850
+ $this.scrolling(true);
851
+ $this.n.searchsettings.css($this.settAnim.showCSS);
852
+ $this.n.searchsettings.removeClass($this.settAnim.hideClass).addClass($this.settAnim.showClass);
853
+
854
+ if ($this.settScroll == null) {
855
+ $this.settScroll = $('.asl_sett_scroll', $this.n.searchsettings).mCustomScrollbar({
856
+ contentTouchScroll: true
857
+ });
858
+ }
859
+ $this.n.prosettings.data('opened', 1);
860
+ },
861
+
862
+ hideSettings: function () {
863
+ var $this = this;
864
+
865
+ $this.n.searchsettings.removeClass($this.settAnim.showClass).addClass($this.settAnim.hideClass);
866
+ setTimeout(function(){
867
+ $this.n.searchsettings.css($this.settAnim.hideCSS);
868
+ }, $this.settAnim.duration);
869
+
870
+ $this.n.prosettings.data('opened', 0);
871
+ },
872
+
873
+ cleanUp: function () {
874
+ var $this = this;
875
+
876
+ if ($('.searchsettings', $this.n.container).length > 0) {
877
+ $('body>#ajaxsearchlitesettings' + $this.o.rid).remove();
878
+ $('body>#ajaxsearchliteres' + $this.o.rid).remove();
879
+ }
880
+ },
881
+ resize: function () {
882
+ var $this = this;
883
+ var bodyTop = 0;
884
+
885
+ if ( $("body").css("position") != "static" )
886
+ bodyTop = $("body").offset().top;
887
+
888
+ if (detectIE() && 0) {
889
+ $this.n.proinput.css({
890
+ width: ($this.n.probox.width() - 8 - ($this.n.proinput.outerWidth(false) - $this.n.proinput.width()) - $this.n.proloading.outerWidth(true) - $this.n.prosettings.outerWidth(true) - $this.n.promagnifier.outerWidth(true) - 10)
891
+ });
892
+ $this.n.text.css({
893
+ width: $this.n.proinput.width() - 2 + $this.n.proloading.outerWidth(true),
894
+ position: 'absolute',
895
+ zIndex: 2
896
+ });
897
+ $this.n.textAutocomplete.css({
898
+ width: $this.n.proinput.width() - 2 + $this.n.proloading.outerWidth(true),
899
+ opacity: 0.25,
900
+ zIndex: 1
901
+ });
902
+ }
903
+
904
+ if ($this.n.prosettings.attr('opened') != 0) {
905
+
906
+ if ($this.o.settingsimagepos == 'left') {
907
+ $this.n.searchsettings.css({
908
+ display: "block",
909
+ top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2 - bodyTop,
910
+ left: $this.n.prosettings.offset().left
911
+ });
912
+ } else {
913
+ $this.n.searchsettings.css({
914
+ display: "block",
915
+ top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2 - bodyTop,
916
+ left: $this.n.prosettings.offset().left + $this.n.prosettings.width() - $this.n.searchsettings.width()
917
+ });
918
+ }
919
+ }
920
+ if ($this.n.resultsDiv.css('visibility') != 'hidden') {
921
+ if ($this.o.resultsposition != 'block') {
922
+ var cwidth = $this.n.container.width() - ($this.n.resultsDiv.outerWidth(true) - $this.n.resultsDiv.width());
923
+ var rwidth = cwidth < 240 ? 240 : cwidth;
924
+ $this.n.resultsDiv.css({
925
+ width: rwidth,
926
+ top: $this.n.container.offset().top + $this.n.container.outerHeight(true) + 10 - bodyTop,
927
+ left: $this.n.container.offset().left + (cwidth - rwidth)
928
+ });
929
+ }
930
+
931
+ }
932
+ },
933
+ scrolling: function (ignoreVisibility) {
934
+ var $this = this;
935
+ var bodyTop = 0;
936
+
937
+ if ( $("body").css("position") != "static" )
938
+ bodyTop = $("body").offset().top;
939
+
940
+ if (ignoreVisibility == true || $this.n.searchsettings.css('visibility') == 'visible') {
941
+
942
+ if ($this.o.settingsimagepos == 'left') {
943
+ $this.n.searchsettings.css({
944
+ display: "block",
945
+ top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2 - bodyTop,
946
+ left: $this.n.prosettings.offset().left
947
+ });
948
+ } else {
949
+ $this.n.searchsettings.css({
950
+ display: "block",
951
+ top: $this.n.prosettings.offset().top + $this.n.prosettings.height() - 2 - bodyTop,
952
+ left: $this.n.prosettings.offset().left + $this.n.prosettings.width() - $this.n.searchsettings.width()
953
+ });
954
+ }
955
+ }
956
+
957
+ if ((ignoreVisibility == true || $this.n.resultsDiv.css('visibility') == 'visible')) {
958
+ var cwidth = $this.n.container.width() - ($this.n.resultsDiv.outerWidth(true) - $this.n.resultsDiv.width());
959
+ var rwidth = cwidth < 240 ? 240 : cwidth;
960
+ if ( ($this.o.resultsposition != 'hover' && $this.n.resultsAppend.length > 0) || $this.n.container.hasClass("hiddend"))
961
+ rwidth = 'auto';
962
+
963
+ $this.n.resultsDiv.css({
964
+ width: rwidth,
965
+ top: $this.n.container.offset().top + $this.n.container.outerHeight(true) + 10 - bodyTop,
966
+ left: $this.n.container.offset().left + (cwidth - rwidth)
967
+ });
968
+ }
969
+ }
970
+ };
971
+
972
+ function is_touch_device() {
973
+ return !!("ontouchstart" in window) ? 1 : 0;
974
+ }
975
+
976
+ /* Mobile detection - Touch desktop device safe! */
977
+ function isMobile() {
978
+ try{ document.createEvent("TouchEvent"); return true; }
979
+ catch(e){ return false; }
980
+ }
981
+
982
+ function asp_submit_to_url(action, method, input) {
983
+ 'use strict';
984
+ var form;
985
+ form = $('<form />', {
986
+ action: action,
987
+ method: method,
988
+ style: 'display: none;'
989
+ });
990
+ if (typeof input !== 'undefined' && input !== null) {
991
+ $.each(input, function (name, value) {
992
+ $('<input />', {
993
+ type: 'hidden',
994
+ name: name,
995
+ value: value
996
+ }).appendTo(form);
997
+ });
998
+ }
999
+ form.appendTo('body').submit();
1000
+ }
1001
+
1002
+ function detectIE() {
1003
+ var ua = window.navigator.userAgent;
1004
+ var msie = ua.indexOf('MSIE ');
1005
+ var trident = ua.indexOf('Trident/');
1006
+
1007
+ if (msie > 0 || trident > 0)
1008
+ return true;
1009
+
1010
+ // other browser
1011
+ return false;
1012
+ }
1013
+
1014
+ // Object.create support test, and fallback for browsers without it
1015
+ if (typeof Object.create !== 'function') {
1016
+ Object.create = function (o) {
1017
+ function F() {
1018
+ }
1019
+
1020
+ F.prototype = o;
1021
+ return new F();
1022
+ };
1023
+ }
1024
+
1025
+
1026
+ // Create a plugin based on a defined object
1027
+ $.plugin = function (name, object) {
1028
+ $.fn[name] = function (options) {
1029
+ return this.each(function () {
1030
+ if (!$.data(this, name)) {
1031
+ $.data(this, name, Object.create(object).init(
1032
+ options, this));
1033
+ }
1034
+ });
1035
+ };
1036
+ };
1037
+
1038
+ $.plugin('ajaxsearchlite', methods);
1039
+ })(jQuery);
js/nomin/jquery.gestures.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(a){if(typeof define==="function"&&define.amd&&define.amd.jQuery){define(["jquery"],a)}else{if(typeof module!=="undefined"&&module.exports){a(require("jquery"))}else{a(jQuery)}}}(function(f){var y="1.6.15",p="left",o="right",e="up",x="down",c="in",A="out",m="none",s="auto",l="swipe",t="pinch",B="tap",j="doubletap",b="longtap",z="hold",E="horizontal",u="vertical",i="all",r=10,g="start",k="move",h="end",q="cancel",a="ontouchstart" in window,v=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!a,d=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!a,C="TouchSwipe";var n={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:true};f.fn.swipe=function(H){var G=f(this),F=G.data(C);if(F&&typeof H==="string"){if(F[H]){return F[H].apply(this,Array.prototype.slice.call(arguments,1))}else{f.error("Method "+H+" does not exist on jQuery.swipe")}}else{if(F&&typeof H==="object"){F.option.apply(this,arguments)}else{if(!F&&(typeof H==="object"||!H)){return w.apply(this,arguments)}}}return G};f.fn.swipe.version=y;f.fn.swipe.defaults=n;f.fn.swipe.phases={PHASE_START:g,PHASE_MOVE:k,PHASE_END:h,PHASE_CANCEL:q};f.fn.swipe.directions={LEFT:p,RIGHT:o,UP:e,DOWN:x,IN:c,OUT:A};f.fn.swipe.pageScroll={NONE:m,HORIZONTAL:E,VERTICAL:u,AUTO:s};f.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:i};function w(F){if(F&&(F.allowPageScroll===undefined&&(F.swipe!==undefined||F.swipeStatus!==undefined))){F.allowPageScroll=m}if(F.click!==undefined&&F.tap===undefined){F.tap=F.click}if(!F){F={}}F=f.extend({},f.fn.swipe.defaults,F);return this.each(function(){var H=f(this);var G=H.data(C);if(!G){G=new D(this,F);H.data(C,G)}})}function D(a5,au){var au=f.extend({},au);var az=(a||d||!au.fallbackToMouseEvents),K=az?(d?(v?"MSPointerDown":"pointerdown"):"touchstart"):"mousedown",ax=az?(d?(v?"MSPointerMove":"pointermove"):"touchmove"):"mousemove",V=az?(d?(v?"MSPointerUp":"pointerup"):"touchend"):"mouseup",T=az?(d?"mouseleave":null):"mouseleave",aD=(d?(v?"MSPointerCancel":"pointercancel"):"touchcancel");var ag=0,aP=null,a2=null,ac=0,a1=0,aZ=0,H=1,ap=0,aJ=0,N=null;var aR=f(a5);var aa="start";var X=0;var aQ={};var U=0,a3=0,a6=0,ay=0,O=0;var aW=null,af=null;try{aR.bind(K,aN);aR.bind(aD,ba)}catch(aj){f.error("events not supported "+K+","+aD+" on jQuery.swipe")}this.enable=function(){aR.bind(K,aN);aR.bind(aD,ba);return aR};this.disable=function(){aK();return aR};this.destroy=function(){aK();aR.data(C,null);aR=null};this.option=function(bd,bc){if(typeof bd==="object"){au=f.extend(au,bd)}else{if(au[bd]!==undefined){if(bc===undefined){return au[bd]}else{au[bd]=bc}}else{if(!bd){return au}else{f.error("Option "+bd+" does not exist on jQuery.swipe.options")}}}return null};function aN(be){if(aB()){return}if(f(be.target).closest(au.excludedElements,aR).length>0){return}var bf=be.originalEvent?be.originalEvent:be;var bd,bg=bf.touches,bc=bg?bg[0]:bf;aa=g;if(bg){X=bg.length}else{if(au.preventDefaultEvents!==false){be.preventDefault()}}ag=0;aP=null;a2=null;aJ=null;ac=0;a1=0;aZ=0;H=1;ap=0;N=ab();S();ai(0,bc);if(!bg||(X===au.fingers||au.fingers===i)||aX()){U=ar();if(X==2){ai(1,bg[1]);a1=aZ=at(aQ[0].start,aQ[1].start)}if(au.swipeStatus||au.pinchStatus){bd=P(bf,aa)}}else{bd=false}if(bd===false){aa=q;P(bf,aa);return bd}else{if(au.hold){af=setTimeout(f.proxy(function(){aR.trigger("hold",[bf.target]);if(au.hold){bd=au.hold.call(aR,bf,bf.target)}},this),au.longTapThreshold)}an(true)}return null}function a4(bf){var bi=bf.originalEvent?bf.originalEvent:bf;if(aa===h||aa===q||al()){return}var be,bj=bi.touches,bd=bj?bj[0]:bi;var bg=aH(bd);a3=ar();if(bj){X=bj.length}if(au.hold){clearTimeout(af)}aa=k;if(X==2){if(a1==0){ai(1,bj[1]);a1=aZ=at(aQ[0].start,aQ[1].start)}else{aH(bj[1]);aZ=at(aQ[0].end,aQ[1].end);aJ=aq(aQ[0].end,aQ[1].end)}H=a8(a1,aZ);ap=Math.abs(a1-aZ)}if((X===au.fingers||au.fingers===i)||!bj||aX()){aP=aL(bg.start,bg.end);a2=aL(bg.last,bg.end);ak(bf,a2);ag=aS(bg.start,bg.end);ac=aM();aI(aP,ag);be=P(bi,aa);if(!au.triggerOnTouchEnd||au.triggerOnTouchLeave){var bc=true;if(au.triggerOnTouchLeave){var bh=aY(this);bc=F(bg.end,bh)}if(!au.triggerOnTouchEnd&&bc){aa=aC(k)}else{if(au.triggerOnTouchLeave&&!bc){aa=aC(h)}}if(aa==q||aa==h){P(bi,aa)}}}else{aa=q;P(bi,aa)}if(be===false){aa=q;P(bi,aa)}}function M(bc){var bd=bc.originalEvent?bc.originalEvent:bc,be=bd.touches;if(be){if(be.length&&!al()){G(bd);return true}else{if(be.length&&al()){return true}}}if(al()){X=ay}a3=ar();ac=aM();if(bb()||!am()){aa=q;P(bd,aa)}else{if(au.triggerOnTouchEnd||(au.triggerOnTouchEnd==false&&aa===k)){if(au.preventDefaultEvents!==false){bc.preventDefault()}aa=h;P(bd,aa)}else{if(!au.triggerOnTouchEnd&&a7()){aa=h;aF(bd,aa,B)}else{if(aa===k){aa=q;P(bd,aa)}}}}an(false);return null}function ba(){X=0;a3=0;U=0;a1=0;aZ=0;H=1;S();an(false)}function L(bc){var bd=bc.originalEvent?bc.originalEvent:bc;if(au.triggerOnTouchLeave){aa=aC(h);P(bd,aa)}}function aK(){aR.unbind(K,aN);aR.unbind(aD,ba);aR.unbind(ax,a4);aR.unbind(V,M);if(T){aR.unbind(T,L)}an(false)}function aC(bg){var bf=bg;var be=aA();var bd=am();var bc=bb();if(!be||bc){bf=q}else{if(bd&&bg==k&&(!au.triggerOnTouchEnd||au.triggerOnTouchLeave)){bf=h}else{if(!bd&&bg==h&&au.triggerOnTouchLeave){bf=q}}}return bf}function P(be,bc){var bd,bf=be.touches;if(J()||W()){bd=aF(be,bc,l)}if((Q()||aX())&&bd!==false){bd=aF(be,bc,t)}if(aG()&&bd!==false){bd=aF(be,bc,j)}else{if(ao()&&bd!==false){bd=aF(be,bc,b)}else{if(ah()&&bd!==false){bd=aF(be,bc,B)}}}if(bc===q){if(W()){bd=aF(be,bc,l)}if(aX()){bd=aF(be,bc,t)}ba(be)}if(bc===h){if(bf){if(!bf.length){ba(be)}}else{ba(be)}}return bd}function aF(bf,bc,be){var bd;if(be==l){aR.trigger("swipeStatus",[bc,aP||null,ag||0,ac||0,X,aQ,a2]);if(au.swipeStatus){bd=au.swipeStatus.call(aR,bf,bc,aP||null,ag||0,ac||0,X,aQ,a2);if(bd===false){return false}}if(bc==h&&aV()){clearTimeout(aW);clearTimeout(af);aR.trigger("swipe",[aP,ag,ac,X,aQ,a2]);if(au.swipe){bd=au.swipe.call(aR,bf,aP,ag,ac,X,aQ,a2);if(bd===false){return false}}switch(aP){case p:aR.trigger("swipeLeft",[aP,ag,ac,X,aQ,a2]);if(au.swipeLeft){bd=au.swipeLeft.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case o:aR.trigger("swipeRight",[aP,ag,ac,X,aQ,a2]);if(au.swipeRight){bd=au.swipeRight.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case e:aR.trigger("swipeUp",[aP,ag,ac,X,aQ,a2]);if(au.swipeUp){bd=au.swipeUp.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case x:aR.trigger("swipeDown",[aP,ag,ac,X,aQ,a2]);if(au.swipeDown){bd=au.swipeDown.call(aR,bf,aP,ag,ac,X,aQ,a2)}break}}}if(be==t){aR.trigger("pinchStatus",[bc,aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchStatus){bd=au.pinchStatus.call(aR,bf,bc,aJ||null,ap||0,ac||0,X,H,aQ);if(bd===false){return false}}if(bc==h&&a9()){switch(aJ){case c:aR.trigger("pinchIn",[aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchIn){bd=au.pinchIn.call(aR,bf,aJ||null,ap||0,ac||0,X,H,aQ)}break;case A:aR.trigger("pinchOut",[aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchOut){bd=au.pinchOut.call(aR,bf,aJ||null,ap||0,ac||0,X,H,aQ)}break}}}if(be==B){if(bc===q||bc===h){clearTimeout(aW);clearTimeout(af);if(Z()&&!I()){O=ar();aW=setTimeout(f.proxy(function(){O=null;aR.trigger("tap",[bf.target]);if(au.tap){bd=au.tap.call(aR,bf,bf.target)}},this),au.doubleTapThreshold)}else{O=null;aR.trigger("tap",[bf.target]);if(au.tap){bd=au.tap.call(aR,bf,bf.target)}}}}else{if(be==j){if(bc===q||bc===h){clearTimeout(aW);clearTimeout(af);O=null;aR.trigger("doubletap",[bf.target]);if(au.doubleTap){bd=au.doubleTap.call(aR,bf,bf.target)}}}else{if(be==b){if(bc===q||bc===h){clearTimeout(aW);O=null;aR.trigger("longtap",[bf.target]);if(au.longTap){bd=au.longTap.call(aR,bf,bf.target)}}}}}return bd}function am(){var bc=true;if(au.threshold!==null){bc=ag>=au.threshold}return bc}function bb(){var bc=false;if(au.cancelThreshold!==null&&aP!==null){bc=(aT(aP)-ag)>=au.cancelThreshold}return bc}function ae(){if(au.pinchThreshold!==null){return ap>=au.pinchThreshold}return true}function aA(){var bc;if(au.maxTimeThreshold){if(ac>=au.maxTimeThreshold){bc=false}else{bc=true}}else{bc=true}return bc}function ak(bc,bd){if(au.preventDefaultEvents===false){return}if(au.allowPageScroll===m){bc.preventDefault()}else{var be=au.allowPageScroll===s;switch(bd){case p:if((au.swipeLeft&&be)||(!be&&au.allowPageScroll!=E)){bc.preventDefault()}break;case o:if((au.swipeRight&&be)||(!be&&au.allowPageScroll!=E)){bc.preventDefault()}break;case e:if((au.swipeUp&&be)||(!be&&au.allowPageScroll!=u)){bc.preventDefault()}break;case x:if((au.swipeDown&&be)||(!be&&au.allowPageScroll!=u)){bc.preventDefault()}break}}}function a9(){var bd=aO();var bc=Y();var be=ae();return bd&&bc&&be}function aX(){return !!(au.pinchStatus||au.pinchIn||au.pinchOut)}function Q(){return !!(a9()&&aX())}function aV(){var bf=aA();var bh=am();var be=aO();var bc=Y();var bd=bb();var bg=!bd&&bc&&be&&bh&&bf;return bg}function W(){return !!(au.swipe||au.swipeStatus||au.swipeLeft||au.swipeRight||au.swipeUp||au.swipeDown)}function J(){return !!(aV()&&W())}function aO(){return((X===au.fingers||au.fingers===i)||!a)}function Y(){return aQ[0].end.x!==0}function a7(){return !!(au.tap)}function Z(){return !!(au.doubleTap)}function aU(){return !!(au.longTap)}function R(){if(O==null){return false}var bc=ar();return(Z()&&((bc-O)<=au.doubleTapThreshold))}function I(){return R()}function aw(){return((X===1||!a)&&(isNaN(ag)||ag<au.threshold))}function a0(){return((ac>au.longTapThreshold)&&(ag<r))}function ah(){return !!(aw()&&a7())}function aG(){return !!(R()&&Z())}function ao(){return !!(a0()&&aU())}function G(bc){a6=ar();ay=bc.touches.length+1}function S(){a6=0;ay=0}function al(){var bc=false;if(a6){var bd=ar()-a6;if(bd<=au.fingerReleaseThreshold){bc=true}}return bc}function aB(){return !!(aR.data(C+"_intouch")===true)}function an(bc){if(!aR){return}if(bc===true){aR.bind(ax,a4);aR.bind(V,M);if(T){aR.bind(T,L)}}else{aR.unbind(ax,a4,false);aR.unbind(V,M,false);if(T){aR.unbind(T,L,false)}}aR.data(C+"_intouch",bc===true)}function ai(be,bc){var bd={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};bd.start.x=bd.last.x=bd.end.x=bc.pageX||bc.clientX;bd.start.y=bd.last.y=bd.end.y=bc.pageY||bc.clientY;aQ[be]=bd;return bd}function aH(bc){var be=bc.identifier!==undefined?bc.identifier:0;var bd=ad(be);if(bd===null){bd=ai(be,bc)}bd.last.x=bd.end.x;bd.last.y=bd.end.y;bd.end.x=bc.pageX||bc.clientX;bd.end.y=bc.pageY||bc.clientY;return bd}function ad(bc){return aQ[bc]||null}function aI(bc,bd){bd=Math.max(bd,aT(bc));N[bc].distance=bd}function aT(bc){if(N[bc]){return N[bc].distance}return undefined}function ab(){var bc={};bc[p]=av(p);bc[o]=av(o);bc[e]=av(e);bc[x]=av(x);return bc}function av(bc){return{direction:bc,distance:0}}function aM(){return a3-U}function at(bf,be){var bd=Math.abs(bf.x-be.x);var bc=Math.abs(bf.y-be.y);return Math.round(Math.sqrt(bd*bd+bc*bc))}function a8(bc,bd){var be=(bd/bc)*1;return be.toFixed(2)}function aq(){if(H<1){return A}else{return c}}function aS(bd,bc){return Math.round(Math.sqrt(Math.pow(bc.x-bd.x,2)+Math.pow(bc.y-bd.y,2)))}function aE(bf,bd){var bc=bf.x-bd.x;var bh=bd.y-bf.y;var be=Math.atan2(bh,bc);var bg=Math.round(be*180/Math.PI);if(bg<0){bg=360-Math.abs(bg)}return bg}function aL(bd,bc){var be=aE(bd,bc);if((be<=45)&&(be>=0)){return p}else{if((be<=360)&&(be>=315)){return p}else{if((be>=135)&&(be<=225)){return o}else{if((be>45)&&(be<135)){return x}else{return e}}}}}function ar(){var bc=new Date();return bc.getTime()}function aY(bc){bc=f(bc);var be=bc.offset();var bd={left:be.left,right:be.left+bc.outerWidth(),top:be.top,bottom:be.top+bc.outerHeight()};return bd}function F(bc,bd){return(bc.x>bd.left&&bc.x<bd.right&&bc.y>bd.top&&bc.y<bd.bottom)}}}));
js/nomin/jquery.highlight.js ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Highlight plugin
3
+ *
4
+ * Based on highlight v3 by Johann Burkard
5
+ * http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html
6
+ *
7
+ * Code a little bit refactored and cleaned (in my humble opinion).
8
+ * Most important changes:
9
+ * - has an option to highlight only entire words (wordsOnly - false by default),
10
+ * - has an option to be case sensitive (caseSensitive - false by default)
11
+ * - highlight element tag and class names can be specified in options
12
+ *
13
+ * Usage:
14
+ * // wrap every occurrance of text 'lorem' in content
15
+ * // with <span class='highlight'> (default options)
16
+ * $('#content').highlight('lorem');
17
+ *
18
+ * // search for and highlight more terms at once
19
+ * // so you can save some time on traversing DOM
20
+ * $('#content').highlight(['lorem', 'ipsum']);
21
+ * $('#content').highlight('lorem ipsum');
22
+ *
23
+ * // search only for entire word 'lorem'
24
+ * $('#content').highlight('lorem', { wordsOnly: true });
25
+ *
26
+ * // don't ignore case during search of term 'lorem'
27
+ * $('#content').highlight('lorem', { caseSensitive: true });
28
+ *
29
+ * // wrap every occurrance of term 'ipsum' in content
30
+ * // with <em class='important'>
31
+ * $('#content').highlight('ipsum', { element: 'em', className: 'important' });
32
+ *
33
+ * // remove default highlight
34
+ * $('#content').unhighlight();
35
+ *
36
+ * // remove custom highlight
37
+ * $('#content').unhighlight({ element: 'em', className: 'important' });
38
+ *
39
+ *
40
+ * Copyright (c) 2009 Bartek Szopka
41
+ *
42
+ * Licensed under MIT license.
43
+ *
44
+ */
45
+ jQuery.extend({
46
+ highlight: function (node, re, nodeName, className) {
47
+ if (node.nodeType === 3) {
48
+ var match = node.data.match(re);
49
+ if (match) {
50
+ var highlight = document.createElement(nodeName || 'span');
51
+ highlight.className = className || 'highlight';
52
+ var wordNode = node.splitText(match.index);
53
+ wordNode.splitText(match[0].length);
54
+ var wordClone = wordNode.cloneNode(true);
55
+ highlight.appendChild(wordClone);
56
+ wordNode.parentNode.replaceChild(highlight, wordNode);
57
+ return 1; //skip added node in parent
58
+ }
59
+ } else if ((node.nodeType === 1 && node.childNodes) && // only element nodes that have children
60
+ !/(script|style)/i.test(node.tagName) && // ignore script and style nodes
61
+ !(node.tagName === nodeName.toUpperCase() && node.className === className)) { // skip if already highlighted
62
+ for (var i = 0; i < node.childNodes.length; i++) {
63
+ i += jQuery.highlight(node.childNodes[i], re, nodeName, className);
64
+ }
65
+ }
66
+ return 0;
67
+ }
68
+ });
69
+
70
+ jQuery.fn.unhighlight = function (options) {
71
+ var settings = { className: 'highlight', element: 'span' };
72
+ jQuery.extend(settings, options);
73
+
74
+ return this.find(settings.element + "." + settings.className).each(function () {
75
+ var parent = this.parentNode;
76
+ parent.replaceChild(this.firstChild, this);
77
+ parent.normalize();
78
+ }).end();
79
+ };
80
+
81
+ jQuery.fn.highlight = function (words, options) {
82
+ var settings = { className: 'highlight', element: 'span', caseSensitive: false, wordsOnly: false };
83
+ jQuery.extend(settings, options);
84
+
85
+ if (words.constructor === String) {
86
+ words = [words];
87
+ }
88
+ words = jQuery.grep(words, function(word, i){
89
+ return word != '';
90
+ });
91
+ words = jQuery.map(words, function(word, i) {
92
+ return word.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
93
+ });
94
+ if (words.length == 0) { return this; };
95
+
96
+ var flag = settings.caseSensitive ? "" : "i";
97
+ var pattern = "(" + words.join("|") + ")";
98
+ if (settings.wordsOnly) {
99
+ pattern = "\\b" + pattern + "\\b";
100
+ }
101
+ var re = new RegExp(pattern, flag);
102
+
103
+ return this.each(function () {
104
+ jQuery.highlight(this, re, settings.element, settings.className);
105
+ });
106
+ };
js/nomin/jquery.mCustomScrollbar.js ADDED
@@ -0,0 +1,946 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ == malihu jquery custom scrollbars plugin ==
3
+ version: 2.8.2
4
+ author: malihu (http://manos.malihu.gr)
5
+ plugin home: http://manos.malihu.gr/jquery-custom-content-scroller
6
+ */
7
+
8
+ /*
9
+ Copyright 2010-2013 Manos Malihutsakis
10
+
11
+ This program is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU Lesser General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ This program is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU Lesser General Public License for more details.
20
+
21
+ You should have received a copy of the GNU Lesser General Public License
22
+ along with this program. If not, see http://www.gnu.org/licenses/lgpl.html.
23
+ */
24
+ (function($){
25
+ /*plugin script*/
26
+ var methods={
27
+ init:function(options){
28
+ var defaults={
29
+ set_width:false, /*optional element width: boolean, pixels, percentage*/
30
+ set_height:false, /*optional element height: boolean, pixels, percentage*/
31
+ horizontalScroll:false, /*scroll horizontally: boolean*/
32
+ scrollInertia:950, /*scrolling inertia: integer (milliseconds)*/
33
+ mouseWheel:true, /*mousewheel support: boolean*/
34
+ mouseWheelPixels:"auto", /*mousewheel pixels amount: integer, "auto"*/
35
+ autoDraggerLength:true, /*auto-adjust scrollbar dragger length: boolean*/
36
+ autoHideScrollbar:false, /*auto-hide scrollbar when idle*/
37
+ snapAmount:null, /* optional element always snaps to a multiple of this number in pixels */
38
+ snapOffset:0, /* when snapping, snap with this number in pixels as an offset */
39
+ scrollButtons:{ /*scroll buttons*/
40
+ enable:false, /*scroll buttons support: boolean*/
41
+ scrollType:"continuous", /*scroll buttons scrolling type: "continuous", "pixels"*/
42
+ scrollSpeed:"auto", /*scroll buttons continuous scrolling speed: integer, "auto"*/
43
+ scrollAmount:40 /*scroll buttons pixels scroll amount: integer (pixels)*/
44
+ },
45
+ advanced:{
46
+ updateOnBrowserResize:true, /*update scrollbars on browser resize (for layouts based on percentages): boolean*/
47
+ updateOnContentResize:false, /*auto-update scrollbars on content resize (for dynamic content): boolean*/
48
+ autoExpandHorizontalScroll:false, /*auto-expand width for horizontal scrolling: boolean*/
49
+ autoScrollOnFocus:true, /*auto-scroll on focused elements: boolean*/
50
+ normalizeMouseWheelDelta:false /*normalize mouse-wheel delta (-1/1)*/
51
+ },
52
+ contentTouchScroll:true, /*scrolling by touch-swipe content: boolean*/
53
+ callbacks:{
54
+ onScrollStart:function(){}, /*user custom callback function on scroll start event*/
55
+ onScroll:function(){}, /*user custom callback function on scroll event*/
56
+ onTotalScroll:function(){}, /*user custom callback function on scroll end reached event*/
57
+ onTotalScrollBack:function(){}, /*user custom callback function on scroll begin reached event*/
58
+ onTotalScrollOffset:0, /*scroll end reached offset: integer (pixels)*/
59
+ onTotalScrollBackOffset:0, /*scroll begin reached offset: integer (pixels)*/
60
+ whileScrolling:function(){} /*user custom callback function on scrolling event*/
61
+ },
62
+ theme:"light" /*"light", "dark", "light-2", "dark-2", "light-thick", "dark-thick", "light-thin", "dark-thin"*/
63
+ },
64
+ options=$.extend(true,defaults,options);
65
+ return this.each(function(){
66
+ var $this=$(this);
67
+ /*set element width/height, create markup for custom scrollbars, add classes*/
68
+ if(options.set_width){
69
+ $this.css("width",options.set_width);
70
+ }
71
+ if(options.set_height){
72
+ $this.css("height",options.set_height);
73
+ }
74
+ if(!$(document).data("mCustomScrollbar-index")){
75
+ $(document).data("mCustomScrollbar-index","1");
76
+ }else{
77
+ var mCustomScrollbarIndex=parseInt($(document).data("mCustomScrollbar-index"));
78
+ $(document).data("mCustomScrollbar-index",mCustomScrollbarIndex+1);
79
+ }
80
+ $this.wrapInner("<div class='mCustomScrollBox"+" mCS-"+options.theme+"' id='mCSB_"+$(document).data("mCustomScrollbar-index")+"' style='position:relative; height:100%; overflow:hidden; max-width:100%;' />").addClass("mCustomScrollbar _mCS_"+$(document).data("mCustomScrollbar-index"));
81
+ var mCustomScrollBox=$this.children(".mCustomScrollBox");
82
+ if(options.horizontalScroll){
83
+ mCustomScrollBox.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />");
84
+ var mCSB_h_wrapper=mCustomScrollBox.children(".mCSB_h_wrapper");
85
+ mCSB_h_wrapper.wrapInner("<div class='mCSB_container' style='position:absolute; left:0;' />").children(".mCSB_container").css({"width":mCSB_h_wrapper.children().outerWidth(),"position":"relative"}).unwrap();
86
+ }else{
87
+ mCustomScrollBox.wrapInner("<div class='mCSB_container' style='position:relative; top:0;' />");
88
+ }
89
+ var mCSB_container=mCustomScrollBox.children(".mCSB_container");
90
+ if($.support.touch){
91
+ mCSB_container.addClass("mCS_touch");
92
+ }
93
+ mCSB_container.after("<div class='mCSB_scrollTools' style='position:absolute;'><div class='mCSB_draggerContainer'><div class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' style='position:relative;'></div></div><div class='mCSB_draggerRail'></div></div></div>");
94
+ var mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
95
+ mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),
96
+ mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger");
97
+ if(options.horizontalScroll){
98
+ mCSB_dragger.data("minDraggerWidth",mCSB_dragger.width());
99
+ }else{
100
+ mCSB_dragger.data("minDraggerHeight",mCSB_dragger.height());
101
+ }
102
+ if(options.scrollButtons.enable){
103
+ if(options.horizontalScroll){
104
+ mCSB_scrollTools.prepend("<a class='mCSB_buttonLeft' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonRight' oncontextmenu='return false;'></a>");
105
+ }else{
106
+ mCSB_scrollTools.prepend("<a class='mCSB_buttonUp' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonDown' oncontextmenu='return false;'></a>");
107
+ }
108
+ }
109
+ /*mCustomScrollBox scrollTop and scrollLeft is always 0 to prevent browser focus scrolling*/
110
+ mCustomScrollBox.bind("scroll",function(){
111
+ if(!$this.is(".mCS_disabled")){ /*native focus scrolling for disabled scrollbars*/
112
+ mCustomScrollBox.scrollTop(0).scrollLeft(0);
113
+ }
114
+ });
115
+ /*store options, global vars/states, intervals*/
116
+ $this.data({
117
+ /*init state*/
118
+ "mCS_Init":true,
119
+ /*instance index*/
120
+ "mCustomScrollbarIndex":$(document).data("mCustomScrollbar-index"),
121
+ /*option parameters*/
122
+ "horizontalScroll":options.horizontalScroll,
123
+ "scrollInertia":options.scrollInertia,
124
+ "scrollEasing":"mcsEaseOut",
125
+ "mouseWheel":options.mouseWheel,
126
+ "mouseWheelPixels":options.mouseWheelPixels,
127
+ "autoDraggerLength":options.autoDraggerLength,
128
+ "autoHideScrollbar":options.autoHideScrollbar,
129
+ "snapAmount":options.snapAmount,
130
+ "snapOffset":options.snapOffset,
131
+ "scrollButtons_enable":options.scrollButtons.enable,
132
+ "scrollButtons_scrollType":options.scrollButtons.scrollType,
133
+ "scrollButtons_scrollSpeed":options.scrollButtons.scrollSpeed,
134
+ "scrollButtons_scrollAmount":options.scrollButtons.scrollAmount,
135
+ "autoExpandHorizontalScroll":options.advanced.autoExpandHorizontalScroll,
136
+ "autoScrollOnFocus":options.advanced.autoScrollOnFocus,
137
+ "normalizeMouseWheelDelta":options.advanced.normalizeMouseWheelDelta,
138
+ "contentTouchScroll":options.contentTouchScroll,
139
+ "onScrollStart_Callback":options.callbacks.onScrollStart,
140
+ "onScroll_Callback":options.callbacks.onScroll,
141
+ "onTotalScroll_Callback":options.callbacks.onTotalScroll,
142
+ "onTotalScrollBack_Callback":options.callbacks.onTotalScrollBack,
143
+ "onTotalScroll_Offset":options.callbacks.onTotalScrollOffset,
144
+ "onTotalScrollBack_Offset":options.callbacks.onTotalScrollBackOffset,
145
+ "whileScrolling_Callback":options.callbacks.whileScrolling,
146
+ /*events binding state*/
147
+ "bindEvent_scrollbar_drag":false,
148
+ "bindEvent_content_touch":false,
149
+ "bindEvent_scrollbar_click":false,
150
+ "bindEvent_mousewheel":false,
151
+ "bindEvent_buttonsContinuous_y":false,
152
+ "bindEvent_buttonsContinuous_x":false,
153
+ "bindEvent_buttonsPixels_y":false,
154
+ "bindEvent_buttonsPixels_x":false,
155
+ "bindEvent_focusin":false,
156
+ "bindEvent_autoHideScrollbar":false,
157
+ /*buttons intervals*/
158
+ "mCSB_buttonScrollRight":false,
159
+ "mCSB_buttonScrollLeft":false,
160
+ "mCSB_buttonScrollDown":false,
161
+ "mCSB_buttonScrollUp":false
162
+ });
163
+ /*max-width/max-height*/
164
+ if(options.horizontalScroll){
165
+ if($this.css("max-width")!=="none"){
166
+ if(!options.advanced.updateOnContentResize){ /*needs updateOnContentResize*/
167
+ options.advanced.updateOnContentResize=true;
168
+ }
169
+ }
170
+ }else{
171
+ if($this.css("max-height")!=="none"){
172
+ var percentage=false,maxHeight=parseInt($this.css("max-height"));
173
+ if($this.css("max-height").indexOf("%")>=0){
174
+ percentage=maxHeight,
175
+ maxHeight=$this.parent().height()*percentage/100;
176
+ }
177
+ $this.css("overflow","hidden");
178
+ mCustomScrollBox.css("max-height",maxHeight);
179
+ }
180
+ }
181
+ $this.mCustomScrollbar("update");
182
+ /*window resize fn (for layouts based on percentages)*/
183
+ if(options.advanced.updateOnBrowserResize){
184
+ var mCSB_resizeTimeout,currWinWidth=$(window).width(),currWinHeight=$(window).height();
185
+ $(window).bind("resize."+$this.data("mCustomScrollbarIndex"),function(){
186
+ if(mCSB_resizeTimeout){
187
+ clearTimeout(mCSB_resizeTimeout);
188
+ }
189
+ mCSB_resizeTimeout=setTimeout(function(){
190
+ if(!$this.is(".mCS_disabled") && !$this.is(".mCS_destroyed")){
191
+ var winWidth=$(window).width(),winHeight=$(window).height();
192
+ if(currWinWidth!==winWidth || currWinHeight!==winHeight){ /*ie8 fix*/
193
+ if($this.css("max-height")!=="none" && percentage){
194
+ mCustomScrollBox.css("max-height",$this.parent().height()*percentage/100);
195
+ }
196
+ $this.mCustomScrollbar("update");
197
+ currWinWidth=winWidth; currWinHeight=winHeight;
198
+ }
199
+ }
200
+ },150);
201
+ });
202
+ }
203
+ /*content resize fn (for dynamically generated content)*/
204
+ if(options.advanced.updateOnContentResize){
205
+ var mCSB_onContentResize;
206
+ if(options.horizontalScroll){
207
+ var mCSB_containerOldSize=mCSB_container.outerWidth();
208
+ }else{
209
+ var mCSB_containerOldSize=mCSB_container.outerHeight();
210
+ }
211
+ mCSB_onContentResize=setInterval(function(){
212
+ if(options.horizontalScroll){
213
+ if(options.advanced.autoExpandHorizontalScroll){
214
+ mCSB_container.css({"position":"absolute","width":"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({"width":mCSB_container.outerWidth(),"position":"relative"}).unwrap();
215
+ }
216
+ var mCSB_containerNewSize=mCSB_container.outerWidth();
217
+ }else{
218
+ var mCSB_containerNewSize=mCSB_container.outerHeight();
219
+ }
220
+ if(mCSB_containerNewSize!=mCSB_containerOldSize){
221
+ $this.mCustomScrollbar("update");
222
+ mCSB_containerOldSize=mCSB_containerNewSize;
223
+ }
224
+ },300);
225
+ }
226
+ });
227
+ },
228
+ update:function(){
229
+ var $this=$(this),
230
+ mCustomScrollBox=$this.children(".mCustomScrollBox"),
231
+ mCSB_container=mCustomScrollBox.children(".mCSB_container");
232
+ mCSB_container.removeClass("mCS_no_scrollbar");
233
+ $this.removeClass("mCS_disabled mCS_destroyed");
234
+ mCustomScrollBox.scrollTop(0).scrollLeft(0); /*reset scrollTop/scrollLeft to prevent browser focus scrolling*/
235
+ var mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
236
+ mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),
237
+ mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger");
238
+ if($this.data("horizontalScroll")){
239
+ var mCSB_buttonLeft=mCSB_scrollTools.children(".mCSB_buttonLeft"),
240
+ mCSB_buttonRight=mCSB_scrollTools.children(".mCSB_buttonRight"),
241
+ mCustomScrollBoxW=mCustomScrollBox.width();
242
+ if($this.data("autoExpandHorizontalScroll")){
243
+ mCSB_container.css({"position":"absolute","width":"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({"width":mCSB_container.outerWidth(),"position":"relative"}).unwrap();
244
+ }
245
+ var mCSB_containerW=mCSB_container.outerWidth();
246
+ }else{
247
+ var mCSB_buttonUp=mCSB_scrollTools.children(".mCSB_buttonUp"),
248
+ mCSB_buttonDown=mCSB_scrollTools.children(".mCSB_buttonDown"),
249
+ mCustomScrollBoxH=mCustomScrollBox.height(),
250
+ mCSB_containerH=mCSB_container.outerHeight();
251
+ }
252
+ if(mCSB_containerH>mCustomScrollBoxH && !$this.data("horizontalScroll")){ /*content needs vertical scrolling*/
253
+ mCSB_scrollTools.css("display","block");
254
+ var mCSB_draggerContainerH=mCSB_draggerContainer.height();
255
+ /*auto adjust scrollbar dragger length analogous to content*/
256
+ if($this.data("autoDraggerLength")){
257
+ var draggerH=Math.round(mCustomScrollBoxH/mCSB_containerH*mCSB_draggerContainerH),
258
+ minDraggerH=mCSB_dragger.data("minDraggerHeight");
259
+ if(draggerH<=minDraggerH){ /*min dragger height*/
260
+ mCSB_dragger.css({"height":minDraggerH});
261
+ }else if(draggerH>=mCSB_draggerContainerH-10){ /*max dragger height*/
262
+ var mCSB_draggerContainerMaxH=mCSB_draggerContainerH-10;
263
+ mCSB_dragger.css({"height":mCSB_draggerContainerMaxH});
264
+ }else{
265
+ mCSB_dragger.css({"height":draggerH});
266
+ }
267
+ mCSB_dragger.children(".mCSB_dragger_bar").css({"line-height":mCSB_dragger.height()+"px"});
268
+ }
269
+ var mCSB_draggerH=mCSB_dragger.height(),
270
+ /*calculate and store scroll amount, add scrolling*/
271
+ scrollAmount=(mCSB_containerH-mCustomScrollBoxH)/(mCSB_draggerContainerH-mCSB_draggerH);
272
+ $this.data("scrollAmount",scrollAmount).mCustomScrollbar("scrolling",mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight);
273
+ /*scroll*/
274
+ var mCSB_containerP=Math.abs(mCSB_container.position().top);
275
+ $this.mCustomScrollbar("scrollTo",mCSB_containerP,{scrollInertia:0,trigger:"internal"});
276
+ }else if(mCSB_containerW>mCustomScrollBoxW && $this.data("horizontalScroll")){ /*content needs horizontal scrolling*/
277
+ mCSB_scrollTools.css("display","block");
278
+ var mCSB_draggerContainerW=mCSB_draggerContainer.width();
279
+ /*auto adjust scrollbar dragger length analogous to content*/
280
+ if($this.data("autoDraggerLength")){
281
+ var draggerW=Math.round(mCustomScrollBoxW/mCSB_containerW*mCSB_draggerContainerW),
282
+ minDraggerW=mCSB_dragger.data("minDraggerWidth");
283
+ if(draggerW<=minDraggerW){ /*min dragger height*/
284
+ mCSB_dragger.css({"width":minDraggerW});
285
+ }else if(draggerW>=mCSB_draggerContainerW-10){ /*max dragger height*/
286
+ var mCSB_draggerContainerMaxW=mCSB_draggerContainerW-10;
287
+ mCSB_dragger.css({"width":mCSB_draggerContainerMaxW});
288
+ }else{
289
+ mCSB_dragger.css({"width":draggerW});
290
+ }
291
+ }
292
+ var mCSB_draggerW=mCSB_dragger.width(),
293
+ /*calculate and store scroll amount, add scrolling*/
294
+ scrollAmount=(mCSB_containerW-mCustomScrollBoxW)/(mCSB_draggerContainerW-mCSB_draggerW);
295
+ $this.data("scrollAmount",scrollAmount).mCustomScrollbar("scrolling",mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight);
296
+ /*scroll*/
297
+ var mCSB_containerP=Math.abs(mCSB_container.position().left);
298
+ $this.mCustomScrollbar("scrollTo",mCSB_containerP,{scrollInertia:0,trigger:"internal"});
299
+ }else{ /*content does not need scrolling*/
300
+ /*unbind events, reset content position, hide scrollbars, remove classes*/
301
+ mCustomScrollBox.unbind("mousewheel focusin");
302
+ if($this.data("horizontalScroll")){
303
+ mCSB_dragger.add(mCSB_container).css("left",0);
304
+ }else{
305
+ mCSB_dragger.add(mCSB_container).css("top",0);
306
+ }
307
+ mCSB_scrollTools.css("display","none");
308
+ mCSB_container.addClass("mCS_no_scrollbar");
309
+ $this.data({"bindEvent_mousewheel":false,"bindEvent_focusin":false});
310
+ }
311
+ },
312
+ scrolling:function(mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight){
313
+ var $this=$(this);
314
+ /*scrollbar drag scrolling*/
315
+ if(!$this.data("bindEvent_scrollbar_drag")){
316
+ var mCSB_draggerDragY,mCSB_draggerDragX;
317
+ if($.support.msPointer){ /*MSPointer*/
318
+ mCSB_dragger.bind("MSPointerDown",function(e){
319
+ e.preventDefault();
320
+ $this.data({"on_drag":true}); mCSB_dragger.addClass("mCSB_dragger_onDrag");
321
+ var elem=$(this),
322
+ elemOffset=elem.offset(),
323
+ x=e.originalEvent.pageX-elemOffset.left,
324
+ y=e.originalEvent.pageY-elemOffset.top;
325
+ if(x<elem.width() && x>0 && y<elem.height() && y>0){
326
+ mCSB_draggerDragY=y;
327
+ mCSB_draggerDragX=x;
328
+ }
329
+ });
330
+ $(document).bind("MSPointerMove."+$this.data("mCustomScrollbarIndex"),function(e){
331
+ e.preventDefault();
332
+ if($this.data("on_drag")){
333
+ var elem=mCSB_dragger,
334
+ elemOffset=elem.offset(),
335
+ x=e.originalEvent.pageX-elemOffset.left,
336
+ y=e.originalEvent.pageY-elemOffset.top;
337
+ scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);
338
+ }
339
+ }).bind("MSPointerUp."+$this.data("mCustomScrollbarIndex"),function(e){
340
+ $this.data({"on_drag":false}); mCSB_dragger.removeClass("mCSB_dragger_onDrag");
341
+ });
342
+ }else{ /*mouse/touch*/
343
+ mCSB_dragger.bind("mousedown touchstart",function(e){
344
+ e.preventDefault(); e.stopImmediatePropagation();
345
+ var elem=$(this),elemOffset=elem.offset(),x,y;
346
+ if(e.type==="touchstart"){
347
+ var touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
348
+ x=touch.pageX-elemOffset.left; y=touch.pageY-elemOffset.top;
349
+ }else{
350
+ $this.data({"on_drag":true}); mCSB_dragger.addClass("mCSB_dragger_onDrag");
351
+ x=e.pageX-elemOffset.left; y=e.pageY-elemOffset.top;
352
+ }
353
+ if(x<elem.width() && x>0 && y<elem.height() && y>0){
354
+ mCSB_draggerDragY=y; mCSB_draggerDragX=x;
355
+ }
356
+ }).bind("touchmove",function(e){
357
+ e.preventDefault(); e.stopImmediatePropagation();
358
+ var touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0],
359
+ elem=$(this),
360
+ elemOffset=elem.offset(),
361
+ x=touch.pageX-elemOffset.left,
362
+ y=touch.pageY-elemOffset.top;
363
+ scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);
364
+ });
365
+ $(document).bind("mousemove."+$this.data("mCustomScrollbarIndex"),function(e){
366
+ if($this.data("on_drag")){
367
+ var elem=mCSB_dragger,
368
+ elemOffset=elem.offset(),
369
+ x=e.pageX-elemOffset.left,
370
+ y=e.pageY-elemOffset.top;
371
+ scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);
372
+ }
373
+ }).bind("mouseup."+$this.data("mCustomScrollbarIndex"),function(e){
374
+ $this.data({"on_drag":false}); mCSB_dragger.removeClass("mCSB_dragger_onDrag");
375
+ });
376
+ }
377
+ $this.data({"bindEvent_scrollbar_drag":true});
378
+ }
379
+ function scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x){
380
+ if($this.data("horizontalScroll")){
381
+ $this.mCustomScrollbar("scrollTo",(mCSB_dragger.position().left-(mCSB_draggerDragX))+x,{moveDragger:true,trigger:"internal"});
382
+ }else{
383
+ $this.mCustomScrollbar("scrollTo",(mCSB_dragger.position().top-(mCSB_draggerDragY))+y,{moveDragger:true,trigger:"internal"});
384
+ }
385
+ }
386
+ /*content touch-drag*/
387
+ if($.support.touch && $this.data("contentTouchScroll")){
388
+ if(!$this.data("bindEvent_content_touch")){
389
+ var touch,
390
+ elem,elemOffset,y,x,mCSB_containerTouchY,mCSB_containerTouchX;
391
+ mCSB_container.bind("touchstart",function(e){
392
+ e.stopImmediatePropagation();
393
+ touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
394
+ elem=$(this);
395
+ elemOffset=elem.offset();
396
+ x=touch.pageX-elemOffset.left;
397
+ y=touch.pageY-elemOffset.top;
398
+ mCSB_containerTouchY=y;
399
+ mCSB_containerTouchX=x;
400
+ });
401
+ mCSB_container.bind("touchmove",function(e){
402
+ e.preventDefault(); e.stopImmediatePropagation();
403
+ touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
404
+ elem=$(this).parent();
405
+ elemOffset=elem.offset();
406
+ x=touch.pageX-elemOffset.left;
407
+ y=touch.pageY-elemOffset.top;
408
+ if($this.data("horizontalScroll")){
409
+ $this.mCustomScrollbar("scrollTo",mCSB_containerTouchX-x,{trigger:"internal"});
410
+ }else{
411
+ $this.mCustomScrollbar("scrollTo",mCSB_containerTouchY-y,{trigger:"internal"});
412
+ }
413
+ });
414
+ }
415
+ }
416
+ /*dragger rail click scrolling*/
417
+ if(!$this.data("bindEvent_scrollbar_click")){
418
+ mCSB_draggerContainer.bind("click",function(e){
419
+ var scrollToPos=(e.pageY-mCSB_draggerContainer.offset().top)*$this.data("scrollAmount"),target=$(e.target);
420
+ if($this.data("horizontalScroll")){
421
+ scrollToPos=(e.pageX-mCSB_draggerContainer.offset().left)*$this.data("scrollAmount");
422
+ }
423
+ if(target.hasClass("mCSB_draggerContainer") || target.hasClass("mCSB_draggerRail")){
424
+ $this.mCustomScrollbar("scrollTo",scrollToPos,{trigger:"internal",scrollEasing:"draggerRailEase"});
425
+ }
426
+ });
427
+ $this.data({"bindEvent_scrollbar_click":true});
428
+ }
429
+ /*mousewheel scrolling*/
430
+ if($this.data("mouseWheel")){
431
+ if(!$this.data("bindEvent_mousewheel")){
432
+ mCustomScrollBox.bind("mousewheel",function(e,delta){
433
+ var scrollTo,mouseWheelPixels=$this.data("mouseWheelPixels"),absPos=Math.abs(mCSB_container.position().top),
434
+ draggerPos=mCSB_dragger.position().top,limit=mCSB_draggerContainer.height()-mCSB_dragger.height();
435
+ if($this.data("normalizeMouseWheelDelta")){
436
+ if(delta<0){delta=-1;}else{delta=1;}
437
+ }
438
+ if(mouseWheelPixels==="auto"){
439
+ mouseWheelPixels=100+Math.round($this.data("scrollAmount")/2);
440
+ }
441
+ if($this.data("horizontalScroll")){
442
+ draggerPos=mCSB_dragger.position().left;
443
+ limit=mCSB_draggerContainer.width()-mCSB_dragger.width();
444
+ absPos=Math.abs(mCSB_container.position().left);
445
+ }
446
+ if((delta>0 && draggerPos!==0) || (delta<0 && draggerPos!==limit)){e.preventDefault(); e.stopImmediatePropagation();}
447
+ scrollTo=absPos-(delta*mouseWheelPixels);
448
+ $this.mCustomScrollbar("scrollTo",scrollTo,{trigger:"internal"});
449
+ });
450
+ $this.data({"bindEvent_mousewheel":true});
451
+ }
452
+ }
453
+ /*buttons scrolling*/
454
+ if($this.data("scrollButtons_enable")){
455
+ if($this.data("scrollButtons_scrollType")==="pixels"){ /*scroll by pixels*/
456
+ if($this.data("horizontalScroll")){
457
+ mCSB_buttonRight.add(mCSB_buttonLeft).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",mCSB_buttonRight_stop,mCSB_buttonLeft_stop);
458
+ $this.data({"bindEvent_buttonsContinuous_x":false});
459
+ if(!$this.data("bindEvent_buttonsPixels_x")){
460
+ /*scroll right*/
461
+ mCSB_buttonRight.bind("click",function(e){
462
+ e.preventDefault();
463
+ PixelsScrollTo(Math.abs(mCSB_container.position().left)+$this.data("scrollButtons_scrollAmount"));
464
+ });
465
+ /*scroll left*/
466
+ mCSB_buttonLeft.bind("click",function(e){
467
+ e.preventDefault();
468
+ PixelsScrollTo(Math.abs(mCSB_container.position().left)-$this.data("scrollButtons_scrollAmount"));
469
+ });
470
+ $this.data({"bindEvent_buttonsPixels_x":true});
471
+ }
472
+ }else{
473
+ mCSB_buttonDown.add(mCSB_buttonUp).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",mCSB_buttonRight_stop,mCSB_buttonLeft_stop);
474
+ $this.data({"bindEvent_buttonsContinuous_y":false});
475
+ if(!$this.data("bindEvent_buttonsPixels_y")){
476
+ /*scroll down*/
477
+ mCSB_buttonDown.bind("click",function(e){
478
+ e.preventDefault();
479
+ PixelsScrollTo(Math.abs(mCSB_container.position().top)+$this.data("scrollButtons_scrollAmount"));
480
+ });
481
+ /*scroll up*/
482
+ mCSB_buttonUp.bind("click",function(e){
483
+ e.preventDefault();
484
+ PixelsScrollTo(Math.abs(mCSB_container.position().top)-$this.data("scrollButtons_scrollAmount"));
485
+ });
486
+ $this.data({"bindEvent_buttonsPixels_y":true});
487
+ }
488
+ }
489
+ function PixelsScrollTo(to){
490
+ if(!mCSB_dragger.data("preventAction")){
491
+ mCSB_dragger.data("preventAction",true);
492
+ $this.mCustomScrollbar("scrollTo",to,{trigger:"internal"});
493
+ }
494
+ }
495
+ }else{ /*continuous scrolling*/
496
+ if($this.data("horizontalScroll")){
497
+ mCSB_buttonRight.add(mCSB_buttonLeft).unbind("click");
498
+ $this.data({"bindEvent_buttonsPixels_x":false});
499
+ if(!$this.data("bindEvent_buttonsContinuous_x")){
500
+ /*scroll right*/
501
+ mCSB_buttonRight.bind("mousedown touchstart MSPointerDown",function(e){
502
+ e.preventDefault();
503
+ var scrollButtonsSpeed=ScrollButtonsSpeed();
504
+ $this.data({"mCSB_buttonScrollRight":setInterval(function(){
505
+ $this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().left)+scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
506
+ },17)});
507
+ });
508
+ var mCSB_buttonRight_stop=function(e){
509
+ e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollRight"));
510
+ }
511
+ mCSB_buttonRight.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",mCSB_buttonRight_stop);
512
+ /*scroll left*/
513
+ mCSB_buttonLeft.bind("mousedown touchstart MSPointerDown",function(e){
514
+ e.preventDefault();
515
+ var scrollButtonsSpeed=ScrollButtonsSpeed();
516
+ $this.data({"mCSB_buttonScrollLeft":setInterval(function(){
517
+ $this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().left)-scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
518
+ },17)});
519
+ });
520
+ var mCSB_buttonLeft_stop=function(e){
521
+ e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollLeft"));
522
+ }
523
+ mCSB_buttonLeft.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",mCSB_buttonLeft_stop);
524
+ $this.data({"bindEvent_buttonsContinuous_x":true});
525
+ }
526
+ }else{
527
+ mCSB_buttonDown.add(mCSB_buttonUp).unbind("click");
528
+ $this.data({"bindEvent_buttonsPixels_y":false});
529
+ if(!$this.data("bindEvent_buttonsContinuous_y")){
530
+ /*scroll down*/
531
+ mCSB_buttonDown.bind("mousedown touchstart MSPointerDown",function(e){
532
+ e.preventDefault();
533
+ var scrollButtonsSpeed=ScrollButtonsSpeed();
534
+ $this.data({"mCSB_buttonScrollDown":setInterval(function(){
535
+ $this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().top)+scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
536
+ },17)});
537
+ });
538
+ var mCSB_buttonDown_stop=function(e){
539
+ e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollDown"));
540
+ }
541
+ mCSB_buttonDown.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",mCSB_buttonDown_stop);
542
+ /*scroll up*/
543
+ mCSB_buttonUp.bind("mousedown touchstart MSPointerDown",function(e){
544
+ e.preventDefault();
545
+ var scrollButtonsSpeed=ScrollButtonsSpeed();
546
+ $this.data({"mCSB_buttonScrollUp":setInterval(function(){
547
+ $this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().top)-scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
548
+ },17)});
549
+ });
550
+ var mCSB_buttonUp_stop=function(e){
551
+ e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollUp"));
552
+ }
553
+ mCSB_buttonUp.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",mCSB_buttonUp_stop);
554
+ $this.data({"bindEvent_buttonsContinuous_y":true});
555
+ }
556
+ }
557
+ function ScrollButtonsSpeed(){
558
+ var speed=$this.data("scrollButtons_scrollSpeed");
559
+ if($this.data("scrollButtons_scrollSpeed")==="auto"){
560
+ speed=Math.round(($this.data("scrollInertia")+100)/40);
561
+ }
562
+ return speed;
563
+ }
564
+ }
565
+ }
566
+ /*scrolling on element focus (e.g. via TAB key)*/
567
+ if($this.data("autoScrollOnFocus")){
568
+ if(!$this.data("bindEvent_focusin")){
569
+ mCustomScrollBox.bind("focusin",function(){
570
+ mCustomScrollBox.scrollTop(0).scrollLeft(0);
571
+ var focusedElem=$(document.activeElement);
572
+ if(focusedElem.is("input,textarea,select,button,a[tabindex],area,object")){
573
+ var mCSB_containerPos=mCSB_container.position().top,
574
+ focusedElemPos=focusedElem.position().top,
575
+ visibleLimit=mCustomScrollBox.height()-focusedElem.outerHeight();
576
+ if($this.data("horizontalScroll")){
577
+ mCSB_containerPos=mCSB_container.position().left;
578
+ focusedElemPos=focusedElem.position().left;
579
+ visibleLimit=mCustomScrollBox.width()-focusedElem.outerWidth();
580
+ }
581
+ if(mCSB_containerPos+focusedElemPos<0 || mCSB_containerPos+focusedElemPos>visibleLimit){
582
+ $this.mCustomScrollbar("scrollTo",focusedElemPos,{trigger:"internal"});
583
+ }
584
+ }
585
+ });
586
+ $this.data({"bindEvent_focusin":true});
587
+ }
588
+ }
589
+ /*auto-hide scrollbar*/
590
+ if($this.data("autoHideScrollbar")){
591
+ if(!$this.data("bindEvent_autoHideScrollbar")){
592
+ mCustomScrollBox.bind("mouseenter",function(e){
593
+ mCustomScrollBox.addClass("mCS-mouse-over");
594
+ functions.showScrollbar.call(mCustomScrollBox.children(".mCSB_scrollTools"));
595
+ }).bind("mouseleave touchend",function(e){
596
+ mCustomScrollBox.removeClass("mCS-mouse-over");
597
+ if(e.type==="mouseleave"){functions.hideScrollbar.call(mCustomScrollBox.children(".mCSB_scrollTools"));}
598
+ });
599
+ $this.data({"bindEvent_autoHideScrollbar":true});
600
+ }
601
+ }
602
+ },
603
+ scrollTo:function(scrollTo,options){
604
+ var $this=$(this),
605
+ defaults={
606
+ moveDragger:false,
607
+ trigger:"external",
608
+ callbacks:true,
609
+ scrollInertia:$this.data("scrollInertia"),
610
+ scrollEasing:$this.data("scrollEasing")
611
+ },
612
+ options=$.extend(defaults,options),
613
+ draggerScrollTo,
614
+ mCustomScrollBox=$this.children(".mCustomScrollBox"),
615
+ mCSB_container=mCustomScrollBox.children(".mCSB_container"),
616
+ mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
617
+ mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),
618
+ mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger"),
619
+ contentSpeed=draggerSpeed=options.scrollInertia,
620
+ scrollBeginning,scrollBeginningOffset,totalScroll,totalScrollOffset;
621
+ if(!mCSB_container.hasClass("mCS_no_scrollbar")){
622
+ $this.data({"mCS_trigger":options.trigger});
623
+ if($this.data("mCS_Init")){options.callbacks=false;}
624
+ if(scrollTo || scrollTo===0){
625
+ if(typeof(scrollTo)==="number"){ /*if integer, scroll by number of pixels*/
626
+ if(options.moveDragger){ /*scroll dragger*/
627
+ draggerScrollTo=scrollTo;
628
+ if($this.data("horizontalScroll")){
629
+ scrollTo=mCSB_dragger.position().left*$this.data("scrollAmount");
630
+ }else{
631
+ scrollTo=mCSB_dragger.position().top*$this.data("scrollAmount");
632
+ }
633
+ draggerSpeed=0;
634
+ }else{ /*scroll content by default*/
635
+ draggerScrollTo=scrollTo/$this.data("scrollAmount");
636
+ }
637
+ }else if(typeof(scrollTo)==="string"){ /*if string, scroll by element position*/
638
+ var target;
639
+ if(scrollTo==="top"){ /*scroll to top*/
640
+ target=0;
641
+ }else if(scrollTo==="bottom" && !$this.data("horizontalScroll")){ /*scroll to bottom*/
642
+ target=mCSB_container.outerHeight()-mCustomScrollBox.height();
643
+ }else if(scrollTo==="left"){ /*scroll to left*/
644
+ target=0;
645
+ }else if(scrollTo==="right" && $this.data("horizontalScroll")){ /*scroll to right*/
646
+ target=mCSB_container.outerWidth()-mCustomScrollBox.width();
647
+ }else if(scrollTo==="first"){ /*scroll to first element position*/
648
+ target=$this.find(".mCSB_container").find(":first");
649
+ }else if(scrollTo==="last"){ /*scroll to last element position*/
650
+ target=$this.find(".mCSB_container").find(":last");
651
+ }else{ /*scroll to element position*/
652
+ target=$this.find(scrollTo);
653
+ }
654
+ if(target.length===1){ /*if such unique element exists, scroll to it*/
655
+ if($this.data("horizontalScroll")){
656
+ scrollTo=target.position().left;
657
+ }else{
658
+ scrollTo=target.position().top;
659
+ }
660
+ draggerScrollTo=scrollTo/$this.data("scrollAmount");
661
+ }else{
662
+ draggerScrollTo=scrollTo=target;
663
+ }
664
+ }
665
+ /*scroll to*/
666
+ if($this.data("horizontalScroll")){
667
+ if($this.data("onTotalScrollBack_Offset")){ /*scroll beginning offset*/
668
+ scrollBeginningOffset=-$this.data("onTotalScrollBack_Offset");
669
+ }
670
+ if($this.data("onTotalScroll_Offset")){ /*total scroll offset*/
671
+ totalScrollOffset=mCustomScrollBox.width()-mCSB_container.outerWidth()+$this.data("onTotalScroll_Offset");
672
+ }
673
+ if(draggerScrollTo<0){ /*scroll start position*/
674
+ draggerScrollTo=scrollTo=0; clearInterval($this.data("mCSB_buttonScrollLeft"));
675
+ if(!scrollBeginningOffset){scrollBeginning=true;}
676
+ }else if(draggerScrollTo>=mCSB_draggerContainer.width()-mCSB_dragger.width()){ /*scroll end position*/
677
+ draggerScrollTo=mCSB_draggerContainer.width()-mCSB_dragger.width();
678
+ scrollTo=mCustomScrollBox.width()-mCSB_container.outerWidth(); clearInterval($this.data("mCSB_buttonScrollRight"));
679
+ if(!totalScrollOffset){totalScroll=true;}
680
+ }else{scrollTo=-scrollTo;}
681
+ var snapAmount = $this.data("snapAmount");
682
+ if (snapAmount) {
683
+ scrollTo = Math.round(scrollTo / snapAmount) * snapAmount - $this.data("snapOffset");
684
+ }
685
+ /*scrolling animation*/
686
+ functions.mTweenAxis.call(this,mCSB_dragger[0],"left",Math.round(draggerScrollTo),draggerSpeed,options.scrollEasing);
687
+ functions.mTweenAxis.call(this,mCSB_container[0],"left",Math.round(scrollTo),contentSpeed,options.scrollEasing,{
688
+ onStart:function(){
689
+ if(options.callbacks && !$this.data("mCS_tweenRunning")){callbacks("onScrollStart");}
690
+ if($this.data("autoHideScrollbar")){functions.showScrollbar.call(mCSB_scrollTools);}
691
+ },
692
+ onUpdate:function(){
693
+ if(options.callbacks){callbacks("whileScrolling");}
694
+ },
695
+ onComplete:function(){
696
+ if(options.callbacks){
697
+ callbacks("onScroll");
698
+ if(scrollBeginning || (scrollBeginningOffset && mCSB_container.position().left>=scrollBeginningOffset)){callbacks("onTotalScrollBack");}
699
+ if(totalScroll || (totalScrollOffset && mCSB_container.position().left<=totalScrollOffset)){callbacks("onTotalScroll");}
700
+ }
701
+ mCSB_dragger.data("preventAction",false); $this.data("mCS_tweenRunning",false);
702
+ if($this.data("autoHideScrollbar")){if(!mCustomScrollBox.hasClass("mCS-mouse-over")){functions.hideScrollbar.call(mCSB_scrollTools);}}
703
+ }
704
+ });
705
+ }else{
706
+ if($this.data("onTotalScrollBack_Offset")){ /*scroll beginning offset*/
707
+ scrollBeginningOffset=-$this.data("onTotalScrollBack_Offset");
708
+ }
709
+ if($this.data("onTotalScroll_Offset")){ /*total scroll offset*/
710
+ totalScrollOffset=mCustomScrollBox.height()-mCSB_container.outerHeight()+$this.data("onTotalScroll_Offset");
711
+ }
712
+ if(draggerScrollTo<0){ /*scroll start position*/
713
+ draggerScrollTo=scrollTo=0; clearInterval($this.data("mCSB_buttonScrollUp"));
714
+ if(!scrollBeginningOffset){scrollBeginning=true;}
715
+ }else if(draggerScrollTo>=mCSB_draggerContainer.height()-mCSB_dragger.height()){ /*scroll end position*/
716
+ draggerScrollTo=mCSB_draggerContainer.height()-mCSB_dragger.height();
717
+ scrollTo=mCustomScrollBox.height()-mCSB_container.outerHeight(); clearInterval($this.data("mCSB_buttonScrollDown"));
718
+ if(!totalScrollOffset){totalScroll=true;}
719
+ }else{scrollTo=-scrollTo;}
720
+ var snapAmount = $this.data("snapAmount");
721
+ if (snapAmount) {
722
+ scrollTo = Math.round(scrollTo / snapAmount) * snapAmount - $this.data("snapOffset");
723
+ }
724
+ /*scrolling animation*/
725
+ functions.mTweenAxis.call(this,mCSB_dragger[0],"top",Math.round(draggerScrollTo),draggerSpeed,options.scrollEasing);
726
+ functions.mTweenAxis.call(this,mCSB_container[0],"top",Math.round(scrollTo),contentSpeed,options.scrollEasing,{
727
+ onStart:function(){
728
+ if(options.callbacks && !$this.data("mCS_tweenRunning")){callbacks("onScrollStart");}
729
+ if($this.data("autoHideScrollbar")){functions.showScrollbar.call(mCSB_scrollTools);}
730
+ },
731
+ onUpdate:function(){
732
+ if(options.callbacks){callbacks("whileScrolling");}
733
+ },
734
+ onComplete:function(){
735
+ if(options.callbacks){
736
+ callbacks("onScroll");
737
+ if(scrollBeginning || (scrollBeginningOffset && mCSB_container.position().top>=scrollBeginningOffset)){callbacks("onTotalScrollBack");}
738
+ if(totalScroll || (totalScrollOffset && mCSB_container.position().top<=totalScrollOffset)){callbacks("onTotalScroll");}
739
+ }
740
+ mCSB_dragger.data("preventAction",false); $this.data("mCS_tweenRunning",false);
741
+ if($this.data("autoHideScrollbar")){if(!mCustomScrollBox.hasClass("mCS-mouse-over")){functions.hideScrollbar.call(mCSB_scrollTools);}}
742
+ }
743
+ });
744
+ }
745
+ if($this.data("mCS_Init")){$this.data({"mCS_Init":false});}
746
+ }
747
+ }
748
+ /*callbacks*/
749
+ function callbacks(cb){
750
+ this.mcs={
751
+ top:mCSB_container.position().top,left:mCSB_container.position().left,
752
+ draggerTop:mCSB_dragger.position().top,draggerLeft:mCSB_dragger.position().left,
753
+ topPct:Math.round((100*Math.abs(mCSB_container.position().top))/Math.abs(mCSB_container.outerHeight()-mCustomScrollBox.height())),
754
+ leftPct:Math.round((100*Math.abs(mCSB_container.position().left))/Math.abs(mCSB_container.outerWidth()-mCustomScrollBox.width()))
755
+ };
756
+ switch(cb){
757
+ /*start scrolling callback*/
758
+ case "onScrollStart":
759
+ $this.data("mCS_tweenRunning",true).data("onScrollStart_Callback").call($this,this.mcs);
760
+ break;
761
+ case "whileScrolling":
762
+ $this.data("whileScrolling_Callback").call($this,this.mcs);
763
+ break;
764
+ case "onScroll":
765
+ $this.data("onScroll_Callback").call($this,this.mcs);
766
+ break;
767
+ case "onTotalScrollBack":
768
+ $this.data("onTotalScrollBack_Callback").call($this,this.mcs);
769
+ break;
770
+ case "onTotalScroll":
771
+ $this.data("onTotalScroll_Callback").call($this,this.mcs);
772
+ break;
773
+ }
774
+ }
775
+ },
776
+ stop:function(){
777
+ var $this=$(this),
778
+ mCSB_container=$this.children().children(".mCSB_container"),
779
+ mCSB_dragger=$this.children().children().children().children(".mCSB_dragger");
780
+ functions.mTweenAxisStop.call(this,mCSB_container[0]);
781
+ functions.mTweenAxisStop.call(this,mCSB_dragger[0]);
782
+ },
783
+ disable:function(resetScroll){
784
+ var $this=$(this),
785
+ mCustomScrollBox=$this.children(".mCustomScrollBox"),
786
+ mCSB_container=mCustomScrollBox.children(".mCSB_container"),
787
+ mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
788
+ mCSB_dragger=mCSB_scrollTools.children().children(".mCSB_dragger");
789
+ mCustomScrollBox.unbind("mousewheel focusin mouseenter mouseleave touchend");
790
+ mCSB_container.unbind("touchstart touchmove")
791
+ if(resetScroll){
792
+ if($this.data("horizontalScroll")){
793
+ mCSB_dragger.add(mCSB_container).css("left",0);
794
+ }else{
795
+ mCSB_dragger.add(mCSB_container).css("top",0);
796
+ }
797
+ }
798
+ mCSB_scrollTools.css("display","none");
799
+ mCSB_container.addClass("mCS_no_scrollbar");
800
+ $this.data({"bindEvent_mousewheel":false,"bindEvent_focusin":false,"bindEvent_content_touch":false,"bindEvent_autoHideScrollbar":false}).addClass("mCS_disabled");
801
+ },
802
+ destroy:function(){
803
+ var $this=$(this);
804
+ $this.removeClass("mCustomScrollbar _mCS_"+$this.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();
805
+ $(document).unbind("mousemove."+$this.data("mCustomScrollbarIndex")+" mouseup."+$this.data("mCustomScrollbarIndex")+" MSPointerMove."+$this.data("mCustomScrollbarIndex")+" MSPointerUp."+$this.data("mCustomScrollbarIndex"));
806
+ $(window).unbind("resize."+$this.data("mCustomScrollbarIndex"));
807
+ }
808
+ },
809
+ functions={
810
+ /*hide/show scrollbar*/
811
+ showScrollbar:function(){
812
+ this.stop().animate({opacity:1},"fast");
813
+ },
814
+ hideScrollbar:function(){
815
+ this.stop().animate({opacity:0},"fast");
816
+ },
817
+ /*js animation tween*/
818
+ mTweenAxis:function(el,prop,to,duration,easing,callbacks){
819
+ var callbacks=callbacks || {},
820
+ onStart=callbacks.onStart || function(){},onUpdate=callbacks.onUpdate || function(){},onComplete=callbacks.onComplete || function(){};
821
+ var startTime=_getTime(),_delay,progress=0,from=el.offsetTop,elStyle=el.style;
822
+ if(prop==="left"){from=el.offsetLeft;}
823
+ var diff=to-from;
824
+ _cancelTween();
825
+ _startTween();
826
+ function _getTime(){
827
+ if(window.performance && window.performance.now){
828
+ return window.performance.now();
829
+ }else{
830
+ if(window.performance && window.performance.webkitNow){
831
+ return window.performance.webkitNow();
832
+ }else{
833
+ if(Date.now){return Date.now();}else{return new Date().getTime();}
834
+ }
835
+ }
836
+ }
837
+ function _step(){
838
+ if(!progress){onStart.call();}
839
+ progress=_getTime()-startTime;
840
+ _tween();
841
+ if(progress>=el._time){
842
+ el._time=(progress>el._time) ? progress+_delay-(progress- el._time) : progress+_delay-1;
843
+ if(el._time<progress+1){el._time=progress+1;}
844
+ }
845
+ if(el._time<duration){el._id=_request(_step);}else{onComplete.call();}
846
+ }
847
+ function _tween(){
848
+ if(duration>0){
849
+ el.currVal=_ease(el._time,from,diff,duration,easing);
850
+ elStyle[prop]=Math.round(el.currVal)+"px";
851
+ }else{
852
+ elStyle[prop]=to+"px";
853
+ }
854
+ onUpdate.call();
855
+ }
856
+ function _startTween(){
857
+ _delay=1000/60;
858
+ el._time=progress+_delay;
859
+ _request=(!window.requestAnimationFrame) ? function(f){_tween(); return setTimeout(f,0.01);} : window.requestAnimationFrame;
860
+ el._id=_request(_step);
861
+ }
862
+ function _cancelTween(){
863
+ if(el._id==null){return;}
864
+ if(!window.requestAnimationFrame){clearTimeout(el._id);
865
+ }else{window.cancelAnimationFrame(el._id);}
866
+ el._id=null;
867
+ }
868
+ function _ease(t,b,c,d,type){
869
+ switch(type){
870
+ case "linear":
871
+ return c*t/d + b;
872
+ break;
873
+ case "easeOutQuad":
874
+ t /= d; return -c * t*(t-2) + b;
875
+ break;
876
+ case "easeInOutQuad":
877
+ t /= d/2;
878
+ if (t < 1) return c/2*t*t + b;
879
+ t--;
880
+ return -c/2 * (t*(t-2) - 1) + b;
881
+ break;
882
+ case "easeOutCubic":
883
+ t /= d; t--; return c*(t*t*t + 1) + b;
884
+ break;
885
+ case "easeOutQuart":
886
+ t /= d; t--; return -c * (t*t*t*t - 1) + b;
887
+ break;
888
+ case "easeOutQuint":
889
+ t /= d; t--; return c*(t*t*t*t*t + 1) + b;
890
+ break;
891
+ case "easeOutCirc":
892
+ t /= d; t--; return c * Math.sqrt(1 - t*t) + b;
893
+ break;
894
+ case "easeOutSine":
895
+ return c * Math.sin(t/d * (Math.PI/2)) + b;
896
+ break;
897
+ case "easeOutExpo":
898
+ return c * ( -Math.pow( 2, -10 * t/d ) + 1 ) + b;
899
+ break;
900
+ case "mcsEaseOut":
901
+ var ts=(t/=d)*t,tc=ts*t;
902
+ return b+c*(0.499999999999997*tc*ts + -2.5*ts*ts + 5.5*tc + -6.5*ts + 4*t);
903
+ break;
904
+ case "draggerRailEase":
905
+ t /= d/2;
906
+ if (t < 1) return c/2*t*t*t + b;
907
+ t -= 2;
908
+ return c/2*(t*t*t + 2) + b;
909
+ break;
910
+ }
911
+ }
912
+ },
913
+ /*stop js animation tweens*/
914
+ mTweenAxisStop:function(el){
915
+ if(el._id==null){return;}
916
+ if(!window.requestAnimationFrame){clearTimeout(el._id);
917
+ }else{window.cancelAnimationFrame(el._id);}
918
+ el._id=null;
919
+ },
920
+ /*detect requestAnimationFrame and polyfill*/
921
+ rafPolyfill:function(){
922
+ var pfx=["ms","moz","webkit","o"],i=pfx.length;
923
+ while(--i > -1 && !window.requestAnimationFrame){
924
+ window.requestAnimationFrame=window[pfx[i]+"RequestAnimationFrame"];
925
+ window.cancelAnimationFrame=window[pfx[i]+"CancelAnimationFrame"] || window[pfx[i]+"CancelRequestAnimationFrame"];
926
+ }
927
+ }
928
+ }
929
+ /*detect features*/
930
+ functions.rafPolyfill.call(); /*requestAnimationFrame*/
931
+ $.support.touch=!!('ontouchstart' in window); /*touch*/
932
+ $.support.msPointer=window.navigator.msPointerEnabled; /*MSPointer support*/
933
+ /*plugin dependencies*/
934
+ var _dlp=("https:"==document.location.protocol) ? "https:" : "http:";
935
+ $.event.special.mousewheel || document.write('<script src="'+_dlp+'//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.0.6/jquery.mousewheel.min.js"><\/script>');
936
+ /*plugin fn*/
937
+ $.fn.mCustomScrollbar=function(method){
938
+ if(methods[method]){
939
+ return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
940
+ }else if(typeof method==="object" || !method){
941
+ return methods.init.apply(this,arguments);
942
+ }else{
943
+ $.error("Method "+method+" does not exist");
944
+ }
945
+ };
946
+ })(jQuery);
js/nomin/jquery.mousewheel.js ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
2
+ * Licensed under the MIT License (LICENSE.txt).
3
+ *
4
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
5
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
6
+ * Thanks to: Seamus Leahy for adding deltaX and deltaY
7
+ *
8
+ * Version: 3.0.6
9
+ *
10
+ * Requires: 1.2.2+
11
+ */
12
+
13
+ (function($) {
14
+
15
+ var types = ['DOMMouseScroll', 'mousewheel'];
16
+
17
+ if ($.event.fixHooks) {
18
+ for ( var i=types.length; i; ) {
19
+ $.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
20
+ }
21
+ }
22
+
23
+ $.event.special.mousewheel = {
24
+ setup: function() {
25
+ if ( this.addEventListener ) {
26
+ for ( var i=types.length; i; ) {
27
+ this.addEventListener( types[--i], handler, false );
28
+ }
29
+ } else {
30
+ this.onmousewheel = handler;
31
+ }
32
+ },
33
+
34
+ teardown: function() {
35
+ if ( this.removeEventListener ) {
36
+ for ( var i=types.length; i; ) {
37
+ this.removeEventListener( types[--i], handler, false );
38
+ }
39
+ } else {
40
+ this.onmousewheel = null;
41
+ }
42
+ }
43
+ };
44
+
45
+ $.fn.extend({
46
+ mousewheel: function(fn) {
47
+ return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
48
+ },
49
+
50
+ unmousewheel: function(fn) {
51
+ return this.unbind("mousewheel", fn);
52
+ }
53
+ });
54
+
55
+
56
+ function handler(event) {
57
+ var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
58
+ event = $.event.fix(orgEvent);
59
+ event.type = "mousewheel";
60
+
61
+ // Old school scrollwheel delta
62
+ if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
63
+ if ( orgEvent.detail ) { delta = -orgEvent.detail/3; }
64
+
65
+ // New school multidimensional scroll (touchpads) deltas
66
+ deltaY = delta;
67
+
68
+ // Gecko
69
+ if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
70
+ deltaY = 0;
71
+ deltaX = -1*delta;
72
+ }
73
+
74
+ // Webkit
75
+ if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
76
+ if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
77
+
78
+ // Add event and delta to the front of the arguments
79
+ args.unshift(event, delta, deltaX, deltaY);
80
+
81
+ return ($.event.dispatch || $.event.handle).apply(this, args);
82
+ }
83
+
84
+ })(jQuery);
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === Ajax Search Lite ===
2
  Contributors: wpdreams
3
  Donate link: http://wp-dreams.com
4
  Tags: search, better wordpress search, search plugin, relevance search, widget, Post, ajax search, search filter, wp ajax search, custom fields search, better search, ajax search plugin, wp search, wp search plugin, filter, relevant search plugin, wordpress search, live search, shortcode, google, autocomplete, suggest, woocommerce, woocommerce search, product, product search, custom search, ajax, suggest, autosuggest, autocomplete, search autocomplete, live, plugin, sidebar, product tag search, woocommerce tag search, WooCommerce Plugin, shop, search by sku, relevant search, highlight, term, image
5
  Requires at least: 3.5
6
- Tested up to: 4.4
7
- Stable tag: 4.5.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -31,23 +31,24 @@ Twitter: https://twitter.com/ernest_marcinko
31
  * Search in title, description, excerpt and custom fields
32
  * Custom Filter boxes (checkbox filters) for categories and post types
33
  * WPML and Qtranslate compatible
34
- * 5 built in templates
35
- * Retina ready vectorized SVG icons
36
  * Category and post exclusions
37
  * Frontend search settings boxes
38
  * Images in search results
39
  * Fully ajax powered
40
  * 40+ options on the backend
41
- * Google analytics integration
42
  * Caches images for faster response time
43
  * Performance Options
44
  * Google analytics integration
 
 
45
 
46
  Homepage: [wp-dreams.com](http://wp-dreams.com)
47
 
48
  Pro version Demo: [Ajax Search Pro](http://demo.wp-dreams.com/?product=ajax_search_pro)
49
 
50
- **New In pro version 4.5.3 (2015.10.27):**
51
 
52
  * Frontend Demo: [Ajax Search Pro](http://demo.wp-dreams.com/?product=ajax_search_pro)
53
  * The search now can affect the default WordPress search results
@@ -108,6 +109,23 @@ and will let you know what to do.
108
 
109
  == Changelog ==
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  = 4.5.5 =
112
  * New menu: Compatibility Options
113
  * Compatibility allowing to force case sensitive, insensitive, UTF8 and UNICODE queries
1
+ === Ajax Search Lite ===
2
  Contributors: wpdreams
3
  Donate link: http://wp-dreams.com
4
  Tags: search, better wordpress search, search plugin, relevance search, widget, Post, ajax search, search filter, wp ajax search, custom fields search, better search, ajax search plugin, wp search, wp search plugin, filter, relevant search plugin, wordpress search, live search, shortcode, google, autocomplete, suggest, woocommerce, woocommerce search, product, product search, custom search, ajax, suggest, autosuggest, autocomplete, search autocomplete, live, plugin, sidebar, product tag search, woocommerce tag search, WooCommerce Plugin, shop, search by sku, relevant search, highlight, term, image
5
  Requires at least: 3.5
6
+ Tested up to: 4.5
7
+ Stable tag: 4.6.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
31
  * Search in title, description, excerpt and custom fields
32
  * Custom Filter boxes (checkbox filters) for categories and post types
33
  * WPML and Qtranslate compatible
34
+ * 8 built in templates
35
+ * Retina ready vectorized SVG and CSS3 icons
36
  * Category and post exclusions
37
  * Frontend search settings boxes
38
  * Images in search results
39
  * Fully ajax powered
40
  * 40+ options on the backend
 
41
  * Caches images for faster response time
42
  * Performance Options
43
  * Google analytics integration
44
+ * Primary and Secondary ordering options
45
+ * Highly compatible and responsive
46
 
47
  Homepage: [wp-dreams.com](http://wp-dreams.com)
48
 
49
  Pro version Demo: [Ajax Search Pro](http://demo.wp-dreams.com/?product=ajax_search_pro)
50
 
51
+ **Pro version fetures v4.8.4 (2016.03.24):**
52
 
53
  * Frontend Demo: [Ajax Search Pro](http://demo.wp-dreams.com/?product=ajax_search_pro)
54
  * The search now can affect the default WordPress search results
109
 
110
  == Changelog ==
111
 
112
+ = 4.6.0 =
113
+ * Core reworked to a much better structure
114
+ * Visual Composer bugfix
115
+ * Better shortcode stripping algo
116
+ * More performant context finder
117
+ * imagecache.class.php file removal
118
+ * Animations have been replaced with CSS3 animations
119
+ * Primary and Secondary ordering implemented
120
+ * Placeholder WPML string translation ready
121
+ * Private custom fields are displayed on the back-end now
122
+ * Option saving returns to the parent tab
123
+ * Search box and results override
124
+ * Ajax detection initializer
125
+ * Javascript sources & initialization switch
126
+ * Width and Margin option
127
+ * Results position and width fix for low bar widths
128
+
129
  = 4.5.5 =
130
  * New menu: Compatibility Options
131
  * Compatibility allowing to force case sensitive, insensitive, UTF8 and UNICODE queries
search.php DELETED
@@ -1,147 +0,0 @@
1
- <?php
2
- add_action('wp_ajax_nopriv_ajaxsearchlite_search', 'ajaxsearchlite_search');
3
- add_action('wp_ajax_ajaxsearchlite_search', 'ajaxsearchlite_search');
4
-
5
- require_once(ASL_PATH . "/includes/imagecache.class.php");
6
- require_once(ASL_PATH . "/includes/bfi_thumb.php");
7
- require_once(ASL_PATH . "/includes/suggest/suggest.inc.php");
8
-
9
- require_once(ASL_PATH . "/includes/search.class.php");
10
- require_once(ASL_PATH . "/includes/search_content.class.php");
11
- require_once(ASL_PATH . "/includes/search_demo.class.php");
12
-
13
- function ajaxsearchlite_search() {
14
- global $wpdb;
15
- global $search;
16
-
17
- /*print "in ajaxsearchlite_search();";
18
- print_r(array()); return; */
19
-
20
- $s = $_POST['aslp'];
21
- $s = apply_filters('asl_search_phrase_before_cleaning', $s);
22
-
23
- $s = stripcslashes($s);
24
- $s = trim($s);
25
- $s = preg_replace('/\s+/', ' ', $s);
26
-
27
- $s = apply_filters('asl_search_phrase_after_cleaning', $s);
28
-
29
-
30
- $def_data = get_option('asl_defaults');
31
- $search = array();
32
- $search['data'] = get_option('asl_options');
33
- $search['data'] = array_merge($def_data, $search['data']);
34
-
35
- $search['data']['image_options'] = array(
36
- 'show_images' => $search['data']['show_images'],
37
- 'image_bg_color' => '#FFFFFF',
38
- 'image_transparency' => 1,
39
- 'image_crop_location' => w_isset_def($search['data']['image_crop_location'], "c"),
40
- 'image_width' => $search['data']['image_width'],
41
- 'image_height' => $search['data']['image_height'],
42
- 'image_source1' => $search['data']['image_source1'],
43
- 'image_source2' => $search['data']['image_source2'],
44
- 'image_source3' => $search['data']['image_source3'],
45
- 'image_source4' => $search['data']['image_source4'],
46
- 'image_source5' => $search['data']['image_source5'],
47
- 'image_default' => $search['data']['image_default'],
48
- 'image_custom_field' => $search['data']['image_custom_field']
49
- );
50
-
51
- // ----------------- Recalculate image width/height ---------------
52
- switch ($search['data']['resultstype']) {
53
- case "horizontal":
54
- /* Same width as height */
55
- $search['data']['image_options']['image_width'] = wpdreams_width_from_px($search['data']['image_options']['hreswidth']);
56
- $search['data']['image_options']['image_height'] = wpdreams_width_from_px($search['data']['image_options']['hreswidth']);
57
- break;
58
- case "polaroid":
59
- $search['data']['image_options']['image_width'] = intval($search['data']['preswidth']);
60
- $search['data']['image_options']['image_height'] = intval($search['data']['preswidth']);
61
- break;
62
- case "isotopic":
63
- $search['data']['image_options']['image_width'] = intval($search['data']['i_item_width'] * 1.5);
64
- $search['data']['image_options']['image_height'] = intval($search['data']['i_item_height'] * 1.5);
65
- break;
66
- }
67
-
68
- if (isset($search['data']['selected-imagesettings'])) {
69
- $search['data']['settings-imagesettings'] = $search['data']['selected-imagesettings'];
70
- }
71
- /*if (isset($search) && $search['data']['exactonly']!=1) {
72
- $_s = explode(" ", $s);
73
- }*/
74
- if (isset($_POST['options'])) {
75
- parse_str($_POST['options'], $search['options']);
76
- }
77
-
78
-
79
- $blogresults = array();
80
- $allpageposts = array();
81
- $pageposts = array();
82
-
83
- do_action('asl_before_search', $s);
84
-
85
- $params = array('data' => $search['data'], 'options' => $search['options']);
86
-
87
- $_posts = new wpdreams_searchContent($params);
88
- $pageposts = $_posts->search($s);
89
- $allpageposts = array_merge($allpageposts, $pageposts);
90
-
91
- do_action('asl_after_pagepost_results', $s, $pageposts);
92
-
93
- $allpageposts = apply_filters('asl_pagepost_results', $allpageposts);
94
-
95
-
96
- $results = array_merge(
97
- $allpageposts
98
- );
99
-
100
-
101
- // Keyword suggestions
102
- if ( count($results) <= 0 && w_isset_def($search['data']['kw_suggestions'], 1) == 1 ) {
103
- $keywords = array();
104
- $types = array();
105
- $sd = $search['data'];
106
-
107
- if ($sd['searchinposts'] == 1)
108
- $types[] = "post";
109
- if ($sd['searchinpages'] == 1)
110
- $types[] = "page";
111
- if (isset($sd['selected-customtypes']) && count($sd['selected-customtypes']) > 0)
112
- $types = array_merge($types, $sd['selected-customtypes']);
113
-
114
- $t = new wpd_keywordSuggest("google", array(
115
- 'maxCount' => w_isset_def( $sd['kw_count'], 10 ),
116
- 'maxCharsPerWord' => w_isset_def($sd['kw_length'], 60),
117
- 'postTypes' => $types,
118
- 'lang' => w_isset_def( $sd['kw_google_lang'], "en" ),
119
- 'overrideUrl' => ''
120
- ));
121
-
122
- $keywords = $t->getKeywords($s);
123
-
124
- if ($keywords != false) {
125
- $results['keywords'] = $keywords;
126
- $results['nores'] = 1;
127
- $results = apply_filters('asl_only_keyword_results', $results);
128
- }
129
- } else if (count($results > 0)) {
130
- $results = apply_filters('asl_only_non_keyword_results', $results);
131
- }
132
-
133
- $results = apply_filters('asl_results', $results);
134
-
135
- do_action('asl_after_search', $s, $results);
136
-
137
- // Generate the results here
138
- $html_results = asl_generate_html_results( $results, $search['data'] );
139
-
140
- /* Clear output buffer, possible warnings */
141
- print "!!ASLSTART!!";
142
- //var_dump($results);die();
143
- print_r($html_results);
144
- print "!!ASLEND!!";
145
- die();
146
-
147
- }