Ink_and_Toner_Finder-TopFINDER - Version 1.0.0

Version Notes

First Release

Download this release

Release Info

Developer TopData GmbH
Extension Ink_and_Toner_Finder-TopFINDER
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (61) hide show
  1. app/code/local/Cis/Inktonerfinder/Block/Inktonerfinder.php +9 -0
  2. app/code/local/Cis/Inktonerfinder/Helper/Data.php +46 -0
  3. app/code/local/Cis/Inktonerfinder/Model/Dimension.php +11 -0
  4. app/code/local/Cis/Inktonerfinder/Model/Searchby.php +13 -0
  5. app/code/local/Cis/Inktonerfinder/Model/Searchfields.php +12 -0
  6. app/code/local/Cis/Inktonerfinder/Model/Secondbox.php +12 -0
  7. app/code/local/Cis/Inktonerfinder/controllers/CustomController.php +54 -0
  8. app/code/local/Cis/Inktonerfinder/etc/adminhtml.xml +22 -0
  9. app/code/local/Cis/Inktonerfinder/etc/config.xml +74 -0
  10. app/code/local/Cis/Inktonerfinder/etc/system.xml +141 -0
  11. app/code/local/Cis/Printer/Block/Index.php +8 -0
  12. app/code/local/Cis/Printer/Block/Printer/Result.php +50 -0
  13. app/code/local/Cis/Printer/Helper/Data.php +5 -0
  14. app/code/local/Cis/Printer/controllers/IndexController.php +9 -0
  15. app/code/local/Cis/Printer/etc/config.xml +38 -0
  16. app/design/frontend/base/default/layout/inktonerfinder.xml +24 -0
  17. app/design/frontend/base/default/layout/printer.xml +48 -0
  18. app/design/frontend/base/default/template/inktonerfinder/catalog/product/list.phtml +158 -0
  19. app/design/frontend/base/default/template/inktonerfinder/inktonerfinder.phtml +41 -0
  20. app/design/frontend/base/default/template/inktonerfinder/search_heading.phtml +19 -0
  21. app/design/frontend/base/default/template/printer/index.phtml +14 -0
  22. app/etc/modules/Cis_Inktonerfinder.xml +10 -0
  23. app/etc/modules/Cis_Printer.xml +10 -0
  24. app/locale/de_DE/Cis_Inktonerfinder.csv +7 -0
  25. app/locale/en_US/Cis_Inktonerfinder.csv +7 -0
  26. package.xml +22 -0
  27. skin/frontend/base/default/css/inktonerfinder.css +26 -0
  28. skin/frontend/base/default/js/inktonerfinder.js +132 -0
  29. skin/frontend/base/default/js/inktonerfinder_chosen/chosen-sprite.png +0 -0
  30. skin/frontend/base/default/js/inktonerfinder_chosen/chosen-sprite@2x.png +0 -0
  31. skin/frontend/base/default/js/inktonerfinder_chosen/chosen.css +437 -0
  32. skin/frontend/base/default/js/inktonerfinder_chosen/chosen.css.bak +437 -0
  33. skin/frontend/base/default/js/inktonerfinder_chosen/chosen.jquery.js +1239 -0
  34. skin/frontend/base/default/js/inktonerfinder_chosen/chosen.jquery.js.bak +1240 -0
  35. skin/frontend/base/default/js/inktonerfinder_chosen/chosen.jquery.min.js +2 -0
  36. skin/frontend/base/default/js/inktonerfinder_chosen/chosen.min.css +3 -0
  37. skin/frontend/base/default/js/inktonerfinder_chosen/chosen.proto.js +1259 -0
  38. skin/frontend/base/default/js/inktonerfinder_chosen/chosen.proto.min.js +2 -0
  39. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/external/jquery/jquery.js +9789 -0
  40. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  41. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  42. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  43. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  44. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  45. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  46. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  47. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  48. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-icons_222222_256x240.png +0 -0
  49. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-icons_2e83ff_256x240.png +0 -0
  50. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-icons_454545_256x240.png +0 -0
  51. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-icons_888888_256x240.png +0 -0
  52. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-icons_cd0a0a_256x240.png +0 -0
  53. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/index.html +371 -0
  54. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.css +544 -0
  55. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.js +2610 -0
  56. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.min.css +7 -0
  57. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.min.js +7 -0
  58. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.structure.css +152 -0
  59. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.structure.min.css +5 -0
  60. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.theme.css +410 -0
  61. skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.theme.min.css +5 -0
app/code/local/Cis/Inktonerfinder/Block/Inktonerfinder.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Cis_Inktonerfinder_Block_Inktonerfinder extends Mage_Core_Block_Template{
4
+
5
+ public function __construct(){
6
+ parent::__consturct();
7
+ }
8
+ }
9
+
app/code/local/Cis/Inktonerfinder/Helper/Data.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Cis_Inktonerfinder_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ public function getStoreConfigvalues()
5
+ {
6
+
7
+ $inktonerfinder['brands_url'] = 'http://ws.cloud.topdata.de/finder/ink_toner/brands?';
8
+ $inktonerfinder['modelseries_url'] = 'http://ws.cloud.topdata.de/finder/ink_toner/modelseries?';
9
+ $inktonerfinder['modeltype_url'] = 'http://ws.cloud.topdata.de/finder/ink_toner/devicetypes?';
10
+ $inktonerfinder['model_url'] = 'http://ws.cloud.topdata.de/finder/ink_toner/models?';
11
+ $inktonerfinder['productslist_url'] = 'http://ws.cloud.topdata.de/product_accessories/';
12
+ $inktonerfinder['model_text_search'] = 'http://ws.cloud.topdata.de/finder/ink_toner/search?';
13
+ $inktonerfinder['manufacturer_info'] = 'http://ws.cloud.topdata.de/product/';
14
+ $inktonerfinder['base_url'] = Mage::getBaseUrl();
15
+ $inktonerfinder['user_id'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/user_id');
16
+ $inktonerfinder['key'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/key');
17
+ $inktonerfinder['password'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/password');
18
+ //$inktonerfinder['version'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/version');
19
+ $inktonerfinder['version'] = '100';
20
+ //$inktonerfinder['language'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/language');
21
+ $locale = explode('_',Mage::getStoreConfig('general/locale/code'));
22
+ if(isset($locale[0]) && strlen($locale[0]) == 2)
23
+ $inktonerfinder['language'] = $locale[0];
24
+ else
25
+ $inktonerfinder['language'] = 'en';
26
+ $inktonerfinder['search_field'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/search_field');
27
+ $inktonerfinder['remove_modelseries'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/remove_modelseries');
28
+ $inktonerfinder['search_by'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/search_by');
29
+ $inktonerfinder['search_dimension'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/search_dimension');
30
+ $inktonerfinder['ean_attribute'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/ean_attribute');
31
+ $inktonerfinder['oem_attribute'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/oem_attribute');
32
+ $inktonerfinder['artnum_attribute'] = Mage::getStoreConfig('inktonerfinder_options/inktonerfinder_group/artnum_attribute');
33
+ return $inktonerfinder;
34
+ }
35
+
36
+ public function getManufacturersRecords()
37
+ {
38
+ $configOptions = $this->getStoreConfigvalues();
39
+ $url = $configOptions['brands_url'].'uid='.$configOptions['user_id'].'&security_key='.$configOptions['key'].'&password='.$configOptions['password'].'&version='.$configOptions['version'].'&language='.$configOptions['language'];
40
+ $manufacturers = file_get_contents ( $url );
41
+ $manufacturersRecords = json_decode ( $manufacturers, true ) ;
42
+ return $manufacturersRecords;
43
+ }
44
+
45
+ }
46
+
app/code/local/Cis/Inktonerfinder/Model/Dimension.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Cis_Inktonerfinder_Model_Dimension
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value'=>1, 'label'=>Mage::helper('inktonerfinder')->__('Horizontal')),
8
+ array('value'=>2, 'label'=>Mage::helper('inktonerfinder')->__('Vertical')),
9
+ );
10
+ }
11
+ }
app/code/local/Cis/Inktonerfinder/Model/Searchby.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Cis_Inktonerfinder_Model_Searchby
4
+ {
5
+
6
+ public function toOptionArray()
7
+ {
8
+ return array(
9
+ array('value'=>1, 'label'=>Mage::helper('inktonerfinder')->__('EAN/OEM')),
10
+ array('value'=>2, 'label'=>Mage::helper('inktonerfinder')->__('Article Number')),
11
+ );
12
+ }
13
+ }
app/code/local/Cis/Inktonerfinder/Model/Searchfields.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Cis_Inktonerfinder_Model_Searchfields
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value'=>1, 'label'=>Mage::helper('inktonerfinder')->__('Drop-Down and Fulltextsearch (Professional Version)')),
8
+ array('value'=>2, 'label'=>Mage::helper('inktonerfinder')->__('Drop-Down')),
9
+ array('value'=>3, 'label'=>Mage::helper('inktonerfinder')->__('Fulltextsearch (Professional Version)')),
10
+ );
11
+ }
12
+ }
app/code/local/Cis/Inktonerfinder/Model/Secondbox.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Cis_Inktonerfinder_Model_Secondbox
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value'=>1, 'label'=>Mage::helper('inktonerfinder')->__('Modelserie (Business Version)')),
8
+ array('value'=>2, 'label'=>Mage::helper('inktonerfinder')->__('Devicetype (Business Version)')),
9
+ array('value'=>3, 'label'=>Mage::helper('inktonerfinder')->__('No')),
10
+ );
11
+ }
12
+ }
app/code/local/Cis/Inktonerfinder/controllers/CustomController.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Cis_Inktonerfinder_CustomController extends Mage_Core_Controller_Front_Action
3
+ {
4
+
5
+ public function getBrandAction()
6
+ {
7
+ $configOptions = Mage::helper('inktonerfinder')->getStoreConfigvalues();
8
+ $url = $configOptions['brands_url'].'uid='.$configOptions['user_id'].'&security_key='.$configOptions['key'].'&password='.$configOptions['password'].'&version='.$configOptions['version'].'&language='.$configOptions['language'].'&source='.$configOptions['base_url'];
9
+ echo file_get_contents ( $url );
10
+ }
11
+
12
+ public function getModelsAndModelSeriesAjaxAction()
13
+ {
14
+ $manufactureId = $this->getRequest()->getParam('manufacture');
15
+ $configOptions = Mage::helper('inktonerfinder')->getStoreConfigvalues();
16
+ if($configOptions['remove_modelseries'] == 1)
17
+ $Url = $configOptions['modelseries_url'].'brand_id='.$manufactureId.'&uid='.$configOptions['user_id'].'&security_key='.$configOptions['key'].'&password='.$configOptions['password'].'&version='.$configOptions['version'].'&language='.$configOptions['language'].'&source='.$configOptions['base_url'];
18
+ else
19
+ $Url = $configOptions['modeltype_url'].'brand_id='.$manufactureId.'&uid='.$configOptions['user_id'].'&security_key='.$configOptions['key'].'&password='.$configOptions['password'].'&version='.$configOptions['version'].'&language='.$configOptions['language'].'&source='.$configOptions['base_url'];
20
+ echo file_get_contents($Url);
21
+ }
22
+
23
+ public function getModelsListAjaxAction()
24
+ {
25
+ $manufactureId = $this->getRequest()->getParam('manufacture');
26
+ $modelserieId = $this->getRequest()->getParam('modelseries');
27
+
28
+ $html .= '<option value="">Select Model</option>';
29
+ $configOptions = Mage::helper('inktonerfinder')->getStoreConfigvalues();
30
+
31
+ $url = $configOptions['model_url'].'brand_id='.$manufactureId.'&modelserie_id='.$modelserieId.'&uid='.$configOptions['user_id'].'&security_key='.$configOptions['key'].'&password='.$configOptions['password'].'&version='.$configOptions['version'].'&language='.$configOptions['language'].'&source='.$configOptions['base_url'];
32
+ echo $types = file_get_contents ( $url );
33
+ }
34
+
35
+ public function productsAutoCompletePrototypeAction()
36
+ {
37
+ $term = $this->getRequest()->getParam('term');
38
+ $configOptions = Mage::helper('inktonerfinder')->getStoreConfigvalues();
39
+ $term = rawurlencode($term);
40
+ $url = $configOptions['model_text_search'].'q='.$term.'&uid='.$configOptions['user_id'].'&security_key='.$configOptions['key'].'&password='.$configOptions['password'].'&version='.$configOptions['version'].'&language='.$configOptions['language'].'&source='.$configOptions['base_url'];
41
+ //print_r($url);die();
42
+ echo file_get_contents ($url);
43
+ //$typesRecords = json_decode ( $products, true ) ;
44
+ /*$html = '<ul>';
45
+ foreach( $typesRecords as $typesName){
46
+
47
+ foreach( $typesName as $type){
48
+ $html .= '<li id ="'.$type["id"].'">'.$type["val"].'</li>';
49
+ }
50
+ }
51
+ $html .= '</ul>';
52
+ echo $html;*/
53
+ }
54
+ }
app/code/local/Cis/Inktonerfinder/etc/adminhtml.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <inktonerfinder_options>
12
+ <title>Printer Finder</title>
13
+ </inktonerfinder_options>
14
+ </children>
15
+ </config>
16
+ </children>
17
+ </system>
18
+ </children>
19
+ </admin>
20
+ </resources>
21
+ </acl>
22
+ </config>
app/code/local/Cis/Inktonerfinder/etc/config.xml ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Cis_Inktonerfinder>
5
+ <version>0.1.0</version>
6
+ </Cis_Inktonerfinder>
7
+ </modules>
8
+ <admin>
9
+ <routers>
10
+ <inktonerfinder>
11
+ <use>admin</use>
12
+ <args>
13
+ <module>Cis_Inktonerfinder</module>
14
+ <frontName>inktonerfinder</frontName>
15
+ </args>
16
+ </inktonerfinder>
17
+ </routers>
18
+ </admin>
19
+ <frontend>
20
+ <routers>
21
+ <inktonerfinder>
22
+ <use>standard</use>
23
+ <args>
24
+ <module>Cis_Inktonerfinder</module>
25
+ <frontName>inktonerfinder</frontName>
26
+ </args>
27
+ </inktonerfinder>
28
+ </routers>
29
+ <layout>
30
+ <updates>
31
+ <inktonerfinder>
32
+ <file>inktonerfinder.xml</file>
33
+ </inktonerfinder>
34
+ </updates>
35
+ </layout>
36
+ <translate>
37
+ <modules>
38
+ <Cis_Inktonerfinder>
39
+ <files>
40
+ <default>Cis_Inktonerfinder.csv</default>
41
+ </files>
42
+ </Cis_Inktonerfinder>
43
+ </modules>
44
+ </translate>
45
+ </frontend>
46
+ <global>
47
+ <blocks>
48
+ <cis_inktonerfinder>
49
+ <class>Cis_Inktonerfinder_Block</class>
50
+ </cis_inktonerfinder>
51
+ </blocks>
52
+ <helpers>
53
+ <inktonerfinder>
54
+ <class>Cis_Inktonerfinder_Helper</class>
55
+ </inktonerfinder>
56
+ </helpers>
57
+ <models>
58
+ <inktonerfinder>
59
+ <class>Cis_Inktonerfinder_Model</class>
60
+ <resourceModel>inktonerfinder_mysql4</resourceModel>
61
+ </inktonerfinder>
62
+ </models>
63
+
64
+ </global>
65
+ <default>
66
+ <inktonerfinder_options>
67
+ <inktonerfinder_group translate="welcome" module="inktonerfinder">
68
+ <search_field>2</search_field>
69
+ <search_by>1</search_by>
70
+ <search_dimension>1</search_dimension>
71
+ </inktonerfinder_group>
72
+ </inktonerfinder_options>
73
+ </default>
74
+ </config>
app/code/local/Cis/Inktonerfinder/etc/system.xml ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <tabs>
3
+ <inktonerfinder translate="label" module="inktonerfinder">
4
+ <label>Ink Toner Finder</label>
5
+ <sort_order>100</sort_order>
6
+ </inktonerfinder>
7
+ </tabs>
8
+ <sections>
9
+ <inktonerfinder_options translate="label" module="inktonerfinder">
10
+ <label>Ink Toner Finder Config Options</label>
11
+ <tab>inktonerfinder</tab>
12
+ <frontend_type>text</frontend_type>
13
+ <sort_order>1000</sort_order>
14
+ <show_in_default>1</show_in_default>
15
+ <show_in_website>1</show_in_website>
16
+ <show_in_store>1</show_in_store>
17
+ <groups>
18
+ <inktonerfinder_group translate="label">
19
+ <label>Ink Toner Finder Config Fields</label>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>1</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <fields>
26
+ <user_id translate="label tooltip comment">
27
+ <label>API-User ID</label>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>1</show_in_store>
31
+ <frontend_type>text</frontend_type>
32
+ <sort_order>100</sort_order>
33
+ </user_id>
34
+ <key translate="label tooltip comment">
35
+ <label>API-Securitykey</label>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ <frontend_type>text</frontend_type>
40
+ <sort_order>200</sort_order>
41
+ </key>
42
+ <password translate="label tooltip comment">
43
+ <label>API-Password</label>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>1</show_in_store>
47
+ <frontend_type>password</frontend_type>
48
+ <sort_order>300</sort_order>
49
+ </password>
50
+ <!--<version translate="label tooltip comment">
51
+ <label>Version</label>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ <frontend_type>text</frontend_type>
56
+ <sort_order>400</sort_order>
57
+ </version>-->
58
+ <!--<language translate="label tooltip comment">
59
+ <label>Language</label>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ <frontend_type>text</frontend_type>
64
+ <comment>Language should be in format, for example: "en"</comment>
65
+ <sort_order>500</sort_order>
66
+ </language>-->
67
+
68
+ <search_field translate="label tooltip comment">
69
+ <label>Select Search Field</label>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>700</show_in_store>
73
+ <frontend_type>select</frontend_type>
74
+ <source_model>inktonerfinder/searchfields</source_model>
75
+ <sort_order>600</sort_order>
76
+ </search_field>
77
+
78
+ <search_dimension translate="label tooltip comment">
79
+ <label>Drop-Down Dimension</label>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>1</show_in_website>
82
+ <show_in_store>700</show_in_store>
83
+ <frontend_type>select</frontend_type>
84
+ <source_model>inktonerfinder/dimension</source_model>
85
+ <sort_order>600</sort_order>
86
+ </search_dimension>
87
+
88
+ <search_by translate="label tooltip comment">
89
+ <label>Select Search By</label>
90
+ <comment>EAN Or OEM or Articlenumber</comment>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>700</show_in_store>
94
+ <frontend_type>select</frontend_type>
95
+ <source_model>inktonerfinder/searchby</source_model>
96
+ <sort_order>650</sort_order>
97
+ </search_by>
98
+
99
+
100
+ <remove_modelseries translate="label comment">
101
+ <label>Show Second Drop-Down Step</label>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>1</show_in_website>
104
+ <show_in_store>700</show_in_store>
105
+ <frontend_type>select</frontend_type>
106
+ <source_model>inktonerfinder/secondbox</source_model>
107
+ <sort_order>600</sort_order>
108
+ </remove_modelseries>
109
+
110
+ <ean_attribute translate="label tooltip comment">
111
+ <label>Attribute code of EAN</label>
112
+ <show_in_default>1</show_in_default>
113
+ <show_in_website>1</show_in_website>
114
+ <show_in_store>1</show_in_store>
115
+ <frontend_type>text</frontend_type>
116
+ <sort_order>800</sort_order>
117
+ </ean_attribute>
118
+ <oem_attribute translate="label tooltip comment">
119
+ <label>Attribute code of OEM</label>
120
+ <show_in_default>1</show_in_default>
121
+ <show_in_website>1</show_in_website>
122
+ <show_in_store>1</show_in_store>
123
+ <frontend_type>text</frontend_type>
124
+ <sort_order>900</sort_order>
125
+ </oem_attribute>
126
+
127
+ <artnum_attribute translate="label tooltip comment">
128
+ <label>Attribute code of Article Number</label>
129
+ <show_in_default>1</show_in_default>
130
+ <show_in_website>1</show_in_website>
131
+ <show_in_store>1</show_in_store>
132
+ <frontend_type>text</frontend_type>
133
+ <sort_order>1000</sort_order>
134
+ </artnum_attribute>
135
+
136
+ </fields>
137
+ </inktonerfinder_group>
138
+ </groups>
139
+ </inktonerfinder_options>
140
+ </sections>
141
+ </config>
app/code/local/Cis/Printer/Block/Index.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Cis_Printer_Block_Index extends Mage_Core_Block_Template{
3
+
4
+
5
+
6
+
7
+
8
+ }
app/code/local/Cis/Printer/Block/Printer/Result.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Cis_Printer_Block_Printer_Result extends Mage_CatalogSearch_Block_Advanced_Result
3
+ {
4
+ public function setListCollection()
5
+ {
6
+ $collection = $this->_getProductCollection();
7
+ $models = $this->getRequest()->getParam('model_id');
8
+ $configOptions = Mage::helper('inktonerfinder')->getStoreConfigvalues();
9
+
10
+ $productsListArray = array();
11
+ for($page = 1;;$page++)
12
+ {
13
+ $url = $configOptions['productslist_url'].$models.'?uid='.$configOptions['user_id'].'&security_key='.$configOptions['key'].'&password='.$configOptions['password'].'&version='.$configOptions['version'].'&language='.$configOptions['language'].'&source='.$configOptions['base_url'].'&page='.$page;
14
+ $products = file_get_contents($url);
15
+ $productsRecords = json_decode($products,true);
16
+ //print_r($productsRecords);die();
17
+ $noOfPages = $productsRecords['page']['available_pages'];
18
+
19
+ $productEanNumber = array();
20
+ $productOemsNumber = array();
21
+ $productArtnrsNumber = array();
22
+ foreach($productsRecords['products'] as $productsData)
23
+ {
24
+ $productEanNumber = array_merge($productEanNumber,$productsData['eans']);
25
+ $productOemsNumber = array_merge($productOemsNumber,$productsData['oems']);
26
+ if(isset($productsData['distributors']) && count($productsData['distributors']) > 0)
27
+ {
28
+ foreach($productsData['distributors'] as $dis)
29
+ $productArtnrsNumber = array_merge($productArtnrsNumber,$dis['artnrs']);
30
+ }
31
+ }
32
+ if($noOfPages <= $page)
33
+ break;
34
+ }
35
+
36
+ //print_r($productArtnrsNumber);die();
37
+ if($configOptions['search_by'] == 1)
38
+ {
39
+ if(count($productEanNumber) > 0 && trim($configOptions['ean_attribute']) != '')
40
+ $collection->addFieldToFilter(trim($configOptions['ean_attribute']), array('in' => $productEanNumber));
41
+ if(count($productOemsNumber) > 0 && trim($configOptions['oem_attribute']) != '')
42
+ $collection->addFieldToFilter(trim($configOptions['oem_attribute']), array('in' => $productOemsNumber));
43
+ }elseif(count($productArtnrsNumber) && $configOptions['search_by'] == 2 && trim($configOptions['artnum_attribute']))
44
+ $collection->addFieldToFilter(trim($configOptions['artnum_attribute']), array('in' => $productArtnrsNumber));
45
+ else
46
+ $collection->addFieldToFilter('status', 123);
47
+
48
+ $this->getChild('search_result_list')->setCollection($collection);
49
+ }
50
+ }
app/code/local/Cis/Printer/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Cis_Printer_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
5
+
app/code/local/Cis/Printer/controllers/IndexController.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Cis_Printer_IndexController extends Mage_Core_Controller_Front_Action{
3
+
4
+ public function IndexAction() {
5
+ $this->loadLayout();
6
+ $this->getLayout()->getBlock("head")->setTitle($this->__('printer_finder'));
7
+ $this->renderLayout();
8
+ }
9
+ }
app/code/local/Cis/Printer/etc/config.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Cis_Printer>
5
+ <version>0.1.0</version>
6
+ </Cis_Printer>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <printer>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Cis_Printer</module>
14
+ <frontName>printer</frontName>
15
+ </args>
16
+ </printer>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <printer>
21
+ <file>printer.xml</file>
22
+ </printer>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <global>
27
+ <helpers>
28
+ <printer>
29
+ <class>Cis_Printer_Helper</class>
30
+ </printer>
31
+ </helpers>
32
+ <blocks>
33
+ <printer>
34
+ <class>Cis_Printer_Block</class>
35
+ </printer>
36
+ </blocks>
37
+ </global>
38
+ </config>
app/design/frontend/base/default/layout/inktonerfinder.xml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="1.0.0">
3
+ <default translate="label" module="inktonerfinder">
4
+ <reference name="head">
5
+ <action method="addItem"><type>skin_css</type><name>css/inktonerfinder.css</name></action>
6
+ <action method="addItem"><type>skin_css</type><name>js/inktonerfinder_chosen/chosen.css</name></action>
7
+ <action method="addItem"><type>skin_css</type><name>js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.min.css</name></action>
8
+ <action method="addItem"><type>skin_js</type><name>js/inktonerfinder.js</name></action>
9
+ <action method="addItem"><type>skin_js</type><name>js/inktonerfinder_chosen/chosen.jquery.min.js</name></action>
10
+ <action method="addItem"><type>skin_js</type><name>js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.min.js</name></action>
11
+ <block type="core/text" name="your_external_csv">
12
+ <action method="setText">
13
+ <text><![CDATA[<link rel="stylesheet" type="text/css" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">]]></text>
14
+ </action>
15
+ </block>
16
+ </reference>
17
+ <reference name="content">
18
+ <block type="core/template" name="inktonerfinder" template="inktonerfinder/inktonerfinder.phtml" before="-" />
19
+ </reference>
20
+ <!--<reference name="header">
21
+ <block type="core/template" as="inktonerfinder_child" name="inktonerfinder_child" template="inktonerfinder/inktonerfinder.phtml"/>
22
+ </reference>-->
23
+ </default>
24
+ </layout>
app/design/frontend/base/default/layout/printer.xml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <printer_index_index>
4
+ <reference name="root">
5
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
6
+ </reference>
7
+ <reference name="breadcrumbs">
8
+ <action method="addCrumb">
9
+ <crumbName>Home</crumbName>
10
+ <crumbInfo>
11
+ <label>Home</label>
12
+ <title>Home</title>
13
+ <link>/</link>
14
+ </crumbInfo>
15
+ </action>
16
+ <action method="addCrumb">
17
+ <crumbName>Printer</crumbName>
18
+ <crumbInfo>
19
+ <label>Printer Finder</label>
20
+ <title>Printer Finder</title>
21
+ </crumbInfo>
22
+ </action>
23
+
24
+ </reference>
25
+ <reference name="content">
26
+ <!-- <block type="printer/index" name="printer_index" template="printer/index.phtml"/> -->
27
+
28
+ <block type="printer/printer_result" name="printer_result" template="printer/index.phtml">
29
+ <block type="catalog/product_list" name="search_result_list" template="inktonerfinder/catalog/product/list.phtml">
30
+ <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
31
+ <block type="page/html_pager" name="product_list_toolbar_pager"/>
32
+ </block>
33
+ <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
34
+ <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
35
+ <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
36
+ <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
37
+ <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
38
+ <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
39
+ </block>
40
+ <action method="setListOrders"/>
41
+ <action method="setListModes"/>
42
+ <action method="setListCollection"/>
43
+ </block>
44
+
45
+ </reference>
46
+ </printer_index_index>
47
+ </layout>
48
+
app/design/frontend/base/default/template/inktonerfinder/catalog/product/list.phtml ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php
3
+ $_productCollection=$this->getLoadedProductCollection();
4
+ $_helper = $this->helper('catalog/output');
5
+ ?>
6
+ <?php if(!$_productCollection->count()): ?>
7
+ <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
8
+ <?php else: ?>
9
+ <div class="category-products">
10
+ <?php echo $this->getToolbarHtml() ?>
11
+ <?php // List mode ?>
12
+ <?php if($this->getMode()!='grid'): ?>
13
+ <?php $_iterator = 0; ?>
14
+ <ol class="products-list" id="products-list">
15
+ <?php foreach ($_productCollection as $_product): ?>
16
+ <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
17
+ <?php // Product Image ?>
18
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
19
+
20
+ <?php $_imgSize = 150; ?>
21
+ <img id="product-collection-image-<?php echo $_product->getId(); ?>"
22
+ src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($_imgSize); ?>"
23
+ alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
24
+ </a>
25
+ <?php // Product description ?>
26
+ <div class="product-shop">
27
+ <div class="f-fix">
28
+ <div class="product-primary">
29
+ <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
30
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
31
+ <?php if($_product->getRatingSummary()): ?>
32
+ <?php echo $this->getReviewsSummaryHtml($_product) ?>
33
+ <?php endif; ?>
34
+
35
+ <?php
36
+ $_nameAfter = $this->getChild('name.after');
37
+ if($_nameAfter):
38
+ $_nameAfterChildren = $_nameAfter->getSortedChildren();
39
+ foreach($_nameAfterChildren as $_nameAfterChildName):
40
+ $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
41
+ $_nameAfterChild->setProduct($_product);
42
+ echo $_nameAfterChild->toHtml();
43
+ endforeach;
44
+ endif;
45
+ ?>
46
+ </div>
47
+ <div class="product-secondary">
48
+ <?php echo $this->getPriceHtml($_product, true) ?>
49
+ </div>
50
+ <div class="product-secondary">
51
+ <?php if($_product->isSaleable() && !$_product->canConfigure()): ?>
52
+ <p class="action"><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
53
+ <?php elseif($_product->isSaleable()): ?>
54
+ <p class="action"><a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a></p>
55
+ <?php else: ?>
56
+ <p class="action availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
57
+ <?php endif; ?>
58
+ <ul class="add-to-links">
59
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
60
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
61
+ <?php endif; ?>
62
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
63
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
64
+ <?php endif; ?>
65
+ </ul>
66
+ </div>
67
+ <div class="desc std">
68
+ <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
69
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
70
+ </div>
71
+ </div>
72
+ </div>
73
+ </li>
74
+ <?php endforeach; ?>
75
+ </ol>
76
+ <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
77
+
78
+ <?php else: ?>
79
+
80
+ <?php // Grid Mode ?>
81
+
82
+ <?php $_collectionSize = $_productCollection->count() ?>
83
+ <?php $_columnCount = $this->getColumnCount(); ?>
84
+ <ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col">
85
+ <?php $i=0; foreach ($_productCollection as $_product): ?>
86
+ <?php /*if ($i++%$_columnCount==0): ?>
87
+ <?php endif*/ ?>
88
+ <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
89
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
90
+ <?php $_imgSize = 210; ?>
91
+ <img id="product-collection-image-<?php echo $_product->getId(); ?>"
92
+ src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize); ?>"
93
+ alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
94
+ </a>
95
+ <div class="product-info">
96
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
97
+
98
+ <?php
99
+ $_nameAfter = $this->getChild('name.after');
100
+ if($_nameAfter):
101
+ $_nameAfterChildren = $_nameAfter->getSortedChildren();
102
+ foreach($_nameAfterChildren as $_nameAfterChildName):
103
+ $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
104
+ $_nameAfterChild->setProduct($_product);
105
+ echo $_nameAfterChild->toHtml();
106
+ endforeach;
107
+ endif;
108
+ ?>
109
+
110
+ <?php echo $this->getPriceHtml($_product, true) ?>
111
+ <?php if($_product->getRatingSummary()): ?>
112
+ <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
113
+ <?php endif; ?>
114
+ <div class="actions">
115
+ <?php if($_product->isSaleable() && !$_product->canConfigure()): ?>
116
+ <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
117
+ <?php elseif($_product->isSaleable()): ?>
118
+ <a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a>
119
+ <?php else: ?>
120
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
121
+ <?php endif; ?>
122
+ <ul class="add-to-links">
123
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
124
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
125
+ <?php endif; ?>
126
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
127
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
128
+ <?php endif; ?>
129
+ </ul>
130
+ </div>
131
+ </div>
132
+ </li>
133
+ <?php /*if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
134
+ <?php endif*/ ?>
135
+ <?php endforeach ?>
136
+ </ul>
137
+ <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
138
+ <?php endif; ?>
139
+
140
+ <div class="toolbar-bottom">
141
+ <?php echo $this->getToolbarHtml() ?>
142
+ </div>
143
+ </div>
144
+ <?php endif; ?>
145
+
146
+
147
+ <?php
148
+ //set product collection on after blocks
149
+ $_afterChildren = $this->getChild('after');
150
+ if ($_afterChildren):
151
+ $_afterChildren = $this->getChild('after')->getSortedChildren();
152
+ foreach($_afterChildren as $_afterChildName):
153
+ $_afterChild = $this->getChild('after')->getChild($_afterChildName);
154
+ $_afterChild->setProductCollection($_productCollection);
155
+ ?>
156
+ <?php echo $_afterChild->toHtml(); ?>
157
+ <?php endforeach; ?>
158
+ <?php endif; ?>
app/design/frontend/base/default/template/inktonerfinder/inktonerfinder.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $configOptions = Mage::helper('inktonerfinder')->getStoreConfigvalues();
2
+ $manufacturersRecords = Mage::helper('inktonerfinder')->getManufacturersRecords(); ?>
3
+
4
+ <div class="inktonerfinder">
5
+ <?php if($configOptions['search_field'] == 1 || $configOptions['search_field'] == 3) { ?>
6
+ <div class="toner-text">
7
+ <input type="text" id="inktonerfinder-search" name="inktonerfinder-search" placeholder="<?php echo $this->__('search_placeholder') ?>" />
8
+ <i class="loader fa fa-search fa-lg"></i>
9
+ </div>
10
+ <?php }
11
+ //print_r($configOptions);
12
+ if($configOptions['search_field'] == 1 || $configOptions['search_field'] == 2) { ?>
13
+ <div class="dropdowns<?php echo ($configOptions['search_dimension'] == 2 ? ' vertical_drops' : '') ?><?php echo ($configOptions['remove_modelseries'] == 3 ? ' two_drops' : '') ?>">
14
+ <div>
15
+ <select onchange="getModelsAndModelSeriesAjax(); getModelsListAjax();" name="inktonerfinder-brands-select" id="inktonerfinder-brands-select" disabled="disabled">
16
+ <option value=""><?php echo $this->__('select_manufacturer') ?></option>
17
+ <?php /*
18
+ foreach( $manufacturersRecords as $manufacturerName){
19
+ foreach( $manufacturerName as $manufacturer){
20
+ echo '<option value="'.$manufacturer['id'].'">'.$manufacturer['val'].'</option>';
21
+ }
22
+ } */ ?>
23
+ </select>
24
+ </div>
25
+ <?php if($configOptions['remove_modelseries'] != 3) { ?>
26
+ <div>
27
+ <select onchange="getModelsListAjax()" name="inktonerfinder-modelseries-select" id="inktonerfinder-modelseries-select" disabled="disabled">
28
+ <option value=""><?php echo ($configOptions['remove_modelseries'] == 1 ? $this->__('select_modelseries') : $this->__('select_devicetype')) ?></option>
29
+ </select>
30
+ </div>
31
+ <?php } ?>
32
+
33
+ <div>
34
+ <select onchange="getProductsListAjax()" name="inktonerfinder-models-select" id="inktonerfinder-models-select" disabled="disabled">
35
+ <option value=""><?php echo $this->__('select_model') ?></option>
36
+ </select>
37
+ </div>
38
+ <div></div>
39
+ </div>
40
+ <?php } ?>
41
+ </div>
app/design/frontend/base/default/template/inktonerfinder/search_heading.phtml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $model_id = $this->getRequest()->getParam('model_id');
4
+ if($model_id){
5
+ $configOptions = Mage::helper('inktonerfinder')->getStoreConfigvalues();
6
+ $url = $configOptions['manufacturer_info'].''.$model_id.'?&uid='.$configOptions['user_id'].'&security_key='.$configOptions['key'].'&password='.$configOptions['password'].'&version='.$configOptions['version'].'&language='.$configOptions['language'];
7
+
8
+ $products = file_get_contents ( $url );
9
+ $typesRecords = json_decode ( $products, true ) ;
10
+
11
+ foreach( $typesRecords as $typesName){
12
+ $manufacturertext = $typesName['short_description'];
13
+ }
14
+
15
+ ?>
16
+ <div class="printer_info">
17
+ <h3><?php echo $manufacturertext ?> </h3>
18
+ </div>
19
+ <?php } ?>
app/design/frontend/base/default/template/printer/index.phtml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="page-title">
3
+ <h1><?php echo $this->__('printer_finder') ?></h1>
4
+ </div>
5
+ <?php echo $this->getMessagesBlock()->getGroupedHtml();
6
+ echo $this->getLayout()->createBlock('core/template')->setTemplate('inktonerfinder/search_heading.phtml')->toHtml();
7
+ ?>
8
+ <?php if($this->getResultCount()):
9
+ echo $this->getProductListHtml();
10
+ else: ?>
11
+ <p class="error-msg"><?php echo $this->helper('catalogsearch')->__('no_item_found');?>
12
+ <?php endif; ?>
13
+
14
+
app/etc/modules/Cis_Inktonerfinder.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Cis_Inktonerfinder>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ <version>0.1.0</version>
8
+ </Cis_Inktonerfinder>
9
+ </modules>
10
+ </config>
app/etc/modules/Cis_Printer.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Cis_Printer>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ <version>0.1.0</version>
8
+ </Cis_Printer>
9
+ </modules>
10
+ </config>
app/locale/de_DE/Cis_Inktonerfinder.csv ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ printer_finder,Druckerfinder
2
+ select_manufacturer,Marke auswählen
3
+ select_modelseries,Modellserie auswählen
4
+ select_devicetype,DruckerTyp auswählen
5
+ select_model,Modell auswählen
6
+ no_item_found,Es konnte keine Verbrauchsmaterial zum passenden Drucker gefunden werden
7
+ search_placeholder,Druckersuche
app/locale/en_US/Cis_Inktonerfinder.csv ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ printer_finder,Printer Finder
2
+ select_manufacturer,Select Manufacturer
3
+ select_modelseries,Select Model Series
4
+ select_devicetype,Select Printer Type
5
+ select_model,Select Model
6
+ no_item_found,No items were found using the following search criteria.
7
+ search_placeholder,Printersearch
package.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Ink_and_Toner_Finder-TopFINDER</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Suchen von Verbrauchsmaterialien &#xFC;ber den Drucker</summary>
10
+ <description>Die Suchfunktion des &lt;b&gt;TopFINDER&lt;/b&gt; ist dabei so ausgelegt, dass Ihre Kunden &#xFC;ber die Volltextsuche sowie &#xFC;ber die drei Dropdowns (Hersteller, Modellserie/Ger&#xE4;tetyp und Modellauswahl) das gesuchte Druckermodell finden k&#xF6;nnen.&#xD;
11
+ &#xD;
12
+ Die zugeh&#xF6;rigen Produkte werden dann sofort im Shop aufgelistet. &#xD;
13
+ &#xD;
14
+ Sie ben&#xF6;tigen nur einen TopData API Zugang den Sie &lt;a href="http://topfinder.shop.td/"&gt;hier&lt;/a&gt; fordern k&#xF6;nnen.</description>
15
+ <notes>First Release</notes>
16
+ <authors><author><name>TopData GmbH</name><user>MAG002246728</user><email>info@topdata.de</email></author></authors>
17
+ <date>2015-06-04</date>
18
+ <time>08:21:43</time>
19
+ <contents><target name="magelocal"><dir name="Cis"><dir name="Inktonerfinder"><dir name="Block"><file name="Inktonerfinder.php" hash="a6963fe5b3b46e9e3dda51128e6b8cfa"/></dir><dir name="Helper"><file name="Data.php" hash="4decbd0a38e61fa61684f7cf1229816f"/></dir><dir name="Model"><file name="Dimension.php" hash="b90cbfdc3aac3d38c2fe90da6d881dd8"/><file name="Searchby.php" hash="eb524dfec0b42446aaa20d8037f9a6e6"/><file name="Searchfields.php" hash="d8c053b0b50df767c817e025b113a045"/><file name="Secondbox.php" hash="c33ee677ed1b17d50bad8098319181ff"/></dir><dir name="controllers"><file name="CustomController.php" hash="354f640c006808704e8552687320640b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="23ecf62c5ceb8eff24f05be50275941f"/><file name="config.xml" hash="714960c9d5fff67fa33757cd06354719"/><file name="system.xml" hash="524b2a8c3505c72e777a2b0b1775a5cf"/></dir></dir><dir name="Printer"><dir name="Block"><file name="Index.php" hash="b3de34d4193a50fd3166a4a4b7d5b850"/><dir name="Printer"><file name="Result.php" hash="7a1d33715e8a82589ded7861432c97e8"/></dir></dir><dir name="Helper"><file name="Data.php" hash="77bb28835e9f4d57be4ff05b392899f3"/></dir><dir name="controllers"><file name="IndexController.php" hash="7e09eb92585e3ce0ff4f3a84c58e0d4f"/></dir><dir name="etc"><file name="config.xml" hash="1346295e9c7f46db839be4df1c46536a"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="inktonerfinder.xml" hash="aab0cd3c0fef2c3dfc1c4ed1fe482364"/><file name="printer.xml" hash="f2c2bfdc44f1472acce3cb7f4b707513"/></dir><dir name="template"><dir name="inktonerfinder"><dir name="catalog"><dir name="product"><file name="list.phtml" hash="bd7aed7ef6a42fa201dc7621f150facb"/></dir></dir><file name="inktonerfinder.phtml" hash="1413ce772393fa1383118ef9e185ba14"/><file name="search_heading.phtml" hash="fa133cec96b9d79e628219c39ff7216c"/></dir><dir name="printer"><file name="index.phtml" hash="c113729c6dafc837a1aadde37ade5aad"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cis_Inktonerfinder.xml" hash="5d62fbdc3e6b79c07582c62237cb0352"/><file name="Cis_Printer.xml" hash="4feb5261e30754dabdb65b1dce87c2e5"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Cis_Inktonerfinder.csv" hash="c7ac3f462a67d1e745535048b261e014"/></dir><dir name="en_US"><file name="Cis_Inktonerfinder.csv" hash="79ba988251fac9cd8aa9e762b4c40f97"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="inktonerfinder.css" hash="1612ec7b4fd2cb8bb08d2c8dc4e0b987"/></dir><dir name="js"><dir name="inktonerfinder_chosen"><file name="chosen-sprite.png" hash="8b55a822e72b8fd5e2ee069236f2d797"/><file name="chosen-sprite@2x.png" hash="614fad616d014daf5367e068505cad35"/><file name="chosen.css" hash="a7de6bea803915a79e1757c43c105ac2"/><file name="chosen.css.bak" hash="a7de6bea803915a79e1757c43c105ac2"/><file name="chosen.jquery.js" hash="2bc9d9ba4273e162cedb62f1d20df1f2"/><file name="chosen.jquery.js.bak" hash="ab99df784a54442092de06464db8423b"/><file name="chosen.jquery.min.js" hash="8786a9ac3b0cc1f8e6621ea6c7f5eba5"/><file name="chosen.min.css" hash="3ec0caaf02bd5384967ca6bfadc71f5d"/><file name="chosen.proto.js" hash="249ee64baf95772fe3f4ad34e9ccb6b9"/><file name="chosen.proto.min.js" hash="93d1133ded89a8d03997a20dc220c2ae"/></dir><dir name="inktonerfinder_jquery-ui-1.11.4.custom"><dir name="external"><dir name="jquery"><file name="jquery.js" hash="91515770ce8c55de23b306444d8ea998"/></dir></dir><dir name="images"><file name="ui-bg_flat_0_aaaaaa_40x100.png" hash="dc2be39ecde5242f9ef8ff062275c0b6"/><file name="ui-bg_flat_75_ffffff_40x100.png" hash="e9a98fd2e4b2868461f3949e6878aaca"/><file name="ui-bg_glass_55_fbf9ee_1x400.png" hash="0a52106d35b23329c1c7cde33193ceff"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="51a55753c342efe53a7a1ff1ed93c669"/><file name="ui-bg_glass_75_dadada_1x400.png" hash="0b5b500105a13b3021b1e599e8ef88e0"/><file name="ui-bg_glass_75_e6e6e6_1x400.png" hash="425d4361723bc873acf9a42f78a1fa20"/><file name="ui-bg_glass_95_fef1ec_1x400.png" hash="8f5ac2fe4bdf1379a45f4b6aa9d3c1f7"/><file name="ui-bg_highlight-soft_75_cccccc_1x100.png" hash="9fd5e589d5ff777a0af76da164398908"/><file name="ui-icons_222222_256x240.png" hash="3a3c5468f484f07ac4a320d9e22acb8c"/><file name="ui-icons_2e83ff_256x240.png" hash="d92acecad29da2ccee5c9d491267f4a2"/><file name="ui-icons_454545_256x240.png" hash="3b001ae33bd74fff64bc609ce6a55628"/><file name="ui-icons_888888_256x240.png" hash="6cc57703e2f287de68f76244a618f15c"/><file name="ui-icons_cd0a0a_256x240.png" hash="fdc58c14e91fbb086f953818c525a7ee"/></dir><file name="index.html" hash="98a2253ee78db142c7f8bfb08e3d8794"/><file name="jquery-ui.css" hash="3e967061b7320c7f0b069702f14bddc2"/><file name="jquery-ui.js" hash="6890508bec24cf5995b2aed289e010c1"/><file name="jquery-ui.min.css" hash="f4560dcbd69f65e050ece6f6610c9e87"/><file name="jquery-ui.min.js" hash="ccac6fa7d570a3fb30913788afba5f2f"/><file name="jquery-ui.structure.css" hash="06f860aad9cc6e0b9ee8e519be0a0d2f"/><file name="jquery-ui.structure.min.css" hash="228636963da7e0a38ed3b2095cef9e5d"/><file name="jquery-ui.theme.css" hash="06058a95fce187278b88cbb92acddb73"/><file name="jquery-ui.theme.min.css" hash="3b17b9c94648e92f76e550e6e6a65ea5"/></dir><file name="inktonerfinder.js" hash="4aeea2b40deb7f3fa189e2067a91c223"/></dir></dir></dir></dir></target></contents>
20
+ <compatible/>
21
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.5.0.0</min><max/></package></required></dependencies>
22
+ </package>
skin/frontend/base/default/css/inktonerfinder.css ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .inktonerfinder {margin-bottom: 20px; padding: 10px; width: 100%; background: #3399CC;}
2
+ .inktonerfinder .dropdowns{line-height: 0;}
3
+ .inktonerfinder .dropdowns select{width: 100%;}
4
+ .inktonerfinder .dropdowns > div{float: left; width:33%; margin-right: 0.5%;}
5
+ .inktonerfinder .dropdowns > div:last-child{clear: both; float: none; margin: 0px;}
6
+ .inktonerfinder .dropdowns > div:nth-last-child(2){margin-right: 0px;}
7
+ .inktonerfinder .dropdowns > div .loader{float: right; margin-top: -23px; margin-right: 20px;}
8
+ .inktonerfinder .dropdowns .chosen-container{padding:0 0 0 0; background: #fff; height: 30px; font-size: 16px; width: 100%;}
9
+ .inktonerfinder .dropdowns .chosen-container-single .chosen-single{margin-top:3px; background: #fff; font-size: 16px; border:none; box-shadow:none; border-radius:0px;}
10
+ .inktonerfinder .dropdowns .chosen-drop{margin-top:3px;}
11
+ .inktonerfinder .two_drops > div{width:49.5%; margin-right: 1%;}
12
+ .inktonerfinder .vertical_drops > div{width:100%; margin-right: 0px; margin-bottom: 5px;}
13
+ .inktonerfinder .vertical_drops > div:nth-last-child(2){margin-bottom: 0px;}
14
+ .inktonerfinder .toner-text{margin-bottom: 5px;}
15
+ .inktonerfinder .toner-text input{font-size: 16px; width: 100%; background: #fff; height: 30px; border-radius:0px; border:0;}
16
+ .inktonerfinder .toner-text .loader{float: right; margin-top: -23px; margin-right: 5px;}
17
+ .ui-autocomplete{overflow-y: auto; overflow-x: hidden; max-height: 300px;}
18
+
19
+ .printer_info h3 {background: #3399CC none repeat scroll 0 0; font-weight: 600; padding: 5px; color: #000;}
20
+ .printer_info .printer_text_info table th{font-weight: 600;}
21
+ .printer_info {border-bottom: 1px solid; margin-bottom: 10px; width: 100%;}
22
+
23
+ .printer-index-index .breadcrumbs .home,.printer-index-index .breadcrumbs .search {display: none;}
24
+ .printer-index-index .breadcrumbs .search_result {display: none;}
25
+ .printer-index-index .breadcrumbs .printer.finder {display: none;}
26
+ .printer-index-index .breadcrumbs .Printer span{display: none;}
skin/frontend/base/default/js/inktonerfinder.js ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function getSelectionId(text, li)
2
+ {
3
+ var url = window.location.origin+'/printer/?model_id='+li.id;
4
+ window.open(url,"_self");
5
+ }
6
+
7
+ function getbrands()
8
+ {
9
+ var brandsData = '<option value="" disabled="disabled">Select Manufacturer</option>';
10
+ var url = window.location.origin+'/inktonerfinder/custom/getBrand';
11
+
12
+ $j('#inktonerfinder-brands-select').closest('div').append('<i class="loader fa fa-refresh fa-spin fa-lg"></i>');
13
+ $j.getJSON(url, function(d){
14
+ if(typeof d.data != 'undefined')
15
+ {
16
+ select_text = $j("#inktonerfinder-brands-select option:first-child").clone();
17
+ html_s = '<select onchange="getModelsAndModelSeriesAjax();getModelsListAjax();" name="inktonerfinder-brands-select" id="inktonerfinder-brands-select">';
18
+ $j.each(d.data, function() {
19
+ html_s+= '<option value="'+this.id+'">'+this.val+'</option>';
20
+ });
21
+ html_s+= '</select>';
22
+ $j('#inktonerfinder-brands-select').closest('div').html(html_s);
23
+ $j(select_text).prependTo('#inktonerfinder-brands-select').prop('selected',true);
24
+ $j('#inktonerfinder-brands-select').chosen({ search_contains: true });
25
+ }
26
+ $j('#inktonerfinder-brands-select').closest('div').find('.loader').remove();
27
+ });
28
+ }
29
+
30
+ function getModelsAndModelSeriesAjax()
31
+ {
32
+ console.log($j('#inktonerfinder-modelseries-select'));
33
+ if($j('#inktonerfinder-modelseries-select').length > 0)
34
+ {
35
+ var manufacturersId = $j("#inktonerfinder-brands-select option:selected").val();
36
+ if (manufacturersId)
37
+ {
38
+ var url = window.location.origin+'/inktonerfinder/custom/getModelsAndModelSeriesAjax/manufacture/'+manufacturersId;
39
+
40
+ $j('#inktonerfinder-modelseries-select').prop('disabled',true).closest('div').append('<i class="loader fa fa-refresh fa-spin fa-lg"></i>');
41
+ $j.getJSON(url, function(d){
42
+ if(typeof d.data != 'undefined')
43
+ {
44
+ select_text = $j("#inktonerfinder-modelseries-select option:first-child").clone();
45
+ html_s = '<select onchange="getModelsListAjax()" name="inktonerfinder-modelseries-select" id="inktonerfinder-modelseries-select">';
46
+ $j.each(d.data, function(){
47
+ html_s+= '<option value="'+this.id+'">'+this.val+'</option>';
48
+ });
49
+ html_s+= '</select>';
50
+ $j('#inktonerfinder-modelseries-select').closest('div').html('').html(html_s);
51
+ $j(select_text).prependTo('#inktonerfinder-modelseries-select').prop('selected',true);
52
+ $j('#inktonerfinder-modelseries-select').chosen({ search_contains: true });
53
+ }
54
+ $j('#inktonerfinder-modelseries-select').closest('div').find('.loader').remove();
55
+ });
56
+ }
57
+ }
58
+ }
59
+
60
+ function getModelsListAjax()
61
+ {
62
+ var manufacturersId = $j("#inktonerfinder-brands-select option:selected").val();
63
+ var modelseriesId = $j("#inktonerfinder-modelseries-select option:selected").val();
64
+ if (manufacturersId)
65
+ {
66
+ var url = window.location.origin+'/inktonerfinder/custom/getModelsListAjax/modelseries/'+modelseriesId+'/manufacture/'+manufacturersId;
67
+
68
+ $j('#inktonerfinder-models-select').prop('disabled',true).closest('div').append('<i class="loader fa fa-refresh fa-spin fa-lg"></i>');
69
+ $j.getJSON(url, function(d){
70
+ if(typeof d.data != 'undefined')
71
+ {
72
+ select_text = $j("#inktonerfinder-models-select option:first-child").clone();
73
+ html_s = '<select onchange="getProductsListAjax()" name="inktonerfinder-models-select" id="inktonerfinder-models-select">';
74
+ $j.each(d.data, function(){
75
+ html_s+= '<option value="'+this.id+'">'+this.val+'</option>';
76
+ });
77
+ html_s+= '</select>';
78
+ $j('#inktonerfinder-models-select').closest('div').html('').html(html_s);
79
+ $j(select_text).prependTo('#inktonerfinder-models-select').prop('selected',true);
80
+ $j('#inktonerfinder-models-select').chosen({ search_contains: true });
81
+ }
82
+ $j('#inktonerfinder-models-select').closest('div').find('.loader').remove();
83
+ });
84
+ }
85
+ }
86
+
87
+ function getProductsListAjax()
88
+ {
89
+ var modelId = $j("#inktonerfinder-models-select").val();
90
+ var url = window.location.origin+'/printer/?model_id='+modelId;
91
+ window.open(url,"_self");
92
+ }
93
+
94
+ //Event.observe(window, "load", getbrands);
95
+ $j(document).ready(function(){
96
+ getbrands();
97
+ $j('.dropdowns select').chosen({ search_contains: true });
98
+
99
+ $j("#inktonerfinder-search" ).autocomplete({
100
+ source: function( request, response ) {
101
+ $j('#inktonerfinder-search').closest('div').find('.loader').removeClass('fa-search').addClass('fa-refresh fa-spin');
102
+ $j.ajax({
103
+ url: window.location.origin+'/inktonerfinder/custom/productsAutoCompletePrototype/',
104
+ dataType: "json",
105
+ data: {term: request.term},
106
+ success: function(d){
107
+ backdata = new Array();
108
+ $j(d.data).each(function(k,v){
109
+ backdata.push({value: v.val, id: v.id });
110
+ });
111
+ response( backdata );
112
+ $j('#inktonerfinder-search').closest('div').find('.loader').removeClass('fa-refresh fa-spin').addClass('fa-search');
113
+ }
114
+ });
115
+ },
116
+ minLength: 3,
117
+ autoFocus: true,
118
+ select: function( event, ui ) {
119
+ //console.log( ui.item);
120
+ //console.log( this);
121
+ var url = window.location.origin+'/printer/?model_id='+ui.item.id;
122
+ window.open(url,"_self");
123
+ },
124
+ open: function() {
125
+ $j( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
126
+ },
127
+ close: function() {
128
+ $j( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
129
+ }
130
+ });
131
+ });
132
+
skin/frontend/base/default/js/inktonerfinder_chosen/chosen-sprite.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_chosen/chosen-sprite@2x.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_chosen/chosen.css ADDED
@@ -0,0 +1,437 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Chosen, a Select Box Enhancer for jQuery and Prototype
3
+ by Patrick Filler for Harvest, http://getharvest.com
4
+
5
+ Version 1.3.0
6
+ Full source at https://github.com/harvesthq/chosen
7
+ Copyright (c) 2011-2014 Harvest http://getharvest.com
8
+
9
+ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
+ This file is generated by `grunt build`, do not edit it by hand.
11
+ */
12
+
13
+ /* @group Base */
14
+ .chosen-container {
15
+ position: relative;
16
+ display: inline-block;
17
+ vertical-align: middle;
18
+ font-size: 13px;
19
+ zoom: 1;
20
+ *display: inline;
21
+ -webkit-user-select: none;
22
+ -moz-user-select: none;
23
+ user-select: none;
24
+ }
25
+ .chosen-container * {
26
+ -webkit-box-sizing: border-box;
27
+ -moz-box-sizing: border-box;
28
+ box-sizing: border-box;
29
+ }
30
+ .chosen-container .chosen-drop {
31
+ position: absolute;
32
+ top: 100%;
33
+ left: -9999px;
34
+ z-index: 1010;
35
+ width: 100%;
36
+ border: 1px solid #aaa;
37
+ border-top: 0;
38
+ background: #fff;
39
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
40
+ }
41
+ .chosen-container.chosen-with-drop .chosen-drop {
42
+ left: 0;
43
+ }
44
+ .chosen-container a {
45
+ cursor: pointer;
46
+ }
47
+
48
+ /* @end */
49
+ /* @group Single Chosen */
50
+ .chosen-container-single .chosen-single {
51
+ position: relative;
52
+ display: block;
53
+ overflow: hidden;
54
+ padding: 0 0 0 8px;
55
+ height: 25px;
56
+ border: 1px solid #aaa;
57
+ border-radius: 5px;
58
+ background-color: #fff;
59
+ background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
60
+ background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
61
+ background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
62
+ background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
63
+ background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
64
+ background-clip: padding-box;
65
+ box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
66
+ color: #444;
67
+ text-decoration: none;
68
+ white-space: nowrap;
69
+ line-height: 24px;
70
+ }
71
+ .chosen-container-single .chosen-default {
72
+ color: #999;
73
+ }
74
+ .chosen-container-single .chosen-single span {
75
+ display: block;
76
+ overflow: hidden;
77
+ margin-right: 26px;
78
+ text-overflow: ellipsis;
79
+ white-space: nowrap;
80
+ }
81
+ .chosen-container-single .chosen-single-with-deselect span {
82
+ margin-right: 38px;
83
+ }
84
+ .chosen-container-single .chosen-single abbr {
85
+ position: absolute;
86
+ top: 6px;
87
+ right: 26px;
88
+ display: block;
89
+ width: 12px;
90
+ height: 12px;
91
+ background: url('chosen-sprite.png') -42px 1px no-repeat;
92
+ font-size: 1px;
93
+ }
94
+ .chosen-container-single .chosen-single abbr:hover {
95
+ background-position: -42px -10px;
96
+ }
97
+ .chosen-container-single.chosen-disabled .chosen-single abbr:hover {
98
+ background-position: -42px -10px;
99
+ }
100
+ .chosen-container-single .chosen-single div {
101
+ position: absolute;
102
+ top: 0;
103
+ right: 0;
104
+ display: block;
105
+ width: 18px;
106
+ height: 100%;
107
+ }
108
+ .chosen-container-single .chosen-single div b {
109
+ display: block;
110
+ width: 100%;
111
+ height: 100%;
112
+ background: url('chosen-sprite.png') no-repeat 0px 2px;
113
+ }
114
+ .chosen-container-single .chosen-search {
115
+ position: relative;
116
+ z-index: 1010;
117
+ margin: 0;
118
+ padding: 3px 4px;
119
+ white-space: nowrap;
120
+ }
121
+ .chosen-container-single .chosen-search input[type="text"] {
122
+ margin: 1px 0;
123
+ padding: 4px 20px 4px 5px;
124
+ width: 100%;
125
+ height: auto;
126
+ outline: 0;
127
+ border: 1px solid #aaa;
128
+ background: white url('chosen-sprite.png') no-repeat 100% -20px;
129
+ background: url('chosen-sprite.png') no-repeat 100% -20px;
130
+ font-size: 1em;
131
+ font-family: sans-serif;
132
+ line-height: normal;
133
+ border-radius: 0;
134
+ }
135
+ .chosen-container-single .chosen-drop {
136
+ margin-top: -1px;
137
+ border-radius: 0 0 4px 4px;
138
+ background-clip: padding-box;
139
+ }
140
+ .chosen-container-single.chosen-container-single-nosearch .chosen-search {
141
+ position: absolute;
142
+ left: -9999px;
143
+ }
144
+
145
+ /* @end */
146
+ /* @group Results */
147
+ .chosen-container .chosen-results {
148
+ color: #444;
149
+ position: relative;
150
+ overflow-x: hidden;
151
+ overflow-y: auto;
152
+ margin: 0 4px 4px 0;
153
+ padding: 0 0 0 4px;
154
+ max-height: 240px;
155
+ -webkit-overflow-scrolling: touch;
156
+ }
157
+ .chosen-container .chosen-results li {
158
+ display: none;
159
+ margin: 0;
160
+ padding: 5px 6px;
161
+ list-style: none;
162
+ line-height: 15px;
163
+ word-wrap: break-word;
164
+ -webkit-touch-callout: none;
165
+ }
166
+ .chosen-container .chosen-results li.active-result {
167
+ display: list-item;
168
+ cursor: pointer;
169
+ }
170
+ .chosen-container .chosen-results li.disabled-result {
171
+ display: list-item;
172
+ color: #ccc;
173
+ cursor: default;
174
+ }
175
+ .chosen-container .chosen-results li.highlighted {
176
+ background-color: #3875d7;
177
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
178
+ background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
179
+ background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
180
+ background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
181
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
182
+ color: #fff;
183
+ }
184
+ .chosen-container .chosen-results li.no-results {
185
+ color: #777;
186
+ display: list-item;
187
+ background: #f4f4f4;
188
+ }
189
+ .chosen-container .chosen-results li.group-result {
190
+ display: list-item;
191
+ font-weight: bold;
192
+ cursor: default;
193
+ }
194
+ .chosen-container .chosen-results li.group-option {
195
+ padding-left: 15px;
196
+ }
197
+ .chosen-container .chosen-results li em {
198
+ font-style: normal;
199
+ text-decoration: underline;
200
+ }
201
+
202
+ /* @end */
203
+ /* @group Multi Chosen */
204
+ .chosen-container-multi .chosen-choices {
205
+ position: relative;
206
+ overflow: hidden;
207
+ margin: 0;
208
+ padding: 0 5px;
209
+ width: 100%;
210
+ height: auto !important;
211
+ height: 1%;
212
+ border: 1px solid #aaa;
213
+ background-color: #fff;
214
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
215
+ background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);
216
+ background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);
217
+ background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);
218
+ background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
219
+ cursor: text;
220
+ }
221
+ .chosen-container-multi .chosen-choices li {
222
+ float: left;
223
+ list-style: none;
224
+ }
225
+ .chosen-container-multi .chosen-choices li.search-field {
226
+ margin: 0;
227
+ padding: 0;
228
+ white-space: nowrap;
229
+ }
230
+ .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
231
+ margin: 1px 0;
232
+ padding: 0;
233
+ height: 25px;
234
+ outline: 0;
235
+ border: 0 !important;
236
+ background: transparent !important;
237
+ box-shadow: none;
238
+ color: #999;
239
+ font-size: 100%;
240
+ font-family: sans-serif;
241
+ line-height: normal;
242
+ border-radius: 0;
243
+ }
244
+ .chosen-container-multi .chosen-choices li.search-choice {
245
+ position: relative;
246
+ margin: 3px 5px 3px 0;
247
+ padding: 3px 20px 3px 5px;
248
+ border: 1px solid #aaa;
249
+ max-width: 100%;
250
+ border-radius: 3px;
251
+ background-color: #eeeeee;
252
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
253
+ background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
254
+ background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
255
+ background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
256
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
257
+ background-size: 100% 19px;
258
+ background-repeat: repeat-x;
259
+ background-clip: padding-box;
260
+ box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
261
+ color: #333;
262
+ line-height: 13px;
263
+ cursor: default;
264
+ }
265
+ .chosen-container-multi .chosen-choices li.search-choice span {
266
+ word-wrap: break-word;
267
+ }
268
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
269
+ position: absolute;
270
+ top: 4px;
271
+ right: 3px;
272
+ display: block;
273
+ width: 12px;
274
+ height: 12px;
275
+ background: url('chosen-sprite.png') -42px 1px no-repeat;
276
+ font-size: 1px;
277
+ }
278
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
279
+ background-position: -42px -10px;
280
+ }
281
+ .chosen-container-multi .chosen-choices li.search-choice-disabled {
282
+ padding-right: 5px;
283
+ border: 1px solid #ccc;
284
+ background-color: #e4e4e4;
285
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
286
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
287
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
288
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
289
+ background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
290
+ color: #666;
291
+ }
292
+ .chosen-container-multi .chosen-choices li.search-choice-focus {
293
+ background: #d4d4d4;
294
+ }
295
+ .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
296
+ background-position: -42px -10px;
297
+ }
298
+ .chosen-container-multi .chosen-results {
299
+ margin: 0;
300
+ padding: 0;
301
+ }
302
+ .chosen-container-multi .chosen-drop .result-selected {
303
+ display: list-item;
304
+ color: #ccc;
305
+ cursor: default;
306
+ }
307
+
308
+ /* @end */
309
+ /* @group Active */
310
+ .chosen-container-active .chosen-single {
311
+ border: 1px solid #5897fb;
312
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
313
+ }
314
+ .chosen-container-active.chosen-with-drop .chosen-single {
315
+ border: 1px solid #aaa;
316
+ -moz-border-radius-bottomright: 0;
317
+ border-bottom-right-radius: 0;
318
+ -moz-border-radius-bottomleft: 0;
319
+ border-bottom-left-radius: 0;
320
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
321
+ background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);
322
+ background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);
323
+ background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);
324
+ background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
325
+ box-shadow: 0 1px 0 #fff inset;
326
+ }
327
+ .chosen-container-active.chosen-with-drop .chosen-single div {
328
+ border-left: none;
329
+ background: transparent;
330
+ }
331
+ .chosen-container-active.chosen-with-drop .chosen-single div b {
332
+ background-position: -18px 2px;
333
+ }
334
+ .chosen-container-active .chosen-choices {
335
+ border: 1px solid #5897fb;
336
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
337
+ }
338
+ .chosen-container-active .chosen-choices li.search-field input[type="text"] {
339
+ color: #222 !important;
340
+ }
341
+
342
+ /* @end */
343
+ /* @group Disabled Support */
344
+ .chosen-disabled {
345
+ opacity: 0.5 !important;
346
+ cursor: default;
347
+ }
348
+ .chosen-disabled .chosen-single {
349
+ cursor: default;
350
+ }
351
+ .chosen-disabled .chosen-choices .search-choice .search-choice-close {
352
+ cursor: default;
353
+ }
354
+
355
+ /* @end */
356
+ /* @group Right to Left */
357
+ .chosen-rtl {
358
+ text-align: right;
359
+ }
360
+ .chosen-rtl .chosen-single {
361
+ overflow: visible;
362
+ padding: 0 8px 0 0;
363
+ }
364
+ .chosen-rtl .chosen-single span {
365
+ margin-right: 0;
366
+ margin-left: 26px;
367
+ direction: rtl;
368
+ }
369
+ .chosen-rtl .chosen-single-with-deselect span {
370
+ margin-left: 38px;
371
+ }
372
+ .chosen-rtl .chosen-single div {
373
+ right: auto;
374
+ left: 3px;
375
+ }
376
+ .chosen-rtl .chosen-single abbr {
377
+ right: auto;
378
+ left: 26px;
379
+ }
380
+ .chosen-rtl .chosen-choices li {
381
+ float: right;
382
+ }
383
+ .chosen-rtl .chosen-choices li.search-field input[type="text"] {
384
+ direction: rtl;
385
+ }
386
+ .chosen-rtl .chosen-choices li.search-choice {
387
+ margin: 3px 5px 3px 0;
388
+ padding: 3px 5px 3px 19px;
389
+ }
390
+ .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
391
+ right: auto;
392
+ left: 4px;
393
+ }
394
+ .chosen-rtl.chosen-container-single-nosearch .chosen-search,
395
+ .chosen-rtl .chosen-drop {
396
+ left: 9999px;
397
+ }
398
+ .chosen-rtl.chosen-container-single .chosen-results {
399
+ margin: 0 0 4px 4px;
400
+ padding: 0 4px 0 0;
401
+ }
402
+ .chosen-rtl .chosen-results li.group-option {
403
+ padding-right: 15px;
404
+ padding-left: 0;
405
+ }
406
+ .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
407
+ border-right: none;
408
+ }
409
+ .chosen-rtl .chosen-search input[type="text"] {
410
+ padding: 4px 5px 4px 20px;
411
+ background: white url('chosen-sprite.png') no-repeat -30px -20px;
412
+ background: url('chosen-sprite.png') no-repeat -30px -20px;
413
+ direction: rtl;
414
+ }
415
+ .chosen-rtl.chosen-container-single .chosen-single div b {
416
+ background-position: 6px 2px;
417
+ }
418
+ .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
419
+ background-position: -12px 2px;
420
+ }
421
+
422
+ /* @end */
423
+ /* @group Retina compatibility */
424
+ @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
425
+ .chosen-rtl .chosen-search input[type="text"],
426
+ .chosen-container-single .chosen-single abbr,
427
+ .chosen-container-single .chosen-single div b,
428
+ .chosen-container-single .chosen-search input[type="text"],
429
+ .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
430
+ .chosen-container .chosen-results-scroll-down span,
431
+ .chosen-container .chosen-results-scroll-up span {
432
+ background-image: url('chosen-sprite@2x.png') !important;
433
+ background-size: 52px 37px !important;
434
+ background-repeat: no-repeat !important;
435
+ }
436
+ }
437
+ /* @end */
skin/frontend/base/default/js/inktonerfinder_chosen/chosen.css.bak ADDED
@@ -0,0 +1,437 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Chosen, a Select Box Enhancer for jQuery and Prototype
3
+ by Patrick Filler for Harvest, http://getharvest.com
4
+
5
+ Version 1.3.0
6
+ Full source at https://github.com/harvesthq/chosen
7
+ Copyright (c) 2011-2014 Harvest http://getharvest.com
8
+
9
+ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
+ This file is generated by `grunt build`, do not edit it by hand.
11
+ */
12
+
13
+ /* @group Base */
14
+ .chosen-container {
15
+ position: relative;
16
+ display: inline-block;
17
+ vertical-align: middle;
18
+ font-size: 13px;
19
+ zoom: 1;
20
+ *display: inline;
21
+ -webkit-user-select: none;
22
+ -moz-user-select: none;
23
+ user-select: none;
24
+ }
25
+ .chosen-container * {
26
+ -webkit-box-sizing: border-box;
27
+ -moz-box-sizing: border-box;
28
+ box-sizing: border-box;
29
+ }
30
+ .chosen-container .chosen-drop {
31
+ position: absolute;
32
+ top: 100%;
33
+ left: -9999px;
34
+ z-index: 1010;
35
+ width: 100%;
36
+ border: 1px solid #aaa;
37
+ border-top: 0;
38
+ background: #fff;
39
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
40
+ }
41
+ .chosen-container.chosen-with-drop .chosen-drop {
42
+ left: 0;
43
+ }
44
+ .chosen-container a {
45
+ cursor: pointer;
46
+ }
47
+
48
+ /* @end */
49
+ /* @group Single Chosen */
50
+ .chosen-container-single .chosen-single {
51
+ position: relative;
52
+ display: block;
53
+ overflow: hidden;
54
+ padding: 0 0 0 8px;
55
+ height: 25px;
56
+ border: 1px solid #aaa;
57
+ border-radius: 5px;
58
+ background-color: #fff;
59
+ background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
60
+ background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
61
+ background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
62
+ background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
63
+ background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
64
+ background-clip: padding-box;
65
+ box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
66
+ color: #444;
67
+ text-decoration: none;
68
+ white-space: nowrap;
69
+ line-height: 24px;
70
+ }
71
+ .chosen-container-single .chosen-default {
72
+ color: #999;
73
+ }
74
+ .chosen-container-single .chosen-single span {
75
+ display: block;
76
+ overflow: hidden;
77
+ margin-right: 26px;
78
+ text-overflow: ellipsis;
79
+ white-space: nowrap;
80
+ }
81
+ .chosen-container-single .chosen-single-with-deselect span {
82
+ margin-right: 38px;
83
+ }
84
+ .chosen-container-single .chosen-single abbr {
85
+ position: absolute;
86
+ top: 6px;
87
+ right: 26px;
88
+ display: block;
89
+ width: 12px;
90
+ height: 12px;
91
+ background: url('chosen-sprite.png') -42px 1px no-repeat;
92
+ font-size: 1px;
93
+ }
94
+ .chosen-container-single .chosen-single abbr:hover {
95
+ background-position: -42px -10px;
96
+ }
97
+ .chosen-container-single.chosen-disabled .chosen-single abbr:hover {
98
+ background-position: -42px -10px;
99
+ }
100
+ .chosen-container-single .chosen-single div {
101
+ position: absolute;
102
+ top: 0;
103
+ right: 0;
104
+ display: block;
105
+ width: 18px;
106
+ height: 100%;
107
+ }
108
+ .chosen-container-single .chosen-single div b {
109
+ display: block;
110
+ width: 100%;
111
+ height: 100%;
112
+ background: url('chosen-sprite.png') no-repeat 0px 2px;
113
+ }
114
+ .chosen-container-single .chosen-search {
115
+ position: relative;
116
+ z-index: 1010;
117
+ margin: 0;
118
+ padding: 3px 4px;
119
+ white-space: nowrap;
120
+ }
121
+ .chosen-container-single .chosen-search input[type="text"] {
122
+ margin: 1px 0;
123
+ padding: 4px 20px 4px 5px;
124
+ width: 100%;
125
+ height: auto;
126
+ outline: 0;
127
+ border: 1px solid #aaa;
128
+ background: white url('chosen-sprite.png') no-repeat 100% -20px;
129
+ background: url('chosen-sprite.png') no-repeat 100% -20px;
130
+ font-size: 1em;
131
+ font-family: sans-serif;
132
+ line-height: normal;
133
+ border-radius: 0;
134
+ }
135
+ .chosen-container-single .chosen-drop {
136
+ margin-top: -1px;
137
+ border-radius: 0 0 4px 4px;
138
+ background-clip: padding-box;
139
+ }
140
+ .chosen-container-single.chosen-container-single-nosearch .chosen-search {
141
+ position: absolute;
142
+ left: -9999px;
143
+ }
144
+
145
+ /* @end */
146
+ /* @group Results */
147
+ .chosen-container .chosen-results {
148
+ color: #444;
149
+ position: relative;
150
+ overflow-x: hidden;
151
+ overflow-y: auto;
152
+ margin: 0 4px 4px 0;
153
+ padding: 0 0 0 4px;
154
+ max-height: 240px;
155
+ -webkit-overflow-scrolling: touch;
156
+ }
157
+ .chosen-container .chosen-results li {
158
+ display: none;
159
+ margin: 0;
160
+ padding: 5px 6px;
161
+ list-style: none;
162
+ line-height: 15px;
163
+ word-wrap: break-word;
164
+ -webkit-touch-callout: none;
165
+ }
166
+ .chosen-container .chosen-results li.active-result {
167
+ display: list-item;
168
+ cursor: pointer;
169
+ }
170
+ .chosen-container .chosen-results li.disabled-result {
171
+ display: list-item;
172
+ color: #ccc;
173
+ cursor: default;
174
+ }
175
+ .chosen-container .chosen-results li.highlighted {
176
+ background-color: #3875d7;
177
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
178
+ background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
179
+ background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
180
+ background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
181
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
182
+ color: #fff;
183
+ }
184
+ .chosen-container .chosen-results li.no-results {
185
+ color: #777;
186
+ display: list-item;
187
+ background: #f4f4f4;
188
+ }
189
+ .chosen-container .chosen-results li.group-result {
190
+ display: list-item;
191
+ font-weight: bold;
192
+ cursor: default;
193
+ }
194
+ .chosen-container .chosen-results li.group-option {
195
+ padding-left: 15px;
196
+ }
197
+ .chosen-container .chosen-results li em {
198
+ font-style: normal;
199
+ text-decoration: underline;
200
+ }
201
+
202
+ /* @end */
203
+ /* @group Multi Chosen */
204
+ .chosen-container-multi .chosen-choices {
205
+ position: relative;
206
+ overflow: hidden;
207
+ margin: 0;
208
+ padding: 0 5px;
209
+ width: 100%;
210
+ height: auto !important;
211
+ height: 1%;
212
+ border: 1px solid #aaa;
213
+ background-color: #fff;
214
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
215
+ background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);
216
+ background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);
217
+ background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);
218
+ background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
219
+ cursor: text;
220
+ }
221
+ .chosen-container-multi .chosen-choices li {
222
+ float: left;
223
+ list-style: none;
224
+ }
225
+ .chosen-container-multi .chosen-choices li.search-field {
226
+ margin: 0;
227
+ padding: 0;
228
+ white-space: nowrap;
229
+ }
230
+ .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
231
+ margin: 1px 0;
232
+ padding: 0;
233
+ height: 25px;
234
+ outline: 0;
235
+ border: 0 !important;
236
+ background: transparent !important;
237
+ box-shadow: none;
238
+ color: #999;
239
+ font-size: 100%;
240
+ font-family: sans-serif;
241
+ line-height: normal;
242
+ border-radius: 0;
243
+ }
244
+ .chosen-container-multi .chosen-choices li.search-choice {
245
+ position: relative;
246
+ margin: 3px 5px 3px 0;
247
+ padding: 3px 20px 3px 5px;
248
+ border: 1px solid #aaa;
249
+ max-width: 100%;
250
+ border-radius: 3px;
251
+ background-color: #eeeeee;
252
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
253
+ background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
254
+ background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
255
+ background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
256
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
257
+ background-size: 100% 19px;
258
+ background-repeat: repeat-x;
259
+ background-clip: padding-box;
260
+ box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
261
+ color: #333;
262
+ line-height: 13px;
263
+ cursor: default;
264
+ }
265
+ .chosen-container-multi .chosen-choices li.search-choice span {
266
+ word-wrap: break-word;
267
+ }
268
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
269
+ position: absolute;
270
+ top: 4px;
271
+ right: 3px;
272
+ display: block;
273
+ width: 12px;
274
+ height: 12px;
275
+ background: url('chosen-sprite.png') -42px 1px no-repeat;
276
+ font-size: 1px;
277
+ }
278
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
279
+ background-position: -42px -10px;
280
+ }
281
+ .chosen-container-multi .chosen-choices li.search-choice-disabled {
282
+ padding-right: 5px;
283
+ border: 1px solid #ccc;
284
+ background-color: #e4e4e4;
285
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
286
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
287
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
288
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
289
+ background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
290
+ color: #666;
291
+ }
292
+ .chosen-container-multi .chosen-choices li.search-choice-focus {
293
+ background: #d4d4d4;
294
+ }
295
+ .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
296
+ background-position: -42px -10px;
297
+ }
298
+ .chosen-container-multi .chosen-results {
299
+ margin: 0;
300
+ padding: 0;
301
+ }
302
+ .chosen-container-multi .chosen-drop .result-selected {
303
+ display: list-item;
304
+ color: #ccc;
305
+ cursor: default;
306
+ }
307
+
308
+ /* @end */
309
+ /* @group Active */
310
+ .chosen-container-active .chosen-single {
311
+ border: 1px solid #5897fb;
312
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
313
+ }
314
+ .chosen-container-active.chosen-with-drop .chosen-single {
315
+ border: 1px solid #aaa;
316
+ -moz-border-radius-bottomright: 0;
317
+ border-bottom-right-radius: 0;
318
+ -moz-border-radius-bottomleft: 0;
319
+ border-bottom-left-radius: 0;
320
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
321
+ background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);
322
+ background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);
323
+ background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);
324
+ background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
325
+ box-shadow: 0 1px 0 #fff inset;
326
+ }
327
+ .chosen-container-active.chosen-with-drop .chosen-single div {
328
+ border-left: none;
329
+ background: transparent;
330
+ }
331
+ .chosen-container-active.chosen-with-drop .chosen-single div b {
332
+ background-position: -18px 2px;
333
+ }
334
+ .chosen-container-active .chosen-choices {
335
+ border: 1px solid #5897fb;
336
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
337
+ }
338
+ .chosen-container-active .chosen-choices li.search-field input[type="text"] {
339
+ color: #222 !important;
340
+ }
341
+
342
+ /* @end */
343
+ /* @group Disabled Support */
344
+ .chosen-disabled {
345
+ opacity: 0.5 !important;
346
+ cursor: default;
347
+ }
348
+ .chosen-disabled .chosen-single {
349
+ cursor: default;
350
+ }
351
+ .chosen-disabled .chosen-choices .search-choice .search-choice-close {
352
+ cursor: default;
353
+ }
354
+
355
+ /* @end */
356
+ /* @group Right to Left */
357
+ .chosen-rtl {
358
+ text-align: right;
359
+ }
360
+ .chosen-rtl .chosen-single {
361
+ overflow: visible;
362
+ padding: 0 8px 0 0;
363
+ }
364
+ .chosen-rtl .chosen-single span {
365
+ margin-right: 0;
366
+ margin-left: 26px;
367
+ direction: rtl;
368
+ }
369
+ .chosen-rtl .chosen-single-with-deselect span {
370
+ margin-left: 38px;
371
+ }
372
+ .chosen-rtl .chosen-single div {
373
+ right: auto;
374
+ left: 3px;
375
+ }
376
+ .chosen-rtl .chosen-single abbr {
377
+ right: auto;
378
+ left: 26px;
379
+ }
380
+ .chosen-rtl .chosen-choices li {
381
+ float: right;
382
+ }
383
+ .chosen-rtl .chosen-choices li.search-field input[type="text"] {
384
+ direction: rtl;
385
+ }
386
+ .chosen-rtl .chosen-choices li.search-choice {
387
+ margin: 3px 5px 3px 0;
388
+ padding: 3px 5px 3px 19px;
389
+ }
390
+ .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
391
+ right: auto;
392
+ left: 4px;
393
+ }
394
+ .chosen-rtl.chosen-container-single-nosearch .chosen-search,
395
+ .chosen-rtl .chosen-drop {
396
+ left: 9999px;
397
+ }
398
+ .chosen-rtl.chosen-container-single .chosen-results {
399
+ margin: 0 0 4px 4px;
400
+ padding: 0 4px 0 0;
401
+ }
402
+ .chosen-rtl .chosen-results li.group-option {
403
+ padding-right: 15px;
404
+ padding-left: 0;
405
+ }
406
+ .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
407
+ border-right: none;
408
+ }
409
+ .chosen-rtl .chosen-search input[type="text"] {
410
+ padding: 4px 5px 4px 20px;
411
+ background: white url('chosen-sprite.png') no-repeat -30px -20px;
412
+ background: url('chosen-sprite.png') no-repeat -30px -20px;
413
+ direction: rtl;
414
+ }
415
+ .chosen-rtl.chosen-container-single .chosen-single div b {
416
+ background-position: 6px 2px;
417
+ }
418
+ .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
419
+ background-position: -12px 2px;
420
+ }
421
+
422
+ /* @end */
423
+ /* @group Retina compatibility */
424
+ @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
425
+ .chosen-rtl .chosen-search input[type="text"],
426
+ .chosen-container-single .chosen-single abbr,
427
+ .chosen-container-single .chosen-single div b,
428
+ .chosen-container-single .chosen-search input[type="text"],
429
+ .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
430
+ .chosen-container .chosen-results-scroll-down span,
431
+ .chosen-container .chosen-results-scroll-up span {
432
+ background-image: url('chosen-sprite@2x.png') !important;
433
+ background-size: 52px 37px !important;
434
+ background-repeat: no-repeat !important;
435
+ }
436
+ }
437
+ /* @end */
skin/frontend/base/default/js/inktonerfinder_chosen/chosen.jquery.js ADDED
@@ -0,0 +1,1239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Chosen, a Select Box Enhancer for jQuery and Prototype
3
+ by Patrick Filler for Harvest, http://getharvest.com
4
+
5
+ Version 1.3.0
6
+ Full source at https://github.com/harvesthq/chosen
7
+ Copyright (c) 2011-2014 Harvest http://getharvest.com
8
+
9
+ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
+ This file is generated by `grunt build`, do not edit it by hand.
11
+ */
12
+
13
+ (function() {
14
+ var $, AbstractChosen, Chosen, SelectParser, _ref,
15
+ __hasProp = {}.hasOwnProperty,
16
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
17
+
18
+ SelectParser = (function() {
19
+ function SelectParser() {
20
+ this.options_index = 0;
21
+ this.parsed = [];
22
+ }
23
+
24
+ SelectParser.prototype.add_node = function(child) {
25
+ if (child.nodeName.toUpperCase() === "OPTGROUP") {
26
+ return this.add_group(child);
27
+ } else {
28
+ return this.add_option(child);
29
+ }
30
+ };
31
+
32
+ SelectParser.prototype.add_group = function(group) {
33
+ var group_position, option, _i, _len, _ref, _results;
34
+ group_position = this.parsed.length;
35
+ this.parsed.push({
36
+ array_index: group_position,
37
+ group: true,
38
+ label: this.escapeExpression(group.label),
39
+ children: 0,
40
+ disabled: group.disabled,
41
+ classes: group.className
42
+ });
43
+ _ref = group.childNodes;
44
+ _results = [];
45
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
46
+ option = _ref[_i];
47
+ _results.push(this.add_option(option, group_position, group.disabled));
48
+ }
49
+ return _results;
50
+ };
51
+
52
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
53
+ if (option.nodeName.toUpperCase() === "OPTION") {
54
+ if (option.text !== "") {
55
+ if (group_position != null) {
56
+ this.parsed[group_position].children += 1;
57
+ }
58
+ this.parsed.push({
59
+ array_index: this.parsed.length,
60
+ options_index: this.options_index,
61
+ value: option.value,
62
+ text: option.text,
63
+ html: option.innerHTML,
64
+ selected: option.selected,
65
+ disabled: group_disabled === true ? group_disabled : option.disabled,
66
+ group_array_index: group_position,
67
+ classes: option.className,
68
+ style: option.style.cssText
69
+ });
70
+ } else {
71
+ this.parsed.push({
72
+ array_index: this.parsed.length,
73
+ options_index: this.options_index,
74
+ empty: true
75
+ });
76
+ }
77
+ return this.options_index += 1;
78
+ }
79
+ };
80
+
81
+ SelectParser.prototype.escapeExpression = function(text) {
82
+ var map, unsafe_chars;
83
+ if ((text == null) || text === false) {
84
+ return "";
85
+ }
86
+ if (!/[\&\<\>\"\'\`]/.test(text)) {
87
+ return text;
88
+ }
89
+ map = {
90
+ "<": "&lt;",
91
+ ">": "&gt;",
92
+ '"': "&quot;",
93
+ "'": "&#x27;",
94
+ "`": "&#x60;"
95
+ };
96
+ unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
97
+ return text.replace(unsafe_chars, function(chr) {
98
+ return map[chr] || "&amp;";
99
+ });
100
+ };
101
+
102
+ return SelectParser;
103
+
104
+ })();
105
+
106
+ SelectParser.select_to_array = function(select) {
107
+ var child, parser, _i, _len, _ref;
108
+ parser = new SelectParser();
109
+ _ref = select.childNodes;
110
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
111
+ child = _ref[_i];
112
+ parser.add_node(child);
113
+ }
114
+ return parser.parsed;
115
+ };
116
+
117
+ AbstractChosen = (function() {
118
+ function AbstractChosen(form_field, options) {
119
+ this.form_field = form_field;
120
+ this.options = options != null ? options : {};
121
+ if (!AbstractChosen.browser_is_supported()) {
122
+ return;
123
+ }
124
+ this.is_multiple = this.form_field.multiple;
125
+ this.set_default_text();
126
+ this.set_default_values();
127
+ this.setup();
128
+ this.set_up_html();
129
+ this.register_observers();
130
+ this.on_ready();
131
+ }
132
+
133
+ AbstractChosen.prototype.set_default_values = function() {
134
+ var _this = this;
135
+ this.click_test_action = function(evt) {
136
+ return _this.test_active_click(evt);
137
+ };
138
+ this.activate_action = function(evt) {
139
+ return _this.activate_field(evt);
140
+ };
141
+ this.active_field = false;
142
+ this.mouse_on_container = false;
143
+ this.results_showing = false;
144
+ this.result_highlighted = null;
145
+ this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
146
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
147
+ this.disable_search = this.options.disable_search || false;
148
+ this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
149
+ this.group_search = this.options.group_search != null ? this.options.group_search : true;
150
+ this.search_contains = this.options.search_contains || false;
151
+ this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
152
+ this.max_selected_options = this.options.max_selected_options || Infinity;
153
+ this.inherit_select_classes = this.options.inherit_select_classes || false;
154
+ this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
155
+ return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
156
+ };
157
+
158
+ AbstractChosen.prototype.set_default_text = function() {
159
+ if (this.form_field.getAttribute("data-placeholder")) {
160
+ this.default_text = this.form_field.getAttribute("data-placeholder");
161
+ } else if (this.is_multiple) {
162
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
163
+ } else {
164
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
165
+ }
166
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
167
+ };
168
+
169
+ AbstractChosen.prototype.mouse_enter = function() {
170
+ return this.mouse_on_container = true;
171
+ };
172
+
173
+ AbstractChosen.prototype.mouse_leave = function() {
174
+ return this.mouse_on_container = false;
175
+ };
176
+
177
+ AbstractChosen.prototype.input_focus = function(evt) {
178
+ var _this = this;
179
+ if (this.is_multiple) {
180
+ if (!this.active_field) {
181
+ return setTimeout((function() {
182
+ return _this.container_mousedown();
183
+ }), 50);
184
+ }
185
+ } else {
186
+ if (!this.active_field) {
187
+ return this.activate_field();
188
+ }
189
+ }
190
+ };
191
+
192
+ AbstractChosen.prototype.input_blur = function(evt) {
193
+ var _this = this;
194
+ if (!this.mouse_on_container) {
195
+ this.active_field = false;
196
+ return setTimeout((function() {
197
+ return _this.blur_test();
198
+ }), 100);
199
+ }
200
+ };
201
+
202
+ AbstractChosen.prototype.results_option_build = function(options) {
203
+ var content, data, _i, _len, _ref;
204
+ content = '';
205
+ _ref = this.results_data;
206
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
207
+ data = _ref[_i];
208
+ if (data.group) {
209
+ content += this.result_add_group(data);
210
+ } else {
211
+ content += this.result_add_option(data);
212
+ }
213
+ if (options != null ? options.first : void 0) {
214
+ if (data.selected && this.is_multiple) {
215
+ this.choice_build(data);
216
+ } else if (data.selected && !this.is_multiple) {
217
+ this.single_set_selected_text(data.text);
218
+ }
219
+ }
220
+ }
221
+ return content;
222
+ };
223
+
224
+ AbstractChosen.prototype.result_add_option = function(option) {
225
+ var classes, option_el;
226
+ if (!option.search_match) {
227
+ return '';
228
+ }
229
+ if (!this.include_option_in_results(option)) {
230
+ return '';
231
+ }
232
+ classes = [];
233
+ if (!option.disabled && !(option.selected && this.is_multiple)) {
234
+ classes.push("active-result");
235
+ }
236
+ if (option.disabled && !(option.selected && this.is_multiple)) {
237
+ classes.push("disabled-result");
238
+ }
239
+ if (option.selected) {
240
+ classes.push("result-selected");
241
+ }
242
+ if (option.group_array_index != null) {
243
+ classes.push("group-option");
244
+ }
245
+ if (option.classes !== "") {
246
+ classes.push(option.classes);
247
+ }
248
+ option_el = document.createElement("li");
249
+ option_el.className = classes.join(" ");
250
+ option_el.style.cssText = option.style;
251
+ option_el.setAttribute("data-option-array-index", option.array_index);
252
+ option_el.innerHTML = option.search_text;
253
+ return this.outerHTML(option_el);
254
+ };
255
+
256
+ AbstractChosen.prototype.result_add_group = function(group) {
257
+ var classes, group_el;
258
+ if (!(group.search_match || group.group_match)) {
259
+ return '';
260
+ }
261
+ if (!(group.active_options > 0)) {
262
+ return '';
263
+ }
264
+ classes = [];
265
+ classes.push("group-result");
266
+ if (group.classes) {
267
+ classes.push(group.classes);
268
+ }
269
+ group_el = document.createElement("li");
270
+ group_el.className = classes.join(" ");
271
+ group_el.innerHTML = group.search_text;
272
+ return this.outerHTML(group_el);
273
+ };
274
+
275
+ AbstractChosen.prototype.results_update_field = function() {
276
+ this.set_default_text();
277
+ if (!this.is_multiple) {
278
+ this.results_reset_cleanup();
279
+ }
280
+ this.result_clear_highlight();
281
+ this.results_build();
282
+ if (this.results_showing) {
283
+ return this.winnow_results();
284
+ }
285
+ };
286
+
287
+ AbstractChosen.prototype.reset_single_select_options = function() {
288
+ var result, _i, _len, _ref, _results;
289
+ _ref = this.results_data;
290
+ _results = [];
291
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
292
+ result = _ref[_i];
293
+ if (result.selected) {
294
+ _results.push(result.selected = false);
295
+ } else {
296
+ _results.push(void 0);
297
+ }
298
+ }
299
+ return _results;
300
+ };
301
+
302
+ AbstractChosen.prototype.results_toggle = function() {
303
+ if (this.results_showing) {
304
+ return this.results_hide();
305
+ } else {
306
+ return this.results_show();
307
+ }
308
+ };
309
+
310
+ AbstractChosen.prototype.results_search = function(evt) {
311
+ if (this.results_showing) {
312
+ return this.winnow_results();
313
+ } else {
314
+ return this.results_show();
315
+ }
316
+ };
317
+
318
+ AbstractChosen.prototype.winnow_results = function() {
319
+ var escapedSearchText, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
320
+ this.no_results_clear();
321
+ results = 0;
322
+ searchText = this.get_search_text();
323
+ escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
324
+ zregex = new RegExp(escapedSearchText, 'i');
325
+ regex = this.get_search_regex(escapedSearchText);
326
+ _ref = this.results_data;
327
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
328
+ option = _ref[_i];
329
+ option.search_match = false;
330
+ results_group = null;
331
+ if (this.include_option_in_results(option)) {
332
+ if (option.group) {
333
+ option.group_match = false;
334
+ option.active_options = 0;
335
+ }
336
+ if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
337
+ results_group = this.results_data[option.group_array_index];
338
+ if (results_group.active_options === 0 && results_group.search_match) {
339
+ results += 1;
340
+ }
341
+ results_group.active_options += 1;
342
+ }
343
+ if (!(option.group && !this.group_search)) {
344
+ option.search_text = option.group ? option.label : option.text;
345
+ option.search_match = this.search_string_match(option.search_text, regex);
346
+ if (option.search_match && !option.group) {
347
+ results += 1;
348
+ }
349
+ if (option.search_match) {
350
+ if (searchText.length) {
351
+ startpos = option.search_text.search(zregex);
352
+ text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
353
+ option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
354
+ }
355
+ if (results_group != null) {
356
+ results_group.group_match = true;
357
+ }
358
+ } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
359
+ option.search_match = true;
360
+ }
361
+ }
362
+ }
363
+ }
364
+ this.result_clear_highlight();
365
+ if (results < 1 && searchText.length) {
366
+ this.update_results_content("");
367
+ return this.no_results(searchText);
368
+ } else {
369
+ this.update_results_content(this.results_option_build());
370
+ return this.winnow_results_set_highlight();
371
+ }
372
+ };
373
+
374
+ AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
375
+ var regex_anchor;
376
+ regex_anchor = this.search_contains ? "" : "^";
377
+ return new RegExp(regex_anchor + escaped_search_string, 'i');
378
+ };
379
+
380
+ AbstractChosen.prototype.search_string_match = function(search_string, regex) {
381
+ var part, parts, _i, _len;
382
+ if (regex.test(search_string)) {
383
+ return true;
384
+ } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
385
+ parts = search_string.replace(/\[|\]/g, "").split(" ");
386
+ if (parts.length) {
387
+ for (_i = 0, _len = parts.length; _i < _len; _i++) {
388
+ part = parts[_i];
389
+ if (regex.test(part)) {
390
+ return true;
391
+ }
392
+ }
393
+ }
394
+ }
395
+ };
396
+
397
+ AbstractChosen.prototype.choices_count = function() {
398
+ var option, _i, _len, _ref;
399
+ if (this.selected_option_count != null) {
400
+ return this.selected_option_count;
401
+ }
402
+ this.selected_option_count = 0;
403
+ _ref = this.form_field.options;
404
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
405
+ option = _ref[_i];
406
+ if (option.selected) {
407
+ this.selected_option_count += 1;
408
+ }
409
+ }
410
+ return this.selected_option_count;
411
+ };
412
+
413
+ AbstractChosen.prototype.choices_click = function(evt) {
414
+ evt.preventDefault();
415
+ if (!(this.results_showing || this.is_disabled)) {
416
+ return this.results_show();
417
+ }
418
+ };
419
+
420
+ AbstractChosen.prototype.keyup_checker = function(evt) {
421
+ var stroke, _ref;
422
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
423
+ this.search_field_scale();
424
+ switch (stroke) {
425
+ case 8:
426
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
427
+ return this.keydown_backstroke();
428
+ } else if (!this.pending_backstroke) {
429
+ this.result_clear_highlight();
430
+ return this.results_search();
431
+ }
432
+ break;
433
+ case 13:
434
+ evt.preventDefault();
435
+ if (this.results_showing) {
436
+ return this.result_select(evt);
437
+ }
438
+ break;
439
+ case 27:
440
+ if (this.results_showing) {
441
+ this.results_hide();
442
+ }
443
+ return true;
444
+ case 9:
445
+ case 38:
446
+ case 40:
447
+ case 16:
448
+ case 91:
449
+ case 17:
450
+ break;
451
+ default:
452
+ return this.results_search();
453
+ }
454
+ };
455
+
456
+ AbstractChosen.prototype.clipboard_event_checker = function(evt) {
457
+ var _this = this;
458
+ return setTimeout((function() {
459
+ return _this.results_search();
460
+ }), 50);
461
+ };
462
+
463
+ AbstractChosen.prototype.container_width = function() {
464
+ if (this.options.width != null) {
465
+ return this.options.width;
466
+ } else {
467
+ return "" + this.form_field.offsetWidth + "px";
468
+ }
469
+ };
470
+
471
+ AbstractChosen.prototype.include_option_in_results = function(option) {
472
+ if (this.is_multiple && (!this.display_selected_options && option.selected)) {
473
+ return false;
474
+ }
475
+ if (!this.display_disabled_options && option.disabled) {
476
+ return false;
477
+ }
478
+ if (option.empty) {
479
+ return false;
480
+ }
481
+ return true;
482
+ };
483
+
484
+ AbstractChosen.prototype.search_results_touchstart = function(evt) {
485
+ this.touch_started = true;
486
+ return this.search_results_mouseover(evt);
487
+ };
488
+
489
+ AbstractChosen.prototype.search_results_touchmove = function(evt) {
490
+ this.touch_started = false;
491
+ return this.search_results_mouseout(evt);
492
+ };
493
+
494
+ AbstractChosen.prototype.search_results_touchend = function(evt) {
495
+ if (this.touch_started) {
496
+ return this.search_results_mouseup(evt);
497
+ }
498
+ };
499
+
500
+ AbstractChosen.prototype.outerHTML = function(element) {
501
+ var tmp;
502
+ if (element.outerHTML) {
503
+ return element.outerHTML;
504
+ }
505
+ tmp = document.createElement("div");
506
+ tmp.appendChild(element);
507
+ return tmp.innerHTML;
508
+ };
509
+
510
+ AbstractChosen.browser_is_supported = function() {
511
+ if (window.navigator.appName === "Microsoft Internet Explorer") {
512
+ return document.documentMode >= 8;
513
+ }
514
+ if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
515
+ return false;
516
+ }
517
+ if (/Android/i.test(window.navigator.userAgent)) {
518
+ if (/Mobile/i.test(window.navigator.userAgent)) {
519
+ return false;
520
+ }
521
+ }
522
+ return true;
523
+ };
524
+
525
+ AbstractChosen.default_multiple_text = "Select Some Options";
526
+
527
+ AbstractChosen.default_single_text = "Select an Option";
528
+
529
+ AbstractChosen.default_no_result_text = "No results match";
530
+
531
+ return AbstractChosen;
532
+
533
+ })();
534
+
535
+ $ = jQuery;
536
+
537
+ $.fn.extend({
538
+ chosen: function(options) {
539
+ if (!AbstractChosen.browser_is_supported()) {
540
+ return this;
541
+ }
542
+ return this.each(function(input_field) {
543
+ var $this, chosen;
544
+ $this = $(this);
545
+ chosen = $this.data('chosen');
546
+ if (options === 'destroy' && chosen instanceof Chosen) {
547
+ chosen.destroy();
548
+ } else if (!(chosen instanceof Chosen)) {
549
+ $this.data('chosen', new Chosen(this, options));
550
+ }
551
+ });
552
+ }
553
+ });
554
+
555
+ Chosen = (function(_super) {
556
+ __extends(Chosen, _super);
557
+
558
+ function Chosen() {
559
+ _ref = Chosen.__super__.constructor.apply(this, arguments);
560
+ return _ref;
561
+ }
562
+
563
+ Chosen.prototype.setup = function() {
564
+ this.form_field_jq = $(this.form_field);
565
+ this.current_selectedIndex = this.form_field.selectedIndex;
566
+ return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
567
+ };
568
+
569
+ Chosen.prototype.set_up_html = function() {
570
+ var container_classes, container_props;
571
+ container_classes = ["chosen-container"];
572
+ container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
573
+ if (this.inherit_select_classes && this.form_field.className) {
574
+ container_classes.push(this.form_field.className);
575
+ }
576
+ if (this.is_rtl) {
577
+ container_classes.push("chosen-rtl");
578
+ }
579
+ container_props = {
580
+ 'class': container_classes.join(' '),
581
+ 'style': "width: " + (this.container_width()) + ";",
582
+ 'title': this.form_field.title
583
+ };
584
+ if (this.form_field.id.length) {
585
+ container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
586
+ }
587
+ this.container = $("<div />", container_props);
588
+ if (this.is_multiple) {
589
+ this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
590
+ } else {
591
+ this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
592
+ }
593
+ this.form_field_jq.hide().after(this.container);
594
+ this.dropdown = this.container.find('div.chosen-drop').first();
595
+ this.search_field = this.container.find('input').first();
596
+ this.search_results = this.container.find('ul.chosen-results').first();
597
+ this.search_field_scale();
598
+ this.search_no_results = this.container.find('li.no-results').first();
599
+ if (this.is_multiple) {
600
+ this.search_choices = this.container.find('ul.chosen-choices').first();
601
+ this.search_container = this.container.find('li.search-field').first();
602
+ } else {
603
+ this.search_container = this.container.find('div.chosen-search').first();
604
+ this.selected_item = this.container.find('.chosen-single').first();
605
+ }
606
+ this.results_build();
607
+ this.set_tab_index();
608
+ return this.set_label_behavior();
609
+ };
610
+
611
+ Chosen.prototype.on_ready = function() {
612
+ return this.form_field_jq.trigger("chosen:ready", {
613
+ chosen: this
614
+ });
615
+ };
616
+
617
+ Chosen.prototype.register_observers = function() {
618
+ var _this = this;
619
+ this.container.bind('touchstart.chosen', function(evt) {
620
+ _this.container_mousedown(evt);
621
+ });
622
+ this.container.bind('touchend.chosen', function(evt) {
623
+ _this.container_mouseup(evt);
624
+ });
625
+ this.container.bind('mousedown.chosen', function(evt) {
626
+ _this.container_mousedown(evt);
627
+ });
628
+ this.container.bind('mouseup.chosen', function(evt) {
629
+ _this.container_mouseup(evt);
630
+ });
631
+ this.container.bind('mouseenter.chosen', function(evt) {
632
+ _this.mouse_enter(evt);
633
+ });
634
+ this.container.bind('mouseleave.chosen', function(evt) {
635
+ _this.mouse_leave(evt);
636
+ });
637
+ this.search_results.bind('mouseup.chosen', function(evt) {
638
+ _this.search_results_mouseup(evt);
639
+ });
640
+ this.search_results.bind('mouseover.chosen', function(evt) {
641
+ _this.search_results_mouseover(evt);
642
+ });
643
+ this.search_results.bind('mouseout.chosen', function(evt) {
644
+ _this.search_results_mouseout(evt);
645
+ });
646
+ this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
647
+ _this.search_results_mousewheel(evt);
648
+ });
649
+ this.search_results.bind('touchstart.chosen', function(evt) {
650
+ _this.search_results_touchstart(evt);
651
+ });
652
+ this.search_results.bind('touchmove.chosen', function(evt) {
653
+ _this.search_results_touchmove(evt);
654
+ });
655
+ this.search_results.bind('touchend.chosen', function(evt) {
656
+ _this.search_results_touchend(evt);
657
+ });
658
+ this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
659
+ _this.results_update_field(evt);
660
+ });
661
+ this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
662
+ _this.activate_field(evt);
663
+ });
664
+ this.form_field_jq.bind("chosen:open.chosen", function(evt) {
665
+ _this.container_mousedown(evt);
666
+ });
667
+ this.form_field_jq.bind("chosen:close.chosen", function(evt) {
668
+ _this.input_blur(evt);
669
+ });
670
+ this.search_field.bind('blur.chosen', function(evt) {
671
+ _this.input_blur(evt);
672
+ });
673
+ this.search_field.bind('keyup.chosen', function(evt) {
674
+ _this.keyup_checker(evt);
675
+ });
676
+ this.search_field.bind('keydown.chosen', function(evt) {
677
+ _this.keydown_checker(evt);
678
+ });
679
+ this.search_field.bind('focus.chosen', function(evt) {
680
+ _this.input_focus(evt);
681
+ });
682
+ this.search_field.bind('cut.chosen', function(evt) {
683
+ _this.clipboard_event_checker(evt);
684
+ });
685
+ this.search_field.bind('paste.chosen', function(evt) {
686
+ _this.clipboard_event_checker(evt);
687
+ });
688
+ if (this.is_multiple) {
689
+ return this.search_choices.bind('click.chosen', function(evt) {
690
+ _this.choices_click(evt);
691
+ });
692
+ } else {
693
+ return this.container.bind('click.chosen', function(evt) {
694
+ evt.preventDefault();
695
+ });
696
+ }
697
+ };
698
+
699
+ Chosen.prototype.destroy = function() {
700
+ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
701
+ if (this.search_field[0].tabIndex) {
702
+ this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
703
+ }
704
+ this.container.remove();
705
+ this.form_field_jq.removeData('chosen');
706
+ return this.form_field_jq.show();
707
+ };
708
+
709
+ Chosen.prototype.search_field_disabled = function() {
710
+ this.is_disabled = this.form_field_jq[0].disabled;
711
+ if (this.is_disabled) {
712
+ this.container.addClass('chosen-disabled');
713
+ this.search_field[0].disabled = true;
714
+ if (!this.is_multiple) {
715
+ this.selected_item.unbind("focus.chosen", this.activate_action);
716
+ }
717
+ return this.close_field();
718
+ } else {
719
+ this.container.removeClass('chosen-disabled');
720
+ this.search_field[0].disabled = false;
721
+ if (!this.is_multiple) {
722
+ return this.selected_item.bind("focus.chosen", this.activate_action);
723
+ }
724
+ }
725
+ };
726
+
727
+ Chosen.prototype.container_mousedown = function(evt) {
728
+ if (!this.is_disabled) {
729
+ if (evt && evt.type === "mousedown" && !this.results_showing) {
730
+ evt.preventDefault();
731
+ }
732
+ if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
733
+ if (!this.active_field) {
734
+ if (this.is_multiple) {
735
+ this.search_field.val("");
736
+ }
737
+ $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
738
+ this.results_show();
739
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
740
+ evt.preventDefault();
741
+ this.results_toggle();
742
+ }
743
+ return this.activate_field();
744
+ }
745
+ }
746
+ };
747
+
748
+ Chosen.prototype.container_mouseup = function(evt) {
749
+ if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
750
+ return this.results_reset(evt);
751
+ }
752
+ };
753
+
754
+ Chosen.prototype.search_results_mousewheel = function(evt) {
755
+ var delta;
756
+ if (evt.originalEvent) {
757
+ delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
758
+ }
759
+ if (delta != null) {
760
+ evt.preventDefault();
761
+ if (evt.type === 'DOMMouseScroll') {
762
+ delta = delta * 40;
763
+ }
764
+ return this.search_results.scrollTop(delta + this.search_results.scrollTop());
765
+ }
766
+ };
767
+
768
+ Chosen.prototype.blur_test = function(evt) {
769
+ if (!this.active_field && this.container.hasClass("chosen-container-active")) {
770
+ return this.close_field();
771
+ }
772
+ };
773
+
774
+ Chosen.prototype.close_field = function() {
775
+ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
776
+ this.active_field = false;
777
+ this.results_hide();
778
+ this.container.removeClass("chosen-container-active");
779
+ this.clear_backstroke();
780
+ this.show_search_field_default();
781
+ return this.search_field_scale();
782
+ };
783
+
784
+ Chosen.prototype.activate_field = function() {
785
+ this.container.addClass("chosen-container-active");
786
+ this.active_field = true;
787
+ this.search_field.val(this.search_field.val());
788
+ return this.search_field.focus();
789
+ };
790
+
791
+ Chosen.prototype.test_active_click = function(evt) {
792
+ var active_container;
793
+ active_container = $(evt.target).closest('.chosen-container');
794
+ if (active_container.length && this.container[0] === active_container[0]) {
795
+ return this.active_field = true;
796
+ } else {
797
+ return this.close_field();
798
+ }
799
+ };
800
+
801
+ Chosen.prototype.results_build = function() {
802
+ this.parsing = true;
803
+ this.selected_option_count = null;
804
+ this.results_data = SelectParser.select_to_array(this.form_field);
805
+ if (this.is_multiple) {
806
+ this.search_choices.find("li.search-choice").remove();
807
+ } else if (!this.is_multiple) {
808
+ this.single_set_selected_text();
809
+ if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
810
+ this.search_field[0].readOnly = true;
811
+ this.container.addClass("chosen-container-single-nosearch");
812
+ } else {
813
+ this.search_field[0].readOnly = false;
814
+ this.container.removeClass("chosen-container-single-nosearch");
815
+ }
816
+ }
817
+ this.update_results_content(this.results_option_build({
818
+ first: true
819
+ }));
820
+ this.search_field_disabled();
821
+ this.show_search_field_default();
822
+ this.search_field_scale();
823
+ return this.parsing = false;
824
+ };
825
+
826
+ Chosen.prototype.result_do_highlight = function(el) {
827
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
828
+ if (el.length) {
829
+ this.result_clear_highlight();
830
+ this.result_highlight = el;
831
+ this.result_highlight.addClass("highlighted");
832
+ maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
833
+ visible_top = this.search_results.scrollTop();
834
+ visible_bottom = maxHeight + visible_top;
835
+ high_top = this.result_highlight.position().top + this.search_results.scrollTop();
836
+ high_bottom = high_top + this.result_highlight.outerHeight();
837
+ if (high_bottom >= visible_bottom) {
838
+ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
839
+ } else if (high_top < visible_top) {
840
+ return this.search_results.scrollTop(high_top);
841
+ }
842
+ }
843
+ };
844
+
845
+ Chosen.prototype.result_clear_highlight = function() {
846
+ if (this.result_highlight) {
847
+ this.result_highlight.removeClass("highlighted");
848
+ }
849
+ return this.result_highlight = null;
850
+ };
851
+
852
+ Chosen.prototype.results_show = function() {
853
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
854
+ this.form_field_jq.trigger("chosen:maxselected", {
855
+ chosen: this
856
+ });
857
+ return false;
858
+ }
859
+ this.container.addClass("chosen-with-drop");
860
+ this.results_showing = true;
861
+ this.search_field.focus();
862
+ this.search_field.val(this.search_field.val());
863
+ this.winnow_results();
864
+ return this.form_field_jq.trigger("chosen:showing_dropdown", {
865
+ chosen: this
866
+ });
867
+ };
868
+
869
+ Chosen.prototype.update_results_content = function(content) {
870
+ return this.search_results.html(content);
871
+ };
872
+
873
+ Chosen.prototype.results_hide = function() {
874
+ if (this.results_showing) {
875
+ this.result_clear_highlight();
876
+ this.container.removeClass("chosen-with-drop");
877
+ this.form_field_jq.trigger("chosen:hiding_dropdown", {
878
+ chosen: this
879
+ });
880
+ }
881
+ return this.results_showing = false;
882
+ };
883
+
884
+ Chosen.prototype.set_tab_index = function(el) {
885
+ var ti;
886
+ if (this.form_field.tabIndex) {
887
+ ti = this.form_field.tabIndex;
888
+ this.form_field.tabIndex = -1;
889
+ return this.search_field[0].tabIndex = ti;
890
+ }
891
+ };
892
+
893
+ Chosen.prototype.set_label_behavior = function() {
894
+ var _this = this;
895
+ this.form_field_label = this.form_field_jq.parents("label");
896
+ if (!this.form_field_label.length && this.form_field.id.length) {
897
+ this.form_field_label = $("label[for='" + this.form_field.id + "']");
898
+ }
899
+ if (this.form_field_label.length > 0) {
900
+ return this.form_field_label.bind('click.chosen', function(evt) {
901
+ if (_this.is_multiple) {
902
+ return _this.container_mousedown(evt);
903
+ } else {
904
+ return _this.activate_field();
905
+ }
906
+ });
907
+ }
908
+ };
909
+
910
+ Chosen.prototype.show_search_field_default = function() {
911
+ if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
912
+ this.search_field.val(this.default_text);
913
+ return this.search_field.addClass("default");
914
+ } else {
915
+ this.search_field.val("");
916
+ return this.search_field.removeClass("default");
917
+ }
918
+ };
919
+
920
+ Chosen.prototype.search_results_mouseup = function(evt) {
921
+ var target;
922
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
923
+ if (target.length) {
924
+ this.result_highlight = target;
925
+ this.result_select(evt);
926
+ return this.search_field.focus();
927
+ }
928
+ };
929
+
930
+ Chosen.prototype.search_results_mouseover = function(evt) {
931
+ var target;
932
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
933
+ if (target) {
934
+ return this.result_do_highlight(target);
935
+ }
936
+ };
937
+
938
+ Chosen.prototype.search_results_mouseout = function(evt) {
939
+ if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
940
+ return this.result_clear_highlight();
941
+ }
942
+ };
943
+
944
+ Chosen.prototype.choice_build = function(item) {
945
+ var choice, close_link,
946
+ _this = this;
947
+ choice = $('<li />', {
948
+ "class": "search-choice"
949
+ }).html("<span>" + item.html + "</span>");
950
+ if (item.disabled) {
951
+ choice.addClass('search-choice-disabled');
952
+ } else {
953
+ close_link = $('<a />', {
954
+ "class": 'search-choice-close',
955
+ 'data-option-array-index': item.array_index
956
+ });
957
+ close_link.bind('click.chosen', function(evt) {
958
+ return _this.choice_destroy_link_click(evt);
959
+ });
960
+ choice.append(close_link);
961
+ }
962
+ return this.search_container.before(choice);
963
+ };
964
+
965
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
966
+ evt.preventDefault();
967
+ evt.stopPropagation();
968
+ if (!this.is_disabled) {
969
+ return this.choice_destroy($(evt.target));
970
+ }
971
+ };
972
+
973
+ Chosen.prototype.choice_destroy = function(link) {
974
+ if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
975
+ this.show_search_field_default();
976
+ if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
977
+ this.results_hide();
978
+ }
979
+ link.parents('li').first().remove();
980
+ return this.search_field_scale();
981
+ }
982
+ };
983
+
984
+ Chosen.prototype.results_reset = function() {
985
+ this.reset_single_select_options();
986
+ this.form_field.options[0].selected = true;
987
+ this.single_set_selected_text();
988
+ this.show_search_field_default();
989
+ this.results_reset_cleanup();
990
+ this.form_field_jq.trigger("change");
991
+ if (this.active_field) {
992
+ return this.results_hide();
993
+ }
994
+ };
995
+
996
+ Chosen.prototype.results_reset_cleanup = function() {
997
+ this.current_selectedIndex = this.form_field.selectedIndex;
998
+ return this.selected_item.find("abbr").remove();
999
+ };
1000
+
1001
+ Chosen.prototype.result_select = function(evt) {
1002
+ var high, item;
1003
+ if (this.result_highlight) {
1004
+ high = this.result_highlight;
1005
+ this.result_clear_highlight();
1006
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
1007
+ this.form_field_jq.trigger("chosen:maxselected", {
1008
+ chosen: this
1009
+ });
1010
+ return false;
1011
+ }
1012
+ if (this.is_multiple) {
1013
+ high.removeClass("active-result");
1014
+ } else {
1015
+ this.reset_single_select_options();
1016
+ }
1017
+ item = this.results_data[high[0].getAttribute("data-option-array-index")];
1018
+ item.selected = true;
1019
+ this.form_field.options[item.options_index].selected = true;
1020
+ this.selected_option_count = null;
1021
+ if (this.is_multiple) {
1022
+ this.choice_build(item);
1023
+ } else {
1024
+ this.single_set_selected_text(item.text);
1025
+ }
1026
+ if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
1027
+ this.results_hide();
1028
+ }
1029
+ this.search_field.val("");
1030
+ if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1031
+ this.form_field_jq.trigger("change", {
1032
+ 'selected': this.form_field.options[item.options_index].value
1033
+ });
1034
+ }
1035
+ this.current_selectedIndex = this.form_field.selectedIndex;
1036
+ return this.search_field_scale();
1037
+ }
1038
+ };
1039
+
1040
+ Chosen.prototype.single_set_selected_text = function(text) {
1041
+ if (text == null) {
1042
+ text = this.default_text;
1043
+ }
1044
+ if (text === this.default_text) {
1045
+ this.selected_item.addClass("chosen-default");
1046
+ } else {
1047
+ this.single_deselect_control_build();
1048
+ this.selected_item.removeClass("chosen-default");
1049
+ }
1050
+ return this.selected_item.find("span").text(text);
1051
+ };
1052
+
1053
+ Chosen.prototype.result_deselect = function(pos) {
1054
+ var result_data;
1055
+ result_data = this.results_data[pos];
1056
+ if (!this.form_field.options[result_data.options_index].disabled) {
1057
+ result_data.selected = false;
1058
+ this.form_field.options[result_data.options_index].selected = false;
1059
+ this.selected_option_count = null;
1060
+ this.result_clear_highlight();
1061
+ if (this.results_showing) {
1062
+ this.winnow_results();
1063
+ }
1064
+ this.form_field_jq.trigger("change", {
1065
+ deselected: this.form_field.options[result_data.options_index].value
1066
+ });
1067
+ this.search_field_scale();
1068
+ return true;
1069
+ } else {
1070
+ return false;
1071
+ }
1072
+ };
1073
+
1074
+ Chosen.prototype.single_deselect_control_build = function() {
1075
+ if (!this.allow_single_deselect) {
1076
+ return;
1077
+ }
1078
+ if (!this.selected_item.find("abbr").length) {
1079
+ this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
1080
+ }
1081
+ return this.selected_item.addClass("chosen-single-with-deselect");
1082
+ };
1083
+
1084
+ Chosen.prototype.get_search_text = function() {
1085
+ if (this.search_field.val() === this.default_text) {
1086
+ return "";
1087
+ } else {
1088
+ return $('<div/>').text($.trim(this.search_field.val())).html();
1089
+ }
1090
+ };
1091
+
1092
+ Chosen.prototype.winnow_results_set_highlight = function() {
1093
+ var do_high, selected_results;
1094
+ selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
1095
+ do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
1096
+ if (do_high != null) {
1097
+ return this.result_do_highlight(do_high);
1098
+ }
1099
+ };
1100
+
1101
+ Chosen.prototype.no_results = function(terms) {
1102
+ var no_results_html;
1103
+ no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
1104
+ no_results_html.find("span").first().html(terms);
1105
+ this.search_results.append(no_results_html);
1106
+ return this.form_field_jq.trigger("chosen:no_results", {
1107
+ chosen: this
1108
+ });
1109
+ };
1110
+
1111
+ Chosen.prototype.no_results_clear = function() {
1112
+ return this.search_results.find(".no-results").remove();
1113
+ };
1114
+
1115
+ Chosen.prototype.keydown_arrow = function() {
1116
+ var next_sib;
1117
+ if (this.results_showing && this.result_highlight) {
1118
+ next_sib = this.result_highlight.nextAll("li.active-result").first();
1119
+ if (next_sib) {
1120
+ return this.result_do_highlight(next_sib);
1121
+ }
1122
+ } else {
1123
+ return this.results_show();
1124
+ }
1125
+ };
1126
+
1127
+ Chosen.prototype.keyup_arrow = function() {
1128
+ var prev_sibs;
1129
+ if (!this.results_showing && !this.is_multiple) {
1130
+ return this.results_show();
1131
+ } else if (this.result_highlight) {
1132
+ prev_sibs = this.result_highlight.prevAll("li.active-result");
1133
+ if (prev_sibs.length) {
1134
+ return this.result_do_highlight(prev_sibs.first());
1135
+ } else {
1136
+ if (this.choices_count() > 0) {
1137
+ this.results_hide();
1138
+ }
1139
+ return this.result_clear_highlight();
1140
+ }
1141
+ }
1142
+ };
1143
+
1144
+ Chosen.prototype.keydown_backstroke = function() {
1145
+ var next_available_destroy;
1146
+ if (this.pending_backstroke) {
1147
+ this.choice_destroy(this.pending_backstroke.find("a").first());
1148
+ return this.clear_backstroke();
1149
+ } else {
1150
+ next_available_destroy = this.search_container.siblings("li.search-choice").last();
1151
+ if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
1152
+ this.pending_backstroke = next_available_destroy;
1153
+ if (this.single_backstroke_delete) {
1154
+ return this.keydown_backstroke();
1155
+ } else {
1156
+ return this.pending_backstroke.addClass("search-choice-focus");
1157
+ }
1158
+ }
1159
+ }
1160
+ };
1161
+
1162
+ Chosen.prototype.clear_backstroke = function() {
1163
+ if (this.pending_backstroke) {
1164
+ this.pending_backstroke.removeClass("search-choice-focus");
1165
+ }
1166
+ return this.pending_backstroke = null;
1167
+ };
1168
+
1169
+ Chosen.prototype.keydown_checker = function(evt) {
1170
+ var stroke, _ref1;
1171
+ stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
1172
+ this.search_field_scale();
1173
+ if (stroke !== 8 && this.pending_backstroke) {
1174
+ this.clear_backstroke();
1175
+ }
1176
+ switch (stroke) {
1177
+ case 8:
1178
+ this.backstroke_length = this.search_field.val().length;
1179
+ break;
1180
+ case 9:
1181
+ if (this.results_showing && !this.is_multiple) {
1182
+ this.result_select(evt);
1183
+ }
1184
+ this.mouse_on_container = false;
1185
+ break;
1186
+ case 13:
1187
+ if (this.results_showing) {
1188
+ evt.preventDefault();
1189
+ }
1190
+ break;
1191
+ case 32:
1192
+ if (this.disable_search) {
1193
+ evt.preventDefault();
1194
+ }
1195
+ break;
1196
+ case 38:
1197
+ evt.preventDefault();
1198
+ this.keyup_arrow();
1199
+ break;
1200
+ case 40:
1201
+ evt.preventDefault();
1202
+ this.keydown_arrow();
1203
+ break;
1204
+ }
1205
+ };
1206
+
1207
+ Chosen.prototype.search_field_scale = function() {
1208
+ var div, f_width, h, style, style_block, styles, w, _i, _len;
1209
+ if (this.is_multiple) {
1210
+ h = 0;
1211
+ w = 0;
1212
+ style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1213
+ styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1214
+ for (_i = 0, _len = styles.length; _i < _len; _i++) {
1215
+ style = styles[_i];
1216
+ style_block += style + ":" + this.search_field.css(style) + ";";
1217
+ }
1218
+ div = $('<div />', {
1219
+ 'style': style_block
1220
+ });
1221
+ div.text(this.search_field.val());
1222
+ $('body').append(div);
1223
+ w = div.width() + 25;
1224
+ div.remove();
1225
+ f_width = this.container.outerWidth();
1226
+ if (w > f_width - 10) {
1227
+ w = f_width - 10;
1228
+ }
1229
+ return this.search_field.css({
1230
+ 'width': w + 'px'
1231
+ });
1232
+ }
1233
+ };
1234
+
1235
+ return Chosen;
1236
+
1237
+ })(AbstractChosen);
1238
+
1239
+ }).call(this);
skin/frontend/base/default/js/inktonerfinder_chosen/chosen.jquery.js.bak ADDED
@@ -0,0 +1,1240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Chosen, a Select Box Enhancer for jQuery and Prototype
3
+ by Patrick Filler for Harvest, http://getharvest.com
4
+
5
+ Version 1.3.0
6
+ Full source at https://github.com/harvesthq/chosen
7
+ Copyright (c) 2011-2014 Harvest http://getharvest.com
8
+
9
+ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
+ This file is generated by `grunt build`, do not edit it by hand.
11
+ */
12
+
13
+ (function() {
14
+ var $, AbstractChosen, Chosen, SelectParser, _ref,
15
+ __hasProp = {}.hasOwnProperty,
16
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
17
+
18
+ SelectParser = (function() {
19
+ function SelectParser() {
20
+ this.options_index = 0;
21
+ this.parsed = [];
22
+ }
23
+
24
+ SelectParser.prototype.add_node = function(child) {
25
+ if (child.nodeName.toUpperCase() === "OPTGROUP") {
26
+ return this.add_group(child);
27
+ } else {
28
+ return this.add_option(child);
29
+ }
30
+ };
31
+
32
+ SelectParser.prototype.add_group = function(group) {
33
+ var group_position, option, _i, _len, _ref, _results;
34
+ group_position = this.parsed.length;
35
+ this.parsed.push({
36
+ array_index: group_position,
37
+ group: true,
38
+ label: this.escapeExpression(group.label),
39
+ children: 0,
40
+ disabled: group.disabled,
41
+ classes: group.className
42
+ });
43
+ _ref = group.childNodes;
44
+ _results = [];
45
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
46
+ option = _ref[_i];
47
+ _results.push(this.add_option(option, group_position, group.disabled));
48
+ }
49
+ return _results;
50
+ };
51
+
52
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
53
+ if (option.nodeName.toUpperCase() === "OPTION") {
54
+ if (option.text !== "") {
55
+ if (group_position != null) {
56
+ this.parsed[group_position].children += 1;
57
+ }
58
+ this.parsed.push({
59
+ array_index: this.parsed.length,
60
+ options_index: this.options_index,
61
+ value: option.value,
62
+ text: option.text,
63
+ html: option.innerHTML,
64
+ selected: option.selected,
65
+ disabled: group_disabled === true ? group_disabled : option.disabled,
66
+ group_array_index: group_position,
67
+ classes: option.className,
68
+ style: option.style.cssText
69
+ });
70
+ } else {
71
+ this.parsed.push({
72
+ array_index: this.parsed.length,
73
+ options_index: this.options_index,
74
+ empty: true
75
+ });
76
+ }
77
+ return this.options_index += 1;
78
+ }
79
+ };
80
+
81
+ SelectParser.prototype.escapeExpression = function(text) {
82
+ var map, unsafe_chars;
83
+ if ((text == null) || text === false) {
84
+ return "";
85
+ }
86
+ if (!/[\&\<\>\"\'\`]/.test(text)) {
87
+ return text;
88
+ }
89
+ map = {
90
+ "<": "&lt;",
91
+ ">": "&gt;",
92
+ '"': "&quot;",
93
+ "'": "&#x27;",
94
+ "`": "&#x60;"
95
+ };
96
+ unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
97
+ return text.replace(unsafe_chars, function(chr) {
98
+ return map[chr] || "&amp;";
99
+ });
100
+ };
101
+
102
+ return SelectParser;
103
+
104
+ })();
105
+
106
+ SelectParser.select_to_array = function(select) {
107
+ var child, parser, _i, _len, _ref;
108
+ parser = new SelectParser();
109
+ _ref = select.childNodes;
110
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
111
+ child = _ref[_i];
112
+ parser.add_node(child);
113
+ }
114
+ return parser.parsed;
115
+ };
116
+
117
+ AbstractChosen = (function() {
118
+ function AbstractChosen(form_field, options) {
119
+ this.form_field = form_field;
120
+ this.options = options != null ? options : {};
121
+ if (!AbstractChosen.browser_is_supported()) {
122
+ return;
123
+ }
124
+ this.is_multiple = this.form_field.multiple;
125
+ this.set_default_text();
126
+ this.set_default_values();
127
+ this.setup();
128
+ this.set_up_html();
129
+ this.register_observers();
130
+ this.on_ready();
131
+ }
132
+
133
+ AbstractChosen.prototype.set_default_values = function() {
134
+ var _this = this;
135
+ this.click_test_action = function(evt) {
136
+ return _this.test_active_click(evt);
137
+ };
138
+ this.activate_action = function(evt) {
139
+ return _this.activate_field(evt);
140
+ };
141
+ this.active_field = false;
142
+ this.mouse_on_container = false;
143
+ this.results_showing = false;
144
+ this.result_highlighted = null;
145
+ this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
146
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
147
+ this.disable_search = this.options.disable_search || false;
148
+ this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
149
+ this.group_search = this.options.group_search != null ? this.options.group_search : true;
150
+ this.search_contains = this.options.search_contains || false;
151
+ this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
152
+ this.max_selected_options = this.options.max_selected_options || Infinity;
153
+ this.inherit_select_classes = this.options.inherit_select_classes || false;
154
+ this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
155
+ return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
156
+ };
157
+
158
+ AbstractChosen.prototype.set_default_text = function() {
159
+ if (this.form_field.getAttribute("data-placeholder")) {
160
+ this.default_text = this.form_field.getAttribute("data-placeholder");
161
+ } else if (this.is_multiple) {
162
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
163
+ } else {
164
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
165
+ }
166
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
167
+ };
168
+
169
+ AbstractChosen.prototype.mouse_enter = function() {
170
+ return this.mouse_on_container = true;
171
+ };
172
+
173
+ AbstractChosen.prototype.mouse_leave = function() {
174
+ return this.mouse_on_container = false;
175
+ };
176
+
177
+ AbstractChosen.prototype.input_focus = function(evt) {
178
+ var _this = this;
179
+ if (this.is_multiple) {
180
+ if (!this.active_field) {
181
+ return setTimeout((function() {
182
+ return _this.container_mousedown();
183
+ }), 50);
184
+ }
185
+ } else {
186
+ if (!this.active_field) {
187
+ return this.activate_field();
188
+ }
189
+ }
190
+ };
191
+
192
+ AbstractChosen.prototype.input_blur = function(evt) {
193
+ var _this = this;
194
+ if (!this.mouse_on_container) {
195
+ this.active_field = false;
196
+ return setTimeout((function() {
197
+ return _this.blur_test();
198
+ }), 100);
199
+ }
200
+ };
201
+
202
+ AbstractChosen.prototype.results_option_build = function(options) {
203
+ var content, data, _i, _len, _ref;
204
+ content = '';
205
+ _ref = this.results_data;
206
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
207
+ data = _ref[_i];
208
+ if (data.group) {
209
+ content += this.result_add_group(data);
210
+ } else {
211
+ content += this.result_add_option(data);
212
+ }
213
+ if (options != null ? options.first : void 0) {
214
+ if (data.selected && this.is_multiple) {
215
+ this.choice_build(data);
216
+ } else if (data.selected && !this.is_multiple) {
217
+ this.single_set_selected_text(data.text);
218
+ }
219
+ }
220
+ }
221
+ return content;
222
+ };
223
+
224
+ AbstractChosen.prototype.result_add_option = function(option) {
225
+ var classes, option_el;
226
+ if (!option.search_match) {
227
+ return '';
228
+ }
229
+ if (!this.include_option_in_results(option)) {
230
+ return '';
231
+ }
232
+ classes = [];
233
+ if (!option.disabled && !(option.selected && this.is_multiple)) {
234
+ classes.push("active-result");
235
+ }
236
+ if (option.disabled && !(option.selected && this.is_multiple)) {
237
+ classes.push("disabled-result");
238
+ }
239
+ if (option.selected) {
240
+ classes.push("result-selected");
241
+ }
242
+ if (option.group_array_index != null) {
243
+ classes.push("group-option");
244
+ }
245
+ if (option.classes !== "") {
246
+ classes.push(option.classes);
247
+ }
248
+ option_el = document.createElement("li");
249
+ option_el.className = classes.join(" ");
250
+ option_el.style.cssText = option.style;
251
+ option_el.setAttribute("data-option-array-index", option.array_index);
252
+ option_el.innerHTML = option.search_text;
253
+ return this.outerHTML(option_el);
254
+ };
255
+
256
+ AbstractChosen.prototype.result_add_group = function(group) {
257
+ var classes, group_el;
258
+ if (!(group.search_match || group.group_match)) {
259
+ return '';
260
+ }
261
+ if (!(group.active_options > 0)) {
262
+ return '';
263
+ }
264
+ classes = [];
265
+ classes.push("group-result");
266
+ if (group.classes) {
267
+ classes.push(group.classes);
268
+ }
269
+ group_el = document.createElement("li");
270
+ group_el.className = classes.join(" ");
271
+ group_el.innerHTML = group.search_text;
272
+ return this.outerHTML(group_el);
273
+ };
274
+
275
+ AbstractChosen.prototype.results_update_field = function() {
276
+ this.set_default_text();
277
+ if (!this.is_multiple) {
278
+ this.results_reset_cleanup();
279
+ }
280
+ this.result_clear_highlight();
281
+ this.results_build();
282
+ if (this.results_showing) {
283
+ return this.winnow_results();
284
+ }
285
+ };
286
+
287
+ AbstractChosen.prototype.reset_single_select_options = function() {
288
+ var result, _i, _len, _ref, _results;
289
+ _ref = this.results_data;
290
+ _results = [];
291
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
292
+ result = _ref[_i];
293
+ if (result.selected) {
294
+ _results.push(result.selected = false);
295
+ } else {
296
+ _results.push(void 0);
297
+ }
298
+ }
299
+ return _results;
300
+ };
301
+
302
+ AbstractChosen.prototype.results_toggle = function() {
303
+ if (this.results_showing) {
304
+ return this.results_hide();
305
+ } else {
306
+ return this.results_show();
307
+ }
308
+ };
309
+
310
+ AbstractChosen.prototype.results_search = function(evt) {
311
+ if (this.results_showing) {
312
+ return this.winnow_results();
313
+ } else {
314
+ return this.results_show();
315
+ }
316
+ };
317
+
318
+ AbstractChosen.prototype.winnow_results = function() {
319
+ var escapedSearchText, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
320
+ this.no_results_clear();
321
+ results = 0;
322
+ searchText = this.get_search_text();
323
+ console.log(searchText);
324
+ escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
325
+ zregex = new RegExp(escapedSearchText, 'i');
326
+ regex = this.get_search_regex(escapedSearchText);
327
+ _ref = this.results_data;
328
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
329
+ option = _ref[_i];
330
+ option.search_match = false;
331
+ results_group = null;
332
+ if (this.include_option_in_results(option)) {
333
+ if (option.group) {
334
+ option.group_match = false;
335
+ option.active_options = 0;
336
+ }
337
+ if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
338
+ results_group = this.results_data[option.group_array_index];
339
+ if (results_group.active_options === 0 && results_group.search_match) {
340
+ results += 1;
341
+ }
342
+ results_group.active_options += 1;
343
+ }
344
+ if (!(option.group && !this.group_search)) {
345
+ option.search_text = option.group ? option.label : option.text;
346
+ option.search_match = this.search_string_match(option.search_text, regex);
347
+ if (option.search_match && !option.group) {
348
+ results += 1;
349
+ }
350
+ if (option.search_match) {
351
+ if (searchText.length) {
352
+ startpos = option.search_text.search(zregex);
353
+ text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
354
+ option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
355
+ }
356
+ if (results_group != null) {
357
+ results_group.group_match = true;
358
+ }
359
+ } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
360
+ option.search_match = true;
361
+ }
362
+ }
363
+ }
364
+ }
365
+ this.result_clear_highlight();
366
+ if (results < 1 && searchText.length) {
367
+ this.update_results_content("");
368
+ return this.no_results(searchText);
369
+ } else {
370
+ this.update_results_content(this.results_option_build());
371
+ return this.winnow_results_set_highlight();
372
+ }
373
+ };
374
+
375
+ AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
376
+ var regex_anchor;
377
+ regex_anchor = this.search_contains ? "" : "^";
378
+ return new RegExp(regex_anchor + escaped_search_string, 'i');
379
+ };
380
+
381
+ AbstractChosen.prototype.search_string_match = function(search_string, regex) {
382
+ var part, parts, _i, _len;
383
+ if (regex.test(search_string)) {
384
+ return true;
385
+ } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
386
+ parts = search_string.replace(/\[|\]/g, "").split(" ");
387
+ if (parts.length) {
388
+ for (_i = 0, _len = parts.length; _i < _len; _i++) {
389
+ part = parts[_i];
390
+ if (regex.test(part)) {
391
+ return true;
392
+ }
393
+ }
394
+ }
395
+ }
396
+ };
397
+
398
+ AbstractChosen.prototype.choices_count = function() {
399
+ var option, _i, _len, _ref;
400
+ if (this.selected_option_count != null) {
401
+ return this.selected_option_count;
402
+ }
403
+ this.selected_option_count = 0;
404
+ _ref = this.form_field.options;
405
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
406
+ option = _ref[_i];
407
+ if (option.selected) {
408
+ this.selected_option_count += 1;
409
+ }
410
+ }
411
+ return this.selected_option_count;
412
+ };
413
+
414
+ AbstractChosen.prototype.choices_click = function(evt) {
415
+ evt.preventDefault();
416
+ if (!(this.results_showing || this.is_disabled)) {
417
+ return this.results_show();
418
+ }
419
+ };
420
+
421
+ AbstractChosen.prototype.keyup_checker = function(evt) {
422
+ var stroke, _ref;
423
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
424
+ this.search_field_scale();
425
+ switch (stroke) {
426
+ case 8:
427
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
428
+ return this.keydown_backstroke();
429
+ } else if (!this.pending_backstroke) {
430
+ this.result_clear_highlight();
431
+ return this.results_search();
432
+ }
433
+ break;
434
+ case 13:
435
+ evt.preventDefault();
436
+ if (this.results_showing) {
437
+ return this.result_select(evt);
438
+ }
439
+ break;
440
+ case 27:
441
+ if (this.results_showing) {
442
+ this.results_hide();
443
+ }
444
+ return true;
445
+ case 9:
446
+ case 38:
447
+ case 40:
448
+ case 16:
449
+ case 91:
450
+ case 17:
451
+ break;
452
+ default:
453
+ return this.results_search();
454
+ }
455
+ };
456
+
457
+ AbstractChosen.prototype.clipboard_event_checker = function(evt) {
458
+ var _this = this;
459
+ return setTimeout((function() {
460
+ return _this.results_search();
461
+ }), 50);
462
+ };
463
+
464
+ AbstractChosen.prototype.container_width = function() {
465
+ if (this.options.width != null) {
466
+ return this.options.width;
467
+ } else {
468
+ return "" + this.form_field.offsetWidth + "px";
469
+ }
470
+ };
471
+
472
+ AbstractChosen.prototype.include_option_in_results = function(option) {
473
+ if (this.is_multiple && (!this.display_selected_options && option.selected)) {
474
+ return false;
475
+ }
476
+ if (!this.display_disabled_options && option.disabled) {
477
+ return false;
478
+ }
479
+ if (option.empty) {
480
+ return false;
481
+ }
482
+ return true;
483
+ };
484
+
485
+ AbstractChosen.prototype.search_results_touchstart = function(evt) {
486
+ this.touch_started = true;
487
+ return this.search_results_mouseover(evt);
488
+ };
489
+
490
+ AbstractChosen.prototype.search_results_touchmove = function(evt) {
491
+ this.touch_started = false;
492
+ return this.search_results_mouseout(evt);
493
+ };
494
+
495
+ AbstractChosen.prototype.search_results_touchend = function(evt) {
496
+ if (this.touch_started) {
497
+ return this.search_results_mouseup(evt);
498
+ }
499
+ };
500
+
501
+ AbstractChosen.prototype.outerHTML = function(element) {
502
+ var tmp;
503
+ if (element.outerHTML) {
504
+ return element.outerHTML;
505
+ }
506
+ tmp = document.createElement("div");
507
+ tmp.appendChild(element);
508
+ return tmp.innerHTML;
509
+ };
510
+
511
+ AbstractChosen.browser_is_supported = function() {
512
+ if (window.navigator.appName === "Microsoft Internet Explorer") {
513
+ return document.documentMode >= 8;
514
+ }
515
+ if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
516
+ return false;
517
+ }
518
+ if (/Android/i.test(window.navigator.userAgent)) {
519
+ if (/Mobile/i.test(window.navigator.userAgent)) {
520
+ return false;
521
+ }
522
+ }
523
+ return true;
524
+ };
525
+
526
+ AbstractChosen.default_multiple_text = "Select Some Options";
527
+
528
+ AbstractChosen.default_single_text = "Select an Option";
529
+
530
+ AbstractChosen.default_no_result_text = "No results match";
531
+
532
+ return AbstractChosen;
533
+
534
+ })();
535
+
536
+ $ = jQuery;
537
+
538
+ $.fn.extend({
539
+ chosen: function(options) {
540
+ if (!AbstractChosen.browser_is_supported()) {
541
+ return this;
542
+ }
543
+ return this.each(function(input_field) {
544
+ var $this, chosen;
545
+ $this = $(this);
546
+ chosen = $this.data('chosen');
547
+ if (options === 'destroy' && chosen instanceof Chosen) {
548
+ chosen.destroy();
549
+ } else if (!(chosen instanceof Chosen)) {
550
+ $this.data('chosen', new Chosen(this, options));
551
+ }
552
+ });
553
+ }
554
+ });
555
+
556
+ Chosen = (function(_super) {
557
+ __extends(Chosen, _super);
558
+
559
+ function Chosen() {
560
+ _ref = Chosen.__super__.constructor.apply(this, arguments);
561
+ return _ref;
562
+ }
563
+
564
+ Chosen.prototype.setup = function() {
565
+ this.form_field_jq = $(this.form_field);
566
+ this.current_selectedIndex = this.form_field.selectedIndex;
567
+ return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
568
+ };
569
+
570
+ Chosen.prototype.set_up_html = function() {
571
+ var container_classes, container_props;
572
+ container_classes = ["chosen-container"];
573
+ container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
574
+ if (this.inherit_select_classes && this.form_field.className) {
575
+ container_classes.push(this.form_field.className);
576
+ }
577
+ if (this.is_rtl) {
578
+ container_classes.push("chosen-rtl");
579
+ }
580
+ container_props = {
581
+ 'class': container_classes.join(' '),
582
+ 'style': "width: " + (this.container_width()) + ";",
583
+ 'title': this.form_field.title
584
+ };
585
+ if (this.form_field.id.length) {
586
+ container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
587
+ }
588
+ this.container = $("<div />", container_props);
589
+ if (this.is_multiple) {
590
+ this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
591
+ } else {
592
+ this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
593
+ }
594
+ this.form_field_jq.hide().after(this.container);
595
+ this.dropdown = this.container.find('div.chosen-drop').first();
596
+ this.search_field = this.container.find('input').first();
597
+ this.search_results = this.container.find('ul.chosen-results').first();
598
+ this.search_field_scale();
599
+ this.search_no_results = this.container.find('li.no-results').first();
600
+ if (this.is_multiple) {
601
+ this.search_choices = this.container.find('ul.chosen-choices').first();
602
+ this.search_container = this.container.find('li.search-field').first();
603
+ } else {
604
+ this.search_container = this.container.find('div.chosen-search').first();
605
+ this.selected_item = this.container.find('.chosen-single').first();
606
+ }
607
+ this.results_build();
608
+ this.set_tab_index();
609
+ return this.set_label_behavior();
610
+ };
611
+
612
+ Chosen.prototype.on_ready = function() {
613
+ return this.form_field_jq.trigger("chosen:ready", {
614
+ chosen: this
615
+ });
616
+ };
617
+
618
+ Chosen.prototype.register_observers = function() {
619
+ var _this = this;
620
+ this.container.bind('touchstart.chosen', function(evt) {
621
+ _this.container_mousedown(evt);
622
+ });
623
+ this.container.bind('touchend.chosen', function(evt) {
624
+ _this.container_mouseup(evt);
625
+ });
626
+ this.container.bind('mousedown.chosen', function(evt) {
627
+ _this.container_mousedown(evt);
628
+ });
629
+ this.container.bind('mouseup.chosen', function(evt) {
630
+ _this.container_mouseup(evt);
631
+ });
632
+ this.container.bind('mouseenter.chosen', function(evt) {
633
+ _this.mouse_enter(evt);
634
+ });
635
+ this.container.bind('mouseleave.chosen', function(evt) {
636
+ _this.mouse_leave(evt);
637
+ });
638
+ this.search_results.bind('mouseup.chosen', function(evt) {
639
+ _this.search_results_mouseup(evt);
640
+ });
641
+ this.search_results.bind('mouseover.chosen', function(evt) {
642
+ _this.search_results_mouseover(evt);
643
+ });
644
+ this.search_results.bind('mouseout.chosen', function(evt) {
645
+ _this.search_results_mouseout(evt);
646
+ });
647
+ this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
648
+ _this.search_results_mousewheel(evt);
649
+ });
650
+ this.search_results.bind('touchstart.chosen', function(evt) {
651
+ _this.search_results_touchstart(evt);
652
+ });
653
+ this.search_results.bind('touchmove.chosen', function(evt) {
654
+ _this.search_results_touchmove(evt);
655
+ });
656
+ this.search_results.bind('touchend.chosen', function(evt) {
657
+ _this.search_results_touchend(evt);
658
+ });
659
+ this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
660
+ _this.results_update_field(evt);
661
+ });
662
+ this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
663
+ _this.activate_field(evt);
664
+ });
665
+ this.form_field_jq.bind("chosen:open.chosen", function(evt) {
666
+ _this.container_mousedown(evt);
667
+ });
668
+ this.form_field_jq.bind("chosen:close.chosen", function(evt) {
669
+ _this.input_blur(evt);
670
+ });
671
+ this.search_field.bind('blur.chosen', function(evt) {
672
+ _this.input_blur(evt);
673
+ });
674
+ this.search_field.bind('keyup.chosen', function(evt) {
675
+ _this.keyup_checker(evt);
676
+ });
677
+ this.search_field.bind('keydown.chosen', function(evt) {
678
+ _this.keydown_checker(evt);
679
+ });
680
+ this.search_field.bind('focus.chosen', function(evt) {
681
+ _this.input_focus(evt);
682
+ });
683
+ this.search_field.bind('cut.chosen', function(evt) {
684
+ _this.clipboard_event_checker(evt);
685
+ });
686
+ this.search_field.bind('paste.chosen', function(evt) {
687
+ _this.clipboard_event_checker(evt);
688
+ });
689
+ if (this.is_multiple) {
690
+ return this.search_choices.bind('click.chosen', function(evt) {
691
+ _this.choices_click(evt);
692
+ });
693
+ } else {
694
+ return this.container.bind('click.chosen', function(evt) {
695
+ evt.preventDefault();
696
+ });
697
+ }
698
+ };
699
+
700
+ Chosen.prototype.destroy = function() {
701
+ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
702
+ if (this.search_field[0].tabIndex) {
703
+ this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
704
+ }
705
+ this.container.remove();
706
+ this.form_field_jq.removeData('chosen');
707
+ return this.form_field_jq.show();
708
+ };
709
+
710
+ Chosen.prototype.search_field_disabled = function() {
711
+ this.is_disabled = this.form_field_jq[0].disabled;
712
+ if (this.is_disabled) {
713
+ this.container.addClass('chosen-disabled');
714
+ this.search_field[0].disabled = true;
715
+ if (!this.is_multiple) {
716
+ this.selected_item.unbind("focus.chosen", this.activate_action);
717
+ }
718
+ return this.close_field();
719
+ } else {
720
+ this.container.removeClass('chosen-disabled');
721
+ this.search_field[0].disabled = false;
722
+ if (!this.is_multiple) {
723
+ return this.selected_item.bind("focus.chosen", this.activate_action);
724
+ }
725
+ }
726
+ };
727
+
728
+ Chosen.prototype.container_mousedown = function(evt) {
729
+ if (!this.is_disabled) {
730
+ if (evt && evt.type === "mousedown" && !this.results_showing) {
731
+ evt.preventDefault();
732
+ }
733
+ if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
734
+ if (!this.active_field) {
735
+ if (this.is_multiple) {
736
+ this.search_field.val("");
737
+ }
738
+ $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
739
+ this.results_show();
740
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
741
+ evt.preventDefault();
742
+ this.results_toggle();
743
+ }
744
+ return this.activate_field();
745
+ }
746
+ }
747
+ };
748
+
749
+ Chosen.prototype.container_mouseup = function(evt) {
750
+ if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
751
+ return this.results_reset(evt);
752
+ }
753
+ };
754
+
755
+ Chosen.prototype.search_results_mousewheel = function(evt) {
756
+ var delta;
757
+ if (evt.originalEvent) {
758
+ delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
759
+ }
760
+ if (delta != null) {
761
+ evt.preventDefault();
762
+ if (evt.type === 'DOMMouseScroll') {
763
+ delta = delta * 40;
764
+ }
765
+ return this.search_results.scrollTop(delta + this.search_results.scrollTop());
766
+ }
767
+ };
768
+
769
+ Chosen.prototype.blur_test = function(evt) {
770
+ if (!this.active_field && this.container.hasClass("chosen-container-active")) {
771
+ return this.close_field();
772
+ }
773
+ };
774
+
775
+ Chosen.prototype.close_field = function() {
776
+ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
777
+ this.active_field = false;
778
+ this.results_hide();
779
+ this.container.removeClass("chosen-container-active");
780
+ this.clear_backstroke();
781
+ this.show_search_field_default();
782
+ return this.search_field_scale();
783
+ };
784
+
785
+ Chosen.prototype.activate_field = function() {
786
+ this.container.addClass("chosen-container-active");
787
+ this.active_field = true;
788
+ this.search_field.val(this.search_field.val());
789
+ return this.search_field.focus();
790
+ };
791
+
792
+ Chosen.prototype.test_active_click = function(evt) {
793
+ var active_container;
794
+ active_container = $(evt.target).closest('.chosen-container');
795
+ if (active_container.length && this.container[0] === active_container[0]) {
796
+ return this.active_field = true;
797
+ } else {
798
+ return this.close_field();
799
+ }
800
+ };
801
+
802
+ Chosen.prototype.results_build = function() {
803
+ this.parsing = true;
804
+ this.selected_option_count = null;
805
+ this.results_data = SelectParser.select_to_array(this.form_field);
806
+ if (this.is_multiple) {
807
+ this.search_choices.find("li.search-choice").remove();
808
+ } else if (!this.is_multiple) {
809
+ this.single_set_selected_text();
810
+ if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
811
+ this.search_field[0].readOnly = true;
812
+ this.container.addClass("chosen-container-single-nosearch");
813
+ } else {
814
+ this.search_field[0].readOnly = false;
815
+ this.container.removeClass("chosen-container-single-nosearch");
816
+ }
817
+ }
818
+ this.update_results_content(this.results_option_build({
819
+ first: true
820
+ }));
821
+ this.search_field_disabled();
822
+ this.show_search_field_default();
823
+ this.search_field_scale();
824
+ return this.parsing = false;
825
+ };
826
+
827
+ Chosen.prototype.result_do_highlight = function(el) {
828
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
829
+ if (el.length) {
830
+ this.result_clear_highlight();
831
+ this.result_highlight = el;
832
+ this.result_highlight.addClass("highlighted");
833
+ maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
834
+ visible_top = this.search_results.scrollTop();
835
+ visible_bottom = maxHeight + visible_top;
836
+ high_top = this.result_highlight.position().top + this.search_results.scrollTop();
837
+ high_bottom = high_top + this.result_highlight.outerHeight();
838
+ if (high_bottom >= visible_bottom) {
839
+ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
840
+ } else if (high_top < visible_top) {
841
+ return this.search_results.scrollTop(high_top);
842
+ }
843
+ }
844
+ };
845
+
846
+ Chosen.prototype.result_clear_highlight = function() {
847
+ if (this.result_highlight) {
848
+ this.result_highlight.removeClass("highlighted");
849
+ }
850
+ return this.result_highlight = null;
851
+ };
852
+
853
+ Chosen.prototype.results_show = function() {
854
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
855
+ this.form_field_jq.trigger("chosen:maxselected", {
856
+ chosen: this
857
+ });
858
+ return false;
859
+ }
860
+ this.container.addClass("chosen-with-drop");
861
+ this.results_showing = true;
862
+ this.search_field.focus();
863
+ this.search_field.val(this.search_field.val());
864
+ this.winnow_results();
865
+ return this.form_field_jq.trigger("chosen:showing_dropdown", {
866
+ chosen: this
867
+ });
868
+ };
869
+
870
+ Chosen.prototype.update_results_content = function(content) {
871
+ return this.search_results.html(content);
872
+ };
873
+
874
+ Chosen.prototype.results_hide = function() {
875
+ if (this.results_showing) {
876
+ this.result_clear_highlight();
877
+ this.container.removeClass("chosen-with-drop");
878
+ this.form_field_jq.trigger("chosen:hiding_dropdown", {
879
+ chosen: this
880
+ });
881
+ }
882
+ return this.results_showing = false;
883
+ };
884
+
885
+ Chosen.prototype.set_tab_index = function(el) {
886
+ var ti;
887
+ if (this.form_field.tabIndex) {
888
+ ti = this.form_field.tabIndex;
889
+ this.form_field.tabIndex = -1;
890
+ return this.search_field[0].tabIndex = ti;
891
+ }
892
+ };
893
+
894
+ Chosen.prototype.set_label_behavior = function() {
895
+ var _this = this;
896
+ this.form_field_label = this.form_field_jq.parents("label");
897
+ if (!this.form_field_label.length && this.form_field.id.length) {
898
+ this.form_field_label = $("label[for='" + this.form_field.id + "']");
899
+ }
900
+ if (this.form_field_label.length > 0) {
901
+ return this.form_field_label.bind('click.chosen', function(evt) {
902
+ if (_this.is_multiple) {
903
+ return _this.container_mousedown(evt);
904
+ } else {
905
+ return _this.activate_field();
906
+ }
907
+ });
908
+ }
909
+ };
910
+
911
+ Chosen.prototype.show_search_field_default = function() {
912
+ if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
913
+ this.search_field.val(this.default_text);
914
+ return this.search_field.addClass("default");
915
+ } else {
916
+ this.search_field.val("");
917
+ return this.search_field.removeClass("default");
918
+ }
919
+ };
920
+
921
+ Chosen.prototype.search_results_mouseup = function(evt) {
922
+ var target;
923
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
924
+ if (target.length) {
925
+ this.result_highlight = target;
926
+ this.result_select(evt);
927
+ return this.search_field.focus();
928
+ }
929
+ };
930
+
931
+ Chosen.prototype.search_results_mouseover = function(evt) {
932
+ var target;
933
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
934
+ if (target) {
935
+ return this.result_do_highlight(target);
936
+ }
937
+ };
938
+
939
+ Chosen.prototype.search_results_mouseout = function(evt) {
940
+ if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
941
+ return this.result_clear_highlight();
942
+ }
943
+ };
944
+
945
+ Chosen.prototype.choice_build = function(item) {
946
+ var choice, close_link,
947
+ _this = this;
948
+ choice = $('<li />', {
949
+ "class": "search-choice"
950
+ }).html("<span>" + item.html + "</span>");
951
+ if (item.disabled) {
952
+ choice.addClass('search-choice-disabled');
953
+ } else {
954
+ close_link = $('<a />', {
955
+ "class": 'search-choice-close',
956
+ 'data-option-array-index': item.array_index
957
+ });
958
+ close_link.bind('click.chosen', function(evt) {
959
+ return _this.choice_destroy_link_click(evt);
960
+ });
961
+ choice.append(close_link);
962
+ }
963
+ return this.search_container.before(choice);
964
+ };
965
+
966
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
967
+ evt.preventDefault();
968
+ evt.stopPropagation();
969
+ if (!this.is_disabled) {
970
+ return this.choice_destroy($(evt.target));
971
+ }
972
+ };
973
+
974
+ Chosen.prototype.choice_destroy = function(link) {
975
+ if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
976
+ this.show_search_field_default();
977
+ if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
978
+ this.results_hide();
979
+ }
980
+ link.parents('li').first().remove();
981
+ return this.search_field_scale();
982
+ }
983
+ };
984
+
985
+ Chosen.prototype.results_reset = function() {
986
+ this.reset_single_select_options();
987
+ this.form_field.options[0].selected = true;
988
+ this.single_set_selected_text();
989
+ this.show_search_field_default();
990
+ this.results_reset_cleanup();
991
+ this.form_field_jq.trigger("change");
992
+ if (this.active_field) {
993
+ return this.results_hide();
994
+ }
995
+ };
996
+
997
+ Chosen.prototype.results_reset_cleanup = function() {
998
+ this.current_selectedIndex = this.form_field.selectedIndex;
999
+ return this.selected_item.find("abbr").remove();
1000
+ };
1001
+
1002
+ Chosen.prototype.result_select = function(evt) {
1003
+ var high, item;
1004
+ if (this.result_highlight) {
1005
+ high = this.result_highlight;
1006
+ this.result_clear_highlight();
1007
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
1008
+ this.form_field_jq.trigger("chosen:maxselected", {
1009
+ chosen: this
1010
+ });
1011
+ return false;
1012
+ }
1013
+ if (this.is_multiple) {
1014
+ high.removeClass("active-result");
1015
+ } else {
1016
+ this.reset_single_select_options();
1017
+ }
1018
+ item = this.results_data[high[0].getAttribute("data-option-array-index")];
1019
+ item.selected = true;
1020
+ this.form_field.options[item.options_index].selected = true;
1021
+ this.selected_option_count = null;
1022
+ if (this.is_multiple) {
1023
+ this.choice_build(item);
1024
+ } else {
1025
+ this.single_set_selected_text(item.text);
1026
+ }
1027
+ if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
1028
+ this.results_hide();
1029
+ }
1030
+ this.search_field.val("");
1031
+ if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1032
+ this.form_field_jq.trigger("change", {
1033
+ 'selected': this.form_field.options[item.options_index].value
1034
+ });
1035
+ }
1036
+ this.current_selectedIndex = this.form_field.selectedIndex;
1037
+ return this.search_field_scale();
1038
+ }
1039
+ };
1040
+
1041
+ Chosen.prototype.single_set_selected_text = function(text) {
1042
+ if (text == null) {
1043
+ text = this.default_text;
1044
+ }
1045
+ if (text === this.default_text) {
1046
+ this.selected_item.addClass("chosen-default");
1047
+ } else {
1048
+ this.single_deselect_control_build();
1049
+ this.selected_item.removeClass("chosen-default");
1050
+ }
1051
+ return this.selected_item.find("span").text(text);
1052
+ };
1053
+
1054
+ Chosen.prototype.result_deselect = function(pos) {
1055
+ var result_data;
1056
+ result_data = this.results_data[pos];
1057
+ if (!this.form_field.options[result_data.options_index].disabled) {
1058
+ result_data.selected = false;
1059
+ this.form_field.options[result_data.options_index].selected = false;
1060
+ this.selected_option_count = null;
1061
+ this.result_clear_highlight();
1062
+ if (this.results_showing) {
1063
+ this.winnow_results();
1064
+ }
1065
+ this.form_field_jq.trigger("change", {
1066
+ deselected: this.form_field.options[result_data.options_index].value
1067
+ });
1068
+ this.search_field_scale();
1069
+ return true;
1070
+ } else {
1071
+ return false;
1072
+ }
1073
+ };
1074
+
1075
+ Chosen.prototype.single_deselect_control_build = function() {
1076
+ if (!this.allow_single_deselect) {
1077
+ return;
1078
+ }
1079
+ if (!this.selected_item.find("abbr").length) {
1080
+ this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
1081
+ }
1082
+ return this.selected_item.addClass("chosen-single-with-deselect");
1083
+ };
1084
+
1085
+ Chosen.prototype.get_search_text = function() {
1086
+ if (this.search_field.val() === this.default_text) {
1087
+ return "";
1088
+ } else {
1089
+ return $('<div/>').text($.trim(this.search_field.val())).html();
1090
+ }
1091
+ };
1092
+
1093
+ Chosen.prototype.winnow_results_set_highlight = function() {
1094
+ var do_high, selected_results;
1095
+ selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
1096
+ do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
1097
+ if (do_high != null) {
1098
+ return this.result_do_highlight(do_high);
1099
+ }
1100
+ };
1101
+
1102
+ Chosen.prototype.no_results = function(terms) {
1103
+ var no_results_html;
1104
+ no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
1105
+ no_results_html.find("span").first().html(terms);
1106
+ this.search_results.append(no_results_html);
1107
+ return this.form_field_jq.trigger("chosen:no_results", {
1108
+ chosen: this
1109
+ });
1110
+ };
1111
+
1112
+ Chosen.prototype.no_results_clear = function() {
1113
+ return this.search_results.find(".no-results").remove();
1114
+ };
1115
+
1116
+ Chosen.prototype.keydown_arrow = function() {
1117
+ var next_sib;
1118
+ if (this.results_showing && this.result_highlight) {
1119
+ next_sib = this.result_highlight.nextAll("li.active-result").first();
1120
+ if (next_sib) {
1121
+ return this.result_do_highlight(next_sib);
1122
+ }
1123
+ } else {
1124
+ return this.results_show();
1125
+ }
1126
+ };
1127
+
1128
+ Chosen.prototype.keyup_arrow = function() {
1129
+ var prev_sibs;
1130
+ if (!this.results_showing && !this.is_multiple) {
1131
+ return this.results_show();
1132
+ } else if (this.result_highlight) {
1133
+ prev_sibs = this.result_highlight.prevAll("li.active-result");
1134
+ if (prev_sibs.length) {
1135
+ return this.result_do_highlight(prev_sibs.first());
1136
+ } else {
1137
+ if (this.choices_count() > 0) {
1138
+ this.results_hide();
1139
+ }
1140
+ return this.result_clear_highlight();
1141
+ }
1142
+ }
1143
+ };
1144
+
1145
+ Chosen.prototype.keydown_backstroke = function() {
1146
+ var next_available_destroy;
1147
+ if (this.pending_backstroke) {
1148
+ this.choice_destroy(this.pending_backstroke.find("a").first());
1149
+ return this.clear_backstroke();
1150
+ } else {
1151
+ next_available_destroy = this.search_container.siblings("li.search-choice").last();
1152
+ if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
1153
+ this.pending_backstroke = next_available_destroy;
1154
+ if (this.single_backstroke_delete) {
1155
+ return this.keydown_backstroke();
1156
+ } else {
1157
+ return this.pending_backstroke.addClass("search-choice-focus");
1158
+ }
1159
+ }
1160
+ }
1161
+ };
1162
+
1163
+ Chosen.prototype.clear_backstroke = function() {
1164
+ if (this.pending_backstroke) {
1165
+ this.pending_backstroke.removeClass("search-choice-focus");
1166
+ }
1167
+ return this.pending_backstroke = null;
1168
+ };
1169
+
1170
+ Chosen.prototype.keydown_checker = function(evt) {
1171
+ var stroke, _ref1;
1172
+ stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
1173
+ this.search_field_scale();
1174
+ if (stroke !== 8 && this.pending_backstroke) {
1175
+ this.clear_backstroke();
1176
+ }
1177
+ switch (stroke) {
1178
+ case 8:
1179
+ this.backstroke_length = this.search_field.val().length;
1180
+ break;
1181
+ case 9:
1182
+ if (this.results_showing && !this.is_multiple) {
1183
+ this.result_select(evt);
1184
+ }
1185
+ this.mouse_on_container = false;
1186
+ break;
1187
+ case 13:
1188
+ if (this.results_showing) {
1189
+ evt.preventDefault();
1190
+ }
1191
+ break;
1192
+ case 32:
1193
+ if (this.disable_search) {
1194
+ evt.preventDefault();
1195
+ }
1196
+ break;
1197
+ case 38:
1198
+ evt.preventDefault();
1199
+ this.keyup_arrow();
1200
+ break;
1201
+ case 40:
1202
+ evt.preventDefault();
1203
+ this.keydown_arrow();
1204
+ break;
1205
+ }
1206
+ };
1207
+
1208
+ Chosen.prototype.search_field_scale = function() {
1209
+ var div, f_width, h, style, style_block, styles, w, _i, _len;
1210
+ if (this.is_multiple) {
1211
+ h = 0;
1212
+ w = 0;
1213
+ style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1214
+ styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1215
+ for (_i = 0, _len = styles.length; _i < _len; _i++) {
1216
+ style = styles[_i];
1217
+ style_block += style + ":" + this.search_field.css(style) + ";";
1218
+ }
1219
+ div = $('<div />', {
1220
+ 'style': style_block
1221
+ });
1222
+ div.text(this.search_field.val());
1223
+ $('body').append(div);
1224
+ w = div.width() + 25;
1225
+ div.remove();
1226
+ f_width = this.container.outerWidth();
1227
+ if (w > f_width - 10) {
1228
+ w = f_width - 10;
1229
+ }
1230
+ return this.search_field.css({
1231
+ 'width': w + 'px'
1232
+ });
1233
+ }
1234
+ };
1235
+
1236
+ return Chosen;
1237
+
1238
+ })(AbstractChosen);
1239
+
1240
+ }).call(this);
skin/frontend/base/default/js/inktonerfinder_chosen/chosen.jquery.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /* Chosen v1.3.0 | (c) 2011-2014 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
+ !function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&amp;"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0},AbstractChosen.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(){var a=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return a.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(){var a=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return a.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f;for(b="",f=this.results_data,d=0,e=f.length;e>d;d++)c=f[d],b+=c.group?this.result_add_group(c):this.result_add_option(c),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(c.text));return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match?this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,this.outerHTML(c)):"":""},AbstractChosen.prototype.result_add_group=function(a){var b,c;return a.search_match||a.group_match?a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,this.outerHTML(c)):"":""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),(!b.group||this.group_search)&&(b.search_text=b.group?b.label:b.text,b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+"</em>"+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+"<em>"+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>d&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.get_search_regex=function(a){var b;return b=this.search_contains?"":"^",new RegExp(b+a,"i")},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(){var a=this;return setTimeout(function(){return a.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(){var c,d;c=a(this),d=c.data("chosen"),"destroy"===b&&d instanceof Chosen?d.destroy():d instanceof Chosen||c.data("chosen",new Chosen(this,b))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){a.container_mousedown(b)}),this.container.bind("touchend.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(){var a;return this.form_field.tabIndex?(a=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=a):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+b.html+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(c.text),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").text(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":a("<div/>").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}.call(this);
skin/frontend/base/default/js/inktonerfinder_chosen/chosen.min.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /* Chosen v1.3.0 | (c) 2011-2014 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
+
3
+ .chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;zoom:1;*display:inline;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(chosen-sprite.png) no-repeat 100% -20px;background:url(chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto!important;height:1%;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:transparent}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single-nosearch .chosen-search,.chosen-rtl .chosen-drop{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:0}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:#fff url(chosen-sprite.png) no-repeat -30px -20px;background:url(chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-resolution:144dpi){.chosen-rtl .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-container-single .chosen-search input[type=text],.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span{background-image:url(chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
skin/frontend/base/default/js/inktonerfinder_chosen/chosen.proto.js ADDED
@@ -0,0 +1,1259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Chosen, a Select Box Enhancer for jQuery and Prototype
3
+ by Patrick Filler for Harvest, http://getharvest.com
4
+
5
+ Version 1.3.0
6
+ Full source at https://github.com/harvesthq/chosen
7
+ Copyright (c) 2011-2014 Harvest http://getharvest.com
8
+
9
+ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
+ This file is generated by `grunt build`, do not edit it by hand.
11
+ */
12
+
13
+ (function() {
14
+ var AbstractChosen, SelectParser, _ref,
15
+ __hasProp = {}.hasOwnProperty,
16
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
17
+
18
+ SelectParser = (function() {
19
+ function SelectParser() {
20
+ this.options_index = 0;
21
+ this.parsed = [];
22
+ }
23
+
24
+ SelectParser.prototype.add_node = function(child) {
25
+ if (child.nodeName.toUpperCase() === "OPTGROUP") {
26
+ return this.add_group(child);
27
+ } else {
28
+ return this.add_option(child);
29
+ }
30
+ };
31
+
32
+ SelectParser.prototype.add_group = function(group) {
33
+ var group_position, option, _i, _len, _ref, _results;
34
+ group_position = this.parsed.length;
35
+ this.parsed.push({
36
+ array_index: group_position,
37
+ group: true,
38
+ label: this.escapeExpression(group.label),
39
+ children: 0,
40
+ disabled: group.disabled,
41
+ classes: group.className
42
+ });
43
+ _ref = group.childNodes;
44
+ _results = [];
45
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
46
+ option = _ref[_i];
47
+ _results.push(this.add_option(option, group_position, group.disabled));
48
+ }
49
+ return _results;
50
+ };
51
+
52
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
53
+ if (option.nodeName.toUpperCase() === "OPTION") {
54
+ if (option.text !== "") {
55
+ if (group_position != null) {
56
+ this.parsed[group_position].children += 1;
57
+ }
58
+ this.parsed.push({
59
+ array_index: this.parsed.length,
60
+ options_index: this.options_index,
61
+ value: option.value,
62
+ text: option.text,
63
+ html: option.innerHTML,
64
+ selected: option.selected,
65
+ disabled: group_disabled === true ? group_disabled : option.disabled,
66
+ group_array_index: group_position,
67
+ classes: option.className,
68
+ style: option.style.cssText
69
+ });
70
+ } else {
71
+ this.parsed.push({
72
+ array_index: this.parsed.length,
73
+ options_index: this.options_index,
74
+ empty: true
75
+ });
76
+ }
77
+ return this.options_index += 1;
78
+ }
79
+ };
80
+
81
+ SelectParser.prototype.escapeExpression = function(text) {
82
+ var map, unsafe_chars;
83
+ if ((text == null) || text === false) {
84
+ return "";
85
+ }
86
+ if (!/[\&\<\>\"\'\`]/.test(text)) {
87
+ return text;
88
+ }
89
+ map = {
90
+ "<": "&lt;",
91
+ ">": "&gt;",
92
+ '"': "&quot;",
93
+ "'": "&#x27;",
94
+ "`": "&#x60;"
95
+ };
96
+ unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
97
+ return text.replace(unsafe_chars, function(chr) {
98
+ return map[chr] || "&amp;";
99
+ });
100
+ };
101
+
102
+ return SelectParser;
103
+
104
+ })();
105
+
106
+ SelectParser.select_to_array = function(select) {
107
+ var child, parser, _i, _len, _ref;
108
+ parser = new SelectParser();
109
+ _ref = select.childNodes;
110
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
111
+ child = _ref[_i];
112
+ parser.add_node(child);
113
+ }
114
+ return parser.parsed;
115
+ };
116
+
117
+ AbstractChosen = (function() {
118
+ function AbstractChosen(form_field, options) {
119
+ this.form_field = form_field;
120
+ this.options = options != null ? options : {};
121
+ if (!AbstractChosen.browser_is_supported()) {
122
+ return;
123
+ }
124
+ this.is_multiple = this.form_field.multiple;
125
+ this.set_default_text();
126
+ this.set_default_values();
127
+ this.setup();
128
+ this.set_up_html();
129
+ this.register_observers();
130
+ this.on_ready();
131
+ }
132
+
133
+ AbstractChosen.prototype.set_default_values = function() {
134
+ var _this = this;
135
+ this.click_test_action = function(evt) {
136
+ return _this.test_active_click(evt);
137
+ };
138
+ this.activate_action = function(evt) {
139
+ return _this.activate_field(evt);
140
+ };
141
+ this.active_field = false;
142
+ this.mouse_on_container = false;
143
+ this.results_showing = false;
144
+ this.result_highlighted = null;
145
+ this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
146
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
147
+ this.disable_search = this.options.disable_search || false;
148
+ this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
149
+ this.group_search = this.options.group_search != null ? this.options.group_search : true;
150
+ this.search_contains = this.options.search_contains || false;
151
+ this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
152
+ this.max_selected_options = this.options.max_selected_options || Infinity;
153
+ this.inherit_select_classes = this.options.inherit_select_classes || false;
154
+ this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
155
+ return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
156
+ };
157
+
158
+ AbstractChosen.prototype.set_default_text = function() {
159
+ if (this.form_field.getAttribute("data-placeholder")) {
160
+ this.default_text = this.form_field.getAttribute("data-placeholder");
161
+ } else if (this.is_multiple) {
162
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
163
+ } else {
164
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
165
+ }
166
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
167
+ };
168
+
169
+ AbstractChosen.prototype.mouse_enter = function() {
170
+ return this.mouse_on_container = true;
171
+ };
172
+
173
+ AbstractChosen.prototype.mouse_leave = function() {
174
+ return this.mouse_on_container = false;
175
+ };
176
+
177
+ AbstractChosen.prototype.input_focus = function(evt) {
178
+ var _this = this;
179
+ if (this.is_multiple) {
180
+ if (!this.active_field) {
181
+ return setTimeout((function() {
182
+ return _this.container_mousedown();
183
+ }), 50);
184
+ }
185
+ } else {
186
+ if (!this.active_field) {
187
+ return this.activate_field();
188
+ }
189
+ }
190
+ };
191
+
192
+ AbstractChosen.prototype.input_blur = function(evt) {
193
+ var _this = this;
194
+ if (!this.mouse_on_container) {
195
+ this.active_field = false;
196
+ return setTimeout((function() {
197
+ return _this.blur_test();
198
+ }), 100);
199
+ }
200
+ };
201
+
202
+ AbstractChosen.prototype.results_option_build = function(options) {
203
+ var content, data, _i, _len, _ref;
204
+ content = '';
205
+ _ref = this.results_data;
206
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
207
+ data = _ref[_i];
208
+ if (data.group) {
209
+ content += this.result_add_group(data);
210
+ } else {
211
+ content += this.result_add_option(data);
212
+ }
213
+ if (options != null ? options.first : void 0) {
214
+ if (data.selected && this.is_multiple) {
215
+ this.choice_build(data);
216
+ } else if (data.selected && !this.is_multiple) {
217
+ this.single_set_selected_text(data.text);
218
+ }
219
+ }
220
+ }
221
+ return content;
222
+ };
223
+
224
+ AbstractChosen.prototype.result_add_option = function(option) {
225
+ var classes, option_el;
226
+ if (!option.search_match) {
227
+ return '';
228
+ }
229
+ if (!this.include_option_in_results(option)) {
230
+ return '';
231
+ }
232
+ classes = [];
233
+ if (!option.disabled && !(option.selected && this.is_multiple)) {
234
+ classes.push("active-result");
235
+ }
236
+ if (option.disabled && !(option.selected && this.is_multiple)) {
237
+ classes.push("disabled-result");
238
+ }
239
+ if (option.selected) {
240
+ classes.push("result-selected");
241
+ }
242
+ if (option.group_array_index != null) {
243
+ classes.push("group-option");
244
+ }
245
+ if (option.classes !== "") {
246
+ classes.push(option.classes);
247
+ }
248
+ option_el = document.createElement("li");
249
+ option_el.className = classes.join(" ");
250
+ option_el.style.cssText = option.style;
251
+ option_el.setAttribute("data-option-array-index", option.array_index);
252
+ option_el.innerHTML = option.search_text;
253
+ return this.outerHTML(option_el);
254
+ };
255
+
256
+ AbstractChosen.prototype.result_add_group = function(group) {
257
+ var classes, group_el;
258
+ if (!(group.search_match || group.group_match)) {
259
+ return '';
260
+ }
261
+ if (!(group.active_options > 0)) {
262
+ return '';
263
+ }
264
+ classes = [];
265
+ classes.push("group-result");
266
+ if (group.classes) {
267
+ classes.push(group.classes);
268
+ }
269
+ group_el = document.createElement("li");
270
+ group_el.className = classes.join(" ");
271
+ group_el.innerHTML = group.search_text;
272
+ return this.outerHTML(group_el);
273
+ };
274
+
275
+ AbstractChosen.prototype.results_update_field = function() {
276
+ this.set_default_text();
277
+ if (!this.is_multiple) {
278
+ this.results_reset_cleanup();
279
+ }
280
+ this.result_clear_highlight();
281
+ this.results_build();
282
+ if (this.results_showing) {
283
+ return this.winnow_results();
284
+ }
285
+ };
286
+
287
+ AbstractChosen.prototype.reset_single_select_options = function() {
288
+ var result, _i, _len, _ref, _results;
289
+ _ref = this.results_data;
290
+ _results = [];
291
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
292
+ result = _ref[_i];
293
+ if (result.selected) {
294
+ _results.push(result.selected = false);
295
+ } else {
296
+ _results.push(void 0);
297
+ }
298
+ }
299
+ return _results;
300
+ };
301
+
302
+ AbstractChosen.prototype.results_toggle = function() {
303
+ if (this.results_showing) {
304
+ return this.results_hide();
305
+ } else {
306
+ return this.results_show();
307
+ }
308
+ };
309
+
310
+ AbstractChosen.prototype.results_search = function(evt) {
311
+ if (this.results_showing) {
312
+ return this.winnow_results();
313
+ } else {
314
+ return this.results_show();
315
+ }
316
+ };
317
+
318
+ AbstractChosen.prototype.winnow_results = function() {
319
+ var escapedSearchText, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
320
+ this.no_results_clear();
321
+ results = 0;
322
+ searchText = this.get_search_text();
323
+ escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
324
+ zregex = new RegExp(escapedSearchText, 'i');
325
+ regex = this.get_search_regex(escapedSearchText);
326
+ _ref = this.results_data;
327
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
328
+ option = _ref[_i];
329
+ option.search_match = false;
330
+ results_group = null;
331
+ if (this.include_option_in_results(option)) {
332
+ if (option.group) {
333
+ option.group_match = false;
334
+ option.active_options = 0;
335
+ }
336
+ if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
337
+ results_group = this.results_data[option.group_array_index];
338
+ if (results_group.active_options === 0 && results_group.search_match) {
339
+ results += 1;
340
+ }
341
+ results_group.active_options += 1;
342
+ }
343
+ if (!(option.group && !this.group_search)) {
344
+ option.search_text = option.group ? option.label : option.text;
345
+ option.search_match = this.search_string_match(option.search_text, regex);
346
+ if (option.search_match && !option.group) {
347
+ results += 1;
348
+ }
349
+ if (option.search_match) {
350
+ if (searchText.length) {
351
+ startpos = option.search_text.search(zregex);
352
+ text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
353
+ option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
354
+ }
355
+ if (results_group != null) {
356
+ results_group.group_match = true;
357
+ }
358
+ } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
359
+ option.search_match = true;
360
+ }
361
+ }
362
+ }
363
+ }
364
+ this.result_clear_highlight();
365
+ if (results < 1 && searchText.length) {
366
+ this.update_results_content("");
367
+ return this.no_results(searchText);
368
+ } else {
369
+ this.update_results_content(this.results_option_build());
370
+ return this.winnow_results_set_highlight();
371
+ }
372
+ };
373
+
374
+ AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
375
+ var regex_anchor;
376
+ regex_anchor = this.search_contains ? "" : "^";
377
+ return new RegExp(regex_anchor + escaped_search_string, 'i');
378
+ };
379
+
380
+ AbstractChosen.prototype.search_string_match = function(search_string, regex) {
381
+ var part, parts, _i, _len;
382
+ if (regex.test(search_string)) {
383
+ return true;
384
+ } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
385
+ parts = search_string.replace(/\[|\]/g, "").split(" ");
386
+ if (parts.length) {
387
+ for (_i = 0, _len = parts.length; _i < _len; _i++) {
388
+ part = parts[_i];
389
+ if (regex.test(part)) {
390
+ return true;
391
+ }
392
+ }
393
+ }
394
+ }
395
+ };
396
+
397
+ AbstractChosen.prototype.choices_count = function() {
398
+ var option, _i, _len, _ref;
399
+ if (this.selected_option_count != null) {
400
+ return this.selected_option_count;
401
+ }
402
+ this.selected_option_count = 0;
403
+ _ref = this.form_field.options;
404
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
405
+ option = _ref[_i];
406
+ if (option.selected) {
407
+ this.selected_option_count += 1;
408
+ }
409
+ }
410
+ return this.selected_option_count;
411
+ };
412
+
413
+ AbstractChosen.prototype.choices_click = function(evt) {
414
+ evt.preventDefault();
415
+ if (!(this.results_showing || this.is_disabled)) {
416
+ return this.results_show();
417
+ }
418
+ };
419
+
420
+ AbstractChosen.prototype.keyup_checker = function(evt) {
421
+ var stroke, _ref;
422
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
423
+ this.search_field_scale();
424
+ switch (stroke) {
425
+ case 8:
426
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
427
+ return this.keydown_backstroke();
428
+ } else if (!this.pending_backstroke) {
429
+ this.result_clear_highlight();
430
+ return this.results_search();
431
+ }
432
+ break;
433
+ case 13:
434
+ evt.preventDefault();
435
+ if (this.results_showing) {
436
+ return this.result_select(evt);
437
+ }
438
+ break;
439
+ case 27:
440
+ if (this.results_showing) {
441
+ this.results_hide();
442
+ }
443
+ return true;
444
+ case 9:
445
+ case 38:
446
+ case 40:
447
+ case 16:
448
+ case 91:
449
+ case 17:
450
+ break;
451
+ default:
452
+ return this.results_search();
453
+ }
454
+ };
455
+
456
+ AbstractChosen.prototype.clipboard_event_checker = function(evt) {
457
+ var _this = this;
458
+ return setTimeout((function() {
459
+ return _this.results_search();
460
+ }), 50);
461
+ };
462
+
463
+ AbstractChosen.prototype.container_width = function() {
464
+ if (this.options.width != null) {
465
+ return this.options.width;
466
+ } else {
467
+ return "" + this.form_field.offsetWidth + "px";
468
+ }
469
+ };
470
+
471
+ AbstractChosen.prototype.include_option_in_results = function(option) {
472
+ if (this.is_multiple && (!this.display_selected_options && option.selected)) {
473
+ return false;
474
+ }
475
+ if (!this.display_disabled_options && option.disabled) {
476
+ return false;
477
+ }
478
+ if (option.empty) {
479
+ return false;
480
+ }
481
+ return true;
482
+ };
483
+
484
+ AbstractChosen.prototype.search_results_touchstart = function(evt) {
485
+ this.touch_started = true;
486
+ return this.search_results_mouseover(evt);
487
+ };
488
+
489
+ AbstractChosen.prototype.search_results_touchmove = function(evt) {
490
+ this.touch_started = false;
491
+ return this.search_results_mouseout(evt);
492
+ };
493
+
494
+ AbstractChosen.prototype.search_results_touchend = function(evt) {
495
+ if (this.touch_started) {
496
+ return this.search_results_mouseup(evt);
497
+ }
498
+ };
499
+
500
+ AbstractChosen.prototype.outerHTML = function(element) {
501
+ var tmp;
502
+ if (element.outerHTML) {
503
+ return element.outerHTML;
504
+ }
505
+ tmp = document.createElement("div");
506
+ tmp.appendChild(element);
507
+ return tmp.innerHTML;
508
+ };
509
+
510
+ AbstractChosen.browser_is_supported = function() {
511
+ if (window.navigator.appName === "Microsoft Internet Explorer") {
512
+ return document.documentMode >= 8;
513
+ }
514
+ if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
515
+ return false;
516
+ }
517
+ if (/Android/i.test(window.navigator.userAgent)) {
518
+ if (/Mobile/i.test(window.navigator.userAgent)) {
519
+ return false;
520
+ }
521
+ }
522
+ return true;
523
+ };
524
+
525
+ AbstractChosen.default_multiple_text = "Select Some Options";
526
+
527
+ AbstractChosen.default_single_text = "Select an Option";
528
+
529
+ AbstractChosen.default_no_result_text = "No results match";
530
+
531
+ return AbstractChosen;
532
+
533
+ })();
534
+
535
+ this.Chosen = (function(_super) {
536
+ __extends(Chosen, _super);
537
+
538
+ function Chosen() {
539
+ _ref = Chosen.__super__.constructor.apply(this, arguments);
540
+ return _ref;
541
+ }
542
+
543
+ Chosen.prototype.setup = function() {
544
+ this.current_selectedIndex = this.form_field.selectedIndex;
545
+ return this.is_rtl = this.form_field.hasClassName("chosen-rtl");
546
+ };
547
+
548
+ Chosen.prototype.set_default_values = function() {
549
+ Chosen.__super__.set_default_values.call(this);
550
+ this.single_temp = new Template('<a class="chosen-single chosen-default" tabindex="-1"><span>#{default}</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
551
+ this.multi_temp = new Template('<ul class="chosen-choices"><li class="search-field"><input type="text" value="#{default}" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
552
+ return this.no_results_temp = new Template('<li class="no-results">' + this.results_none_found + ' "<span>#{terms}</span>"</li>');
553
+ };
554
+
555
+ Chosen.prototype.set_up_html = function() {
556
+ var container_classes, container_props;
557
+ container_classes = ["chosen-container"];
558
+ container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
559
+ if (this.inherit_select_classes && this.form_field.className) {
560
+ container_classes.push(this.form_field.className);
561
+ }
562
+ if (this.is_rtl) {
563
+ container_classes.push("chosen-rtl");
564
+ }
565
+ container_props = {
566
+ 'class': container_classes.join(' '),
567
+ 'style': "width: " + (this.container_width()) + ";",
568
+ 'title': this.form_field.title
569
+ };
570
+ if (this.form_field.id.length) {
571
+ container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
572
+ }
573
+ this.container = this.is_multiple ? new Element('div', container_props).update(this.multi_temp.evaluate({
574
+ "default": this.default_text
575
+ })) : new Element('div', container_props).update(this.single_temp.evaluate({
576
+ "default": this.default_text
577
+ }));
578
+ this.form_field.hide().insert({
579
+ after: this.container
580
+ });
581
+ this.dropdown = this.container.down('div.chosen-drop');
582
+ this.search_field = this.container.down('input');
583
+ this.search_results = this.container.down('ul.chosen-results');
584
+ this.search_field_scale();
585
+ this.search_no_results = this.container.down('li.no-results');
586
+ if (this.is_multiple) {
587
+ this.search_choices = this.container.down('ul.chosen-choices');
588
+ this.search_container = this.container.down('li.search-field');
589
+ } else {
590
+ this.search_container = this.container.down('div.chosen-search');
591
+ this.selected_item = this.container.down('.chosen-single');
592
+ }
593
+ this.results_build();
594
+ this.set_tab_index();
595
+ return this.set_label_behavior();
596
+ };
597
+
598
+ Chosen.prototype.on_ready = function() {
599
+ return this.form_field.fire("chosen:ready", {
600
+ chosen: this
601
+ });
602
+ };
603
+
604
+ Chosen.prototype.register_observers = function() {
605
+ var _this = this;
606
+ this.container.observe("touchstart", function(evt) {
607
+ return _this.container_mousedown(evt);
608
+ });
609
+ this.container.observe("touchend", function(evt) {
610
+ return _this.container_mouseup(evt);
611
+ });
612
+ this.container.observe("mousedown", function(evt) {
613
+ return _this.container_mousedown(evt);
614
+ });
615
+ this.container.observe("mouseup", function(evt) {
616
+ return _this.container_mouseup(evt);
617
+ });
618
+ this.container.observe("mouseenter", function(evt) {
619
+ return _this.mouse_enter(evt);
620
+ });
621
+ this.container.observe("mouseleave", function(evt) {
622
+ return _this.mouse_leave(evt);
623
+ });
624
+ this.search_results.observe("mouseup", function(evt) {
625
+ return _this.search_results_mouseup(evt);
626
+ });
627
+ this.search_results.observe("mouseover", function(evt) {
628
+ return _this.search_results_mouseover(evt);
629
+ });
630
+ this.search_results.observe("mouseout", function(evt) {
631
+ return _this.search_results_mouseout(evt);
632
+ });
633
+ this.search_results.observe("mousewheel", function(evt) {
634
+ return _this.search_results_mousewheel(evt);
635
+ });
636
+ this.search_results.observe("DOMMouseScroll", function(evt) {
637
+ return _this.search_results_mousewheel(evt);
638
+ });
639
+ this.search_results.observe("touchstart", function(evt) {
640
+ return _this.search_results_touchstart(evt);
641
+ });
642
+ this.search_results.observe("touchmove", function(evt) {
643
+ return _this.search_results_touchmove(evt);
644
+ });
645
+ this.search_results.observe("touchend", function(evt) {
646
+ return _this.search_results_touchend(evt);
647
+ });
648
+ this.form_field.observe("chosen:updated", function(evt) {
649
+ return _this.results_update_field(evt);
650
+ });
651
+ this.form_field.observe("chosen:activate", function(evt) {
652
+ return _this.activate_field(evt);
653
+ });
654
+ this.form_field.observe("chosen:open", function(evt) {
655
+ return _this.container_mousedown(evt);
656
+ });
657
+ this.form_field.observe("chosen:close", function(evt) {
658
+ return _this.input_blur(evt);
659
+ });
660
+ this.search_field.observe("blur", function(evt) {
661
+ return _this.input_blur(evt);
662
+ });
663
+ this.search_field.observe("keyup", function(evt) {
664
+ return _this.keyup_checker(evt);
665
+ });
666
+ this.search_field.observe("keydown", function(evt) {
667
+ return _this.keydown_checker(evt);
668
+ });
669
+ this.search_field.observe("focus", function(evt) {
670
+ return _this.input_focus(evt);
671
+ });
672
+ this.search_field.observe("cut", function(evt) {
673
+ return _this.clipboard_event_checker(evt);
674
+ });
675
+ this.search_field.observe("paste", function(evt) {
676
+ return _this.clipboard_event_checker(evt);
677
+ });
678
+ if (this.is_multiple) {
679
+ return this.search_choices.observe("click", function(evt) {
680
+ return _this.choices_click(evt);
681
+ });
682
+ } else {
683
+ return this.container.observe("click", function(evt) {
684
+ return evt.preventDefault();
685
+ });
686
+ }
687
+ };
688
+
689
+ Chosen.prototype.destroy = function() {
690
+ this.container.ownerDocument.stopObserving("click", this.click_test_action);
691
+ this.form_field.stopObserving();
692
+ this.container.stopObserving();
693
+ this.search_results.stopObserving();
694
+ this.search_field.stopObserving();
695
+ if (this.form_field_label != null) {
696
+ this.form_field_label.stopObserving();
697
+ }
698
+ if (this.is_multiple) {
699
+ this.search_choices.stopObserving();
700
+ this.container.select(".search-choice-close").each(function(choice) {
701
+ return choice.stopObserving();
702
+ });
703
+ } else {
704
+ this.selected_item.stopObserving();
705
+ }
706
+ if (this.search_field.tabIndex) {
707
+ this.form_field.tabIndex = this.search_field.tabIndex;
708
+ }
709
+ this.container.remove();
710
+ return this.form_field.show();
711
+ };
712
+
713
+ Chosen.prototype.search_field_disabled = function() {
714
+ this.is_disabled = this.form_field.disabled;
715
+ if (this.is_disabled) {
716
+ this.container.addClassName('chosen-disabled');
717
+ this.search_field.disabled = true;
718
+ if (!this.is_multiple) {
719
+ this.selected_item.stopObserving("focus", this.activate_action);
720
+ }
721
+ return this.close_field();
722
+ } else {
723
+ this.container.removeClassName('chosen-disabled');
724
+ this.search_field.disabled = false;
725
+ if (!this.is_multiple) {
726
+ return this.selected_item.observe("focus", this.activate_action);
727
+ }
728
+ }
729
+ };
730
+
731
+ Chosen.prototype.container_mousedown = function(evt) {
732
+ if (!this.is_disabled) {
733
+ if (evt && evt.type === "mousedown" && !this.results_showing) {
734
+ evt.stop();
735
+ }
736
+ if (!((evt != null) && evt.target.hasClassName("search-choice-close"))) {
737
+ if (!this.active_field) {
738
+ if (this.is_multiple) {
739
+ this.search_field.clear();
740
+ }
741
+ this.container.ownerDocument.observe("click", this.click_test_action);
742
+ this.results_show();
743
+ } else if (!this.is_multiple && evt && (evt.target === this.selected_item || evt.target.up("a.chosen-single"))) {
744
+ this.results_toggle();
745
+ }
746
+ return this.activate_field();
747
+ }
748
+ }
749
+ };
750
+
751
+ Chosen.prototype.container_mouseup = function(evt) {
752
+ if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
753
+ return this.results_reset(evt);
754
+ }
755
+ };
756
+
757
+ Chosen.prototype.search_results_mousewheel = function(evt) {
758
+ var delta;
759
+ delta = evt.deltaY || -evt.wheelDelta || evt.detail;
760
+ if (delta != null) {
761
+ evt.preventDefault();
762
+ if (evt.type === 'DOMMouseScroll') {
763
+ delta = delta * 40;
764
+ }
765
+ return this.search_results.scrollTop = delta + this.search_results.scrollTop;
766
+ }
767
+ };
768
+
769
+ Chosen.prototype.blur_test = function(evt) {
770
+ if (!this.active_field && this.container.hasClassName("chosen-container-active")) {
771
+ return this.close_field();
772
+ }
773
+ };
774
+
775
+ Chosen.prototype.close_field = function() {
776
+ this.container.ownerDocument.stopObserving("click", this.click_test_action);
777
+ this.active_field = false;
778
+ this.results_hide();
779
+ this.container.removeClassName("chosen-container-active");
780
+ this.clear_backstroke();
781
+ this.show_search_field_default();
782
+ return this.search_field_scale();
783
+ };
784
+
785
+ Chosen.prototype.activate_field = function() {
786
+ this.container.addClassName("chosen-container-active");
787
+ this.active_field = true;
788
+ this.search_field.value = this.search_field.value;
789
+ return this.search_field.focus();
790
+ };
791
+
792
+ Chosen.prototype.test_active_click = function(evt) {
793
+ if (evt.target.up('.chosen-container') === this.container) {
794
+ return this.active_field = true;
795
+ } else {
796
+ return this.close_field();
797
+ }
798
+ };
799
+
800
+ Chosen.prototype.results_build = function() {
801
+ this.parsing = true;
802
+ this.selected_option_count = null;
803
+ this.results_data = SelectParser.select_to_array(this.form_field);
804
+ if (this.is_multiple) {
805
+ this.search_choices.select("li.search-choice").invoke("remove");
806
+ } else if (!this.is_multiple) {
807
+ this.single_set_selected_text();
808
+ if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
809
+ this.search_field.readOnly = true;
810
+ this.container.addClassName("chosen-container-single-nosearch");
811
+ } else {
812
+ this.search_field.readOnly = false;
813
+ this.container.removeClassName("chosen-container-single-nosearch");
814
+ }
815
+ }
816
+ this.update_results_content(this.results_option_build({
817
+ first: true
818
+ }));
819
+ this.search_field_disabled();
820
+ this.show_search_field_default();
821
+ this.search_field_scale();
822
+ return this.parsing = false;
823
+ };
824
+
825
+ Chosen.prototype.result_do_highlight = function(el) {
826
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
827
+ this.result_clear_highlight();
828
+ this.result_highlight = el;
829
+ this.result_highlight.addClassName("highlighted");
830
+ maxHeight = parseInt(this.search_results.getStyle('maxHeight'), 10);
831
+ visible_top = this.search_results.scrollTop;
832
+ visible_bottom = maxHeight + visible_top;
833
+ high_top = this.result_highlight.positionedOffset().top;
834
+ high_bottom = high_top + this.result_highlight.getHeight();
835
+ if (high_bottom >= visible_bottom) {
836
+ return this.search_results.scrollTop = (high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0;
837
+ } else if (high_top < visible_top) {
838
+ return this.search_results.scrollTop = high_top;
839
+ }
840
+ };
841
+
842
+ Chosen.prototype.result_clear_highlight = function() {
843
+ if (this.result_highlight) {
844
+ this.result_highlight.removeClassName('highlighted');
845
+ }
846
+ return this.result_highlight = null;
847
+ };
848
+
849
+ Chosen.prototype.results_show = function() {
850
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
851
+ this.form_field.fire("chosen:maxselected", {
852
+ chosen: this
853
+ });
854
+ return false;
855
+ }
856
+ this.container.addClassName("chosen-with-drop");
857
+ this.results_showing = true;
858
+ this.search_field.focus();
859
+ this.search_field.value = this.search_field.value;
860
+ this.winnow_results();
861
+ return this.form_field.fire("chosen:showing_dropdown", {
862
+ chosen: this
863
+ });
864
+ };
865
+
866
+ Chosen.prototype.update_results_content = function(content) {
867
+ return this.search_results.update(content);
868
+ };
869
+
870
+ Chosen.prototype.results_hide = function() {
871
+ if (this.results_showing) {
872
+ this.result_clear_highlight();
873
+ this.container.removeClassName("chosen-with-drop");
874
+ this.form_field.fire("chosen:hiding_dropdown", {
875
+ chosen: this
876
+ });
877
+ }
878
+ return this.results_showing = false;
879
+ };
880
+
881
+ Chosen.prototype.set_tab_index = function(el) {
882
+ var ti;
883
+ if (this.form_field.tabIndex) {
884
+ ti = this.form_field.tabIndex;
885
+ this.form_field.tabIndex = -1;
886
+ return this.search_field.tabIndex = ti;
887
+ }
888
+ };
889
+
890
+ Chosen.prototype.set_label_behavior = function() {
891
+ var _this = this;
892
+ this.form_field_label = this.form_field.up("label");
893
+ if (this.form_field_label == null) {
894
+ this.form_field_label = $$("label[for='" + this.form_field.id + "']").first();
895
+ }
896
+ if (this.form_field_label != null) {
897
+ return this.form_field_label.observe("click", function(evt) {
898
+ if (_this.is_multiple) {
899
+ return _this.container_mousedown(evt);
900
+ } else {
901
+ return _this.activate_field();
902
+ }
903
+ });
904
+ }
905
+ };
906
+
907
+ Chosen.prototype.show_search_field_default = function() {
908
+ if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
909
+ this.search_field.value = this.default_text;
910
+ return this.search_field.addClassName("default");
911
+ } else {
912
+ this.search_field.value = "";
913
+ return this.search_field.removeClassName("default");
914
+ }
915
+ };
916
+
917
+ Chosen.prototype.search_results_mouseup = function(evt) {
918
+ var target;
919
+ target = evt.target.hasClassName("active-result") ? evt.target : evt.target.up(".active-result");
920
+ if (target) {
921
+ this.result_highlight = target;
922
+ this.result_select(evt);
923
+ return this.search_field.focus();
924
+ }
925
+ };
926
+
927
+ Chosen.prototype.search_results_mouseover = function(evt) {
928
+ var target;
929
+ target = evt.target.hasClassName("active-result") ? evt.target : evt.target.up(".active-result");
930
+ if (target) {
931
+ return this.result_do_highlight(target);
932
+ }
933
+ };
934
+
935
+ Chosen.prototype.search_results_mouseout = function(evt) {
936
+ if (evt.target.hasClassName('active-result') || evt.target.up('.active-result')) {
937
+ return this.result_clear_highlight();
938
+ }
939
+ };
940
+
941
+ Chosen.prototype.choice_build = function(item) {
942
+ var choice, close_link,
943
+ _this = this;
944
+ choice = new Element('li', {
945
+ "class": "search-choice"
946
+ }).update("<span>" + item.html + "</span>");
947
+ if (item.disabled) {
948
+ choice.addClassName('search-choice-disabled');
949
+ } else {
950
+ close_link = new Element('a', {
951
+ href: '#',
952
+ "class": 'search-choice-close',
953
+ rel: item.array_index
954
+ });
955
+ close_link.observe("click", function(evt) {
956
+ return _this.choice_destroy_link_click(evt);
957
+ });
958
+ choice.insert(close_link);
959
+ }
960
+ return this.search_container.insert({
961
+ before: choice
962
+ });
963
+ };
964
+
965
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
966
+ evt.preventDefault();
967
+ evt.stopPropagation();
968
+ if (!this.is_disabled) {
969
+ return this.choice_destroy(evt.target);
970
+ }
971
+ };
972
+
973
+ Chosen.prototype.choice_destroy = function(link) {
974
+ if (this.result_deselect(link.readAttribute("rel"))) {
975
+ this.show_search_field_default();
976
+ if (this.is_multiple && this.choices_count() > 0 && this.search_field.value.length < 1) {
977
+ this.results_hide();
978
+ }
979
+ link.up('li').remove();
980
+ return this.search_field_scale();
981
+ }
982
+ };
983
+
984
+ Chosen.prototype.results_reset = function() {
985
+ this.reset_single_select_options();
986
+ this.form_field.options[0].selected = true;
987
+ this.single_set_selected_text();
988
+ this.show_search_field_default();
989
+ this.results_reset_cleanup();
990
+ if (typeof Event.simulate === 'function') {
991
+ this.form_field.simulate("change");
992
+ }
993
+ if (this.active_field) {
994
+ return this.results_hide();
995
+ }
996
+ };
997
+
998
+ Chosen.prototype.results_reset_cleanup = function() {
999
+ var deselect_trigger;
1000
+ this.current_selectedIndex = this.form_field.selectedIndex;
1001
+ deselect_trigger = this.selected_item.down("abbr");
1002
+ if (deselect_trigger) {
1003
+ return deselect_trigger.remove();
1004
+ }
1005
+ };
1006
+
1007
+ Chosen.prototype.result_select = function(evt) {
1008
+ var high, item;
1009
+ if (this.result_highlight) {
1010
+ high = this.result_highlight;
1011
+ this.result_clear_highlight();
1012
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
1013
+ this.form_field.fire("chosen:maxselected", {
1014
+ chosen: this
1015
+ });
1016
+ return false;
1017
+ }
1018
+ if (this.is_multiple) {
1019
+ high.removeClassName("active-result");
1020
+ } else {
1021
+ this.reset_single_select_options();
1022
+ }
1023
+ high.addClassName("result-selected");
1024
+ item = this.results_data[high.getAttribute("data-option-array-index")];
1025
+ item.selected = true;
1026
+ this.form_field.options[item.options_index].selected = true;
1027
+ this.selected_option_count = null;
1028
+ if (this.is_multiple) {
1029
+ this.choice_build(item);
1030
+ } else {
1031
+ this.single_set_selected_text(item.text);
1032
+ }
1033
+ if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
1034
+ this.results_hide();
1035
+ }
1036
+ this.search_field.value = "";
1037
+ if (typeof Event.simulate === 'function' && (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex)) {
1038
+ this.form_field.simulate("change");
1039
+ }
1040
+ this.current_selectedIndex = this.form_field.selectedIndex;
1041
+ return this.search_field_scale();
1042
+ }
1043
+ };
1044
+
1045
+ Chosen.prototype.single_set_selected_text = function(text) {
1046
+ if (text == null) {
1047
+ text = this.default_text;
1048
+ }
1049
+ if (text === this.default_text) {
1050
+ this.selected_item.addClassName("chosen-default");
1051
+ } else {
1052
+ this.single_deselect_control_build();
1053
+ this.selected_item.removeClassName("chosen-default");
1054
+ }
1055
+ return this.selected_item.down("span").update(text);
1056
+ };
1057
+
1058
+ Chosen.prototype.result_deselect = function(pos) {
1059
+ var result_data;
1060
+ result_data = this.results_data[pos];
1061
+ if (!this.form_field.options[result_data.options_index].disabled) {
1062
+ result_data.selected = false;
1063
+ this.form_field.options[result_data.options_index].selected = false;
1064
+ this.selected_option_count = null;
1065
+ this.result_clear_highlight();
1066
+ if (this.results_showing) {
1067
+ this.winnow_results();
1068
+ }
1069
+ if (typeof Event.simulate === 'function') {
1070
+ this.form_field.simulate("change");
1071
+ }
1072
+ this.search_field_scale();
1073
+ return true;
1074
+ } else {
1075
+ return false;
1076
+ }
1077
+ };
1078
+
1079
+ Chosen.prototype.single_deselect_control_build = function() {
1080
+ if (!this.allow_single_deselect) {
1081
+ return;
1082
+ }
1083
+ if (!this.selected_item.down("abbr")) {
1084
+ this.selected_item.down("span").insert({
1085
+ after: "<abbr class=\"search-choice-close\"></abbr>"
1086
+ });
1087
+ }
1088
+ return this.selected_item.addClassName("chosen-single-with-deselect");
1089
+ };
1090
+
1091
+ Chosen.prototype.get_search_text = function() {
1092
+ if (this.search_field.value === this.default_text) {
1093
+ return "";
1094
+ } else {
1095
+ return this.search_field.value.strip().escapeHTML();
1096
+ }
1097
+ };
1098
+
1099
+ Chosen.prototype.winnow_results_set_highlight = function() {
1100
+ var do_high;
1101
+ if (!this.is_multiple) {
1102
+ do_high = this.search_results.down(".result-selected.active-result");
1103
+ }
1104
+ if (do_high == null) {
1105
+ do_high = this.search_results.down(".active-result");
1106
+ }
1107
+ if (do_high != null) {
1108
+ return this.result_do_highlight(do_high);
1109
+ }
1110
+ };
1111
+
1112
+ Chosen.prototype.no_results = function(terms) {
1113
+ this.search_results.insert(this.no_results_temp.evaluate({
1114
+ terms: terms
1115
+ }));
1116
+ return this.form_field.fire("chosen:no_results", {
1117
+ chosen: this
1118
+ });
1119
+ };
1120
+
1121
+ Chosen.prototype.no_results_clear = function() {
1122
+ var nr, _results;
1123
+ nr = null;
1124
+ _results = [];
1125
+ while (nr = this.search_results.down(".no-results")) {
1126
+ _results.push(nr.remove());
1127
+ }
1128
+ return _results;
1129
+ };
1130
+
1131
+ Chosen.prototype.keydown_arrow = function() {
1132
+ var next_sib;
1133
+ if (this.results_showing && this.result_highlight) {
1134
+ next_sib = this.result_highlight.next('.active-result');
1135
+ if (next_sib) {
1136
+ return this.result_do_highlight(next_sib);
1137
+ }
1138
+ } else {
1139
+ return this.results_show();
1140
+ }
1141
+ };
1142
+
1143
+ Chosen.prototype.keyup_arrow = function() {
1144
+ var actives, prevs, sibs;
1145
+ if (!this.results_showing && !this.is_multiple) {
1146
+ return this.results_show();
1147
+ } else if (this.result_highlight) {
1148
+ sibs = this.result_highlight.previousSiblings();
1149
+ actives = this.search_results.select("li.active-result");
1150
+ prevs = sibs.intersect(actives);
1151
+ if (prevs.length) {
1152
+ return this.result_do_highlight(prevs.first());
1153
+ } else {
1154
+ if (this.choices_count() > 0) {
1155
+ this.results_hide();
1156
+ }
1157
+ return this.result_clear_highlight();
1158
+ }
1159
+ }
1160
+ };
1161
+
1162
+ Chosen.prototype.keydown_backstroke = function() {
1163
+ var next_available_destroy;
1164
+ if (this.pending_backstroke) {
1165
+ this.choice_destroy(this.pending_backstroke.down("a"));
1166
+ return this.clear_backstroke();
1167
+ } else {
1168
+ next_available_destroy = this.search_container.siblings().last();
1169
+ if (next_available_destroy && next_available_destroy.hasClassName("search-choice") && !next_available_destroy.hasClassName("search-choice-disabled")) {
1170
+ this.pending_backstroke = next_available_destroy;
1171
+ if (this.pending_backstroke) {
1172
+ this.pending_backstroke.addClassName("search-choice-focus");
1173
+ }
1174
+ if (this.single_backstroke_delete) {
1175
+ return this.keydown_backstroke();
1176
+ } else {
1177
+ return this.pending_backstroke.addClassName("search-choice-focus");
1178
+ }
1179
+ }
1180
+ }
1181
+ };
1182
+
1183
+ Chosen.prototype.clear_backstroke = function() {
1184
+ if (this.pending_backstroke) {
1185
+ this.pending_backstroke.removeClassName("search-choice-focus");
1186
+ }
1187
+ return this.pending_backstroke = null;
1188
+ };
1189
+
1190
+ Chosen.prototype.keydown_checker = function(evt) {
1191
+ var stroke, _ref1;
1192
+ stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
1193
+ this.search_field_scale();
1194
+ if (stroke !== 8 && this.pending_backstroke) {
1195
+ this.clear_backstroke();
1196
+ }
1197
+ switch (stroke) {
1198
+ case 8:
1199
+ this.backstroke_length = this.search_field.value.length;
1200
+ break;
1201
+ case 9:
1202
+ if (this.results_showing && !this.is_multiple) {
1203
+ this.result_select(evt);
1204
+ }
1205
+ this.mouse_on_container = false;
1206
+ break;
1207
+ case 13:
1208
+ if (this.results_showing) {
1209
+ evt.preventDefault();
1210
+ }
1211
+ break;
1212
+ case 32:
1213
+ if (this.disable_search) {
1214
+ evt.preventDefault();
1215
+ }
1216
+ break;
1217
+ case 38:
1218
+ evt.preventDefault();
1219
+ this.keyup_arrow();
1220
+ break;
1221
+ case 40:
1222
+ evt.preventDefault();
1223
+ this.keydown_arrow();
1224
+ break;
1225
+ }
1226
+ };
1227
+
1228
+ Chosen.prototype.search_field_scale = function() {
1229
+ var div, f_width, h, style, style_block, styles, w, _i, _len;
1230
+ if (this.is_multiple) {
1231
+ h = 0;
1232
+ w = 0;
1233
+ style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1234
+ styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1235
+ for (_i = 0, _len = styles.length; _i < _len; _i++) {
1236
+ style = styles[_i];
1237
+ style_block += style + ":" + this.search_field.getStyle(style) + ";";
1238
+ }
1239
+ div = new Element('div', {
1240
+ 'style': style_block
1241
+ }).update(this.search_field.value.escapeHTML());
1242
+ document.body.appendChild(div);
1243
+ w = Element.measure(div, 'width') + 25;
1244
+ div.remove();
1245
+ f_width = this.container.getWidth();
1246
+ if (w > f_width - 10) {
1247
+ w = f_width - 10;
1248
+ }
1249
+ return this.search_field.setStyle({
1250
+ 'width': w + 'px'
1251
+ });
1252
+ }
1253
+ };
1254
+
1255
+ return Chosen;
1256
+
1257
+ })(AbstractChosen);
1258
+
1259
+ }).call(this);
skin/frontend/base/default/js/inktonerfinder_chosen/chosen.proto.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /* Chosen v1.3.0 | (c) 2011-2014 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
+ !function(){var AbstractChosen,SelectParser,a,b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&amp;"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0},AbstractChosen.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(){var a=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return a.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(){var a=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return a.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f;for(b="",f=this.results_data,d=0,e=f.length;e>d;d++)c=f[d],b+=c.group?this.result_add_group(c):this.result_add_option(c),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(c.text));return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match?this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,this.outerHTML(c)):"":""},AbstractChosen.prototype.result_add_group=function(a){var b,c;return a.search_match||a.group_match?a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,this.outerHTML(c)):"":""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),(!b.group||this.group_search)&&(b.search_text=b.group?b.label:b.text,b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+"</em>"+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+"<em>"+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>d&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.get_search_regex=function(a){var b;return b=this.search_contains?"":"^",new RegExp(b+a,"i")},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(){var a=this;return setTimeout(function(){return a.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),this.Chosen=function(b){function Chosen(){return a=Chosen.__super__.constructor.apply(this,arguments)}return c(Chosen,b),Chosen.prototype.setup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field.hasClassName("chosen-rtl")},Chosen.prototype.set_default_values=function(){return Chosen.__super__.set_default_values.call(this),this.single_temp=new Template('<a class="chosen-single chosen-default" tabindex="-1"><span>#{default}</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.multi_temp=new Template('<ul class="chosen-choices"><li class="search-field"><input type="text" value="#{default}" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'),this.no_results_temp=new Template('<li class="no-results">'+this.results_none_found+' "<span>#{terms}</span>"</li>')},Chosen.prototype.set_up_html=function(){var a,b;return a=["chosen-container"],a.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&a.push(this.form_field.className),this.is_rtl&&a.push("chosen-rtl"),b={"class":a.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(b.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=this.is_multiple?new Element("div",b).update(this.multi_temp.evaluate({"default":this.default_text})):new Element("div",b).update(this.single_temp.evaluate({"default":this.default_text})),this.form_field.hide().insert({after:this.container}),this.dropdown=this.container.down("div.chosen-drop"),this.search_field=this.container.down("input"),this.search_results=this.container.down("ul.chosen-results"),this.search_field_scale(),this.search_no_results=this.container.down("li.no-results"),this.is_multiple?(this.search_choices=this.container.down("ul.chosen-choices"),this.search_container=this.container.down("li.search-field")):(this.search_container=this.container.down("div.chosen-search"),this.selected_item=this.container.down(".chosen-single")),this.results_build(),this.set_tab_index(),this.set_label_behavior()},Chosen.prototype.on_ready=function(){return this.form_field.fire("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.observe("touchstart",function(b){return a.container_mousedown(b)}),this.container.observe("touchend",function(b){return a.container_mouseup(b)}),this.container.observe("mousedown",function(b){return a.container_mousedown(b)}),this.container.observe("mouseup",function(b){return a.container_mouseup(b)}),this.container.observe("mouseenter",function(b){return a.mouse_enter(b)}),this.container.observe("mouseleave",function(b){return a.mouse_leave(b)}),this.search_results.observe("mouseup",function(b){return a.search_results_mouseup(b)}),this.search_results.observe("mouseover",function(b){return a.search_results_mouseover(b)}),this.search_results.observe("mouseout",function(b){return a.search_results_mouseout(b)}),this.search_results.observe("mousewheel",function(b){return a.search_results_mousewheel(b)}),this.search_results.observe("DOMMouseScroll",function(b){return a.search_results_mousewheel(b)}),this.search_results.observe("touchstart",function(b){return a.search_results_touchstart(b)}),this.search_results.observe("touchmove",function(b){return a.search_results_touchmove(b)}),this.search_results.observe("touchend",function(b){return a.search_results_touchend(b)}),this.form_field.observe("chosen:updated",function(b){return a.results_update_field(b)}),this.form_field.observe("chosen:activate",function(b){return a.activate_field(b)}),this.form_field.observe("chosen:open",function(b){return a.container_mousedown(b)}),this.form_field.observe("chosen:close",function(b){return a.input_blur(b)}),this.search_field.observe("blur",function(b){return a.input_blur(b)}),this.search_field.observe("keyup",function(b){return a.keyup_checker(b)}),this.search_field.observe("keydown",function(b){return a.keydown_checker(b)}),this.search_field.observe("focus",function(b){return a.input_focus(b)}),this.search_field.observe("cut",function(b){return a.clipboard_event_checker(b)}),this.search_field.observe("paste",function(b){return a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.observe("click",function(b){return a.choices_click(b)}):this.container.observe("click",function(a){return a.preventDefault()})},Chosen.prototype.destroy=function(){return this.container.ownerDocument.stopObserving("click",this.click_test_action),this.form_field.stopObserving(),this.container.stopObserving(),this.search_results.stopObserving(),this.search_field.stopObserving(),null!=this.form_field_label&&this.form_field_label.stopObserving(),this.is_multiple?(this.search_choices.stopObserving(),this.container.select(".search-choice-close").each(function(a){return a.stopObserving()})):this.selected_item.stopObserving(),this.search_field.tabIndex&&(this.form_field.tabIndex=this.search_field.tabIndex),this.container.remove(),this.form_field.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled,this.is_disabled?(this.container.addClassName("chosen-disabled"),this.search_field.disabled=!0,this.is_multiple||this.selected_item.stopObserving("focus",this.activate_action),this.close_field()):(this.container.removeClassName("chosen-disabled"),this.search_field.disabled=!1,this.is_multiple?void 0:this.selected_item.observe("focus",this.activate_action))},Chosen.prototype.container_mousedown=function(a){return this.is_disabled||(a&&"mousedown"===a.type&&!this.results_showing&&a.stop(),null!=a&&a.target.hasClassName("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!a||a.target!==this.selected_item&&!a.target.up("a.chosen-single")||this.results_toggle():(this.is_multiple&&this.search_field.clear(),this.container.ownerDocument.observe("click",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return b=a.deltaY||-a.wheelDelta||a.detail,null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop=b+this.search_results.scrollTop):void 0},Chosen.prototype.blur_test=function(){return!this.active_field&&this.container.hasClassName("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return this.container.ownerDocument.stopObserving("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClassName("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClassName("chosen-container-active"),this.active_field=!0,this.search_field.value=this.search_field.value,this.search_field.focus()},Chosen.prototype.test_active_click=function(a){return a.target.up(".chosen-container")===this.container?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.select("li.search-choice").invoke("remove"):this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field.readOnly=!0,this.container.addClassName("chosen-container-single-nosearch")):(this.search_field.readOnly=!1,this.container.removeClassName("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;return this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClassName("highlighted"),d=parseInt(this.search_results.getStyle("maxHeight"),10),f=this.search_results.scrollTop,e=d+f,c=this.result_highlight.positionedOffset().top,b=c+this.result_highlight.getHeight(),b>=e?this.search_results.scrollTop=b-d>0?b-d:0:f>c?this.search_results.scrollTop=c:void 0},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClassName("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field.fire("chosen:maxselected",{chosen:this}),!1):(this.container.addClassName("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.value=this.search_field.value,this.winnow_results(),this.form_field.fire("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.update(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClassName("chosen-with-drop"),this.form_field.fire("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(){var a;return this.form_field.tabIndex?(a=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field.tabIndex=a):void 0},Chosen.prototype.set_label_behavior=function(){var a=this;return this.form_field_label=this.form_field.up("label"),null==this.form_field_label&&(this.form_field_label=$$("label[for='"+this.form_field.id+"']").first()),null!=this.form_field_label?this.form_field_label.observe("click",function(b){return a.is_multiple?a.container_mousedown(b):a.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.value=this.default_text,this.search_field.addClassName("default")):(this.search_field.value="",this.search_field.removeClassName("default"))},Chosen.prototype.search_results_mouseup=function(a){var b;return b=a.target.hasClassName("active-result")?a.target:a.target.up(".active-result"),b?(this.result_highlight=b,this.result_select(a),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(a){var b;return b=a.target.hasClassName("active-result")?a.target:a.target.up(".active-result"),b?this.result_do_highlight(b):void 0},Chosen.prototype.search_results_mouseout=function(a){return a.target.hasClassName("active-result")||a.target.up(".active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(a){var b,c,d=this;return b=new Element("li",{"class":"search-choice"}).update("<span>"+a.html+"</span>"),a.disabled?b.addClassName("search-choice-disabled"):(c=new Element("a",{href:"#","class":"search-choice-close",rel:a.array_index}),c.observe("click",function(a){return d.choice_destroy_link_click(a)}),b.insert(c)),this.search_container.insert({before:b})},Chosen.prototype.choice_destroy_link_click=function(a){return a.preventDefault(),a.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a.target)},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a.readAttribute("rel"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.value.length<1&&this.results_hide(),a.up("li").remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),"function"==typeof Event.simulate&&this.form_field.simulate("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){var a;return this.current_selectedIndex=this.form_field.selectedIndex,a=this.selected_item.down("abbr"),a?a.remove():void 0},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field.fire("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClassName("active-result"):this.reset_single_select_options(),b.addClassName("result-selected"),c=this.results_data[b.getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(c.text),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.value="","function"!=typeof Event.simulate||!this.is_multiple&&this.form_field.selectedIndex===this.current_selectedIndex||this.form_field.simulate("change"),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClassName("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClassName("chosen-default")),this.selected_item.down("span").update(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),"function"==typeof Event.simulate&&this.form_field.simulate("change"),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.down("abbr")||this.selected_item.down("span").insert({after:'<abbr class="search-choice-close"></abbr>'}),this.selected_item.addClassName("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return this.search_field.value===this.default_text?"":this.search_field.value.strip().escapeHTML()},Chosen.prototype.winnow_results_set_highlight=function(){var a;return this.is_multiple||(a=this.search_results.down(".result-selected.active-result")),null==a&&(a=this.search_results.down(".active-result")),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(a){return this.search_results.insert(this.no_results_temp.evaluate({terms:a})),this.form_field.fire("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){var a,b;for(a=null,b=[];a=this.search_results.down(".no-results");)b.push(a.remove());return b},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.next(".active-result"))?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a,b,c;return this.results_showing||this.is_multiple?this.result_highlight?(c=this.result_highlight.previousSiblings(),a=this.search_results.select("li.active-result"),b=c.intersect(a),b.length?this.result_do_highlight(b.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.down("a")),this.clear_backstroke()):(a=this.search_container.siblings().last(),a&&a.hasClassName("search-choice")&&!a.hasClassName("search-choice-disabled")?(this.pending_backstroke=a,this.pending_backstroke&&this.pending_backstroke.addClassName("search-choice-focus"),this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClassName("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClassName("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.value.length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var a,b,c,d,e,f,g,h,i;if(this.is_multiple){for(c=0,g=0,e="position:absolute; left: -1000px; top: -1000px; display:none;",f=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],h=0,i=f.length;i>h;h++)d=f[h],e+=d+":"+this.search_field.getStyle(d)+";";return a=new Element("div",{style:e}).update(this.search_field.value.escapeHTML()),document.body.appendChild(a),g=Element.measure(a,"width")+25,a.remove(),b=this.container.getWidth(),g>b-10&&(g=b-10),this.search_field.setStyle({width:g+"px"})}},Chosen}(AbstractChosen)}.call(this);
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/external/jquery/jquery.js ADDED
@@ -0,0 +1,9789 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery JavaScript Library v1.10.2
3
+ * http://jquery.com/
4
+ *
5
+ * Includes Sizzle.js
6
+ * http://sizzlejs.com/
7
+ *
8
+ * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
9
+ * Released under the MIT license
10
+ * http://jquery.org/license
11
+ *
12
+ * Date: 2013-07-03T13:48Z
13
+ */
14
+ (function( window, undefined ) {
15
+
16
+ // Can't do this because several apps including ASP.NET trace
17
+ // the stack via arguments.caller.callee and Firefox dies if
18
+ // you try to trace through "use strict" call chains. (#13335)
19
+ // Support: Firefox 18+
20
+ //"use strict";
21
+ var
22
+ // The deferred used on DOM ready
23
+ readyList,
24
+
25
+ // A central reference to the root jQuery(document)
26
+ rootjQuery,
27
+
28
+ // Support: IE<10
29
+ // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
30
+ core_strundefined = typeof undefined,
31
+
32
+ // Use the correct document accordingly with window argument (sandbox)
33
+ location = window.location,
34
+ document = window.document,
35
+ docElem = document.documentElement,
36
+
37
+ // Map over jQuery in case of overwrite
38
+ _jQuery = window.jQuery,
39
+
40
+ // Map over the $ in case of overwrite
41
+ _$ = window.$,
42
+
43
+ // [[Class]] -> type pairs
44
+ class2type = {},
45
+
46
+ // List of deleted data cache ids, so we can reuse them
47
+ core_deletedIds = [],
48
+
49
+ core_version = "1.10.2",
50
+
51
+ // Save a reference to some core methods
52
+ core_concat = core_deletedIds.concat,
53
+ core_push = core_deletedIds.push,
54
+ core_slice = core_deletedIds.slice,
55
+ core_indexOf = core_deletedIds.indexOf,
56
+ core_toString = class2type.toString,
57
+ core_hasOwn = class2type.hasOwnProperty,
58
+ core_trim = core_version.trim,
59
+
60
+ // Define a local copy of jQuery
61
+ jQuery = function( selector, context ) {
62
+ // The jQuery object is actually just the init constructor 'enhanced'
63
+ return new jQuery.fn.init( selector, context, rootjQuery );
64
+ },
65
+
66
+ // Used for matching numbers
67
+ core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
68
+
69
+ // Used for splitting on whitespace
70
+ core_rnotwhite = /\S+/g,
71
+
72
+ // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
73
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
74
+
75
+ // A simple way to check for HTML strings
76
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
77
+ // Strict HTML recognition (#11290: must start with <)
78
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
79
+
80
+ // Match a standalone tag
81
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
82
+
83
+ // JSON RegExp
84
+ rvalidchars = /^[\],:{}\s]*$/,
85
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
86
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
87
+ rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
88
+
89
+ // Matches dashed string for camelizing
90
+ rmsPrefix = /^-ms-/,
91
+ rdashAlpha = /-([\da-z])/gi,
92
+
93
+ // Used by jQuery.camelCase as callback to replace()
94
+ fcamelCase = function( all, letter ) {
95
+ return letter.toUpperCase();
96
+ },
97
+
98
+ // The ready event handler
99
+ completed = function( event ) {
100
+
101
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
102
+ if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
103
+ detach();
104
+ jQuery.ready();
105
+ }
106
+ },
107
+ // Clean-up method for dom ready events
108
+ detach = function() {
109
+ if ( document.addEventListener ) {
110
+ document.removeEventListener( "DOMContentLoaded", completed, false );
111
+ window.removeEventListener( "load", completed, false );
112
+
113
+ } else {
114
+ document.detachEvent( "onreadystatechange", completed );
115
+ window.detachEvent( "onload", completed );
116
+ }
117
+ };
118
+
119
+ jQuery.fn = jQuery.prototype = {
120
+ // The current version of jQuery being used
121
+ jquery: core_version,
122
+
123
+ constructor: jQuery,
124
+ init: function( selector, context, rootjQuery ) {
125
+ var match, elem;
126
+
127
+ // HANDLE: $(""), $(null), $(undefined), $(false)
128
+ if ( !selector ) {
129
+ return this;
130
+ }
131
+
132
+ // Handle HTML strings
133
+ if ( typeof selector === "string" ) {
134
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
135
+ // Assume that strings that start and end with <> are HTML and skip the regex check
136
+ match = [ null, selector, null ];
137
+
138
+ } else {
139
+ match = rquickExpr.exec( selector );
140
+ }
141
+
142
+ // Match html or make sure no context is specified for #id
143
+ if ( match && (match[1] || !context) ) {
144
+
145
+ // HANDLE: $(html) -> $(array)
146
+ if ( match[1] ) {
147
+ context = context instanceof jQuery ? context[0] : context;
148
+
149
+ // scripts is true for back-compat
150
+ jQuery.merge( this, jQuery.parseHTML(
151
+ match[1],
152
+ context && context.nodeType ? context.ownerDocument || context : document,
153
+ true
154
+ ) );
155
+
156
+ // HANDLE: $(html, props)
157
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
158
+ for ( match in context ) {
159
+ // Properties of context are called as methods if possible
160
+ if ( jQuery.isFunction( this[ match ] ) ) {
161
+ this[ match ]( context[ match ] );
162
+
163
+ // ...and otherwise set as attributes
164
+ } else {
165
+ this.attr( match, context[ match ] );
166
+ }
167
+ }
168
+ }
169
+
170
+ return this;
171
+
172
+ // HANDLE: $(#id)
173
+ } else {
174
+ elem = document.getElementById( match[2] );
175
+
176
+ // Check parentNode to catch when Blackberry 4.6 returns
177
+ // nodes that are no longer in the document #6963
178
+ if ( elem && elem.parentNode ) {
179
+ // Handle the case where IE and Opera return items
180
+ // by name instead of ID
181
+ if ( elem.id !== match[2] ) {
182
+ return rootjQuery.find( selector );
183
+ }
184
+
185
+ // Otherwise, we inject the element directly into the jQuery object
186
+ this.length = 1;
187
+ this[0] = elem;
188
+ }
189
+
190
+ this.context = document;
191
+ this.selector = selector;
192
+ return this;
193
+ }
194
+
195
+ // HANDLE: $(expr, $(...))
196
+ } else if ( !context || context.jquery ) {
197
+ return ( context || rootjQuery ).find( selector );
198
+
199
+ // HANDLE: $(expr, context)
200
+ // (which is just equivalent to: $(context).find(expr)
201
+ } else {
202
+ return this.constructor( context ).find( selector );
203
+ }
204
+
205
+ // HANDLE: $(DOMElement)
206
+ } else if ( selector.nodeType ) {
207
+ this.context = this[0] = selector;
208
+ this.length = 1;
209
+ return this;
210
+
211
+ // HANDLE: $(function)
212
+ // Shortcut for document ready
213
+ } else if ( jQuery.isFunction( selector ) ) {
214
+ return rootjQuery.ready( selector );
215
+ }
216
+
217
+ if ( selector.selector !== undefined ) {
218
+ this.selector = selector.selector;
219
+ this.context = selector.context;
220
+ }
221
+
222
+ return jQuery.makeArray( selector, this );
223
+ },
224
+
225
+ // Start with an empty selector
226
+ selector: "",
227
+
228
+ // The default length of a jQuery object is 0
229
+ length: 0,
230
+
231
+ toArray: function() {
232
+ return core_slice.call( this );
233
+ },
234
+
235
+ // Get the Nth element in the matched element set OR
236
+ // Get the whole matched element set as a clean array
237
+ get: function( num ) {
238
+ return num == null ?
239
+
240
+ // Return a 'clean' array
241
+ this.toArray() :
242
+
243
+ // Return just the object
244
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
245
+ },
246
+
247
+ // Take an array of elements and push it onto the stack
248
+ // (returning the new matched element set)
249
+ pushStack: function( elems ) {
250
+
251
+ // Build a new jQuery matched element set
252
+ var ret = jQuery.merge( this.constructor(), elems );
253
+
254
+ // Add the old object onto the stack (as a reference)
255
+ ret.prevObject = this;
256
+ ret.context = this.context;
257
+
258
+ // Return the newly-formed element set
259
+ return ret;
260
+ },
261
+
262
+ // Execute a callback for every element in the matched set.
263
+ // (You can seed the arguments with an array of args, but this is
264
+ // only used internally.)
265
+ each: function( callback, args ) {
266
+ return jQuery.each( this, callback, args );
267
+ },
268
+
269
+ ready: function( fn ) {
270
+ // Add the callback
271
+ jQuery.ready.promise().done( fn );
272
+
273
+ return this;
274
+ },
275
+
276
+ slice: function() {
277
+ return this.pushStack( core_slice.apply( this, arguments ) );
278
+ },
279
+
280
+ first: function() {
281
+ return this.eq( 0 );
282
+ },
283
+
284
+ last: function() {
285
+ return this.eq( -1 );
286
+ },
287
+
288
+ eq: function( i ) {
289
+ var len = this.length,
290
+ j = +i + ( i < 0 ? len : 0 );
291
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
292
+ },
293
+
294
+ map: function( callback ) {
295
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
296
+ return callback.call( elem, i, elem );
297
+ }));
298
+ },
299
+
300
+ end: function() {
301
+ return this.prevObject || this.constructor(null);
302
+ },
303
+
304
+ // For internal use only.
305
+ // Behaves like an Array's method, not like a jQuery method.
306
+ push: core_push,
307
+ sort: [].sort,
308
+ splice: [].splice
309
+ };
310
+
311
+ // Give the init function the jQuery prototype for later instantiation
312
+ jQuery.fn.init.prototype = jQuery.fn;
313
+
314
+ jQuery.extend = jQuery.fn.extend = function() {
315
+ var src, copyIsArray, copy, name, options, clone,
316
+ target = arguments[0] || {},
317
+ i = 1,
318
+ length = arguments.length,
319
+ deep = false;
320
+
321
+ // Handle a deep copy situation
322
+ if ( typeof target === "boolean" ) {
323
+ deep = target;
324
+ target = arguments[1] || {};
325
+ // skip the boolean and the target
326
+ i = 2;
327
+ }
328
+
329
+ // Handle case when target is a string or something (possible in deep copy)
330
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
331
+ target = {};
332
+ }
333
+
334
+ // extend jQuery itself if only one argument is passed
335
+ if ( length === i ) {
336
+ target = this;
337
+ --i;
338
+ }
339
+
340
+ for ( ; i < length; i++ ) {
341
+ // Only deal with non-null/undefined values
342
+ if ( (options = arguments[ i ]) != null ) {
343
+ // Extend the base object
344
+ for ( name in options ) {
345
+ src = target[ name ];
346
+ copy = options[ name ];
347
+
348
+ // Prevent never-ending loop
349
+ if ( target === copy ) {
350
+ continue;
351
+ }
352
+
353
+ // Recurse if we're merging plain objects or arrays
354
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
355
+ if ( copyIsArray ) {
356
+ copyIsArray = false;
357
+ clone = src && jQuery.isArray(src) ? src : [];
358
+
359
+ } else {
360
+ clone = src && jQuery.isPlainObject(src) ? src : {};
361
+ }
362
+
363
+ // Never move original objects, clone them
364
+ target[ name ] = jQuery.extend( deep, clone, copy );
365
+
366
+ // Don't bring in undefined values
367
+ } else if ( copy !== undefined ) {
368
+ target[ name ] = copy;
369
+ }
370
+ }
371
+ }
372
+ }
373
+
374
+ // Return the modified object
375
+ return target;
376
+ };
377
+
378
+ jQuery.extend({
379
+ // Unique for each copy of jQuery on the page
380
+ // Non-digits removed to match rinlinejQuery
381
+ expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
382
+
383
+ noConflict: function( deep ) {
384
+ if ( window.$ === jQuery ) {
385
+ window.$ = _$;
386
+ }
387
+
388
+ if ( deep && window.jQuery === jQuery ) {
389
+ window.jQuery = _jQuery;
390
+ }
391
+
392
+ return jQuery;
393
+ },
394
+
395
+ // Is the DOM ready to be used? Set to true once it occurs.
396
+ isReady: false,
397
+
398
+ // A counter to track how many items to wait for before
399
+ // the ready event fires. See #6781
400
+ readyWait: 1,
401
+
402
+ // Hold (or release) the ready event
403
+ holdReady: function( hold ) {
404
+ if ( hold ) {
405
+ jQuery.readyWait++;
406
+ } else {
407
+ jQuery.ready( true );
408
+ }
409
+ },
410
+
411
+ // Handle when the DOM is ready
412
+ ready: function( wait ) {
413
+
414
+ // Abort if there are pending holds or we're already ready
415
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
416
+ return;
417
+ }
418
+
419
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
420
+ if ( !document.body ) {
421
+ return setTimeout( jQuery.ready );
422
+ }
423
+
424
+ // Remember that the DOM is ready
425
+ jQuery.isReady = true;
426
+
427
+ // If a normal DOM Ready event fired, decrement, and wait if need be
428
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
429
+ return;
430
+ }
431
+
432
+ // If there are functions bound, to execute
433
+ readyList.resolveWith( document, [ jQuery ] );
434
+
435
+ // Trigger any bound ready events
436
+ if ( jQuery.fn.trigger ) {
437
+ jQuery( document ).trigger("ready").off("ready");
438
+ }
439
+ },
440
+
441
+ // See test/unit/core.js for details concerning isFunction.
442
+ // Since version 1.3, DOM methods and functions like alert
443
+ // aren't supported. They return false on IE (#2968).
444
+ isFunction: function( obj ) {
445
+ return jQuery.type(obj) === "function";
446
+ },
447
+
448
+ isArray: Array.isArray || function( obj ) {
449
+ return jQuery.type(obj) === "array";
450
+ },
451
+
452
+ isWindow: function( obj ) {
453
+ /* jshint eqeqeq: false */
454
+ return obj != null && obj == obj.window;
455
+ },
456
+
457
+ isNumeric: function( obj ) {
458
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
459
+ },
460
+
461
+ type: function( obj ) {
462
+ if ( obj == null ) {
463
+ return String( obj );
464
+ }
465
+ return typeof obj === "object" || typeof obj === "function" ?
466
+ class2type[ core_toString.call(obj) ] || "object" :
467
+ typeof obj;
468
+ },
469
+
470
+ isPlainObject: function( obj ) {
471
+ var key;
472
+
473
+ // Must be an Object.
474
+ // Because of IE, we also have to check the presence of the constructor property.
475
+ // Make sure that DOM nodes and window objects don't pass through, as well
476
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
477
+ return false;
478
+ }
479
+
480
+ try {
481
+ // Not own constructor property must be Object
482
+ if ( obj.constructor &&
483
+ !core_hasOwn.call(obj, "constructor") &&
484
+ !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
485
+ return false;
486
+ }
487
+ } catch ( e ) {
488
+ // IE8,9 Will throw exceptions on certain host objects #9897
489
+ return false;
490
+ }
491
+
492
+ // Support: IE<9
493
+ // Handle iteration over inherited properties before own properties.
494
+ if ( jQuery.support.ownLast ) {
495
+ for ( key in obj ) {
496
+ return core_hasOwn.call( obj, key );
497
+ }
498
+ }
499
+
500
+ // Own properties are enumerated firstly, so to speed up,
501
+ // if last one is own, then all properties are own.
502
+ for ( key in obj ) {}
503
+
504
+ return key === undefined || core_hasOwn.call( obj, key );
505
+ },
506
+
507
+ isEmptyObject: function( obj ) {
508
+ var name;
509
+ for ( name in obj ) {
510
+ return false;
511
+ }
512
+ return true;
513
+ },
514
+
515
+ error: function( msg ) {
516
+ throw new Error( msg );
517
+ },
518
+
519
+ // data: string of html
520
+ // context (optional): If specified, the fragment will be created in this context, defaults to document
521
+ // keepScripts (optional): If true, will include scripts passed in the html string
522
+ parseHTML: function( data, context, keepScripts ) {
523
+ if ( !data || typeof data !== "string" ) {
524
+ return null;
525
+ }
526
+ if ( typeof context === "boolean" ) {
527
+ keepScripts = context;
528
+ context = false;
529
+ }
530
+ context = context || document;
531
+
532
+ var parsed = rsingleTag.exec( data ),
533
+ scripts = !keepScripts && [];
534
+
535
+ // Single tag
536
+ if ( parsed ) {
537
+ return [ context.createElement( parsed[1] ) ];
538
+ }
539
+
540
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
541
+ if ( scripts ) {
542
+ jQuery( scripts ).remove();
543
+ }
544
+ return jQuery.merge( [], parsed.childNodes );
545
+ },
546
+
547
+ parseJSON: function( data ) {
548
+ // Attempt to parse using the native JSON parser first
549
+ if ( window.JSON && window.JSON.parse ) {
550
+ return window.JSON.parse( data );
551
+ }
552
+
553
+ if ( data === null ) {
554
+ return data;
555
+ }
556
+
557
+ if ( typeof data === "string" ) {
558
+
559
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
560
+ data = jQuery.trim( data );
561
+
562
+ if ( data ) {
563
+ // Make sure the incoming data is actual JSON
564
+ // Logic borrowed from http://json.org/json2.js
565
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
566
+ .replace( rvalidtokens, "]" )
567
+ .replace( rvalidbraces, "")) ) {
568
+
569
+ return ( new Function( "return " + data ) )();
570
+ }
571
+ }
572
+ }
573
+
574
+ jQuery.error( "Invalid JSON: " + data );
575
+ },
576
+
577
+ // Cross-browser xml parsing
578
+ parseXML: function( data ) {
579
+ var xml, tmp;
580
+ if ( !data || typeof data !== "string" ) {
581
+ return null;
582
+ }
583
+ try {
584
+ if ( window.DOMParser ) { // Standard
585
+ tmp = new DOMParser();
586
+ xml = tmp.parseFromString( data , "text/xml" );
587
+ } else { // IE
588
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
589
+ xml.async = "false";
590
+ xml.loadXML( data );
591
+ }
592
+ } catch( e ) {
593
+ xml = undefined;
594
+ }
595
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
596
+ jQuery.error( "Invalid XML: " + data );
597
+ }
598
+ return xml;
599
+ },
600
+
601
+ noop: function() {},
602
+
603
+ // Evaluates a script in a global context
604
+ // Workarounds based on findings by Jim Driscoll
605
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
606
+ globalEval: function( data ) {
607
+ if ( data && jQuery.trim( data ) ) {
608
+ // We use execScript on Internet Explorer
609
+ // We use an anonymous function so that context is window
610
+ // rather than jQuery in Firefox
611
+ ( window.execScript || function( data ) {
612
+ window[ "eval" ].call( window, data );
613
+ } )( data );
614
+ }
615
+ },
616
+
617
+ // Convert dashed to camelCase; used by the css and data modules
618
+ // Microsoft forgot to hump their vendor prefix (#9572)
619
+ camelCase: function( string ) {
620
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
621
+ },
622
+
623
+ nodeName: function( elem, name ) {
624
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
625
+ },
626
+
627
+ // args is for internal usage only
628
+ each: function( obj, callback, args ) {
629
+ var value,
630
+ i = 0,
631
+ length = obj.length,
632
+ isArray = isArraylike( obj );
633
+
634
+ if ( args ) {
635
+ if ( isArray ) {
636
+ for ( ; i < length; i++ ) {
637
+ value = callback.apply( obj[ i ], args );
638
+
639
+ if ( value === false ) {
640
+ break;
641
+ }
642
+ }
643
+ } else {
644
+ for ( i in obj ) {
645
+ value = callback.apply( obj[ i ], args );
646
+
647
+ if ( value === false ) {
648
+ break;
649
+ }
650
+ }
651
+ }
652
+
653
+ // A special, fast, case for the most common use of each
654
+ } else {
655
+ if ( isArray ) {
656
+ for ( ; i < length; i++ ) {
657
+ value = callback.call( obj[ i ], i, obj[ i ] );
658
+
659
+ if ( value === false ) {
660
+ break;
661
+ }
662
+ }
663
+ } else {
664
+ for ( i in obj ) {
665
+ value = callback.call( obj[ i ], i, obj[ i ] );
666
+
667
+ if ( value === false ) {
668
+ break;
669
+ }
670
+ }
671
+ }
672
+ }
673
+
674
+ return obj;
675
+ },
676
+
677
+ // Use native String.trim function wherever possible
678
+ trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
679
+ function( text ) {
680
+ return text == null ?
681
+ "" :
682
+ core_trim.call( text );
683
+ } :
684
+
685
+ // Otherwise use our own trimming functionality
686
+ function( text ) {
687
+ return text == null ?
688
+ "" :
689
+ ( text + "" ).replace( rtrim, "" );
690
+ },
691
+
692
+ // results is for internal usage only
693
+ makeArray: function( arr, results ) {
694
+ var ret = results || [];
695
+
696
+ if ( arr != null ) {
697
+ if ( isArraylike( Object(arr) ) ) {
698
+ jQuery.merge( ret,
699
+ typeof arr === "string" ?
700
+ [ arr ] : arr
701
+ );
702
+ } else {
703
+ core_push.call( ret, arr );
704
+ }
705
+ }
706
+
707
+ return ret;
708
+ },
709
+
710
+ inArray: function( elem, arr, i ) {
711
+ var len;
712
+
713
+ if ( arr ) {
714
+ if ( core_indexOf ) {
715
+ return core_indexOf.call( arr, elem, i );
716
+ }
717
+
718
+ len = arr.length;
719
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
720
+
721
+ for ( ; i < len; i++ ) {
722
+ // Skip accessing in sparse arrays
723
+ if ( i in arr && arr[ i ] === elem ) {
724
+ return i;
725
+ }
726
+ }
727
+ }
728
+
729
+ return -1;
730
+ },
731
+
732
+ merge: function( first, second ) {
733
+ var l = second.length,
734
+ i = first.length,
735
+ j = 0;
736
+
737
+ if ( typeof l === "number" ) {
738
+ for ( ; j < l; j++ ) {
739
+ first[ i++ ] = second[ j ];
740
+ }
741
+ } else {
742
+ while ( second[j] !== undefined ) {
743
+ first[ i++ ] = second[ j++ ];
744
+ }
745
+ }
746
+
747
+ first.length = i;
748
+
749
+ return first;
750
+ },
751
+
752
+ grep: function( elems, callback, inv ) {
753
+ var retVal,
754
+ ret = [],
755
+ i = 0,
756
+ length = elems.length;
757
+ inv = !!inv;
758
+
759
+ // Go through the array, only saving the items
760
+ // that pass the validator function
761
+ for ( ; i < length; i++ ) {
762
+ retVal = !!callback( elems[ i ], i );
763
+ if ( inv !== retVal ) {
764
+ ret.push( elems[ i ] );
765
+ }
766
+ }
767
+
768
+ return ret;
769
+ },
770
+
771
+ // arg is for internal usage only
772
+ map: function( elems, callback, arg ) {
773
+ var value,
774
+ i = 0,
775
+ length = elems.length,
776
+ isArray = isArraylike( elems ),
777
+ ret = [];
778
+
779
+ // Go through the array, translating each of the items to their
780
+ if ( isArray ) {
781
+ for ( ; i < length; i++ ) {
782
+ value = callback( elems[ i ], i, arg );
783
+
784
+ if ( value != null ) {
785
+ ret[ ret.length ] = value;
786
+ }
787
+ }
788
+
789
+ // Go through every key on the object,
790
+ } else {
791
+ for ( i in elems ) {
792
+ value = callback( elems[ i ], i, arg );
793
+
794
+ if ( value != null ) {
795
+ ret[ ret.length ] = value;
796
+ }
797
+ }
798
+ }
799
+
800
+ // Flatten any nested arrays
801
+ return core_concat.apply( [], ret );
802
+ },
803
+
804
+ // A global GUID counter for objects
805
+ guid: 1,
806
+
807
+ // Bind a function to a context, optionally partially applying any
808
+ // arguments.
809
+ proxy: function( fn, context ) {
810
+ var args, proxy, tmp;
811
+
812
+ if ( typeof context === "string" ) {
813
+ tmp = fn[ context ];
814
+ context = fn;
815
+ fn = tmp;
816
+ }
817
+
818
+ // Quick check to determine if target is callable, in the spec
819
+ // this throws a TypeError, but we will just return undefined.
820
+ if ( !jQuery.isFunction( fn ) ) {
821
+ return undefined;
822
+ }
823
+
824
+ // Simulated bind
825
+ args = core_slice.call( arguments, 2 );
826
+ proxy = function() {
827
+ return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
828
+ };
829
+
830
+ // Set the guid of unique handler to the same of original handler, so it can be removed
831
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
832
+
833
+ return proxy;
834
+ },
835
+
836
+ // Multifunctional method to get and set values of a collection
837
+ // The value/s can optionally be executed if it's a function
838
+ access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
839
+ var i = 0,
840
+ length = elems.length,
841
+ bulk = key == null;
842
+
843
+ // Sets many values
844
+ if ( jQuery.type( key ) === "object" ) {
845
+ chainable = true;
846
+ for ( i in key ) {
847
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
848
+ }
849
+
850
+ // Sets one value
851
+ } else if ( value !== undefined ) {
852
+ chainable = true;
853
+
854
+ if ( !jQuery.isFunction( value ) ) {
855
+ raw = true;
856
+ }
857
+
858
+ if ( bulk ) {
859
+ // Bulk operations run against the entire set
860
+ if ( raw ) {
861
+ fn.call( elems, value );
862
+ fn = null;
863
+
864
+ // ...except when executing function values
865
+ } else {
866
+ bulk = fn;
867
+ fn = function( elem, key, value ) {
868
+ return bulk.call( jQuery( elem ), value );
869
+ };
870
+ }
871
+ }
872
+
873
+ if ( fn ) {
874
+ for ( ; i < length; i++ ) {
875
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
876
+ }
877
+ }
878
+ }
879
+
880
+ return chainable ?
881
+ elems :
882
+
883
+ // Gets
884
+ bulk ?
885
+ fn.call( elems ) :
886
+ length ? fn( elems[0], key ) : emptyGet;
887
+ },
888
+
889
+ now: function() {
890
+ return ( new Date() ).getTime();
891
+ },
892
+
893
+ // A method for quickly swapping in/out CSS properties to get correct calculations.
894
+ // Note: this method belongs to the css module but it's needed here for the support module.
895
+ // If support gets modularized, this method should be moved back to the css module.
896
+ swap: function( elem, options, callback, args ) {
897
+ var ret, name,
898
+ old = {};
899
+
900
+ // Remember the old values, and insert the new ones
901
+ for ( name in options ) {
902
+ old[ name ] = elem.style[ name ];
903
+ elem.style[ name ] = options[ name ];
904
+ }
905
+
906
+ ret = callback.apply( elem, args || [] );
907
+
908
+ // Revert the old values
909
+ for ( name in options ) {
910
+ elem.style[ name ] = old[ name ];
911
+ }
912
+
913
+ return ret;
914
+ }
915
+ });
916
+
917
+ jQuery.ready.promise = function( obj ) {
918
+ if ( !readyList ) {
919
+
920
+ readyList = jQuery.Deferred();
921
+
922
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
923
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
924
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
925
+ if ( document.readyState === "complete" ) {
926
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
927
+ setTimeout( jQuery.ready );
928
+
929
+ // Standards-based browsers support DOMContentLoaded
930
+ } else if ( document.addEventListener ) {
931
+ // Use the handy event callback
932
+ document.addEventListener( "DOMContentLoaded", completed, false );
933
+
934
+ // A fallback to window.onload, that will always work
935
+ window.addEventListener( "load", completed, false );
936
+
937
+ // If IE event model is used
938
+ } else {
939
+ // Ensure firing before onload, maybe late but safe also for iframes
940
+ document.attachEvent( "onreadystatechange", completed );
941
+
942
+ // A fallback to window.onload, that will always work
943
+ window.attachEvent( "onload", completed );
944
+
945
+ // If IE and not a frame
946
+ // continually check to see if the document is ready
947
+ var top = false;
948
+
949
+ try {
950
+ top = window.frameElement == null && document.documentElement;
951
+ } catch(e) {}
952
+
953
+ if ( top && top.doScroll ) {
954
+ (function doScrollCheck() {
955
+ if ( !jQuery.isReady ) {
956
+
957
+ try {
958
+ // Use the trick by Diego Perini
959
+ // http://javascript.nwbox.com/IEContentLoaded/
960
+ top.doScroll("left");
961
+ } catch(e) {
962
+ return setTimeout( doScrollCheck, 50 );
963
+ }
964
+
965
+ // detach all dom ready events
966
+ detach();
967
+
968
+ // and execute any waiting functions
969
+ jQuery.ready();
970
+ }
971
+ })();
972
+ }
973
+ }
974
+ }
975
+ return readyList.promise( obj );
976
+ };
977
+
978
+ // Populate the class2type map
979
+ jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
980
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
981
+ });
982
+
983
+ function isArraylike( obj ) {
984
+ var length = obj.length,
985
+ type = jQuery.type( obj );
986
+
987
+ if ( jQuery.isWindow( obj ) ) {
988
+ return false;
989
+ }
990
+
991
+ if ( obj.nodeType === 1 && length ) {
992
+ return true;
993
+ }
994
+
995
+ return type === "array" || type !== "function" &&
996
+ ( length === 0 ||
997
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj );
998
+ }
999
+
1000
+ // All jQuery objects should point back to these
1001
+ rootjQuery = jQuery(document);
1002
+ /*!
1003
+ * Sizzle CSS Selector Engine v1.10.2
1004
+ * http://sizzlejs.com/
1005
+ *
1006
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
1007
+ * Released under the MIT license
1008
+ * http://jquery.org/license
1009
+ *
1010
+ * Date: 2013-07-03
1011
+ */
1012
+ (function( window, undefined ) {
1013
+
1014
+ var i,
1015
+ support,
1016
+ cachedruns,
1017
+ Expr,
1018
+ getText,
1019
+ isXML,
1020
+ compile,
1021
+ outermostContext,
1022
+ sortInput,
1023
+
1024
+ // Local document vars
1025
+ setDocument,
1026
+ document,
1027
+ docElem,
1028
+ documentIsHTML,
1029
+ rbuggyQSA,
1030
+ rbuggyMatches,
1031
+ matches,
1032
+ contains,
1033
+
1034
+ // Instance-specific data
1035
+ expando = "sizzle" + -(new Date()),
1036
+ preferredDoc = window.document,
1037
+ dirruns = 0,
1038
+ done = 0,
1039
+ classCache = createCache(),
1040
+ tokenCache = createCache(),
1041
+ compilerCache = createCache(),
1042
+ hasDuplicate = false,
1043
+ sortOrder = function( a, b ) {
1044
+ if ( a === b ) {
1045
+ hasDuplicate = true;
1046
+ return 0;
1047
+ }
1048
+ return 0;
1049
+ },
1050
+
1051
+ // General-purpose constants
1052
+ strundefined = typeof undefined,
1053
+ MAX_NEGATIVE = 1 << 31,
1054
+
1055
+ // Instance methods
1056
+ hasOwn = ({}).hasOwnProperty,
1057
+ arr = [],
1058
+ pop = arr.pop,
1059
+ push_native = arr.push,
1060
+ push = arr.push,
1061
+ slice = arr.slice,
1062
+ // Use a stripped-down indexOf if we can't use a native one
1063
+ indexOf = arr.indexOf || function( elem ) {
1064
+ var i = 0,
1065
+ len = this.length;
1066
+ for ( ; i < len; i++ ) {
1067
+ if ( this[i] === elem ) {
1068
+ return i;
1069
+ }
1070
+ }
1071
+ return -1;
1072
+ },
1073
+
1074
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
1075
+
1076
+ // Regular expressions
1077
+
1078
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
1079
+ whitespace = "[\\x20\\t\\r\\n\\f]",
1080
+ // http://www.w3.org/TR/css3-syntax/#characters
1081
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
1082
+
1083
+ // Loosely modeled on CSS identifier characters
1084
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
1085
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
1086
+ identifier = characterEncoding.replace( "w", "w#" ),
1087
+
1088
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
1089
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
1090
+ "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
1091
+
1092
+ // Prefer arguments quoted,
1093
+ // then not containing pseudos/brackets,
1094
+ // then attribute selectors/non-parenthetical expressions,
1095
+ // then anything else
1096
+ // These preferences are here to reduce the number of selectors
1097
+ // needing tokenize in the PSEUDO preFilter
1098
+ pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
1099
+
1100
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
1101
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
1102
+
1103
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
1104
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
1105
+
1106
+ rsibling = new RegExp( whitespace + "*[+~]" ),
1107
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
1108
+
1109
+ rpseudo = new RegExp( pseudos ),
1110
+ ridentifier = new RegExp( "^" + identifier + "$" ),
1111
+
1112
+ matchExpr = {
1113
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
1114
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
1115
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
1116
+ "ATTR": new RegExp( "^" + attributes ),
1117
+ "PSEUDO": new RegExp( "^" + pseudos ),
1118
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
1119
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
1120
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
1121
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
1122
+ // For use in libraries implementing .is()
1123
+ // We use this for POS matching in `select`
1124
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
1125
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
1126
+ },
1127
+
1128
+ rnative = /^[^{]+\{\s*\[native \w/,
1129
+
1130
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
1131
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
1132
+
1133
+ rinputs = /^(?:input|select|textarea|button)$/i,
1134
+ rheader = /^h\d$/i,
1135
+
1136
+ rescape = /'|\\/g,
1137
+
1138
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
1139
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
1140
+ funescape = function( _, escaped, escapedWhitespace ) {
1141
+ var high = "0x" + escaped - 0x10000;
1142
+ // NaN means non-codepoint
1143
+ // Support: Firefox
1144
+ // Workaround erroneous numeric interpretation of +"0x"
1145
+ return high !== high || escapedWhitespace ?
1146
+ escaped :
1147
+ // BMP codepoint
1148
+ high < 0 ?
1149
+ String.fromCharCode( high + 0x10000 ) :
1150
+ // Supplemental Plane codepoint (surrogate pair)
1151
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
1152
+ };
1153
+
1154
+ // Optimize for push.apply( _, NodeList )
1155
+ try {
1156
+ push.apply(
1157
+ (arr = slice.call( preferredDoc.childNodes )),
1158
+ preferredDoc.childNodes
1159
+ );
1160
+ // Support: Android<4.0
1161
+ // Detect silently failing push.apply
1162
+ arr[ preferredDoc.childNodes.length ].nodeType;
1163
+ } catch ( e ) {
1164
+ push = { apply: arr.length ?
1165
+
1166
+ // Leverage slice if possible
1167
+ function( target, els ) {
1168
+ push_native.apply( target, slice.call(els) );
1169
+ } :
1170
+
1171
+ // Support: IE<9
1172
+ // Otherwise append directly
1173
+ function( target, els ) {
1174
+ var j = target.length,
1175
+ i = 0;
1176
+ // Can't trust NodeList.length
1177
+ while ( (target[j++] = els[i++]) ) {}
1178
+ target.length = j - 1;
1179
+ }
1180
+ };
1181
+ }
1182
+
1183
+ function Sizzle( selector, context, results, seed ) {
1184
+ var match, elem, m, nodeType,
1185
+ // QSA vars
1186
+ i, groups, old, nid, newContext, newSelector;
1187
+
1188
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
1189
+ setDocument( context );
1190
+ }
1191
+
1192
+ context = context || document;
1193
+ results = results || [];
1194
+
1195
+ if ( !selector || typeof selector !== "string" ) {
1196
+ return results;
1197
+ }
1198
+
1199
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
1200
+ return [];
1201
+ }
1202
+
1203
+ if ( documentIsHTML && !seed ) {
1204
+
1205
+ // Shortcuts
1206
+ if ( (match = rquickExpr.exec( selector )) ) {
1207
+ // Speed-up: Sizzle("#ID")
1208
+ if ( (m = match[1]) ) {
1209
+ if ( nodeType === 9 ) {
1210
+ elem = context.getElementById( m );
1211
+ // Check parentNode to catch when Blackberry 4.6 returns
1212
+ // nodes that are no longer in the document #6963
1213
+ if ( elem && elem.parentNode ) {
1214
+ // Handle the case where IE, Opera, and Webkit return items
1215
+ // by name instead of ID
1216
+ if ( elem.id === m ) {
1217
+ results.push( elem );
1218
+ return results;
1219
+ }
1220
+ } else {
1221
+ return results;
1222
+ }
1223
+ } else {
1224
+ // Context is not a document
1225
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
1226
+ contains( context, elem ) && elem.id === m ) {
1227
+ results.push( elem );
1228
+ return results;
1229
+ }
1230
+ }
1231
+
1232
+ // Speed-up: Sizzle("TAG")
1233
+ } else if ( match[2] ) {
1234
+ push.apply( results, context.getElementsByTagName( selector ) );
1235
+ return results;
1236
+
1237
+ // Speed-up: Sizzle(".CLASS")
1238
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
1239
+ push.apply( results, context.getElementsByClassName( m ) );
1240
+ return results;
1241
+ }
1242
+ }
1243
+
1244
+ // QSA path
1245
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
1246
+ nid = old = expando;
1247
+ newContext = context;
1248
+ newSelector = nodeType === 9 && selector;
1249
+
1250
+ // qSA works strangely on Element-rooted queries
1251
+ // We can work around this by specifying an extra ID on the root
1252
+ // and working up from there (Thanks to Andrew Dupont for the technique)
1253
+ // IE 8 doesn't work on object elements
1254
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
1255
+ groups = tokenize( selector );
1256
+
1257
+ if ( (old = context.getAttribute("id")) ) {
1258
+ nid = old.replace( rescape, "\\$&" );
1259
+ } else {
1260
+ context.setAttribute( "id", nid );
1261
+ }
1262
+ nid = "[id='" + nid + "'] ";
1263
+
1264
+ i = groups.length;
1265
+ while ( i-- ) {
1266
+ groups[i] = nid + toSelector( groups[i] );
1267
+ }
1268
+ newContext = rsibling.test( selector ) && context.parentNode || context;
1269
+ newSelector = groups.join(",");
1270
+ }
1271
+
1272
+ if ( newSelector ) {
1273
+ try {
1274
+ push.apply( results,
1275
+ newContext.querySelectorAll( newSelector )
1276
+ );
1277
+ return results;
1278
+ } catch(qsaError) {
1279
+ } finally {
1280
+ if ( !old ) {
1281
+ context.removeAttribute("id");
1282
+ }
1283
+ }
1284
+ }
1285
+ }
1286
+ }
1287
+
1288
+ // All others
1289
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
1290
+ }
1291
+
1292
+ /**
1293
+ * Create key-value caches of limited size
1294
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
1295
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
1296
+ * deleting the oldest entry
1297
+ */
1298
+ function createCache() {
1299
+ var keys = [];
1300
+
1301
+ function cache( key, value ) {
1302
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
1303
+ if ( keys.push( key += " " ) > Expr.cacheLength ) {
1304
+ // Only keep the most recent entries
1305
+ delete cache[ keys.shift() ];
1306
+ }
1307
+ return (cache[ key ] = value);
1308
+ }
1309
+ return cache;
1310
+ }
1311
+
1312
+ /**
1313
+ * Mark a function for special use by Sizzle
1314
+ * @param {Function} fn The function to mark
1315
+ */
1316
+ function markFunction( fn ) {
1317
+ fn[ expando ] = true;
1318
+ return fn;
1319
+ }
1320
+
1321
+ /**
1322
+ * Support testing using an element
1323
+ * @param {Function} fn Passed the created div and expects a boolean result
1324
+ */
1325
+ function assert( fn ) {
1326
+ var div = document.createElement("div");
1327
+
1328
+ try {
1329
+ return !!fn( div );
1330
+ } catch (e) {
1331
+ return false;
1332
+ } finally {
1333
+ // Remove from its parent by default
1334
+ if ( div.parentNode ) {
1335
+ div.parentNode.removeChild( div );
1336
+ }
1337
+ // release memory in IE
1338
+ div = null;
1339
+ }
1340
+ }
1341
+
1342
+ /**
1343
+ * Adds the same handler for all of the specified attrs
1344
+ * @param {String} attrs Pipe-separated list of attributes
1345
+ * @param {Function} handler The method that will be applied
1346
+ */
1347
+ function addHandle( attrs, handler ) {
1348
+ var arr = attrs.split("|"),
1349
+ i = attrs.length;
1350
+
1351
+ while ( i-- ) {
1352
+ Expr.attrHandle[ arr[i] ] = handler;
1353
+ }
1354
+ }
1355
+
1356
+ /**
1357
+ * Checks document order of two siblings
1358
+ * @param {Element} a
1359
+ * @param {Element} b
1360
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
1361
+ */
1362
+ function siblingCheck( a, b ) {
1363
+ var cur = b && a,
1364
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
1365
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
1366
+ ( ~a.sourceIndex || MAX_NEGATIVE );
1367
+
1368
+ // Use IE sourceIndex if available on both nodes
1369
+ if ( diff ) {
1370
+ return diff;
1371
+ }
1372
+
1373
+ // Check if b follows a
1374
+ if ( cur ) {
1375
+ while ( (cur = cur.nextSibling) ) {
1376
+ if ( cur === b ) {
1377
+ return -1;
1378
+ }
1379
+ }
1380
+ }
1381
+
1382
+ return a ? 1 : -1;
1383
+ }
1384
+
1385
+ /**
1386
+ * Returns a function to use in pseudos for input types
1387
+ * @param {String} type
1388
+ */
1389
+ function createInputPseudo( type ) {
1390
+ return function( elem ) {
1391
+ var name = elem.nodeName.toLowerCase();
1392
+ return name === "input" && elem.type === type;
1393
+ };
1394
+ }
1395
+
1396
+ /**
1397
+ * Returns a function to use in pseudos for buttons
1398
+ * @param {String} type
1399
+ */
1400
+ function createButtonPseudo( type ) {
1401
+ return function( elem ) {
1402
+ var name = elem.nodeName.toLowerCase();
1403
+ return (name === "input" || name === "button") && elem.type === type;
1404
+ };
1405
+ }
1406
+
1407
+ /**
1408
+ * Returns a function to use in pseudos for positionals
1409
+ * @param {Function} fn
1410
+ */
1411
+ function createPositionalPseudo( fn ) {
1412
+ return markFunction(function( argument ) {
1413
+ argument = +argument;
1414
+ return markFunction(function( seed, matches ) {
1415
+ var j,
1416
+ matchIndexes = fn( [], seed.length, argument ),
1417
+ i = matchIndexes.length;
1418
+
1419
+ // Match elements found at the specified indexes
1420
+ while ( i-- ) {
1421
+ if ( seed[ (j = matchIndexes[i]) ] ) {
1422
+ seed[j] = !(matches[j] = seed[j]);
1423
+ }
1424
+ }
1425
+ });
1426
+ });
1427
+ }
1428
+
1429
+ /**
1430
+ * Detect xml
1431
+ * @param {Element|Object} elem An element or a document
1432
+ */
1433
+ isXML = Sizzle.isXML = function( elem ) {
1434
+ // documentElement is verified for cases where it doesn't yet exist
1435
+ // (such as loading iframes in IE - #4833)
1436
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1437
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
1438
+ };
1439
+
1440
+ // Expose support vars for convenience
1441
+ support = Sizzle.support = {};
1442
+
1443
+ /**
1444
+ * Sets document-related variables once based on the current document
1445
+ * @param {Element|Object} [doc] An element or document object to use to set the document
1446
+ * @returns {Object} Returns the current document
1447
+ */
1448
+ setDocument = Sizzle.setDocument = function( node ) {
1449
+ var doc = node ? node.ownerDocument || node : preferredDoc,
1450
+ parent = doc.defaultView;
1451
+
1452
+ // If no document and documentElement is available, return
1453
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1454
+ return document;
1455
+ }
1456
+
1457
+ // Set our document
1458
+ document = doc;
1459
+ docElem = doc.documentElement;
1460
+
1461
+ // Support tests
1462
+ documentIsHTML = !isXML( doc );
1463
+
1464
+ // Support: IE>8
1465
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
1466
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
1467
+ // IE6-8 do not support the defaultView property so parent will be undefined
1468
+ if ( parent && parent.attachEvent && parent !== parent.top ) {
1469
+ parent.attachEvent( "onbeforeunload", function() {
1470
+ setDocument();
1471
+ });
1472
+ }
1473
+
1474
+ /* Attributes
1475
+ ---------------------------------------------------------------------- */
1476
+
1477
+ // Support: IE<8
1478
+ // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
1479
+ support.attributes = assert(function( div ) {
1480
+ div.className = "i";
1481
+ return !div.getAttribute("className");
1482
+ });
1483
+
1484
+ /* getElement(s)By*
1485
+ ---------------------------------------------------------------------- */
1486
+
1487
+ // Check if getElementsByTagName("*") returns only elements
1488
+ support.getElementsByTagName = assert(function( div ) {
1489
+ div.appendChild( doc.createComment("") );
1490
+ return !div.getElementsByTagName("*").length;
1491
+ });
1492
+
1493
+ // Check if getElementsByClassName can be trusted
1494
+ support.getElementsByClassName = assert(function( div ) {
1495
+ div.innerHTML = "<div class='a'></div><div class='a i'></div>";
1496
+
1497
+ // Support: Safari<4
1498
+ // Catch class over-caching
1499
+ div.firstChild.className = "i";
1500
+ // Support: Opera<10
1501
+ // Catch gEBCN failure to find non-leading classes
1502
+ return div.getElementsByClassName("i").length === 2;
1503
+ });
1504
+
1505
+ // Support: IE<10
1506
+ // Check if getElementById returns elements by name
1507
+ // The broken getElementById methods don't pick up programatically-set names,
1508
+ // so use a roundabout getElementsByName test
1509
+ support.getById = assert(function( div ) {
1510
+ docElem.appendChild( div ).id = expando;
1511
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
1512
+ });
1513
+
1514
+ // ID find and filter
1515
+ if ( support.getById ) {
1516
+ Expr.find["ID"] = function( id, context ) {
1517
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
1518
+ var m = context.getElementById( id );
1519
+ // Check parentNode to catch when Blackberry 4.6 returns
1520
+ // nodes that are no longer in the document #6963
1521
+ return m && m.parentNode ? [m] : [];
1522
+ }
1523
+ };
1524
+ Expr.filter["ID"] = function( id ) {
1525
+ var attrId = id.replace( runescape, funescape );
1526
+ return function( elem ) {
1527
+ return elem.getAttribute("id") === attrId;
1528
+ };
1529
+ };
1530
+ } else {
1531
+ // Support: IE6/7
1532
+ // getElementById is not reliable as a find shortcut
1533
+ delete Expr.find["ID"];
1534
+
1535
+ Expr.filter["ID"] = function( id ) {
1536
+ var attrId = id.replace( runescape, funescape );
1537
+ return function( elem ) {
1538
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
1539
+ return node && node.value === attrId;
1540
+ };
1541
+ };
1542
+ }
1543
+
1544
+ // Tag
1545
+ Expr.find["TAG"] = support.getElementsByTagName ?
1546
+ function( tag, context ) {
1547
+ if ( typeof context.getElementsByTagName !== strundefined ) {
1548
+ return context.getElementsByTagName( tag );
1549
+ }
1550
+ } :
1551
+ function( tag, context ) {
1552
+ var elem,
1553
+ tmp = [],
1554
+ i = 0,
1555
+ results = context.getElementsByTagName( tag );
1556
+
1557
+ // Filter out possible comments
1558
+ if ( tag === "*" ) {
1559
+ while ( (elem = results[i++]) ) {
1560
+ if ( elem.nodeType === 1 ) {
1561
+ tmp.push( elem );
1562
+ }
1563
+ }
1564
+
1565
+ return tmp;
1566
+ }
1567
+ return results;
1568
+ };
1569
+
1570
+ // Class
1571
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1572
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
1573
+ return context.getElementsByClassName( className );
1574
+ }
1575
+ };
1576
+
1577
+ /* QSA/matchesSelector
1578
+ ---------------------------------------------------------------------- */
1579
+
1580
+ // QSA and matchesSelector support
1581
+
1582
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1583
+ rbuggyMatches = [];
1584
+
1585
+ // qSa(:focus) reports false when true (Chrome 21)
1586
+ // We allow this because of a bug in IE8/9 that throws an error
1587
+ // whenever `document.activeElement` is accessed on an iframe
1588
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
1589
+ // See http://bugs.jquery.com/ticket/13378
1590
+ rbuggyQSA = [];
1591
+
1592
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
1593
+ // Build QSA regex
1594
+ // Regex strategy adopted from Diego Perini
1595
+ assert(function( div ) {
1596
+ // Select is set to empty string on purpose
1597
+ // This is to test IE's treatment of not explicitly
1598
+ // setting a boolean content attribute,
1599
+ // since its presence should be enough
1600
+ // http://bugs.jquery.com/ticket/12359
1601
+ div.innerHTML = "<select><option selected=''></option></select>";
1602
+
1603
+ // Support: IE8
1604
+ // Boolean attributes and "value" are not treated correctly
1605
+ if ( !div.querySelectorAll("[selected]").length ) {
1606
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1607
+ }
1608
+
1609
+ // Webkit/Opera - :checked should return selected option elements
1610
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1611
+ // IE8 throws error here and will not see later tests
1612
+ if ( !div.querySelectorAll(":checked").length ) {
1613
+ rbuggyQSA.push(":checked");
1614
+ }
1615
+ });
1616
+
1617
+ assert(function( div ) {
1618
+
1619
+ // Support: Opera 10-12/IE8
1620
+ // ^= $= *= and empty values
1621
+ // Should not select anything
1622
+ // Support: Windows 8 Native Apps
1623
+ // The type attribute is restricted during .innerHTML assignment
1624
+ var input = doc.createElement("input");
1625
+ input.setAttribute( "type", "hidden" );
1626
+ div.appendChild( input ).setAttribute( "t", "" );
1627
+
1628
+ if ( div.querySelectorAll("[t^='']").length ) {
1629
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1630
+ }
1631
+
1632
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1633
+ // IE8 throws error here and will not see later tests
1634
+ if ( !div.querySelectorAll(":enabled").length ) {
1635
+ rbuggyQSA.push( ":enabled", ":disabled" );
1636
+ }
1637
+
1638
+ // Opera 10-11 does not throw on post-comma invalid pseudos
1639
+ div.querySelectorAll("*,:x");
1640
+ rbuggyQSA.push(",.*:");
1641
+ });
1642
+ }
1643
+
1644
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
1645
+ docElem.mozMatchesSelector ||
1646
+ docElem.oMatchesSelector ||
1647
+ docElem.msMatchesSelector) )) ) {
1648
+
1649
+ assert(function( div ) {
1650
+ // Check to see if it's possible to do matchesSelector
1651
+ // on a disconnected node (IE 9)
1652
+ support.disconnectedMatch = matches.call( div, "div" );
1653
+
1654
+ // This should fail with an exception
1655
+ // Gecko does not error, returns false instead
1656
+ matches.call( div, "[s!='']:x" );
1657
+ rbuggyMatches.push( "!=", pseudos );
1658
+ });
1659
+ }
1660
+
1661
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1662
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1663
+
1664
+ /* Contains
1665
+ ---------------------------------------------------------------------- */
1666
+
1667
+ // Element contains another
1668
+ // Purposefully does not implement inclusive descendent
1669
+ // As in, an element does not contain itself
1670
+ contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?
1671
+ function( a, b ) {
1672
+ var adown = a.nodeType === 9 ? a.documentElement : a,
1673
+ bup = b && b.parentNode;
1674
+ return a === bup || !!( bup && bup.nodeType === 1 && (
1675
+ adown.contains ?
1676
+ adown.contains( bup ) :
1677
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1678
+ ));
1679
+ } :
1680
+ function( a, b ) {
1681
+ if ( b ) {
1682
+ while ( (b = b.parentNode) ) {
1683
+ if ( b === a ) {
1684
+ return true;
1685
+ }
1686
+ }
1687
+ }
1688
+ return false;
1689
+ };
1690
+
1691
+ /* Sorting
1692
+ ---------------------------------------------------------------------- */
1693
+
1694
+ // Document order sorting
1695
+ sortOrder = docElem.compareDocumentPosition ?
1696
+ function( a, b ) {
1697
+
1698
+ // Flag for duplicate removal
1699
+ if ( a === b ) {
1700
+ hasDuplicate = true;
1701
+ return 0;
1702
+ }
1703
+
1704
+ var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
1705
+
1706
+ if ( compare ) {
1707
+ // Disconnected nodes
1708
+ if ( compare & 1 ||
1709
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1710
+
1711
+ // Choose the first element that is related to our preferred document
1712
+ if ( a === doc || contains(preferredDoc, a) ) {
1713
+ return -1;
1714
+ }
1715
+ if ( b === doc || contains(preferredDoc, b) ) {
1716
+ return 1;
1717
+ }
1718
+
1719
+ // Maintain original order
1720
+ return sortInput ?
1721
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1722
+ 0;
1723
+ }
1724
+
1725
+ return compare & 4 ? -1 : 1;
1726
+ }
1727
+
1728
+ // Not directly comparable, sort on existence of method
1729
+ return a.compareDocumentPosition ? -1 : 1;
1730
+ } :
1731
+ function( a, b ) {
1732
+ var cur,
1733
+ i = 0,
1734
+ aup = a.parentNode,
1735
+ bup = b.parentNode,
1736
+ ap = [ a ],
1737
+ bp = [ b ];
1738
+
1739
+ // Exit early if the nodes are identical
1740
+ if ( a === b ) {
1741
+ hasDuplicate = true;
1742
+ return 0;
1743
+
1744
+ // Parentless nodes are either documents or disconnected
1745
+ } else if ( !aup || !bup ) {
1746
+ return a === doc ? -1 :
1747
+ b === doc ? 1 :
1748
+ aup ? -1 :
1749
+ bup ? 1 :
1750
+ sortInput ?
1751
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1752
+ 0;
1753
+
1754
+ // If the nodes are siblings, we can do a quick check
1755
+ } else if ( aup === bup ) {
1756
+ return siblingCheck( a, b );
1757
+ }
1758
+
1759
+ // Otherwise we need full lists of their ancestors for comparison
1760
+ cur = a;
1761
+ while ( (cur = cur.parentNode) ) {
1762
+ ap.unshift( cur );
1763
+ }
1764
+ cur = b;
1765
+ while ( (cur = cur.parentNode) ) {
1766
+ bp.unshift( cur );
1767
+ }
1768
+
1769
+ // Walk down the tree looking for a discrepancy
1770
+ while ( ap[i] === bp[i] ) {
1771
+ i++;
1772
+ }
1773
+
1774
+ return i ?
1775
+ // Do a sibling check if the nodes have a common ancestor
1776
+ siblingCheck( ap[i], bp[i] ) :
1777
+
1778
+ // Otherwise nodes in our document sort first
1779
+ ap[i] === preferredDoc ? -1 :
1780
+ bp[i] === preferredDoc ? 1 :
1781
+ 0;
1782
+ };
1783
+
1784
+ return doc;
1785
+ };
1786
+
1787
+ Sizzle.matches = function( expr, elements ) {
1788
+ return Sizzle( expr, null, null, elements );
1789
+ };
1790
+
1791
+ Sizzle.matchesSelector = function( elem, expr ) {
1792
+ // Set document vars if needed
1793
+ if ( ( elem.ownerDocument || elem ) !== document ) {
1794
+ setDocument( elem );
1795
+ }
1796
+
1797
+ // Make sure that attribute selectors are quoted
1798
+ expr = expr.replace( rattributeQuotes, "='$1']" );
1799
+
1800
+ if ( support.matchesSelector && documentIsHTML &&
1801
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1802
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1803
+
1804
+ try {
1805
+ var ret = matches.call( elem, expr );
1806
+
1807
+ // IE 9's matchesSelector returns false on disconnected nodes
1808
+ if ( ret || support.disconnectedMatch ||
1809
+ // As well, disconnected nodes are said to be in a document
1810
+ // fragment in IE 9
1811
+ elem.document && elem.document.nodeType !== 11 ) {
1812
+ return ret;
1813
+ }
1814
+ } catch(e) {}
1815
+ }
1816
+
1817
+ return Sizzle( expr, document, null, [elem] ).length > 0;
1818
+ };
1819
+
1820
+ Sizzle.contains = function( context, elem ) {
1821
+ // Set document vars if needed
1822
+ if ( ( context.ownerDocument || context ) !== document ) {
1823
+ setDocument( context );
1824
+ }
1825
+ return contains( context, elem );
1826
+ };
1827
+
1828
+ Sizzle.attr = function( elem, name ) {
1829
+ // Set document vars if needed
1830
+ if ( ( elem.ownerDocument || elem ) !== document ) {
1831
+ setDocument( elem );
1832
+ }
1833
+
1834
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
1835
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
1836
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1837
+ fn( elem, name, !documentIsHTML ) :
1838
+ undefined;
1839
+
1840
+ return val === undefined ?
1841
+ support.attributes || !documentIsHTML ?
1842
+ elem.getAttribute( name ) :
1843
+ (val = elem.getAttributeNode(name)) && val.specified ?
1844
+ val.value :
1845
+ null :
1846
+ val;
1847
+ };
1848
+
1849
+ Sizzle.error = function( msg ) {
1850
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
1851
+ };
1852
+
1853
+ /**
1854
+ * Document sorting and removing duplicates
1855
+ * @param {ArrayLike} results
1856
+ */
1857
+ Sizzle.uniqueSort = function( results ) {
1858
+ var elem,
1859
+ duplicates = [],
1860
+ j = 0,
1861
+ i = 0;
1862
+
1863
+ // Unless we *know* we can detect duplicates, assume their presence
1864
+ hasDuplicate = !support.detectDuplicates;
1865
+ sortInput = !support.sortStable && results.slice( 0 );
1866
+ results.sort( sortOrder );
1867
+
1868
+ if ( hasDuplicate ) {
1869
+ while ( (elem = results[i++]) ) {
1870
+ if ( elem === results[ i ] ) {
1871
+ j = duplicates.push( i );
1872
+ }
1873
+ }
1874
+ while ( j-- ) {
1875
+ results.splice( duplicates[ j ], 1 );
1876
+ }
1877
+ }
1878
+
1879
+ return results;
1880
+ };
1881
+
1882
+ /**
1883
+ * Utility function for retrieving the text value of an array of DOM nodes
1884
+ * @param {Array|Element} elem
1885
+ */
1886
+ getText = Sizzle.getText = function( elem ) {
1887
+ var node,
1888
+ ret = "",
1889
+ i = 0,
1890
+ nodeType = elem.nodeType;
1891
+
1892
+ if ( !nodeType ) {
1893
+ // If no nodeType, this is expected to be an array
1894
+ for ( ; (node = elem[i]); i++ ) {
1895
+ // Do not traverse comment nodes
1896
+ ret += getText( node );
1897
+ }
1898
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1899
+ // Use textContent for elements
1900
+ // innerText usage removed for consistency of new lines (see #11153)
1901
+ if ( typeof elem.textContent === "string" ) {
1902
+ return elem.textContent;
1903
+ } else {
1904
+ // Traverse its children
1905
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1906
+ ret += getText( elem );
1907
+ }
1908
+ }
1909
+ } else if ( nodeType === 3 || nodeType === 4 ) {
1910
+ return elem.nodeValue;
1911
+ }
1912
+ // Do not include comment or processing instruction nodes
1913
+
1914
+ return ret;
1915
+ };
1916
+
1917
+ Expr = Sizzle.selectors = {
1918
+
1919
+ // Can be adjusted by the user
1920
+ cacheLength: 50,
1921
+
1922
+ createPseudo: markFunction,
1923
+
1924
+ match: matchExpr,
1925
+
1926
+ attrHandle: {},
1927
+
1928
+ find: {},
1929
+
1930
+ relative: {
1931
+ ">": { dir: "parentNode", first: true },
1932
+ " ": { dir: "parentNode" },
1933
+ "+": { dir: "previousSibling", first: true },
1934
+ "~": { dir: "previousSibling" }
1935
+ },
1936
+
1937
+ preFilter: {
1938
+ "ATTR": function( match ) {
1939
+ match[1] = match[1].replace( runescape, funescape );
1940
+
1941
+ // Move the given value to match[3] whether quoted or unquoted
1942
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
1943
+
1944
+ if ( match[2] === "~=" ) {
1945
+ match[3] = " " + match[3] + " ";
1946
+ }
1947
+
1948
+ return match.slice( 0, 4 );
1949
+ },
1950
+
1951
+ "CHILD": function( match ) {
1952
+ /* matches from matchExpr["CHILD"]
1953
+ 1 type (only|nth|...)
1954
+ 2 what (child|of-type)
1955
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1956
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
1957
+ 5 sign of xn-component
1958
+ 6 x of xn-component
1959
+ 7 sign of y-component
1960
+ 8 y of y-component
1961
+ */
1962
+ match[1] = match[1].toLowerCase();
1963
+
1964
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
1965
+ // nth-* requires argument
1966
+ if ( !match[3] ) {
1967
+ Sizzle.error( match[0] );
1968
+ }
1969
+
1970
+ // numeric x and y parameters for Expr.filter.CHILD
1971
+ // remember that false/true cast respectively to 0/1
1972
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1973
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1974
+
1975
+ // other types prohibit arguments
1976
+ } else if ( match[3] ) {
1977
+ Sizzle.error( match[0] );
1978
+ }
1979
+
1980
+ return match;
1981
+ },
1982
+
1983
+ "PSEUDO": function( match ) {
1984
+ var excess,
1985
+ unquoted = !match[5] && match[2];
1986
+
1987
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
1988
+ return null;
1989
+ }
1990
+
1991
+ // Accept quoted arguments as-is
1992
+ if ( match[3] && match[4] !== undefined ) {
1993
+ match[2] = match[4];
1994
+
1995
+ // Strip excess characters from unquoted arguments
1996
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
1997
+ // Get excess from tokenize (recursively)
1998
+ (excess = tokenize( unquoted, true )) &&
1999
+ // advance to the next closing parenthesis
2000
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
2001
+
2002
+ // excess is a negative index
2003
+ match[0] = match[0].slice( 0, excess );
2004
+ match[2] = unquoted.slice( 0, excess );
2005
+ }
2006
+
2007
+ // Return only captures needed by the pseudo filter method (type and argument)
2008
+ return match.slice( 0, 3 );
2009
+ }
2010
+ },
2011
+
2012
+ filter: {
2013
+
2014
+ "TAG": function( nodeNameSelector ) {
2015
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
2016
+ return nodeNameSelector === "*" ?
2017
+ function() { return true; } :
2018
+ function( elem ) {
2019
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
2020
+ };
2021
+ },
2022
+
2023
+ "CLASS": function( className ) {
2024
+ var pattern = classCache[ className + " " ];
2025
+
2026
+ return pattern ||
2027
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
2028
+ classCache( className, function( elem ) {
2029
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
2030
+ });
2031
+ },
2032
+
2033
+ "ATTR": function( name, operator, check ) {
2034
+ return function( elem ) {
2035
+ var result = Sizzle.attr( elem, name );
2036
+
2037
+ if ( result == null ) {
2038
+ return operator === "!=";
2039
+ }
2040
+ if ( !operator ) {
2041
+ return true;
2042
+ }
2043
+
2044
+ result += "";
2045
+
2046
+ return operator === "=" ? result === check :
2047
+ operator === "!=" ? result !== check :
2048
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
2049
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
2050
+ operator === "$=" ? check && result.slice( -check.length ) === check :
2051
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
2052
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
2053
+ false;
2054
+ };
2055
+ },
2056
+
2057
+ "CHILD": function( type, what, argument, first, last ) {
2058
+ var simple = type.slice( 0, 3 ) !== "nth",
2059
+ forward = type.slice( -4 ) !== "last",
2060
+ ofType = what === "of-type";
2061
+
2062
+ return first === 1 && last === 0 ?
2063
+
2064
+ // Shortcut for :nth-*(n)
2065
+ function( elem ) {
2066
+ return !!elem.parentNode;
2067
+ } :
2068
+
2069
+ function( elem, context, xml ) {
2070
+ var cache, outerCache, node, diff, nodeIndex, start,
2071
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
2072
+ parent = elem.parentNode,
2073
+ name = ofType && elem.nodeName.toLowerCase(),
2074
+ useCache = !xml && !ofType;
2075
+
2076
+ if ( parent ) {
2077
+
2078
+ // :(first|last|only)-(child|of-type)
2079
+ if ( simple ) {
2080
+ while ( dir ) {
2081
+ node = elem;
2082
+ while ( (node = node[ dir ]) ) {
2083
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
2084
+ return false;
2085
+ }
2086
+ }
2087
+ // Reverse direction for :only-* (if we haven't yet done so)
2088
+ start = dir = type === "only" && !start && "nextSibling";
2089
+ }
2090
+ return true;
2091
+ }
2092
+
2093
+ start = [ forward ? parent.firstChild : parent.lastChild ];
2094
+
2095
+ // non-xml :nth-child(...) stores cache data on `parent`
2096
+ if ( forward && useCache ) {
2097
+ // Seek `elem` from a previously-cached index
2098
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
2099
+ cache = outerCache[ type ] || [];
2100
+ nodeIndex = cache[0] === dirruns && cache[1];
2101
+ diff = cache[0] === dirruns && cache[2];
2102
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
2103
+
2104
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
2105
+
2106
+ // Fallback to seeking `elem` from the start
2107
+ (diff = nodeIndex = 0) || start.pop()) ) {
2108
+
2109
+ // When found, cache indexes on `parent` and break
2110
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
2111
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
2112
+ break;
2113
+ }
2114
+ }
2115
+
2116
+ // Use previously-cached element index if available
2117
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
2118
+ diff = cache[1];
2119
+
2120
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
2121
+ } else {
2122
+ // Use the same loop as above to seek `elem` from the start
2123
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
2124
+ (diff = nodeIndex = 0) || start.pop()) ) {
2125
+
2126
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
2127
+ // Cache the index of each encountered element
2128
+ if ( useCache ) {
2129
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
2130
+ }
2131
+
2132
+ if ( node === elem ) {
2133
+ break;
2134
+ }
2135
+ }
2136
+ }
2137
+ }
2138
+
2139
+ // Incorporate the offset, then check against cycle size
2140
+ diff -= last;
2141
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
2142
+ }
2143
+ };
2144
+ },
2145
+
2146
+ "PSEUDO": function( pseudo, argument ) {
2147
+ // pseudo-class names are case-insensitive
2148
+ // http://www.w3.org/TR/selectors/#pseudo-classes
2149
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
2150
+ // Remember that setFilters inherits from pseudos
2151
+ var args,
2152
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
2153
+ Sizzle.error( "unsupported pseudo: " + pseudo );
2154
+
2155
+ // The user may use createPseudo to indicate that
2156
+ // arguments are needed to create the filter function
2157
+ // just as Sizzle does
2158
+ if ( fn[ expando ] ) {
2159
+ return fn( argument );
2160
+ }
2161
+
2162
+ // But maintain support for old signatures
2163
+ if ( fn.length > 1 ) {
2164
+ args = [ pseudo, pseudo, "", argument ];
2165
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
2166
+ markFunction(function( seed, matches ) {
2167
+ var idx,
2168
+ matched = fn( seed, argument ),
2169
+ i = matched.length;
2170
+ while ( i-- ) {
2171
+ idx = indexOf.call( seed, matched[i] );
2172
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
2173
+ }
2174
+ }) :
2175
+ function( elem ) {
2176
+ return fn( elem, 0, args );
2177
+ };
2178
+ }
2179
+
2180
+ return fn;
2181
+ }
2182
+ },
2183
+
2184
+ pseudos: {
2185
+ // Potentially complex pseudos
2186
+ "not": markFunction(function( selector ) {
2187
+ // Trim the selector passed to compile
2188
+ // to avoid treating leading and trailing
2189
+ // spaces as combinators
2190
+ var input = [],
2191
+ results = [],
2192
+ matcher = compile( selector.replace( rtrim, "$1" ) );
2193
+
2194
+ return matcher[ expando ] ?
2195
+ markFunction(function( seed, matches, context, xml ) {
2196
+ var elem,
2197
+ unmatched = matcher( seed, null, xml, [] ),
2198
+ i = seed.length;
2199
+
2200
+ // Match elements unmatched by `matcher`
2201
+ while ( i-- ) {
2202
+ if ( (elem = unmatched[i]) ) {
2203
+ seed[i] = !(matches[i] = elem);
2204
+ }
2205
+ }
2206
+ }) :
2207
+ function( elem, context, xml ) {
2208
+ input[0] = elem;
2209
+ matcher( input, null, xml, results );
2210
+ return !results.pop();
2211
+ };
2212
+ }),
2213
+
2214
+ "has": markFunction(function( selector ) {
2215
+ return function( elem ) {
2216
+ return Sizzle( selector, elem ).length > 0;
2217
+ };
2218
+ }),
2219
+
2220
+ "contains": markFunction(function( text ) {
2221
+ return function( elem ) {
2222
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
2223
+ };
2224
+ }),
2225
+
2226
+ // "Whether an element is represented by a :lang() selector
2227
+ // is based solely on the element's language value
2228
+ // being equal to the identifier C,
2229
+ // or beginning with the identifier C immediately followed by "-".
2230
+ // The matching of C against the element's language value is performed case-insensitively.
2231
+ // The identifier C does not have to be a valid language name."
2232
+ // http://www.w3.org/TR/selectors/#lang-pseudo
2233
+ "lang": markFunction( function( lang ) {
2234
+ // lang value must be a valid identifier
2235
+ if ( !ridentifier.test(lang || "") ) {
2236
+ Sizzle.error( "unsupported lang: " + lang );
2237
+ }
2238
+ lang = lang.replace( runescape, funescape ).toLowerCase();
2239
+ return function( elem ) {
2240
+ var elemLang;
2241
+ do {
2242
+ if ( (elemLang = documentIsHTML ?
2243
+ elem.lang :
2244
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
2245
+
2246
+ elemLang = elemLang.toLowerCase();
2247
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
2248
+ }
2249
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
2250
+ return false;
2251
+ };
2252
+ }),
2253
+
2254
+ // Miscellaneous
2255
+ "target": function( elem ) {
2256
+ var hash = window.location && window.location.hash;
2257
+ return hash && hash.slice( 1 ) === elem.id;
2258
+ },
2259
+
2260
+ "root": function( elem ) {
2261
+ return elem === docElem;
2262
+ },
2263
+
2264
+ "focus": function( elem ) {
2265
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
2266
+ },
2267
+
2268
+ // Boolean properties
2269
+ "enabled": function( elem ) {
2270
+ return elem.disabled === false;
2271
+ },
2272
+
2273
+ "disabled": function( elem ) {
2274
+ return elem.disabled === true;
2275
+ },
2276
+
2277
+ "checked": function( elem ) {
2278
+ // In CSS3, :checked should return both checked and selected elements
2279
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
2280
+ var nodeName = elem.nodeName.toLowerCase();
2281
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
2282
+ },
2283
+
2284
+ "selected": function( elem ) {
2285
+ // Accessing this property makes selected-by-default
2286
+ // options in Safari work properly
2287
+ if ( elem.parentNode ) {
2288
+ elem.parentNode.selectedIndex;
2289
+ }
2290
+
2291
+ return elem.selected === true;
2292
+ },
2293
+
2294
+ // Contents
2295
+ "empty": function( elem ) {
2296
+ // http://www.w3.org/TR/selectors/#empty-pseudo
2297
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
2298
+ // not comment, processing instructions, or others
2299
+ // Thanks to Diego Perini for the nodeName shortcut
2300
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
2301
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
2302
+ if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
2303
+ return false;
2304
+ }
2305
+ }
2306
+ return true;
2307
+ },
2308
+
2309
+ "parent": function( elem ) {
2310
+ return !Expr.pseudos["empty"]( elem );
2311
+ },
2312
+
2313
+ // Element/input types
2314
+ "header": function( elem ) {
2315
+ return rheader.test( elem.nodeName );
2316
+ },
2317
+
2318
+ "input": function( elem ) {
2319
+ return rinputs.test( elem.nodeName );
2320
+ },
2321
+
2322
+ "button": function( elem ) {
2323
+ var name = elem.nodeName.toLowerCase();
2324
+ return name === "input" && elem.type === "button" || name === "button";
2325
+ },
2326
+
2327
+ "text": function( elem ) {
2328
+ var attr;
2329
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
2330
+ // use getAttribute instead to test this case
2331
+ return elem.nodeName.toLowerCase() === "input" &&
2332
+ elem.type === "text" &&
2333
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
2334
+ },
2335
+
2336
+ // Position-in-collection
2337
+ "first": createPositionalPseudo(function() {
2338
+ return [ 0 ];
2339
+ }),
2340
+
2341
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
2342
+ return [ length - 1 ];
2343
+ }),
2344
+
2345
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
2346
+ return [ argument < 0 ? argument + length : argument ];
2347
+ }),
2348
+
2349
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
2350
+ var i = 0;
2351
+ for ( ; i < length; i += 2 ) {
2352
+ matchIndexes.push( i );
2353
+ }
2354
+ return matchIndexes;
2355
+ }),
2356
+
2357
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
2358
+ var i = 1;
2359
+ for ( ; i < length; i += 2 ) {
2360
+ matchIndexes.push( i );
2361
+ }
2362
+ return matchIndexes;
2363
+ }),
2364
+
2365
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2366
+ var i = argument < 0 ? argument + length : argument;
2367
+ for ( ; --i >= 0; ) {
2368
+ matchIndexes.push( i );
2369
+ }
2370
+ return matchIndexes;
2371
+ }),
2372
+
2373
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2374
+ var i = argument < 0 ? argument + length : argument;
2375
+ for ( ; ++i < length; ) {
2376
+ matchIndexes.push( i );
2377
+ }
2378
+ return matchIndexes;
2379
+ })
2380
+ }
2381
+ };
2382
+
2383
+ Expr.pseudos["nth"] = Expr.pseudos["eq"];
2384
+
2385
+ // Add button/input type pseudos
2386
+ for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2387
+ Expr.pseudos[ i ] = createInputPseudo( i );
2388
+ }
2389
+ for ( i in { submit: true, reset: true } ) {
2390
+ Expr.pseudos[ i ] = createButtonPseudo( i );
2391
+ }
2392
+
2393
+ // Easy API for creating new setFilters
2394
+ function setFilters() {}
2395
+ setFilters.prototype = Expr.filters = Expr.pseudos;
2396
+ Expr.setFilters = new setFilters();
2397
+
2398
+ function tokenize( selector, parseOnly ) {
2399
+ var matched, match, tokens, type,
2400
+ soFar, groups, preFilters,
2401
+ cached = tokenCache[ selector + " " ];
2402
+
2403
+ if ( cached ) {
2404
+ return parseOnly ? 0 : cached.slice( 0 );
2405
+ }
2406
+
2407
+ soFar = selector;
2408
+ groups = [];
2409
+ preFilters = Expr.preFilter;
2410
+
2411
+ while ( soFar ) {
2412
+
2413
+ // Comma and first run
2414
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
2415
+ if ( match ) {
2416
+ // Don't consume trailing commas as valid
2417
+ soFar = soFar.slice( match[0].length ) || soFar;
2418
+ }
2419
+ groups.push( tokens = [] );
2420
+ }
2421
+
2422
+ matched = false;
2423
+
2424
+ // Combinators
2425
+ if ( (match = rcombinators.exec( soFar )) ) {
2426
+ matched = match.shift();
2427
+ tokens.push({
2428
+ value: matched,
2429
+ // Cast descendant combinators to space
2430
+ type: match[0].replace( rtrim, " " )
2431
+ });
2432
+ soFar = soFar.slice( matched.length );
2433
+ }
2434
+
2435
+ // Filters
2436
+ for ( type in Expr.filter ) {
2437
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2438
+ (match = preFilters[ type ]( match ))) ) {
2439
+ matched = match.shift();
2440
+ tokens.push({
2441
+ value: matched,
2442
+ type: type,
2443
+ matches: match
2444
+ });
2445
+ soFar = soFar.slice( matched.length );
2446
+ }
2447
+ }
2448
+
2449
+ if ( !matched ) {
2450
+ break;
2451
+ }
2452
+ }
2453
+
2454
+ // Return the length of the invalid excess
2455
+ // if we're just parsing
2456
+ // Otherwise, throw an error or return tokens
2457
+ return parseOnly ?
2458
+ soFar.length :
2459
+ soFar ?
2460
+ Sizzle.error( selector ) :
2461
+ // Cache the tokens
2462
+ tokenCache( selector, groups ).slice( 0 );
2463
+ }
2464
+
2465
+ function toSelector( tokens ) {
2466
+ var i = 0,
2467
+ len = tokens.length,
2468
+ selector = "";
2469
+ for ( ; i < len; i++ ) {
2470
+ selector += tokens[i].value;
2471
+ }
2472
+ return selector;
2473
+ }
2474
+
2475
+ function addCombinator( matcher, combinator, base ) {
2476
+ var dir = combinator.dir,
2477
+ checkNonElements = base && dir === "parentNode",
2478
+ doneName = done++;
2479
+
2480
+ return combinator.first ?
2481
+ // Check against closest ancestor/preceding element
2482
+ function( elem, context, xml ) {
2483
+ while ( (elem = elem[ dir ]) ) {
2484
+ if ( elem.nodeType === 1 || checkNonElements ) {
2485
+ return matcher( elem, context, xml );
2486
+ }
2487
+ }
2488
+ } :
2489
+
2490
+ // Check against all ancestor/preceding elements
2491
+ function( elem, context, xml ) {
2492
+ var data, cache, outerCache,
2493
+ dirkey = dirruns + " " + doneName;
2494
+
2495
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
2496
+ if ( xml ) {
2497
+ while ( (elem = elem[ dir ]) ) {
2498
+ if ( elem.nodeType === 1 || checkNonElements ) {
2499
+ if ( matcher( elem, context, xml ) ) {
2500
+ return true;
2501
+ }
2502
+ }
2503
+ }
2504
+ } else {
2505
+ while ( (elem = elem[ dir ]) ) {
2506
+ if ( elem.nodeType === 1 || checkNonElements ) {
2507
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
2508
+ if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
2509
+ if ( (data = cache[1]) === true || data === cachedruns ) {
2510
+ return data === true;
2511
+ }
2512
+ } else {
2513
+ cache = outerCache[ dir ] = [ dirkey ];
2514
+ cache[1] = matcher( elem, context, xml ) || cachedruns;
2515
+ if ( cache[1] === true ) {
2516
+ return true;
2517
+ }
2518
+ }
2519
+ }
2520
+ }
2521
+ }
2522
+ };
2523
+ }
2524
+
2525
+ function elementMatcher( matchers ) {
2526
+ return matchers.length > 1 ?
2527
+ function( elem, context, xml ) {
2528
+ var i = matchers.length;
2529
+ while ( i-- ) {
2530
+ if ( !matchers[i]( elem, context, xml ) ) {
2531
+ return false;
2532
+ }
2533
+ }
2534
+ return true;
2535
+ } :
2536
+ matchers[0];
2537
+ }
2538
+
2539
+ function condense( unmatched, map, filter, context, xml ) {
2540
+ var elem,
2541
+ newUnmatched = [],
2542
+ i = 0,
2543
+ len = unmatched.length,
2544
+ mapped = map != null;
2545
+
2546
+ for ( ; i < len; i++ ) {
2547
+ if ( (elem = unmatched[i]) ) {
2548
+ if ( !filter || filter( elem, context, xml ) ) {
2549
+ newUnmatched.push( elem );
2550
+ if ( mapped ) {
2551
+ map.push( i );
2552
+ }
2553
+ }
2554
+ }
2555
+ }
2556
+
2557
+ return newUnmatched;
2558
+ }
2559
+
2560
+ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2561
+ if ( postFilter && !postFilter[ expando ] ) {
2562
+ postFilter = setMatcher( postFilter );
2563
+ }
2564
+ if ( postFinder && !postFinder[ expando ] ) {
2565
+ postFinder = setMatcher( postFinder, postSelector );
2566
+ }
2567
+ return markFunction(function( seed, results, context, xml ) {
2568
+ var temp, i, elem,
2569
+ preMap = [],
2570
+ postMap = [],
2571
+ preexisting = results.length,
2572
+
2573
+ // Get initial elements from seed or context
2574
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2575
+
2576
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
2577
+ matcherIn = preFilter && ( seed || !selector ) ?
2578
+ condense( elems, preMap, preFilter, context, xml ) :
2579
+ elems,
2580
+
2581
+ matcherOut = matcher ?
2582
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2583
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2584
+
2585
+ // ...intermediate processing is necessary
2586
+ [] :
2587
+
2588
+ // ...otherwise use results directly
2589
+ results :
2590
+ matcherIn;
2591
+
2592
+ // Find primary matches
2593
+ if ( matcher ) {
2594
+ matcher( matcherIn, matcherOut, context, xml );
2595
+ }
2596
+
2597
+ // Apply postFilter
2598
+ if ( postFilter ) {
2599
+ temp = condense( matcherOut, postMap );
2600
+ postFilter( temp, [], context, xml );
2601
+
2602
+ // Un-match failing elements by moving them back to matcherIn
2603
+ i = temp.length;
2604
+ while ( i-- ) {
2605
+ if ( (elem = temp[i]) ) {
2606
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2607
+ }
2608
+ }
2609
+ }
2610
+
2611
+ if ( seed ) {
2612
+ if ( postFinder || preFilter ) {
2613
+ if ( postFinder ) {
2614
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
2615
+ temp = [];
2616
+ i = matcherOut.length;
2617
+ while ( i-- ) {
2618
+ if ( (elem = matcherOut[i]) ) {
2619
+ // Restore matcherIn since elem is not yet a final match
2620
+ temp.push( (matcherIn[i] = elem) );
2621
+ }
2622
+ }
2623
+ postFinder( null, (matcherOut = []), temp, xml );
2624
+ }
2625
+
2626
+ // Move matched elements from seed to results to keep them synchronized
2627
+ i = matcherOut.length;
2628
+ while ( i-- ) {
2629
+ if ( (elem = matcherOut[i]) &&
2630
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
2631
+
2632
+ seed[temp] = !(results[temp] = elem);
2633
+ }
2634
+ }
2635
+ }
2636
+
2637
+ // Add elements to results, through postFinder if defined
2638
+ } else {
2639
+ matcherOut = condense(
2640
+ matcherOut === results ?
2641
+ matcherOut.splice( preexisting, matcherOut.length ) :
2642
+ matcherOut
2643
+ );
2644
+ if ( postFinder ) {
2645
+ postFinder( null, results, matcherOut, xml );
2646
+ } else {
2647
+ push.apply( results, matcherOut );
2648
+ }
2649
+ }
2650
+ });
2651
+ }
2652
+
2653
+ function matcherFromTokens( tokens ) {
2654
+ var checkContext, matcher, j,
2655
+ len = tokens.length,
2656
+ leadingRelative = Expr.relative[ tokens[0].type ],
2657
+ implicitRelative = leadingRelative || Expr.relative[" "],
2658
+ i = leadingRelative ? 1 : 0,
2659
+
2660
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
2661
+ matchContext = addCombinator( function( elem ) {
2662
+ return elem === checkContext;
2663
+ }, implicitRelative, true ),
2664
+ matchAnyContext = addCombinator( function( elem ) {
2665
+ return indexOf.call( checkContext, elem ) > -1;
2666
+ }, implicitRelative, true ),
2667
+ matchers = [ function( elem, context, xml ) {
2668
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2669
+ (checkContext = context).nodeType ?
2670
+ matchContext( elem, context, xml ) :
2671
+ matchAnyContext( elem, context, xml ) );
2672
+ } ];
2673
+
2674
+ for ( ; i < len; i++ ) {
2675
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2676
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2677
+ } else {
2678
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2679
+
2680
+ // Return special upon seeing a positional matcher
2681
+ if ( matcher[ expando ] ) {
2682
+ // Find the next relative operator (if any) for proper handling
2683
+ j = ++i;
2684
+ for ( ; j < len; j++ ) {
2685
+ if ( Expr.relative[ tokens[j].type ] ) {
2686
+ break;
2687
+ }
2688
+ }
2689
+ return setMatcher(
2690
+ i > 1 && elementMatcher( matchers ),
2691
+ i > 1 && toSelector(
2692
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2693
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2694
+ ).replace( rtrim, "$1" ),
2695
+ matcher,
2696
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
2697
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2698
+ j < len && toSelector( tokens )
2699
+ );
2700
+ }
2701
+ matchers.push( matcher );
2702
+ }
2703
+ }
2704
+
2705
+ return elementMatcher( matchers );
2706
+ }
2707
+
2708
+ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2709
+ // A counter to specify which element is currently being matched
2710
+ var matcherCachedRuns = 0,
2711
+ bySet = setMatchers.length > 0,
2712
+ byElement = elementMatchers.length > 0,
2713
+ superMatcher = function( seed, context, xml, results, expandContext ) {
2714
+ var elem, j, matcher,
2715
+ setMatched = [],
2716
+ matchedCount = 0,
2717
+ i = "0",
2718
+ unmatched = seed && [],
2719
+ outermost = expandContext != null,
2720
+ contextBackup = outermostContext,
2721
+ // We must always have either seed elements or context
2722
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
2723
+ // Use integer dirruns iff this is the outermost matcher
2724
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
2725
+
2726
+ if ( outermost ) {
2727
+ outermostContext = context !== document && context;
2728
+ cachedruns = matcherCachedRuns;
2729
+ }
2730
+
2731
+ // Add elements passing elementMatchers directly to results
2732
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
2733
+ for ( ; (elem = elems[i]) != null; i++ ) {
2734
+ if ( byElement && elem ) {
2735
+ j = 0;
2736
+ while ( (matcher = elementMatchers[j++]) ) {
2737
+ if ( matcher( elem, context, xml ) ) {
2738
+ results.push( elem );
2739
+ break;
2740
+ }
2741
+ }
2742
+ if ( outermost ) {
2743
+ dirruns = dirrunsUnique;
2744
+ cachedruns = ++matcherCachedRuns;
2745
+ }
2746
+ }
2747
+
2748
+ // Track unmatched elements for set filters
2749
+ if ( bySet ) {
2750
+ // They will have gone through all possible matchers
2751
+ if ( (elem = !matcher && elem) ) {
2752
+ matchedCount--;
2753
+ }
2754
+
2755
+ // Lengthen the array for every element, matched or not
2756
+ if ( seed ) {
2757
+ unmatched.push( elem );
2758
+ }
2759
+ }
2760
+ }
2761
+
2762
+ // Apply set filters to unmatched elements
2763
+ matchedCount += i;
2764
+ if ( bySet && i !== matchedCount ) {
2765
+ j = 0;
2766
+ while ( (matcher = setMatchers[j++]) ) {
2767
+ matcher( unmatched, setMatched, context, xml );
2768
+ }
2769
+
2770
+ if ( seed ) {
2771
+ // Reintegrate element matches to eliminate the need for sorting
2772
+ if ( matchedCount > 0 ) {
2773
+ while ( i-- ) {
2774
+ if ( !(unmatched[i] || setMatched[i]) ) {
2775
+ setMatched[i] = pop.call( results );
2776
+ }
2777
+ }
2778
+ }
2779
+
2780
+ // Discard index placeholder values to get only actual matches
2781
+ setMatched = condense( setMatched );
2782
+ }
2783
+
2784
+ // Add matches to results
2785
+ push.apply( results, setMatched );
2786
+
2787
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
2788
+ if ( outermost && !seed && setMatched.length > 0 &&
2789
+ ( matchedCount + setMatchers.length ) > 1 ) {
2790
+
2791
+ Sizzle.uniqueSort( results );
2792
+ }
2793
+ }
2794
+
2795
+ // Override manipulation of globals by nested matchers
2796
+ if ( outermost ) {
2797
+ dirruns = dirrunsUnique;
2798
+ outermostContext = contextBackup;
2799
+ }
2800
+
2801
+ return unmatched;
2802
+ };
2803
+
2804
+ return bySet ?
2805
+ markFunction( superMatcher ) :
2806
+ superMatcher;
2807
+ }
2808
+
2809
+ compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
2810
+ var i,
2811
+ setMatchers = [],
2812
+ elementMatchers = [],
2813
+ cached = compilerCache[ selector + " " ];
2814
+
2815
+ if ( !cached ) {
2816
+ // Generate a function of recursive functions that can be used to check each element
2817
+ if ( !group ) {
2818
+ group = tokenize( selector );
2819
+ }
2820
+ i = group.length;
2821
+ while ( i-- ) {
2822
+ cached = matcherFromTokens( group[i] );
2823
+ if ( cached[ expando ] ) {
2824
+ setMatchers.push( cached );
2825
+ } else {
2826
+ elementMatchers.push( cached );
2827
+ }
2828
+ }
2829
+
2830
+ // Cache the compiled function
2831
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2832
+ }
2833
+ return cached;
2834
+ };
2835
+
2836
+ function multipleContexts( selector, contexts, results ) {
2837
+ var i = 0,
2838
+ len = contexts.length;
2839
+ for ( ; i < len; i++ ) {
2840
+ Sizzle( selector, contexts[i], results );
2841
+ }
2842
+ return results;
2843
+ }
2844
+
2845
+ function select( selector, context, results, seed ) {
2846
+ var i, tokens, token, type, find,
2847
+ match = tokenize( selector );
2848
+
2849
+ if ( !seed ) {
2850
+ // Try to minimize operations if there is only one group
2851
+ if ( match.length === 1 ) {
2852
+
2853
+ // Take a shortcut and set the context if the root selector is an ID
2854
+ tokens = match[0] = match[0].slice( 0 );
2855
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2856
+ support.getById && context.nodeType === 9 && documentIsHTML &&
2857
+ Expr.relative[ tokens[1].type ] ) {
2858
+
2859
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2860
+ if ( !context ) {
2861
+ return results;
2862
+ }
2863
+ selector = selector.slice( tokens.shift().value.length );
2864
+ }
2865
+
2866
+ // Fetch a seed set for right-to-left matching
2867
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2868
+ while ( i-- ) {
2869
+ token = tokens[i];
2870
+
2871
+ // Abort if we hit a combinator
2872
+ if ( Expr.relative[ (type = token.type) ] ) {
2873
+ break;
2874
+ }
2875
+ if ( (find = Expr.find[ type ]) ) {
2876
+ // Search, expanding context for leading sibling combinators
2877
+ if ( (seed = find(
2878
+ token.matches[0].replace( runescape, funescape ),
2879
+ rsibling.test( tokens[0].type ) && context.parentNode || context
2880
+ )) ) {
2881
+
2882
+ // If seed is empty or no tokens remain, we can return early
2883
+ tokens.splice( i, 1 );
2884
+ selector = seed.length && toSelector( tokens );
2885
+ if ( !selector ) {
2886
+ push.apply( results, seed );
2887
+ return results;
2888
+ }
2889
+
2890
+ break;
2891
+ }
2892
+ }
2893
+ }
2894
+ }
2895
+ }
2896
+
2897
+ // Compile and execute a filtering function
2898
+ // Provide `match` to avoid retokenization if we modified the selector above
2899
+ compile( selector, match )(
2900
+ seed,
2901
+ context,
2902
+ !documentIsHTML,
2903
+ results,
2904
+ rsibling.test( selector )
2905
+ );
2906
+ return results;
2907
+ }
2908
+
2909
+ // One-time assignments
2910
+
2911
+ // Sort stability
2912
+ support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2913
+
2914
+ // Support: Chrome<14
2915
+ // Always assume duplicates if they aren't passed to the comparison function
2916
+ support.detectDuplicates = hasDuplicate;
2917
+
2918
+ // Initialize against the default document
2919
+ setDocument();
2920
+
2921
+ // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2922
+ // Detached nodes confoundingly follow *each other*
2923
+ support.sortDetached = assert(function( div1 ) {
2924
+ // Should return 1, but returns 4 (following)
2925
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
2926
+ });
2927
+
2928
+ // Support: IE<8
2929
+ // Prevent attribute/property "interpolation"
2930
+ // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2931
+ if ( !assert(function( div ) {
2932
+ div.innerHTML = "<a href='#'></a>";
2933
+ return div.firstChild.getAttribute("href") === "#" ;
2934
+ }) ) {
2935
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
2936
+ if ( !isXML ) {
2937
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2938
+ }
2939
+ });
2940
+ }
2941
+
2942
+ // Support: IE<9
2943
+ // Use defaultValue in place of getAttribute("value")
2944
+ if ( !support.attributes || !assert(function( div ) {
2945
+ div.innerHTML = "<input/>";
2946
+ div.firstChild.setAttribute( "value", "" );
2947
+ return div.firstChild.getAttribute( "value" ) === "";
2948
+ }) ) {
2949
+ addHandle( "value", function( elem, name, isXML ) {
2950
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2951
+ return elem.defaultValue;
2952
+ }
2953
+ });
2954
+ }
2955
+
2956
+ // Support: IE<9
2957
+ // Use getAttributeNode to fetch booleans when getAttribute lies
2958
+ if ( !assert(function( div ) {
2959
+ return div.getAttribute("disabled") == null;
2960
+ }) ) {
2961
+ addHandle( booleans, function( elem, name, isXML ) {
2962
+ var val;
2963
+ if ( !isXML ) {
2964
+ return (val = elem.getAttributeNode( name )) && val.specified ?
2965
+ val.value :
2966
+ elem[ name ] === true ? name.toLowerCase() : null;
2967
+ }
2968
+ });
2969
+ }
2970
+
2971
+ jQuery.find = Sizzle;
2972
+ jQuery.expr = Sizzle.selectors;
2973
+ jQuery.expr[":"] = jQuery.expr.pseudos;
2974
+ jQuery.unique = Sizzle.uniqueSort;
2975
+ jQuery.text = Sizzle.getText;
2976
+ jQuery.isXMLDoc = Sizzle.isXML;
2977
+ jQuery.contains = Sizzle.contains;
2978
+
2979
+
2980
+ })( window );
2981
+ // String to Object options format cache
2982
+ var optionsCache = {};
2983
+
2984
+ // Convert String-formatted options into Object-formatted ones and store in cache
2985
+ function createOptions( options ) {
2986
+ var object = optionsCache[ options ] = {};
2987
+ jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
2988
+ object[ flag ] = true;
2989
+ });
2990
+ return object;
2991
+ }
2992
+
2993
+ /*
2994
+ * Create a callback list using the following parameters:
2995
+ *
2996
+ * options: an optional list of space-separated options that will change how
2997
+ * the callback list behaves or a more traditional option object
2998
+ *
2999
+ * By default a callback list will act like an event callback list and can be
3000
+ * "fired" multiple times.
3001
+ *
3002
+ * Possible options:
3003
+ *
3004
+ * once: will ensure the callback list can only be fired once (like a Deferred)
3005
+ *
3006
+ * memory: will keep track of previous values and will call any callback added
3007
+ * after the list has been fired right away with the latest "memorized"
3008
+ * values (like a Deferred)
3009
+ *
3010
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
3011
+ *
3012
+ * stopOnFalse: interrupt callings when a callback returns false
3013
+ *
3014
+ */
3015
+ jQuery.Callbacks = function( options ) {
3016
+
3017
+ // Convert options from String-formatted to Object-formatted if needed
3018
+ // (we check in cache first)
3019
+ options = typeof options === "string" ?
3020
+ ( optionsCache[ options ] || createOptions( options ) ) :
3021
+ jQuery.extend( {}, options );
3022
+
3023
+ var // Flag to know if list is currently firing
3024
+ firing,
3025
+ // Last fire value (for non-forgettable lists)
3026
+ memory,
3027
+ // Flag to know if list was already fired
3028
+ fired,
3029
+ // End of the loop when firing
3030
+ firingLength,
3031
+ // Index of currently firing callback (modified by remove if needed)
3032
+ firingIndex,
3033
+ // First callback to fire (used internally by add and fireWith)
3034
+ firingStart,
3035
+ // Actual callback list
3036
+ list = [],
3037
+ // Stack of fire calls for repeatable lists
3038
+ stack = !options.once && [],
3039
+ // Fire callbacks
3040
+ fire = function( data ) {
3041
+ memory = options.memory && data;
3042
+ fired = true;
3043
+ firingIndex = firingStart || 0;
3044
+ firingStart = 0;
3045
+ firingLength = list.length;
3046
+ firing = true;
3047
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
3048
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
3049
+ memory = false; // To prevent further calls using add
3050
+ break;
3051
+ }
3052
+ }
3053
+ firing = false;
3054
+ if ( list ) {
3055
+ if ( stack ) {
3056
+ if ( stack.length ) {
3057
+ fire( stack.shift() );
3058
+ }
3059
+ } else if ( memory ) {
3060
+ list = [];
3061
+ } else {
3062
+ self.disable();
3063
+ }
3064
+ }
3065
+ },
3066
+ // Actual Callbacks object
3067
+ self = {
3068
+ // Add a callback or a collection of callbacks to the list
3069
+ add: function() {
3070
+ if ( list ) {
3071
+ // First, we save the current length
3072
+ var start = list.length;
3073
+ (function add( args ) {
3074
+ jQuery.each( args, function( _, arg ) {
3075
+ var type = jQuery.type( arg );
3076
+ if ( type === "function" ) {
3077
+ if ( !options.unique || !self.has( arg ) ) {
3078
+ list.push( arg );
3079
+ }
3080
+ } else if ( arg && arg.length && type !== "string" ) {
3081
+ // Inspect recursively
3082
+ add( arg );
3083
+ }
3084
+ });
3085
+ })( arguments );
3086
+ // Do we need to add the callbacks to the
3087
+ // current firing batch?
3088
+ if ( firing ) {
3089
+ firingLength = list.length;
3090
+ // With memory, if we're not firing then
3091
+ // we should call right away
3092
+ } else if ( memory ) {
3093
+ firingStart = start;
3094
+ fire( memory );
3095
+ }
3096
+ }
3097
+ return this;
3098
+ },
3099
+ // Remove a callback from the list
3100
+ remove: function() {
3101
+ if ( list ) {
3102
+ jQuery.each( arguments, function( _, arg ) {
3103
+ var index;
3104
+ while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3105
+ list.splice( index, 1 );
3106
+ // Handle firing indexes
3107
+ if ( firing ) {
3108
+ if ( index <= firingLength ) {
3109
+ firingLength--;
3110
+ }
3111
+ if ( index <= firingIndex ) {
3112
+ firingIndex--;
3113
+ }
3114
+ }
3115
+ }
3116
+ });
3117
+ }
3118
+ return this;
3119
+ },
3120
+ // Check if a given callback is in the list.
3121
+ // If no argument is given, return whether or not list has callbacks attached.
3122
+ has: function( fn ) {
3123
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
3124
+ },
3125
+ // Remove all callbacks from the list
3126
+ empty: function() {
3127
+ list = [];
3128
+ firingLength = 0;
3129
+ return this;
3130
+ },
3131
+ // Have the list do nothing anymore
3132
+ disable: function() {
3133
+ list = stack = memory = undefined;
3134
+ return this;
3135
+ },
3136
+ // Is it disabled?
3137
+ disabled: function() {
3138
+ return !list;
3139
+ },
3140
+ // Lock the list in its current state
3141
+ lock: function() {
3142
+ stack = undefined;
3143
+ if ( !memory ) {
3144
+ self.disable();
3145
+ }
3146
+ return this;
3147
+ },
3148
+ // Is it locked?
3149
+ locked: function() {
3150
+ return !stack;
3151
+ },
3152
+ // Call all callbacks with the given context and arguments
3153
+ fireWith: function( context, args ) {
3154
+ if ( list && ( !fired || stack ) ) {
3155
+ args = args || [];
3156
+ args = [ context, args.slice ? args.slice() : args ];
3157
+ if ( firing ) {
3158
+ stack.push( args );
3159
+ } else {
3160
+ fire( args );
3161
+ }
3162
+ }
3163
+ return this;
3164
+ },
3165
+ // Call all the callbacks with the given arguments
3166
+ fire: function() {
3167
+ self.fireWith( this, arguments );
3168
+ return this;
3169
+ },
3170
+ // To know if the callbacks have already been called at least once
3171
+ fired: function() {
3172
+ return !!fired;
3173
+ }
3174
+ };
3175
+
3176
+ return self;
3177
+ };
3178
+ jQuery.extend({
3179
+
3180
+ Deferred: function( func ) {
3181
+ var tuples = [
3182
+ // action, add listener, listener list, final state
3183
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
3184
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
3185
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
3186
+ ],
3187
+ state = "pending",
3188
+ promise = {
3189
+ state: function() {
3190
+ return state;
3191
+ },
3192
+ always: function() {
3193
+ deferred.done( arguments ).fail( arguments );
3194
+ return this;
3195
+ },
3196
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
3197
+ var fns = arguments;
3198
+ return jQuery.Deferred(function( newDefer ) {
3199
+ jQuery.each( tuples, function( i, tuple ) {
3200
+ var action = tuple[ 0 ],
3201
+ fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
3202
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
3203
+ deferred[ tuple[1] ](function() {
3204
+ var returned = fn && fn.apply( this, arguments );
3205
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
3206
+ returned.promise()
3207
+ .done( newDefer.resolve )
3208
+ .fail( newDefer.reject )
3209
+ .progress( newDefer.notify );
3210
+ } else {
3211
+ newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
3212
+ }
3213
+ });
3214
+ });
3215
+ fns = null;
3216
+ }).promise();
3217
+ },
3218
+ // Get a promise for this deferred
3219
+ // If obj is provided, the promise aspect is added to the object
3220
+ promise: function( obj ) {
3221
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
3222
+ }
3223
+ },
3224
+ deferred = {};
3225
+
3226
+ // Keep pipe for back-compat
3227
+ promise.pipe = promise.then;
3228
+
3229
+ // Add list-specific methods
3230
+ jQuery.each( tuples, function( i, tuple ) {
3231
+ var list = tuple[ 2 ],
3232
+ stateString = tuple[ 3 ];
3233
+
3234
+ // promise[ done | fail | progress ] = list.add
3235
+ promise[ tuple[1] ] = list.add;
3236
+
3237
+ // Handle state
3238
+ if ( stateString ) {
3239
+ list.add(function() {
3240
+ // state = [ resolved | rejected ]
3241
+ state = stateString;
3242
+
3243
+ // [ reject_list | resolve_list ].disable; progress_list.lock
3244
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
3245
+ }
3246
+
3247
+ // deferred[ resolve | reject | notify ]
3248
+ deferred[ tuple[0] ] = function() {
3249
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
3250
+ return this;
3251
+ };
3252
+ deferred[ tuple[0] + "With" ] = list.fireWith;
3253
+ });
3254
+
3255
+ // Make the deferred a promise
3256
+ promise.promise( deferred );
3257
+
3258
+ // Call given func if any
3259
+ if ( func ) {
3260
+ func.call( deferred, deferred );
3261
+ }
3262
+
3263
+ // All done!
3264
+ return deferred;
3265
+ },
3266
+
3267
+ // Deferred helper
3268
+ when: function( subordinate /* , ..., subordinateN */ ) {
3269
+ var i = 0,
3270
+ resolveValues = core_slice.call( arguments ),
3271
+ length = resolveValues.length,
3272
+
3273
+ // the count of uncompleted subordinates
3274
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
3275
+
3276
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
3277
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
3278
+
3279
+ // Update function for both resolve and progress values
3280
+ updateFunc = function( i, contexts, values ) {
3281
+ return function( value ) {
3282
+ contexts[ i ] = this;
3283
+ values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
3284
+ if( values === progressValues ) {
3285
+ deferred.notifyWith( contexts, values );
3286
+ } else if ( !( --remaining ) ) {
3287
+ deferred.resolveWith( contexts, values );
3288
+ }
3289
+ };
3290
+ },
3291
+
3292
+ progressValues, progressContexts, resolveContexts;
3293
+
3294
+ // add listeners to Deferred subordinates; treat others as resolved
3295
+ if ( length > 1 ) {
3296
+ progressValues = new Array( length );
3297
+ progressContexts = new Array( length );
3298
+ resolveContexts = new Array( length );
3299
+ for ( ; i < length; i++ ) {
3300
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
3301
+ resolveValues[ i ].promise()
3302
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
3303
+ .fail( deferred.reject )
3304
+ .progress( updateFunc( i, progressContexts, progressValues ) );
3305
+ } else {
3306
+ --remaining;
3307
+ }
3308
+ }
3309
+ }
3310
+
3311
+ // if we're not waiting on anything, resolve the master
3312
+ if ( !remaining ) {
3313
+ deferred.resolveWith( resolveContexts, resolveValues );
3314
+ }
3315
+
3316
+ return deferred.promise();
3317
+ }
3318
+ });
3319
+ jQuery.support = (function( support ) {
3320
+
3321
+ var all, a, input, select, fragment, opt, eventName, isSupported, i,
3322
+ div = document.createElement("div");
3323
+
3324
+ // Setup
3325
+ div.setAttribute( "className", "t" );
3326
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
3327
+
3328
+ // Finish early in limited (non-browser) environments
3329
+ all = div.getElementsByTagName("*") || [];
3330
+ a = div.getElementsByTagName("a")[ 0 ];
3331
+ if ( !a || !a.style || !all.length ) {
3332
+ return support;
3333
+ }
3334
+
3335
+ // First batch of tests
3336
+ select = document.createElement("select");
3337
+ opt = select.appendChild( document.createElement("option") );
3338
+ input = div.getElementsByTagName("input")[ 0 ];
3339
+
3340
+ a.style.cssText = "top:1px;float:left;opacity:.5";
3341
+
3342
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
3343
+ support.getSetAttribute = div.className !== "t";
3344
+
3345
+ // IE strips leading whitespace when .innerHTML is used
3346
+ support.leadingWhitespace = div.firstChild.nodeType === 3;
3347
+
3348
+ // Make sure that tbody elements aren't automatically inserted
3349
+ // IE will insert them into empty tables
3350
+ support.tbody = !div.getElementsByTagName("tbody").length;
3351
+
3352
+ // Make sure that link elements get serialized correctly by innerHTML
3353
+ // This requires a wrapper element in IE
3354
+ support.htmlSerialize = !!div.getElementsByTagName("link").length;
3355
+
3356
+ // Get the style information from getAttribute
3357
+ // (IE uses .cssText instead)
3358
+ support.style = /top/.test( a.getAttribute("style") );
3359
+
3360
+ // Make sure that URLs aren't manipulated
3361
+ // (IE normalizes it by default)
3362
+ support.hrefNormalized = a.getAttribute("href") === "/a";
3363
+
3364
+ // Make sure that element opacity exists
3365
+ // (IE uses filter instead)
3366
+ // Use a regex to work around a WebKit issue. See #5145
3367
+ support.opacity = /^0.5/.test( a.style.opacity );
3368
+
3369
+ // Verify style float existence
3370
+ // (IE uses styleFloat instead of cssFloat)
3371
+ support.cssFloat = !!a.style.cssFloat;
3372
+
3373
+ // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
3374
+ support.checkOn = !!input.value;
3375
+
3376
+ // Make sure that a selected-by-default option has a working selected property.
3377
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
3378
+ support.optSelected = opt.selected;
3379
+
3380
+ // Tests for enctype support on a form (#6743)
3381
+ support.enctype = !!document.createElement("form").enctype;
3382
+
3383
+ // Makes sure cloning an html5 element does not cause problems
3384
+ // Where outerHTML is undefined, this still works
3385
+ support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>";
3386
+
3387
+ // Will be defined later
3388
+ support.inlineBlockNeedsLayout = false;
3389
+ support.shrinkWrapBlocks = false;
3390
+ support.pixelPosition = false;
3391
+ support.deleteExpando = true;
3392
+ support.noCloneEvent = true;
3393
+ support.reliableMarginRight = true;
3394
+ support.boxSizingReliable = true;
3395
+
3396
+ // Make sure checked status is properly cloned
3397
+ input.checked = true;
3398
+ support.noCloneChecked = input.cloneNode( true ).checked;
3399
+
3400
+ // Make sure that the options inside disabled selects aren't marked as disabled
3401
+ // (WebKit marks them as disabled)
3402
+ select.disabled = true;
3403
+ support.optDisabled = !opt.disabled;
3404
+
3405
+ // Support: IE<9
3406
+ try {
3407
+ delete div.test;
3408
+ } catch( e ) {
3409
+ support.deleteExpando = false;
3410
+ }
3411
+
3412
+ // Check if we can trust getAttribute("value")
3413
+ input = document.createElement("input");
3414
+ input.setAttribute( "value", "" );
3415
+ support.input = input.getAttribute( "value" ) === "";
3416
+
3417
+ // Check if an input maintains its value after becoming a radio
3418
+ input.value = "t";
3419
+ input.setAttribute( "type", "radio" );
3420
+ support.radioValue = input.value === "t";
3421
+
3422
+ // #11217 - WebKit loses check when the name is after the checked attribute
3423
+ input.setAttribute( "checked", "t" );
3424
+ input.setAttribute( "name", "t" );
3425
+
3426
+ fragment = document.createDocumentFragment();
3427
+ fragment.appendChild( input );
3428
+
3429
+ // Check if a disconnected checkbox will retain its checked
3430
+ // value of true after appended to the DOM (IE6/7)
3431
+ support.appendChecked = input.checked;
3432
+
3433
+ // WebKit doesn't clone checked state correctly in fragments
3434
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
3435
+
3436
+ // Support: IE<9
3437
+ // Opera does not clone events (and typeof div.attachEvent === undefined).
3438
+ // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
3439
+ if ( div.attachEvent ) {
3440
+ div.attachEvent( "onclick", function() {
3441
+ support.noCloneEvent = false;
3442
+ });
3443
+
3444
+ div.cloneNode( true ).click();
3445
+ }
3446
+
3447
+ // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
3448
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
3449
+ for ( i in { submit: true, change: true, focusin: true }) {
3450
+ div.setAttribute( eventName = "on" + i, "t" );
3451
+
3452
+ support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
3453
+ }
3454
+
3455
+ div.style.backgroundClip = "content-box";
3456
+ div.cloneNode( true ).style.backgroundClip = "";
3457
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
3458
+
3459
+ // Support: IE<9
3460
+ // Iteration over object's inherited properties before its own.
3461
+ for ( i in jQuery( support ) ) {
3462
+ break;
3463
+ }
3464
+ support.ownLast = i !== "0";
3465
+
3466
+ // Run tests that need a body at doc ready
3467
+ jQuery(function() {
3468
+ var container, marginDiv, tds,
3469
+ divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
3470
+ body = document.getElementsByTagName("body")[0];
3471
+
3472
+ if ( !body ) {
3473
+ // Return for frameset docs that don't have a body
3474
+ return;
3475
+ }
3476
+
3477
+ container = document.createElement("div");
3478
+ container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
3479
+
3480
+ body.appendChild( container ).appendChild( div );
3481
+
3482
+ // Support: IE8
3483
+ // Check if table cells still have offsetWidth/Height when they are set
3484
+ // to display:none and there are still other visible table cells in a
3485
+ // table row; if so, offsetWidth/Height are not reliable for use when
3486
+ // determining if an element has been hidden directly using
3487
+ // display:none (it is still safe to use offsets if a parent element is
3488
+ // hidden; don safety goggles and see bug #4512 for more information).
3489
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
3490
+ tds = div.getElementsByTagName("td");
3491
+ tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
3492
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
3493
+
3494
+ tds[ 0 ].style.display = "";
3495
+ tds[ 1 ].style.display = "none";
3496
+
3497
+ // Support: IE8
3498
+ // Check if empty table cells still have offsetWidth/Height
3499
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
3500
+
3501
+ // Check box-sizing and margin behavior.
3502
+ div.innerHTML = "";
3503
+ div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
3504
+
3505
+ // Workaround failing boxSizing test due to offsetWidth returning wrong value
3506
+ // with some non-1 values of body zoom, ticket #13543
3507
+ jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
3508
+ support.boxSizing = div.offsetWidth === 4;
3509
+ });
3510
+
3511
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
3512
+ if ( window.getComputedStyle ) {
3513
+ support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
3514
+ support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
3515
+
3516
+ // Check if div with explicit width and no margin-right incorrectly
3517
+ // gets computed margin-right based on width of container. (#3333)
3518
+ // Fails in WebKit before Feb 2011 nightlies
3519
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
3520
+ marginDiv = div.appendChild( document.createElement("div") );
3521
+ marginDiv.style.cssText = div.style.cssText = divReset;
3522
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
3523
+ div.style.width = "1px";
3524
+
3525
+ support.reliableMarginRight =
3526
+ !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
3527
+ }
3528
+
3529
+ if ( typeof div.style.zoom !== core_strundefined ) {
3530
+ // Support: IE<8
3531
+ // Check if natively block-level elements act like inline-block
3532
+ // elements when setting their display to 'inline' and giving
3533
+ // them layout
3534
+ div.innerHTML = "";
3535
+ div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
3536
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
3537
+
3538
+ // Support: IE6
3539
+ // Check if elements with layout shrink-wrap their children
3540
+ div.style.display = "block";
3541
+ div.innerHTML = "<div></div>";
3542
+ div.firstChild.style.width = "5px";
3543
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
3544
+
3545
+ if ( support.inlineBlockNeedsLayout ) {
3546
+ // Prevent IE 6 from affecting layout for positioned elements #11048
3547
+ // Prevent IE from shrinking the body in IE 7 mode #12869
3548
+ // Support: IE<8
3549
+ body.style.zoom = 1;
3550
+ }
3551
+ }
3552
+
3553
+ body.removeChild( container );
3554
+
3555
+ // Null elements to avoid leaks in IE
3556
+ container = div = tds = marginDiv = null;
3557
+ });
3558
+
3559
+ // Null elements to avoid leaks in IE
3560
+ all = select = fragment = opt = a = input = null;
3561
+
3562
+ return support;
3563
+ })({});
3564
+
3565
+ var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
3566
+ rmultiDash = /([A-Z])/g;
3567
+
3568
+ function internalData( elem, name, data, pvt /* Internal Use Only */ ){
3569
+ if ( !jQuery.acceptData( elem ) ) {
3570
+ return;
3571
+ }
3572
+
3573
+ var ret, thisCache,
3574
+ internalKey = jQuery.expando,
3575
+
3576
+ // We have to handle DOM nodes and JS objects differently because IE6-7
3577
+ // can't GC object references properly across the DOM-JS boundary
3578
+ isNode = elem.nodeType,
3579
+
3580
+ // Only DOM nodes need the global jQuery cache; JS object data is
3581
+ // attached directly to the object so GC can occur automatically
3582
+ cache = isNode ? jQuery.cache : elem,
3583
+
3584
+ // Only defining an ID for JS objects if its cache already exists allows
3585
+ // the code to shortcut on the same path as a DOM node with no cache
3586
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
3587
+
3588
+ // Avoid doing any more work than we need to when trying to get data on an
3589
+ // object that has no data at all
3590
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
3591
+ return;
3592
+ }
3593
+
3594
+ if ( !id ) {
3595
+ // Only DOM nodes need a new unique ID for each element since their data
3596
+ // ends up in the global cache
3597
+ if ( isNode ) {
3598
+ id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++;
3599
+ } else {
3600
+ id = internalKey;
3601
+ }
3602
+ }
3603
+
3604
+ if ( !cache[ id ] ) {
3605
+ // Avoid exposing jQuery metadata on plain JS objects when the object
3606
+ // is serialized using JSON.stringify
3607
+ cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
3608
+ }
3609
+
3610
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
3611
+ // shallow copied over onto the existing cache
3612
+ if ( typeof name === "object" || typeof name === "function" ) {
3613
+ if ( pvt ) {
3614
+ cache[ id ] = jQuery.extend( cache[ id ], name );
3615
+ } else {
3616
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
3617
+ }
3618
+ }
3619
+
3620
+ thisCache = cache[ id ];
3621
+
3622
+ // jQuery data() is stored in a separate object inside the object's internal data
3623
+ // cache in order to avoid key collisions between internal data and user-defined
3624
+ // data.
3625
+ if ( !pvt ) {
3626
+ if ( !thisCache.data ) {
3627
+ thisCache.data = {};
3628
+ }
3629
+
3630
+ thisCache = thisCache.data;
3631
+ }
3632
+
3633
+ if ( data !== undefined ) {
3634
+ thisCache[ jQuery.camelCase( name ) ] = data;
3635
+ }
3636
+
3637
+ // Check for both converted-to-camel and non-converted data property names
3638
+ // If a data property was specified
3639
+ if ( typeof name === "string" ) {
3640
+
3641
+ // First Try to find as-is property data
3642
+ ret = thisCache[ name ];
3643
+
3644
+ // Test for null|undefined property data
3645
+ if ( ret == null ) {
3646
+
3647
+ // Try to find the camelCased property
3648
+ ret = thisCache[ jQuery.camelCase( name ) ];
3649
+ }
3650
+ } else {
3651
+ ret = thisCache;
3652
+ }
3653
+
3654
+ return ret;
3655
+ }
3656
+
3657
+ function internalRemoveData( elem, name, pvt ) {
3658
+ if ( !jQuery.acceptData( elem ) ) {
3659
+ return;
3660
+ }
3661
+
3662
+ var thisCache, i,
3663
+ isNode = elem.nodeType,
3664
+
3665
+ // See jQuery.data for more information
3666
+ cache = isNode ? jQuery.cache : elem,
3667
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
3668
+
3669
+ // If there is already no cache entry for this object, there is no
3670
+ // purpose in continuing
3671
+ if ( !cache[ id ] ) {
3672
+ return;
3673
+ }
3674
+
3675
+ if ( name ) {
3676
+
3677
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
3678
+
3679
+ if ( thisCache ) {
3680
+
3681
+ // Support array or space separated string names for data keys
3682
+ if ( !jQuery.isArray( name ) ) {
3683
+
3684
+ // try the string as a key before any manipulation
3685
+ if ( name in thisCache ) {
3686
+ name = [ name ];
3687
+ } else {
3688
+
3689
+ // split the camel cased version by spaces unless a key with the spaces exists
3690
+ name = jQuery.camelCase( name );
3691
+ if ( name in thisCache ) {
3692
+ name = [ name ];
3693
+ } else {
3694
+ name = name.split(" ");
3695
+ }
3696
+ }
3697
+ } else {
3698
+ // If "name" is an array of keys...
3699
+ // When data is initially created, via ("key", "val") signature,
3700
+ // keys will be converted to camelCase.
3701
+ // Since there is no way to tell _how_ a key was added, remove
3702
+ // both plain key and camelCase key. #12786
3703
+ // This will only penalize the array argument path.
3704
+ name = name.concat( jQuery.map( name, jQuery.camelCase ) );
3705
+ }
3706
+
3707
+ i = name.length;
3708
+ while ( i-- ) {
3709
+ delete thisCache[ name[i] ];
3710
+ }
3711
+
3712
+ // If there is no data left in the cache, we want to continue
3713
+ // and let the cache object itself get destroyed
3714
+ if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
3715
+ return;
3716
+ }
3717
+ }
3718
+ }
3719
+
3720
+ // See jQuery.data for more information
3721
+ if ( !pvt ) {
3722
+ delete cache[ id ].data;
3723
+
3724
+ // Don't destroy the parent cache unless the internal data object
3725
+ // had been the only thing left in it
3726
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
3727
+ return;
3728
+ }
3729
+ }
3730
+
3731
+ // Destroy the cache
3732
+ if ( isNode ) {
3733
+ jQuery.cleanData( [ elem ], true );
3734
+
3735
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
3736
+ /* jshint eqeqeq: false */
3737
+ } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
3738
+ /* jshint eqeqeq: true */
3739
+ delete cache[ id ];
3740
+
3741
+ // When all else fails, null
3742
+ } else {
3743
+ cache[ id ] = null;
3744
+ }
3745
+ }
3746
+
3747
+ jQuery.extend({
3748
+ cache: {},
3749
+
3750
+ // The following elements throw uncatchable exceptions if you
3751
+ // attempt to add expando properties to them.
3752
+ noData: {
3753
+ "applet": true,
3754
+ "embed": true,
3755
+ // Ban all objects except for Flash (which handle expandos)
3756
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
3757
+ },
3758
+
3759
+ hasData: function( elem ) {
3760
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
3761
+ return !!elem && !isEmptyDataObject( elem );
3762
+ },
3763
+
3764
+ data: function( elem, name, data ) {
3765
+ return internalData( elem, name, data );
3766
+ },
3767
+
3768
+ removeData: function( elem, name ) {
3769
+ return internalRemoveData( elem, name );
3770
+ },
3771
+
3772
+ // For internal use only.
3773
+ _data: function( elem, name, data ) {
3774
+ return internalData( elem, name, data, true );
3775
+ },
3776
+
3777
+ _removeData: function( elem, name ) {
3778
+ return internalRemoveData( elem, name, true );
3779
+ },
3780
+
3781
+ // A method for determining if a DOM node can handle the data expando
3782
+ acceptData: function( elem ) {
3783
+ // Do not set data on non-element because it will not be cleared (#8335).
3784
+ if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
3785
+ return false;
3786
+ }
3787
+
3788
+ var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
3789
+
3790
+ // nodes accept data unless otherwise specified; rejection can be conditional
3791
+ return !noData || noData !== true && elem.getAttribute("classid") === noData;
3792
+ }
3793
+ });
3794
+
3795
+ jQuery.fn.extend({
3796
+ data: function( key, value ) {
3797
+ var attrs, name,
3798
+ data = null,
3799
+ i = 0,
3800
+ elem = this[0];
3801
+
3802
+ // Special expections of .data basically thwart jQuery.access,
3803
+ // so implement the relevant behavior ourselves
3804
+
3805
+ // Gets all values
3806
+ if ( key === undefined ) {
3807
+ if ( this.length ) {
3808
+ data = jQuery.data( elem );
3809
+
3810
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
3811
+ attrs = elem.attributes;
3812
+ for ( ; i < attrs.length; i++ ) {
3813
+ name = attrs[i].name;
3814
+
3815
+ if ( name.indexOf("data-") === 0 ) {
3816
+ name = jQuery.camelCase( name.slice(5) );
3817
+
3818
+ dataAttr( elem, name, data[ name ] );
3819
+ }
3820
+ }
3821
+ jQuery._data( elem, "parsedAttrs", true );
3822
+ }
3823
+ }
3824
+
3825
+ return data;
3826
+ }
3827
+
3828
+ // Sets multiple values
3829
+ if ( typeof key === "object" ) {
3830
+ return this.each(function() {
3831
+ jQuery.data( this, key );
3832
+ });
3833
+ }
3834
+
3835
+ return arguments.length > 1 ?
3836
+
3837
+ // Sets one value
3838
+ this.each(function() {
3839
+ jQuery.data( this, key, value );
3840
+ }) :
3841
+
3842
+ // Gets one value
3843
+ // Try to fetch any internally stored data first
3844
+ elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
3845
+ },
3846
+
3847
+ removeData: function( key ) {
3848
+ return this.each(function() {
3849
+ jQuery.removeData( this, key );
3850
+ });
3851
+ }
3852
+ });
3853
+
3854
+ function dataAttr( elem, key, data ) {
3855
+ // If nothing was found internally, try to fetch any
3856
+ // data from the HTML5 data-* attribute
3857
+ if ( data === undefined && elem.nodeType === 1 ) {
3858
+
3859
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
3860
+
3861
+ data = elem.getAttribute( name );
3862
+
3863
+ if ( typeof data === "string" ) {
3864
+ try {
3865
+ data = data === "true" ? true :
3866
+ data === "false" ? false :
3867
+ data === "null" ? null :
3868
+ // Only convert to a number if it doesn't change the string
3869
+ +data + "" === data ? +data :
3870
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
3871
+ data;
3872
+ } catch( e ) {}
3873
+
3874
+ // Make sure we set the data so it isn't changed later
3875
+ jQuery.data( elem, key, data );
3876
+
3877
+ } else {
3878
+ data = undefined;
3879
+ }
3880
+ }
3881
+
3882
+ return data;
3883
+ }
3884
+
3885
+ // checks a cache object for emptiness
3886
+ function isEmptyDataObject( obj ) {
3887
+ var name;
3888
+ for ( name in obj ) {
3889
+
3890
+ // if the public data object is empty, the private is still empty
3891
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
3892
+ continue;
3893
+ }
3894
+ if ( name !== "toJSON" ) {
3895
+ return false;
3896
+ }
3897
+ }
3898
+
3899
+ return true;
3900
+ }
3901
+ jQuery.extend({
3902
+ queue: function( elem, type, data ) {
3903
+ var queue;
3904
+
3905
+ if ( elem ) {
3906
+ type = ( type || "fx" ) + "queue";
3907
+ queue = jQuery._data( elem, type );
3908
+
3909
+ // Speed up dequeue by getting out quickly if this is just a lookup
3910
+ if ( data ) {
3911
+ if ( !queue || jQuery.isArray(data) ) {
3912
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
3913
+ } else {
3914
+ queue.push( data );
3915
+ }
3916
+ }
3917
+ return queue || [];
3918
+ }
3919
+ },
3920
+
3921
+ dequeue: function( elem, type ) {
3922
+ type = type || "fx";
3923
+
3924
+ var queue = jQuery.queue( elem, type ),
3925
+ startLength = queue.length,
3926
+ fn = queue.shift(),
3927
+ hooks = jQuery._queueHooks( elem, type ),
3928
+ next = function() {
3929
+ jQuery.dequeue( elem, type );
3930
+ };
3931
+
3932
+ // If the fx queue is dequeued, always remove the progress sentinel
3933
+ if ( fn === "inprogress" ) {
3934
+ fn = queue.shift();
3935
+ startLength--;
3936
+ }
3937
+
3938
+ if ( fn ) {
3939
+
3940
+ // Add a progress sentinel to prevent the fx queue from being
3941
+ // automatically dequeued
3942
+ if ( type === "fx" ) {
3943
+ queue.unshift( "inprogress" );
3944
+ }
3945
+
3946
+ // clear up the last queue stop function
3947
+ delete hooks.stop;
3948
+ fn.call( elem, next, hooks );
3949
+ }
3950
+
3951
+ if ( !startLength && hooks ) {
3952
+ hooks.empty.fire();
3953
+ }
3954
+ },
3955
+
3956
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
3957
+ _queueHooks: function( elem, type ) {
3958
+ var key = type + "queueHooks";
3959
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
3960
+ empty: jQuery.Callbacks("once memory").add(function() {
3961
+ jQuery._removeData( elem, type + "queue" );
3962
+ jQuery._removeData( elem, key );
3963
+ })
3964
+ });
3965
+ }
3966
+ });
3967
+
3968
+ jQuery.fn.extend({
3969
+ queue: function( type, data ) {
3970
+ var setter = 2;
3971
+
3972
+ if ( typeof type !== "string" ) {
3973
+ data = type;
3974
+ type = "fx";
3975
+ setter--;
3976
+ }
3977
+
3978
+ if ( arguments.length < setter ) {
3979
+ return jQuery.queue( this[0], type );
3980
+ }
3981
+
3982
+ return data === undefined ?
3983
+ this :
3984
+ this.each(function() {
3985
+ var queue = jQuery.queue( this, type, data );
3986
+
3987
+ // ensure a hooks for this queue
3988
+ jQuery._queueHooks( this, type );
3989
+
3990
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
3991
+ jQuery.dequeue( this, type );
3992
+ }
3993
+ });
3994
+ },
3995
+ dequeue: function( type ) {
3996
+ return this.each(function() {
3997
+ jQuery.dequeue( this, type );
3998
+ });
3999
+ },
4000
+ // Based off of the plugin by Clint Helfers, with permission.
4001
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
4002
+ delay: function( time, type ) {
4003
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
4004
+ type = type || "fx";
4005
+
4006
+ return this.queue( type, function( next, hooks ) {
4007
+ var timeout = setTimeout( next, time );
4008
+ hooks.stop = function() {
4009
+ clearTimeout( timeout );
4010
+ };
4011
+ });
4012
+ },
4013
+ clearQueue: function( type ) {
4014
+ return this.queue( type || "fx", [] );
4015
+ },
4016
+ // Get a promise resolved when queues of a certain type
4017
+ // are emptied (fx is the type by default)
4018
+ promise: function( type, obj ) {
4019
+ var tmp,
4020
+ count = 1,
4021
+ defer = jQuery.Deferred(),
4022
+ elements = this,
4023
+ i = this.length,
4024
+ resolve = function() {
4025
+ if ( !( --count ) ) {
4026
+ defer.resolveWith( elements, [ elements ] );
4027
+ }
4028
+ };
4029
+
4030
+ if ( typeof type !== "string" ) {
4031
+ obj = type;
4032
+ type = undefined;
4033
+ }
4034
+ type = type || "fx";
4035
+
4036
+ while( i-- ) {
4037
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
4038
+ if ( tmp && tmp.empty ) {
4039
+ count++;
4040
+ tmp.empty.add( resolve );
4041
+ }
4042
+ }
4043
+ resolve();
4044
+ return defer.promise( obj );
4045
+ }
4046
+ });
4047
+ var nodeHook, boolHook,
4048
+ rclass = /[\t\r\n\f]/g,
4049
+ rreturn = /\r/g,
4050
+ rfocusable = /^(?:input|select|textarea|button|object)$/i,
4051
+ rclickable = /^(?:a|area)$/i,
4052
+ ruseDefault = /^(?:checked|selected)$/i,
4053
+ getSetAttribute = jQuery.support.getSetAttribute,
4054
+ getSetInput = jQuery.support.input;
4055
+
4056
+ jQuery.fn.extend({
4057
+ attr: function( name, value ) {
4058
+ return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
4059
+ },
4060
+
4061
+ removeAttr: function( name ) {
4062
+ return this.each(function() {
4063
+ jQuery.removeAttr( this, name );
4064
+ });
4065
+ },
4066
+
4067
+ prop: function( name, value ) {
4068
+ return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
4069
+ },
4070
+
4071
+ removeProp: function( name ) {
4072
+ name = jQuery.propFix[ name ] || name;
4073
+ return this.each(function() {
4074
+ // try/catch handles cases where IE balks (such as removing a property on window)
4075
+ try {
4076
+ this[ name ] = undefined;
4077
+ delete this[ name ];
4078
+ } catch( e ) {}
4079
+ });
4080
+ },
4081
+
4082
+ addClass: function( value ) {
4083
+ var classes, elem, cur, clazz, j,
4084
+ i = 0,
4085
+ len = this.length,
4086
+ proceed = typeof value === "string" && value;
4087
+
4088
+ if ( jQuery.isFunction( value ) ) {
4089
+ return this.each(function( j ) {
4090
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
4091
+ });
4092
+ }
4093
+
4094
+ if ( proceed ) {
4095
+ // The disjunction here is for better compressibility (see removeClass)
4096
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
4097
+
4098
+ for ( ; i < len; i++ ) {
4099
+ elem = this[ i ];
4100
+ cur = elem.nodeType === 1 && ( elem.className ?
4101
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
4102
+ " "
4103
+ );
4104
+
4105
+ if ( cur ) {
4106
+ j = 0;
4107
+ while ( (clazz = classes[j++]) ) {
4108
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
4109
+ cur += clazz + " ";
4110
+ }
4111
+ }
4112
+ elem.className = jQuery.trim( cur );
4113
+
4114
+ }
4115
+ }
4116
+ }
4117
+
4118
+ return this;
4119
+ },
4120
+
4121
+ removeClass: function( value ) {
4122
+ var classes, elem, cur, clazz, j,
4123
+ i = 0,
4124
+ len = this.length,
4125
+ proceed = arguments.length === 0 || typeof value === "string" && value;
4126
+
4127
+ if ( jQuery.isFunction( value ) ) {
4128
+ return this.each(function( j ) {
4129
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
4130
+ });
4131
+ }
4132
+ if ( proceed ) {
4133
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
4134
+
4135
+ for ( ; i < len; i++ ) {
4136
+ elem = this[ i ];
4137
+ // This expression is here for better compressibility (see addClass)
4138
+ cur = elem.nodeType === 1 && ( elem.className ?
4139
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
4140
+ ""
4141
+ );
4142
+
4143
+ if ( cur ) {
4144
+ j = 0;
4145
+ while ( (clazz = classes[j++]) ) {
4146
+ // Remove *all* instances
4147
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
4148
+ cur = cur.replace( " " + clazz + " ", " " );
4149
+ }
4150
+ }
4151
+ elem.className = value ? jQuery.trim( cur ) : "";
4152
+ }
4153
+ }
4154
+ }
4155
+
4156
+ return this;
4157
+ },
4158
+
4159
+ toggleClass: function( value, stateVal ) {
4160
+ var type = typeof value;
4161
+
4162
+ if ( typeof stateVal === "boolean" && type === "string" ) {
4163
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
4164
+ }
4165
+
4166
+ if ( jQuery.isFunction( value ) ) {
4167
+ return this.each(function( i ) {
4168
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
4169
+ });
4170
+ }
4171
+
4172
+ return this.each(function() {
4173
+ if ( type === "string" ) {
4174
+ // toggle individual class names
4175
+ var className,
4176
+ i = 0,
4177
+ self = jQuery( this ),
4178
+ classNames = value.match( core_rnotwhite ) || [];
4179
+
4180
+ while ( (className = classNames[ i++ ]) ) {
4181
+ // check each className given, space separated list
4182
+ if ( self.hasClass( className ) ) {
4183
+ self.removeClass( className );
4184
+ } else {
4185
+ self.addClass( className );
4186
+ }
4187
+ }
4188
+
4189
+ // Toggle whole class name
4190
+ } else if ( type === core_strundefined || type === "boolean" ) {
4191
+ if ( this.className ) {
4192
+ // store className if set
4193
+ jQuery._data( this, "__className__", this.className );
4194
+ }
4195
+
4196
+ // If the element has a class name or if we're passed "false",
4197
+ // then remove the whole classname (if there was one, the above saved it).
4198
+ // Otherwise bring back whatever was previously saved (if anything),
4199
+ // falling back to the empty string if nothing was stored.
4200
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
4201
+ }
4202
+ });
4203
+ },
4204
+
4205
+ hasClass: function( selector ) {
4206
+ var className = " " + selector + " ",
4207
+ i = 0,
4208
+ l = this.length;
4209
+ for ( ; i < l; i++ ) {
4210
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
4211
+ return true;
4212
+ }
4213
+ }
4214
+
4215
+ return false;
4216
+ },
4217
+
4218
+ val: function( value ) {
4219
+ var ret, hooks, isFunction,
4220
+ elem = this[0];
4221
+
4222
+ if ( !arguments.length ) {
4223
+ if ( elem ) {
4224
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
4225
+
4226
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
4227
+ return ret;
4228
+ }
4229
+
4230
+ ret = elem.value;
4231
+
4232
+ return typeof ret === "string" ?
4233
+ // handle most common string cases
4234
+ ret.replace(rreturn, "") :
4235
+ // handle cases where value is null/undef or number
4236
+ ret == null ? "" : ret;
4237
+ }
4238
+
4239
+ return;
4240
+ }
4241
+
4242
+ isFunction = jQuery.isFunction( value );
4243
+
4244
+ return this.each(function( i ) {
4245
+ var val;
4246
+
4247
+ if ( this.nodeType !== 1 ) {
4248
+ return;
4249
+ }
4250
+
4251
+ if ( isFunction ) {
4252
+ val = value.call( this, i, jQuery( this ).val() );
4253
+ } else {
4254
+ val = value;
4255
+ }
4256
+
4257
+ // Treat null/undefined as ""; convert numbers to string
4258
+ if ( val == null ) {
4259
+ val = "";
4260
+ } else if ( typeof val === "number" ) {
4261
+ val += "";
4262
+ } else if ( jQuery.isArray( val ) ) {
4263
+ val = jQuery.map(val, function ( value ) {
4264
+ return value == null ? "" : value + "";
4265
+ });
4266
+ }
4267
+
4268
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
4269
+
4270
+ // If set returns undefined, fall back to normal setting
4271
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
4272
+ this.value = val;
4273
+ }
4274
+ });
4275
+ }
4276
+ });
4277
+
4278
+ jQuery.extend({
4279
+ valHooks: {
4280
+ option: {
4281
+ get: function( elem ) {
4282
+ // Use proper attribute retrieval(#6932, #12072)
4283
+ var val = jQuery.find.attr( elem, "value" );
4284
+ return val != null ?
4285
+ val :
4286
+ elem.text;
4287
+ }
4288
+ },
4289
+ select: {
4290
+ get: function( elem ) {
4291
+ var value, option,
4292
+ options = elem.options,
4293
+ index = elem.selectedIndex,
4294
+ one = elem.type === "select-one" || index < 0,
4295
+ values = one ? null : [],
4296
+ max = one ? index + 1 : options.length,
4297
+ i = index < 0 ?
4298
+ max :
4299
+ one ? index : 0;
4300
+
4301
+ // Loop through all the selected options
4302
+ for ( ; i < max; i++ ) {
4303
+ option = options[ i ];
4304
+
4305
+ // oldIE doesn't update selected after form reset (#2551)
4306
+ if ( ( option.selected || i === index ) &&
4307
+ // Don't return options that are disabled or in a disabled optgroup
4308
+ ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
4309
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
4310
+
4311
+ // Get the specific value for the option
4312
+ value = jQuery( option ).val();
4313
+
4314
+ // We don't need an array for one selects
4315
+ if ( one ) {
4316
+ return value;
4317
+ }
4318
+
4319
+ // Multi-Selects return an array
4320
+ values.push( value );
4321
+ }
4322
+ }
4323
+
4324
+ return values;
4325
+ },
4326
+
4327
+ set: function( elem, value ) {
4328
+ var optionSet, option,
4329
+ options = elem.options,
4330
+ values = jQuery.makeArray( value ),
4331
+ i = options.length;
4332
+
4333
+ while ( i-- ) {
4334
+ option = options[ i ];
4335
+ if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
4336
+ optionSet = true;
4337
+ }
4338
+ }
4339
+
4340
+ // force browsers to behave consistently when non-matching value is set
4341
+ if ( !optionSet ) {
4342
+ elem.selectedIndex = -1;
4343
+ }
4344
+ return values;
4345
+ }
4346
+ }
4347
+ },
4348
+
4349
+ attr: function( elem, name, value ) {
4350
+ var hooks, ret,
4351
+ nType = elem.nodeType;
4352
+
4353
+ // don't get/set attributes on text, comment and attribute nodes
4354
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
4355
+ return;
4356
+ }
4357
+
4358
+ // Fallback to prop when attributes are not supported
4359
+ if ( typeof elem.getAttribute === core_strundefined ) {
4360
+ return jQuery.prop( elem, name, value );
4361
+ }
4362
+
4363
+ // All attributes are lowercase
4364
+ // Grab necessary hook if one is defined
4365
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
4366
+ name = name.toLowerCase();
4367
+ hooks = jQuery.attrHooks[ name ] ||
4368
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
4369
+ }
4370
+
4371
+ if ( value !== undefined ) {
4372
+
4373
+ if ( value === null ) {
4374
+ jQuery.removeAttr( elem, name );
4375
+
4376
+ } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
4377
+ return ret;
4378
+
4379
+ } else {
4380
+ elem.setAttribute( name, value + "" );
4381
+ return value;
4382
+ }
4383
+
4384
+ } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
4385
+ return ret;
4386
+
4387
+ } else {
4388
+ ret = jQuery.find.attr( elem, name );
4389
+
4390
+ // Non-existent attributes return null, we normalize to undefined
4391
+ return ret == null ?
4392
+ undefined :
4393
+ ret;
4394
+ }
4395
+ },
4396
+
4397
+ removeAttr: function( elem, value ) {
4398
+ var name, propName,
4399
+ i = 0,
4400
+ attrNames = value && value.match( core_rnotwhite );
4401
+
4402
+ if ( attrNames && elem.nodeType === 1 ) {
4403
+ while ( (name = attrNames[i++]) ) {
4404
+ propName = jQuery.propFix[ name ] || name;
4405
+
4406
+ // Boolean attributes get special treatment (#10870)
4407
+ if ( jQuery.expr.match.bool.test( name ) ) {
4408
+ // Set corresponding property to false
4409
+ if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
4410
+ elem[ propName ] = false;
4411
+ // Support: IE<9
4412
+ // Also clear defaultChecked/defaultSelected (if appropriate)
4413
+ } else {
4414
+ elem[ jQuery.camelCase( "default-" + name ) ] =
4415
+ elem[ propName ] = false;
4416
+ }
4417
+
4418
+ // See #9699 for explanation of this approach (setting first, then removal)
4419
+ } else {
4420
+ jQuery.attr( elem, name, "" );
4421
+ }
4422
+
4423
+ elem.removeAttribute( getSetAttribute ? name : propName );
4424
+ }
4425
+ }
4426
+ },
4427
+
4428
+ attrHooks: {
4429
+ type: {
4430
+ set: function( elem, value ) {
4431
+ if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
4432
+ // Setting the type on a radio button after the value resets the value in IE6-9
4433
+ // Reset value to default in case type is set after value during creation
4434
+ var val = elem.value;
4435
+ elem.setAttribute( "type", value );
4436
+ if ( val ) {
4437
+ elem.value = val;
4438
+ }
4439
+ return value;
4440
+ }
4441
+ }
4442
+ }
4443
+ },
4444
+
4445
+ propFix: {
4446
+ "for": "htmlFor",
4447
+ "class": "className"
4448
+ },
4449
+
4450
+ prop: function( elem, name, value ) {
4451
+ var ret, hooks, notxml,
4452
+ nType = elem.nodeType;
4453
+
4454
+ // don't get/set properties on text, comment and attribute nodes
4455
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
4456
+ return;
4457
+ }
4458
+
4459
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
4460
+
4461
+ if ( notxml ) {
4462
+ // Fix name and attach hooks
4463
+ name = jQuery.propFix[ name ] || name;
4464
+ hooks = jQuery.propHooks[ name ];
4465
+ }
4466
+
4467
+ if ( value !== undefined ) {
4468
+ return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
4469
+ ret :
4470
+ ( elem[ name ] = value );
4471
+
4472
+ } else {
4473
+ return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
4474
+ ret :
4475
+ elem[ name ];
4476
+ }
4477
+ },
4478
+
4479
+ propHooks: {
4480
+ tabIndex: {
4481
+ get: function( elem ) {
4482
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
4483
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
4484
+ // Use proper attribute retrieval(#12072)
4485
+ var tabindex = jQuery.find.attr( elem, "tabindex" );
4486
+
4487
+ return tabindex ?
4488
+ parseInt( tabindex, 10 ) :
4489
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
4490
+ 0 :
4491
+ -1;
4492
+ }
4493
+ }
4494
+ }
4495
+ });
4496
+
4497
+ // Hooks for boolean attributes
4498
+ boolHook = {
4499
+ set: function( elem, value, name ) {
4500
+ if ( value === false ) {
4501
+ // Remove boolean attributes when set to false
4502
+ jQuery.removeAttr( elem, name );
4503
+ } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
4504
+ // IE<8 needs the *property* name
4505
+ elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
4506
+
4507
+ // Use defaultChecked and defaultSelected for oldIE
4508
+ } else {
4509
+ elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
4510
+ }
4511
+
4512
+ return name;
4513
+ }
4514
+ };
4515
+ jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
4516
+ var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
4517
+
4518
+ jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
4519
+ function( elem, name, isXML ) {
4520
+ var fn = jQuery.expr.attrHandle[ name ],
4521
+ ret = isXML ?
4522
+ undefined :
4523
+ /* jshint eqeqeq: false */
4524
+ (jQuery.expr.attrHandle[ name ] = undefined) !=
4525
+ getter( elem, name, isXML ) ?
4526
+
4527
+ name.toLowerCase() :
4528
+ null;
4529
+ jQuery.expr.attrHandle[ name ] = fn;
4530
+ return ret;
4531
+ } :
4532
+ function( elem, name, isXML ) {
4533
+ return isXML ?
4534
+ undefined :
4535
+ elem[ jQuery.camelCase( "default-" + name ) ] ?
4536
+ name.toLowerCase() :
4537
+ null;
4538
+ };
4539
+ });
4540
+
4541
+ // fix oldIE attroperties
4542
+ if ( !getSetInput || !getSetAttribute ) {
4543
+ jQuery.attrHooks.value = {
4544
+ set: function( elem, value, name ) {
4545
+ if ( jQuery.nodeName( elem, "input" ) ) {
4546
+ // Does not return so that setAttribute is also used
4547
+ elem.defaultValue = value;
4548
+ } else {
4549
+ // Use nodeHook if defined (#1954); otherwise setAttribute is fine
4550
+ return nodeHook && nodeHook.set( elem, value, name );
4551
+ }
4552
+ }
4553
+ };
4554
+ }
4555
+
4556
+ // IE6/7 do not support getting/setting some attributes with get/setAttribute
4557
+ if ( !getSetAttribute ) {
4558
+
4559
+ // Use this for any attribute in IE6/7
4560
+ // This fixes almost every IE6/7 issue
4561
+ nodeHook = {
4562
+ set: function( elem, value, name ) {
4563
+ // Set the existing or create a new attribute node
4564
+ var ret = elem.getAttributeNode( name );
4565
+ if ( !ret ) {
4566
+ elem.setAttributeNode(
4567
+ (ret = elem.ownerDocument.createAttribute( name ))
4568
+ );
4569
+ }
4570
+
4571
+ ret.value = value += "";
4572
+
4573
+ // Break association with cloned elements by also using setAttribute (#9646)
4574
+ return name === "value" || value === elem.getAttribute( name ) ?
4575
+ value :
4576
+ undefined;
4577
+ }
4578
+ };
4579
+ jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords =
4580
+ // Some attributes are constructed with empty-string values when not defined
4581
+ function( elem, name, isXML ) {
4582
+ var ret;
4583
+ return isXML ?
4584
+ undefined :
4585
+ (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
4586
+ ret.value :
4587
+ null;
4588
+ };
4589
+ jQuery.valHooks.button = {
4590
+ get: function( elem, name ) {
4591
+ var ret = elem.getAttributeNode( name );
4592
+ return ret && ret.specified ?
4593
+ ret.value :
4594
+ undefined;
4595
+ },
4596
+ set: nodeHook.set
4597
+ };
4598
+
4599
+ // Set contenteditable to false on removals(#10429)
4600
+ // Setting to empty string throws an error as an invalid value
4601
+ jQuery.attrHooks.contenteditable = {
4602
+ set: function( elem, value, name ) {
4603
+ nodeHook.set( elem, value === "" ? false : value, name );
4604
+ }
4605
+ };
4606
+
4607
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
4608
+ // This is for removals
4609
+ jQuery.each([ "width", "height" ], function( i, name ) {
4610
+ jQuery.attrHooks[ name ] = {
4611
+ set: function( elem, value ) {
4612
+ if ( value === "" ) {
4613
+ elem.setAttribute( name, "auto" );
4614
+ return value;
4615
+ }
4616
+ }
4617
+ };
4618
+ });
4619
+ }
4620
+
4621
+
4622
+ // Some attributes require a special call on IE
4623
+ // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
4624
+ if ( !jQuery.support.hrefNormalized ) {
4625
+ // href/src property should get the full normalized URL (#10299/#12915)
4626
+ jQuery.each([ "href", "src" ], function( i, name ) {
4627
+ jQuery.propHooks[ name ] = {
4628
+ get: function( elem ) {
4629
+ return elem.getAttribute( name, 4 );
4630
+ }
4631
+ };
4632
+ });
4633
+ }
4634
+
4635
+ if ( !jQuery.support.style ) {
4636
+ jQuery.attrHooks.style = {
4637
+ get: function( elem ) {
4638
+ // Return undefined in the case of empty string
4639
+ // Note: IE uppercases css property names, but if we were to .toLowerCase()
4640
+ // .cssText, that would destroy case senstitivity in URL's, like in "background"
4641
+ return elem.style.cssText || undefined;
4642
+ },
4643
+ set: function( elem, value ) {
4644
+ return ( elem.style.cssText = value + "" );
4645
+ }
4646
+ };
4647
+ }
4648
+
4649
+ // Safari mis-reports the default selected property of an option
4650
+ // Accessing the parent's selectedIndex property fixes it
4651
+ if ( !jQuery.support.optSelected ) {
4652
+ jQuery.propHooks.selected = {
4653
+ get: function( elem ) {
4654
+ var parent = elem.parentNode;
4655
+
4656
+ if ( parent ) {
4657
+ parent.selectedIndex;
4658
+
4659
+ // Make sure that it also works with optgroups, see #5701
4660
+ if ( parent.parentNode ) {
4661
+ parent.parentNode.selectedIndex;
4662
+ }
4663
+ }
4664
+ return null;
4665
+ }
4666
+ };
4667
+ }
4668
+
4669
+ jQuery.each([
4670
+ "tabIndex",
4671
+ "readOnly",
4672
+ "maxLength",
4673
+ "cellSpacing",
4674
+ "cellPadding",
4675
+ "rowSpan",
4676
+ "colSpan",
4677
+ "useMap",
4678
+ "frameBorder",
4679
+ "contentEditable"
4680
+ ], function() {
4681
+ jQuery.propFix[ this.toLowerCase() ] = this;
4682
+ });
4683
+
4684
+ // IE6/7 call enctype encoding
4685
+ if ( !jQuery.support.enctype ) {
4686
+ jQuery.propFix.enctype = "encoding";
4687
+ }
4688
+
4689
+ // Radios and checkboxes getter/setter
4690
+ jQuery.each([ "radio", "checkbox" ], function() {
4691
+ jQuery.valHooks[ this ] = {
4692
+ set: function( elem, value ) {
4693
+ if ( jQuery.isArray( value ) ) {
4694
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
4695
+ }
4696
+ }
4697
+ };
4698
+ if ( !jQuery.support.checkOn ) {
4699
+ jQuery.valHooks[ this ].get = function( elem ) {
4700
+ // Support: Webkit
4701
+ // "" is returned instead of "on" if a value isn't specified
4702
+ return elem.getAttribute("value") === null ? "on" : elem.value;
4703
+ };
4704
+ }
4705
+ });
4706
+ var rformElems = /^(?:input|select|textarea)$/i,
4707
+ rkeyEvent = /^key/,
4708
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
4709
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
4710
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
4711
+
4712
+ function returnTrue() {
4713
+ return true;
4714
+ }
4715
+
4716
+ function returnFalse() {
4717
+ return false;
4718
+ }
4719
+
4720
+ function safeActiveElement() {
4721
+ try {
4722
+ return document.activeElement;
4723
+ } catch ( err ) { }
4724
+ }
4725
+
4726
+ /*
4727
+ * Helper functions for managing events -- not part of the public interface.
4728
+ * Props to Dean Edwards' addEvent library for many of the ideas.
4729
+ */
4730
+ jQuery.event = {
4731
+
4732
+ global: {},
4733
+
4734
+ add: function( elem, types, handler, data, selector ) {
4735
+ var tmp, events, t, handleObjIn,
4736
+ special, eventHandle, handleObj,
4737
+ handlers, type, namespaces, origType,
4738
+ elemData = jQuery._data( elem );
4739
+
4740
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
4741
+ if ( !elemData ) {
4742
+ return;
4743
+ }
4744
+
4745
+ // Caller can pass in an object of custom data in lieu of the handler
4746
+ if ( handler.handler ) {
4747
+ handleObjIn = handler;
4748
+ handler = handleObjIn.handler;
4749
+ selector = handleObjIn.selector;
4750
+ }
4751
+
4752
+ // Make sure that the handler has a unique ID, used to find/remove it later
4753
+ if ( !handler.guid ) {
4754
+ handler.guid = jQuery.guid++;
4755
+ }
4756
+
4757
+ // Init the element's event structure and main handler, if this is the first
4758
+ if ( !(events = elemData.events) ) {
4759
+ events = elemData.events = {};
4760
+ }
4761
+ if ( !(eventHandle = elemData.handle) ) {
4762
+ eventHandle = elemData.handle = function( e ) {
4763
+ // Discard the second event of a jQuery.event.trigger() and
4764
+ // when an event is called after a page has unloaded
4765
+ return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
4766
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
4767
+ undefined;
4768
+ };
4769
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
4770
+ eventHandle.elem = elem;
4771
+ }
4772
+
4773
+ // Handle multiple events separated by a space
4774
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
4775
+ t = types.length;
4776
+ while ( t-- ) {
4777
+ tmp = rtypenamespace.exec( types[t] ) || [];
4778
+ type = origType = tmp[1];
4779
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
4780
+
4781
+ // There *must* be a type, no attaching namespace-only handlers
4782
+ if ( !type ) {
4783
+ continue;
4784
+ }
4785
+
4786
+ // If event changes its type, use the special event handlers for the changed type
4787
+ special = jQuery.event.special[ type ] || {};
4788
+
4789
+ // If selector defined, determine special event api type, otherwise given type
4790
+ type = ( selector ? special.delegateType : special.bindType ) || type;
4791
+
4792
+ // Update special based on newly reset type
4793
+ special = jQuery.event.special[ type ] || {};
4794
+
4795
+ // handleObj is passed to all event handlers
4796
+ handleObj = jQuery.extend({
4797
+ type: type,
4798
+ origType: origType,
4799
+ data: data,
4800
+ handler: handler,
4801
+ guid: handler.guid,
4802
+ selector: selector,
4803
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4804
+ namespace: namespaces.join(".")
4805
+ }, handleObjIn );
4806
+
4807
+ // Init the event handler queue if we're the first
4808
+ if ( !(handlers = events[ type ]) ) {
4809
+ handlers = events[ type ] = [];
4810
+ handlers.delegateCount = 0;
4811
+
4812
+ // Only use addEventListener/attachEvent if the special events handler returns false
4813
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4814
+ // Bind the global event handler to the element
4815
+ if ( elem.addEventListener ) {
4816
+ elem.addEventListener( type, eventHandle, false );
4817
+
4818
+ } else if ( elem.attachEvent ) {
4819
+ elem.attachEvent( "on" + type, eventHandle );
4820
+ }
4821
+ }
4822
+ }
4823
+
4824
+ if ( special.add ) {
4825
+ special.add.call( elem, handleObj );
4826
+
4827
+ if ( !handleObj.handler.guid ) {
4828
+ handleObj.handler.guid = handler.guid;
4829
+ }
4830
+ }
4831
+
4832
+ // Add to the element's handler list, delegates in front
4833
+ if ( selector ) {
4834
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
4835
+ } else {
4836
+ handlers.push( handleObj );
4837
+ }
4838
+
4839
+ // Keep track of which events have ever been used, for event optimization
4840
+ jQuery.event.global[ type ] = true;
4841
+ }
4842
+
4843
+ // Nullify elem to prevent memory leaks in IE
4844
+ elem = null;
4845
+ },
4846
+
4847
+ // Detach an event or set of events from an element
4848
+ remove: function( elem, types, handler, selector, mappedTypes ) {
4849
+ var j, handleObj, tmp,
4850
+ origCount, t, events,
4851
+ special, handlers, type,
4852
+ namespaces, origType,
4853
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
4854
+
4855
+ if ( !elemData || !(events = elemData.events) ) {
4856
+ return;
4857
+ }
4858
+
4859
+ // Once for each type.namespace in types; type may be omitted
4860
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
4861
+ t = types.length;
4862
+ while ( t-- ) {
4863
+ tmp = rtypenamespace.exec( types[t] ) || [];
4864
+ type = origType = tmp[1];
4865
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
4866
+
4867
+ // Unbind all events (on this namespace, if provided) for the element
4868
+ if ( !type ) {
4869
+ for ( type in events ) {
4870
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
4871
+ }
4872
+ continue;
4873
+ }
4874
+
4875
+ special = jQuery.event.special[ type ] || {};
4876
+ type = ( selector ? special.delegateType : special.bindType ) || type;
4877
+ handlers = events[ type ] || [];
4878
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
4879
+
4880
+ // Remove matching events
4881
+ origCount = j = handlers.length;
4882
+ while ( j-- ) {
4883
+ handleObj = handlers[ j ];
4884
+
4885
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
4886
+ ( !handler || handler.guid === handleObj.guid ) &&
4887
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
4888
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
4889
+ handlers.splice( j, 1 );
4890
+
4891
+ if ( handleObj.selector ) {
4892
+ handlers.delegateCount--;
4893
+ }
4894
+ if ( special.remove ) {
4895
+ special.remove.call( elem, handleObj );
4896
+ }
4897
+ }
4898
+ }
4899
+
4900
+ // Remove generic event handler if we removed something and no more handlers exist
4901
+ // (avoids potential for endless recursion during removal of special event handlers)
4902
+ if ( origCount && !handlers.length ) {
4903
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
4904
+ jQuery.removeEvent( elem, type, elemData.handle );
4905
+ }
4906
+
4907
+ delete events[ type ];
4908
+ }
4909
+ }
4910
+
4911
+ // Remove the expando if it's no longer used
4912
+ if ( jQuery.isEmptyObject( events ) ) {
4913
+ delete elemData.handle;
4914
+
4915
+ // removeData also checks for emptiness and clears the expando if empty
4916
+ // so use it instead of delete
4917
+ jQuery._removeData( elem, "events" );
4918
+ }
4919
+ },
4920
+
4921
+ trigger: function( event, data, elem, onlyHandlers ) {
4922
+ var handle, ontype, cur,
4923
+ bubbleType, special, tmp, i,
4924
+ eventPath = [ elem || document ],
4925
+ type = core_hasOwn.call( event, "type" ) ? event.type : event,
4926
+ namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
4927
+
4928
+ cur = tmp = elem = elem || document;
4929
+
4930
+ // Don't do events on text and comment nodes
4931
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
4932
+ return;
4933
+ }
4934
+
4935
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
4936
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
4937
+ return;
4938
+ }
4939
+
4940
+ if ( type.indexOf(".") >= 0 ) {
4941
+ // Namespaced trigger; create a regexp to match event type in handle()
4942
+ namespaces = type.split(".");
4943
+ type = namespaces.shift();
4944
+ namespaces.sort();
4945
+ }
4946
+ ontype = type.indexOf(":") < 0 && "on" + type;
4947
+
4948
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
4949
+ event = event[ jQuery.expando ] ?
4950
+ event :
4951
+ new jQuery.Event( type, typeof event === "object" && event );
4952
+
4953
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
4954
+ event.isTrigger = onlyHandlers ? 2 : 3;
4955
+ event.namespace = namespaces.join(".");
4956
+ event.namespace_re = event.namespace ?
4957
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
4958
+ null;
4959
+
4960
+ // Clean up the event in case it is being reused
4961
+ event.result = undefined;
4962
+ if ( !event.target ) {
4963
+ event.target = elem;
4964
+ }
4965
+
4966
+ // Clone any incoming data and prepend the event, creating the handler arg list
4967
+ data = data == null ?
4968
+ [ event ] :
4969
+ jQuery.makeArray( data, [ event ] );
4970
+
4971
+ // Allow special events to draw outside the lines
4972
+ special = jQuery.event.special[ type ] || {};
4973
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
4974
+ return;
4975
+ }
4976
+
4977
+ // Determine event propagation path in advance, per W3C events spec (#9951)
4978
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
4979
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
4980
+
4981
+ bubbleType = special.delegateType || type;
4982
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
4983
+ cur = cur.parentNode;
4984
+ }
4985
+ for ( ; cur; cur = cur.parentNode ) {
4986
+ eventPath.push( cur );
4987
+ tmp = cur;
4988
+ }
4989
+
4990
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
4991
+ if ( tmp === (elem.ownerDocument || document) ) {
4992
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
4993
+ }
4994
+ }
4995
+
4996
+ // Fire handlers on the event path
4997
+ i = 0;
4998
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
4999
+
5000
+ event.type = i > 1 ?
5001
+ bubbleType :
5002
+ special.bindType || type;
5003
+
5004
+ // jQuery handler
5005
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
5006
+ if ( handle ) {
5007
+ handle.apply( cur, data );
5008
+ }
5009
+
5010
+ // Native handler
5011
+ handle = ontype && cur[ ontype ];
5012
+ if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
5013
+ event.preventDefault();
5014
+ }
5015
+ }
5016
+ event.type = type;
5017
+
5018
+ // If nobody prevented the default action, do it now
5019
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
5020
+
5021
+ if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
5022
+ jQuery.acceptData( elem ) ) {
5023
+
5024
+ // Call a native DOM method on the target with the same name name as the event.
5025
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
5026
+ // Don't do default actions on window, that's where global variables be (#6170)
5027
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
5028
+
5029
+ // Don't re-trigger an onFOO event when we call its FOO() method
5030
+ tmp = elem[ ontype ];
5031
+
5032
+ if ( tmp ) {
5033
+ elem[ ontype ] = null;
5034
+ }
5035
+
5036
+ // Prevent re-triggering of the same event, since we already bubbled it above
5037
+ jQuery.event.triggered = type;
5038
+ try {
5039
+ elem[ type ]();
5040
+ } catch ( e ) {
5041
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
5042
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
5043
+ }
5044
+ jQuery.event.triggered = undefined;
5045
+
5046
+ if ( tmp ) {
5047
+ elem[ ontype ] = tmp;
5048
+ }
5049
+ }
5050
+ }
5051
+ }
5052
+
5053
+ return event.result;
5054
+ },
5055
+
5056
+ dispatch: function( event ) {
5057
+
5058
+ // Make a writable jQuery.Event from the native event object
5059
+ event = jQuery.event.fix( event );
5060
+
5061
+ var i, ret, handleObj, matched, j,
5062
+ handlerQueue = [],
5063
+ args = core_slice.call( arguments ),
5064
+ handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
5065
+ special = jQuery.event.special[ event.type ] || {};
5066
+
5067
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
5068
+ args[0] = event;
5069
+ event.delegateTarget = this;
5070
+
5071
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
5072
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
5073
+ return;
5074
+ }
5075
+
5076
+ // Determine handlers
5077
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
5078
+
5079
+ // Run delegates first; they may want to stop propagation beneath us
5080
+ i = 0;
5081
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
5082
+ event.currentTarget = matched.elem;
5083
+
5084
+ j = 0;
5085
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
5086
+
5087
+ // Triggered event must either 1) have no namespace, or
5088
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
5089
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
5090
+
5091
+ event.handleObj = handleObj;
5092
+ event.data = handleObj.data;
5093
+
5094
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
5095
+ .apply( matched.elem, args );
5096
+
5097
+ if ( ret !== undefined ) {
5098
+ if ( (event.result = ret) === false ) {
5099
+ event.preventDefault();
5100
+ event.stopPropagation();
5101
+ }
5102
+ }
5103
+ }
5104
+ }
5105
+ }
5106
+
5107
+ // Call the postDispatch hook for the mapped type
5108
+ if ( special.postDispatch ) {
5109
+ special.postDispatch.call( this, event );
5110
+ }
5111
+
5112
+ return event.result;
5113
+ },
5114
+
5115
+ handlers: function( event, handlers ) {
5116
+ var sel, handleObj, matches, i,
5117
+ handlerQueue = [],
5118
+ delegateCount = handlers.delegateCount,
5119
+ cur = event.target;
5120
+
5121
+ // Find delegate handlers
5122
+ // Black-hole SVG <use> instance trees (#13180)
5123
+ // Avoid non-left-click bubbling in Firefox (#3861)
5124
+ if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
5125
+
5126
+ /* jshint eqeqeq: false */
5127
+ for ( ; cur != this; cur = cur.parentNode || this ) {
5128
+ /* jshint eqeqeq: true */
5129
+
5130
+ // Don't check non-elements (#13208)
5131
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5132
+ if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
5133
+ matches = [];
5134
+ for ( i = 0; i < delegateCount; i++ ) {
5135
+ handleObj = handlers[ i ];
5136
+
5137
+ // Don't conflict with Object.prototype properties (#13203)
5138
+ sel = handleObj.selector + " ";
5139
+
5140
+ if ( matches[ sel ] === undefined ) {
5141
+ matches[ sel ] = handleObj.needsContext ?
5142
+ jQuery( sel, this ).index( cur ) >= 0 :
5143
+ jQuery.find( sel, this, null, [ cur ] ).length;
5144
+ }
5145
+ if ( matches[ sel ] ) {
5146
+ matches.push( handleObj );
5147
+ }
5148
+ }
5149
+ if ( matches.length ) {
5150
+ handlerQueue.push({ elem: cur, handlers: matches });
5151
+ }
5152
+ }
5153
+ }
5154
+ }
5155
+
5156
+ // Add the remaining (directly-bound) handlers
5157
+ if ( delegateCount < handlers.length ) {
5158
+ handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
5159
+ }
5160
+
5161
+ return handlerQueue;
5162
+ },
5163
+
5164
+ fix: function( event ) {
5165
+ if ( event[ jQuery.expando ] ) {
5166
+ return event;
5167
+ }
5168
+
5169
+ // Create a writable copy of the event object and normalize some properties
5170
+ var i, prop, copy,
5171
+ type = event.type,
5172
+ originalEvent = event,
5173
+ fixHook = this.fixHooks[ type ];
5174
+
5175
+ if ( !fixHook ) {
5176
+ this.fixHooks[ type ] = fixHook =
5177
+ rmouseEvent.test( type ) ? this.mouseHooks :
5178
+ rkeyEvent.test( type ) ? this.keyHooks :
5179
+ {};
5180
+ }
5181
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
5182
+
5183
+ event = new jQuery.Event( originalEvent );
5184
+
5185
+ i = copy.length;
5186
+ while ( i-- ) {
5187
+ prop = copy[ i ];
5188
+ event[ prop ] = originalEvent[ prop ];
5189
+ }
5190
+
5191
+ // Support: IE<9
5192
+ // Fix target property (#1925)
5193
+ if ( !event.target ) {
5194
+ event.target = originalEvent.srcElement || document;
5195
+ }
5196
+
5197
+ // Support: Chrome 23+, Safari?
5198
+ // Target should not be a text node (#504, #13143)
5199
+ if ( event.target.nodeType === 3 ) {
5200
+ event.target = event.target.parentNode;
5201
+ }
5202
+
5203
+ // Support: IE<9
5204
+ // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
5205
+ event.metaKey = !!event.metaKey;
5206
+
5207
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
5208
+ },
5209
+
5210
+ // Includes some event props shared by KeyEvent and MouseEvent
5211
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
5212
+
5213
+ fixHooks: {},
5214
+
5215
+ keyHooks: {
5216
+ props: "char charCode key keyCode".split(" "),
5217
+ filter: function( event, original ) {
5218
+
5219
+ // Add which for key events
5220
+ if ( event.which == null ) {
5221
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
5222
+ }
5223
+
5224
+ return event;
5225
+ }
5226
+ },
5227
+
5228
+ mouseHooks: {
5229
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
5230
+ filter: function( event, original ) {
5231
+ var body, eventDoc, doc,
5232
+ button = original.button,
5233
+ fromElement = original.fromElement;
5234
+
5235
+ // Calculate pageX/Y if missing and clientX/Y available
5236
+ if ( event.pageX == null && original.clientX != null ) {
5237
+ eventDoc = event.target.ownerDocument || document;
5238
+ doc = eventDoc.documentElement;
5239
+ body = eventDoc.body;
5240
+
5241
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
5242
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
5243
+ }
5244
+
5245
+ // Add relatedTarget, if necessary
5246
+ if ( !event.relatedTarget && fromElement ) {
5247
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
5248
+ }
5249
+
5250
+ // Add which for click: 1 === left; 2 === middle; 3 === right
5251
+ // Note: button is not normalized, so don't use it
5252
+ if ( !event.which && button !== undefined ) {
5253
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
5254
+ }
5255
+
5256
+ return event;
5257
+ }
5258
+ },
5259
+
5260
+ special: {
5261
+ load: {
5262
+ // Prevent triggered image.load events from bubbling to window.load
5263
+ noBubble: true
5264
+ },
5265
+ focus: {
5266
+ // Fire native event if possible so blur/focus sequence is correct
5267
+ trigger: function() {
5268
+ if ( this !== safeActiveElement() && this.focus ) {
5269
+ try {
5270
+ this.focus();
5271
+ return false;
5272
+ } catch ( e ) {
5273
+ // Support: IE<9
5274
+ // If we error on focus to hidden element (#1486, #12518),
5275
+ // let .trigger() run the handlers
5276
+ }
5277
+ }
5278
+ },
5279
+ delegateType: "focusin"
5280
+ },
5281
+ blur: {
5282
+ trigger: function() {
5283
+ if ( this === safeActiveElement() && this.blur ) {
5284
+ this.blur();
5285
+ return false;
5286
+ }
5287
+ },
5288
+ delegateType: "focusout"
5289
+ },
5290
+ click: {
5291
+ // For checkbox, fire native event so checked state will be right
5292
+ trigger: function() {
5293
+ if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
5294
+ this.click();
5295
+ return false;
5296
+ }
5297
+ },
5298
+
5299
+ // For cross-browser consistency, don't fire native .click() on links
5300
+ _default: function( event ) {
5301
+ return jQuery.nodeName( event.target, "a" );
5302
+ }
5303
+ },
5304
+
5305
+ beforeunload: {
5306
+ postDispatch: function( event ) {
5307
+
5308
+ // Even when returnValue equals to undefined Firefox will still show alert
5309
+ if ( event.result !== undefined ) {
5310
+ event.originalEvent.returnValue = event.result;
5311
+ }
5312
+ }
5313
+ }
5314
+ },
5315
+
5316
+ simulate: function( type, elem, event, bubble ) {
5317
+ // Piggyback on a donor event to simulate a different one.
5318
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
5319
+ // simulated event prevents default then we do the same on the donor.
5320
+ var e = jQuery.extend(
5321
+ new jQuery.Event(),
5322
+ event,
5323
+ {
5324
+ type: type,
5325
+ isSimulated: true,
5326
+ originalEvent: {}
5327
+ }
5328
+ );
5329
+ if ( bubble ) {
5330
+ jQuery.event.trigger( e, null, elem );
5331
+ } else {
5332
+ jQuery.event.dispatch.call( elem, e );
5333
+ }
5334
+ if ( e.isDefaultPrevented() ) {
5335
+ event.preventDefault();
5336
+ }
5337
+ }
5338
+ };
5339
+
5340
+ jQuery.removeEvent = document.removeEventListener ?
5341
+ function( elem, type, handle ) {
5342
+ if ( elem.removeEventListener ) {
5343
+ elem.removeEventListener( type, handle, false );
5344
+ }
5345
+ } :
5346
+ function( elem, type, handle ) {
5347
+ var name = "on" + type;
5348
+
5349
+ if ( elem.detachEvent ) {
5350
+
5351
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8
5352
+ // detachEvent needed property on element, by name of that event, to properly expose it to GC
5353
+ if ( typeof elem[ name ] === core_strundefined ) {
5354
+ elem[ name ] = null;
5355
+ }
5356
+
5357
+ elem.detachEvent( name, handle );
5358
+ }
5359
+ };
5360
+
5361
+ jQuery.Event = function( src, props ) {
5362
+ // Allow instantiation without the 'new' keyword
5363
+ if ( !(this instanceof jQuery.Event) ) {
5364
+ return new jQuery.Event( src, props );
5365
+ }
5366
+
5367
+ // Event object
5368
+ if ( src && src.type ) {
5369
+ this.originalEvent = src;
5370
+ this.type = src.type;
5371
+
5372
+ // Events bubbling up the document may have been marked as prevented
5373
+ // by a handler lower down the tree; reflect the correct value.
5374
+ this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
5375
+ src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
5376
+
5377
+ // Event type
5378
+ } else {
5379
+ this.type = src;
5380
+ }
5381
+
5382
+ // Put explicitly provided properties onto the event object
5383
+ if ( props ) {
5384
+ jQuery.extend( this, props );
5385
+ }
5386
+
5387
+ // Create a timestamp if incoming event doesn't have one
5388
+ this.timeStamp = src && src.timeStamp || jQuery.now();
5389
+
5390
+ // Mark it as fixed
5391
+ this[ jQuery.expando ] = true;
5392
+ };
5393
+
5394
+ // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
5395
+ // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
5396
+ jQuery.Event.prototype = {
5397
+ isDefaultPrevented: returnFalse,
5398
+ isPropagationStopped: returnFalse,
5399
+ isImmediatePropagationStopped: returnFalse,
5400
+
5401
+ preventDefault: function() {
5402
+ var e = this.originalEvent;
5403
+
5404
+ this.isDefaultPrevented = returnTrue;
5405
+ if ( !e ) {
5406
+ return;
5407
+ }
5408
+
5409
+ // If preventDefault exists, run it on the original event
5410
+ if ( e.preventDefault ) {
5411
+ e.preventDefault();
5412
+
5413
+ // Support: IE
5414
+ // Otherwise set the returnValue property of the original event to false
5415
+ } else {
5416
+ e.returnValue = false;
5417
+ }
5418
+ },
5419
+ stopPropagation: function() {
5420
+ var e = this.originalEvent;
5421
+
5422
+ this.isPropagationStopped = returnTrue;
5423
+ if ( !e ) {
5424
+ return;
5425
+ }
5426
+ // If stopPropagation exists, run it on the original event
5427
+ if ( e.stopPropagation ) {
5428
+ e.stopPropagation();
5429
+ }
5430
+
5431
+ // Support: IE
5432
+ // Set the cancelBubble property of the original event to true
5433
+ e.cancelBubble = true;
5434
+ },
5435
+ stopImmediatePropagation: function() {
5436
+ this.isImmediatePropagationStopped = returnTrue;
5437
+ this.stopPropagation();
5438
+ }
5439
+ };
5440
+
5441
+ // Create mouseenter/leave events using mouseover/out and event-time checks
5442
+ jQuery.each({
5443
+ mouseenter: "mouseover",
5444
+ mouseleave: "mouseout"
5445
+ }, function( orig, fix ) {
5446
+ jQuery.event.special[ orig ] = {
5447
+ delegateType: fix,
5448
+ bindType: fix,
5449
+
5450
+ handle: function( event ) {
5451
+ var ret,
5452
+ target = this,
5453
+ related = event.relatedTarget,
5454
+ handleObj = event.handleObj;
5455
+
5456
+ // For mousenter/leave call the handler if related is outside the target.
5457
+ // NB: No relatedTarget if the mouse left/entered the browser window
5458
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
5459
+ event.type = handleObj.origType;
5460
+ ret = handleObj.handler.apply( this, arguments );
5461
+ event.type = fix;
5462
+ }
5463
+ return ret;
5464
+ }
5465
+ };
5466
+ });
5467
+
5468
+ // IE submit delegation
5469
+ if ( !jQuery.support.submitBubbles ) {
5470
+
5471
+ jQuery.event.special.submit = {
5472
+ setup: function() {
5473
+ // Only need this for delegated form submit events
5474
+ if ( jQuery.nodeName( this, "form" ) ) {
5475
+ return false;
5476
+ }
5477
+
5478
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
5479
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
5480
+ // Node name check avoids a VML-related crash in IE (#9807)
5481
+ var elem = e.target,
5482
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
5483
+ if ( form && !jQuery._data( form, "submitBubbles" ) ) {
5484
+ jQuery.event.add( form, "submit._submit", function( event ) {
5485
+ event._submit_bubble = true;
5486
+ });
5487
+ jQuery._data( form, "submitBubbles", true );
5488
+ }
5489
+ });
5490
+ // return undefined since we don't need an event listener
5491
+ },
5492
+
5493
+ postDispatch: function( event ) {
5494
+ // If form was submitted by the user, bubble the event up the tree
5495
+ if ( event._submit_bubble ) {
5496
+ delete event._submit_bubble;
5497
+ if ( this.parentNode && !event.isTrigger ) {
5498
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
5499
+ }
5500
+ }
5501
+ },
5502
+
5503
+ teardown: function() {
5504
+ // Only need this for delegated form submit events
5505
+ if ( jQuery.nodeName( this, "form" ) ) {
5506
+ return false;
5507
+ }
5508
+
5509
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
5510
+ jQuery.event.remove( this, "._submit" );
5511
+ }
5512
+ };
5513
+ }
5514
+
5515
+ // IE change delegation and checkbox/radio fix
5516
+ if ( !jQuery.support.changeBubbles ) {
5517
+
5518
+ jQuery.event.special.change = {
5519
+
5520
+ setup: function() {
5521
+
5522
+ if ( rformElems.test( this.nodeName ) ) {
5523
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
5524
+ // after a propertychange. Eat the blur-change in special.change.handle.
5525
+ // This still fires onchange a second time for check/radio after blur.
5526
+ if ( this.type === "checkbox" || this.type === "radio" ) {
5527
+ jQuery.event.add( this, "propertychange._change", function( event ) {
5528
+ if ( event.originalEvent.propertyName === "checked" ) {
5529
+ this._just_changed = true;
5530
+ }
5531
+ });
5532
+ jQuery.event.add( this, "click._change", function( event ) {
5533
+ if ( this._just_changed && !event.isTrigger ) {
5534
+ this._just_changed = false;
5535
+ }
5536
+ // Allow triggered, simulated change events (#11500)
5537
+ jQuery.event.simulate( "change", this, event, true );
5538
+ });
5539
+ }
5540
+ return false;
5541
+ }
5542
+ // Delegated event; lazy-add a change handler on descendant inputs
5543
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
5544
+ var elem = e.target;
5545
+
5546
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
5547
+ jQuery.event.add( elem, "change._change", function( event ) {
5548
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
5549
+ jQuery.event.simulate( "change", this.parentNode, event, true );
5550
+ }
5551
+ });
5552
+ jQuery._data( elem, "changeBubbles", true );
5553
+ }
5554
+ });
5555
+ },
5556
+
5557
+ handle: function( event ) {
5558
+ var elem = event.target;
5559
+
5560
+ // Swallow native change events from checkbox/radio, we already triggered them above
5561
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
5562
+ return event.handleObj.handler.apply( this, arguments );
5563
+ }
5564
+ },
5565
+
5566
+ teardown: function() {
5567
+ jQuery.event.remove( this, "._change" );
5568
+
5569
+ return !rformElems.test( this.nodeName );
5570
+ }
5571
+ };
5572
+ }
5573
+
5574
+ // Create "bubbling" focus and blur events
5575
+ if ( !jQuery.support.focusinBubbles ) {
5576
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
5577
+
5578
+ // Attach a single capturing handler while someone wants focusin/focusout
5579
+ var attaches = 0,
5580
+ handler = function( event ) {
5581
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
5582
+ };
5583
+
5584
+ jQuery.event.special[ fix ] = {
5585
+ setup: function() {
5586
+ if ( attaches++ === 0 ) {
5587
+ document.addEventListener( orig, handler, true );
5588
+ }
5589
+ },
5590
+ teardown: function() {
5591
+ if ( --attaches === 0 ) {
5592
+ document.removeEventListener( orig, handler, true );
5593
+ }
5594
+ }
5595
+ };
5596
+ });
5597
+ }
5598
+
5599
+ jQuery.fn.extend({
5600
+
5601
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
5602
+ var type, origFn;
5603
+
5604
+ // Types can be a map of types/handlers
5605
+ if ( typeof types === "object" ) {
5606
+ // ( types-Object, selector, data )
5607
+ if ( typeof selector !== "string" ) {
5608
+ // ( types-Object, data )
5609
+ data = data || selector;
5610
+ selector = undefined;
5611
+ }
5612
+ for ( type in types ) {
5613
+ this.on( type, selector, data, types[ type ], one );
5614
+ }
5615
+ return this;
5616
+ }
5617
+
5618
+ if ( data == null && fn == null ) {
5619
+ // ( types, fn )
5620
+ fn = selector;
5621
+ data = selector = undefined;
5622
+ } else if ( fn == null ) {
5623
+ if ( typeof selector === "string" ) {
5624
+ // ( types, selector, fn )
5625
+ fn = data;
5626
+ data = undefined;
5627
+ } else {
5628
+ // ( types, data, fn )
5629
+ fn = data;
5630
+ data = selector;
5631
+ selector = undefined;
5632
+ }
5633
+ }
5634
+ if ( fn === false ) {
5635
+ fn = returnFalse;
5636
+ } else if ( !fn ) {
5637
+ return this;
5638
+ }
5639
+
5640
+ if ( one === 1 ) {
5641
+ origFn = fn;
5642
+ fn = function( event ) {
5643
+ // Can use an empty set, since event contains the info
5644
+ jQuery().off( event );
5645
+ return origFn.apply( this, arguments );
5646
+ };
5647
+ // Use same guid so caller can remove using origFn
5648
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
5649
+ }
5650
+ return this.each( function() {
5651
+ jQuery.event.add( this, types, fn, data, selector );
5652
+ });
5653
+ },
5654
+ one: function( types, selector, data, fn ) {
5655
+ return this.on( types, selector, data, fn, 1 );
5656
+ },
5657
+ off: function( types, selector, fn ) {
5658
+ var handleObj, type;
5659
+ if ( types && types.preventDefault && types.handleObj ) {
5660
+ // ( event ) dispatched jQuery.Event
5661
+ handleObj = types.handleObj;
5662
+ jQuery( types.delegateTarget ).off(
5663
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
5664
+ handleObj.selector,
5665
+ handleObj.handler
5666
+ );
5667
+ return this;
5668
+ }
5669
+ if ( typeof types === "object" ) {
5670
+ // ( types-object [, selector] )
5671
+ for ( type in types ) {
5672
+ this.off( type, selector, types[ type ] );
5673
+ }
5674
+ return this;
5675
+ }
5676
+ if ( selector === false || typeof selector === "function" ) {
5677
+ // ( types [, fn] )
5678
+ fn = selector;
5679
+ selector = undefined;
5680
+ }
5681
+ if ( fn === false ) {
5682
+ fn = returnFalse;
5683
+ }
5684
+ return this.each(function() {
5685
+ jQuery.event.remove( this, types, fn, selector );
5686
+ });
5687
+ },
5688
+
5689
+ trigger: function( type, data ) {
5690
+ return this.each(function() {
5691
+ jQuery.event.trigger( type, data, this );
5692
+ });
5693
+ },
5694
+ triggerHandler: function( type, data ) {
5695
+ var elem = this[0];
5696
+ if ( elem ) {
5697
+ return jQuery.event.trigger( type, data, elem, true );
5698
+ }
5699
+ }
5700
+ });
5701
+ var isSimple = /^.[^:#\[\.,]*$/,
5702
+ rparentsprev = /^(?:parents|prev(?:Until|All))/,
5703
+ rneedsContext = jQuery.expr.match.needsContext,
5704
+ // methods guaranteed to produce a unique set when starting from a unique set
5705
+ guaranteedUnique = {
5706
+ children: true,
5707
+ contents: true,
5708
+ next: true,
5709
+ prev: true
5710
+ };
5711
+
5712
+ jQuery.fn.extend({
5713
+ find: function( selector ) {
5714
+ var i,
5715
+ ret = [],
5716
+ self = this,
5717
+ len = self.length;
5718
+
5719
+ if ( typeof selector !== "string" ) {
5720
+ return this.pushStack( jQuery( selector ).filter(function() {
5721
+ for ( i = 0; i < len; i++ ) {
5722
+ if ( jQuery.contains( self[ i ], this ) ) {
5723
+ return true;
5724
+ }
5725
+ }
5726
+ }) );
5727
+ }
5728
+
5729
+ for ( i = 0; i < len; i++ ) {
5730
+ jQuery.find( selector, self[ i ], ret );
5731
+ }
5732
+
5733
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
5734
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
5735
+ ret.selector = this.selector ? this.selector + " " + selector : selector;
5736
+ return ret;
5737
+ },
5738
+
5739
+ has: function( target ) {
5740
+ var i,
5741
+ targets = jQuery( target, this ),
5742
+ len = targets.length;
5743
+
5744
+ return this.filter(function() {
5745
+ for ( i = 0; i < len; i++ ) {
5746
+ if ( jQuery.contains( this, targets[i] ) ) {
5747
+ return true;
5748
+ }
5749
+ }
5750
+ });
5751
+ },
5752
+
5753
+ not: function( selector ) {
5754
+ return this.pushStack( winnow(this, selector || [], true) );
5755
+ },
5756
+
5757
+ filter: function( selector ) {
5758
+ return this.pushStack( winnow(this, selector || [], false) );
5759
+ },
5760
+
5761
+ is: function( selector ) {
5762
+ return !!winnow(
5763
+ this,
5764
+
5765
+ // If this is a positional/relative selector, check membership in the returned set
5766
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
5767
+ typeof selector === "string" && rneedsContext.test( selector ) ?
5768
+ jQuery( selector ) :
5769
+ selector || [],
5770
+ false
5771
+ ).length;
5772
+ },
5773
+
5774
+ closest: function( selectors, context ) {
5775
+ var cur,
5776
+ i = 0,
5777
+ l = this.length,
5778
+ ret = [],
5779
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
5780
+ jQuery( selectors, context || this.context ) :
5781
+ 0;
5782
+
5783
+ for ( ; i < l; i++ ) {
5784
+ for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
5785
+ // Always skip document fragments
5786
+ if ( cur.nodeType < 11 && (pos ?
5787
+ pos.index(cur) > -1 :
5788
+
5789
+ // Don't pass non-elements to Sizzle
5790
+ cur.nodeType === 1 &&
5791
+ jQuery.find.matchesSelector(cur, selectors)) ) {
5792
+
5793
+ cur = ret.push( cur );
5794
+ break;
5795
+ }
5796
+ }
5797
+ }
5798
+
5799
+ return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
5800
+ },
5801
+
5802
+ // Determine the position of an element within
5803
+ // the matched set of elements
5804
+ index: function( elem ) {
5805
+
5806
+ // No argument, return index in parent
5807
+ if ( !elem ) {
5808
+ return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
5809
+ }
5810
+
5811
+ // index in selector
5812
+ if ( typeof elem === "string" ) {
5813
+ return jQuery.inArray( this[0], jQuery( elem ) );
5814
+ }
5815
+
5816
+ // Locate the position of the desired element
5817
+ return jQuery.inArray(
5818
+ // If it receives a jQuery object, the first element is used
5819
+ elem.jquery ? elem[0] : elem, this );
5820
+ },
5821
+
5822
+ add: function( selector, context ) {
5823
+ var set = typeof selector === "string" ?
5824
+ jQuery( selector, context ) :
5825
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
5826
+ all = jQuery.merge( this.get(), set );
5827
+
5828
+ return this.pushStack( jQuery.unique(all) );
5829
+ },
5830
+
5831
+ addBack: function( selector ) {
5832
+ return this.add( selector == null ?
5833
+ this.prevObject : this.prevObject.filter(selector)
5834
+ );
5835
+ }
5836
+ });
5837
+
5838
+ function sibling( cur, dir ) {
5839
+ do {
5840
+ cur = cur[ dir ];
5841
+ } while ( cur && cur.nodeType !== 1 );
5842
+
5843
+ return cur;
5844
+ }
5845
+
5846
+ jQuery.each({
5847
+ parent: function( elem ) {
5848
+ var parent = elem.parentNode;
5849
+ return parent && parent.nodeType !== 11 ? parent : null;
5850
+ },
5851
+ parents: function( elem ) {
5852
+ return jQuery.dir( elem, "parentNode" );
5853
+ },
5854
+ parentsUntil: function( elem, i, until ) {
5855
+ return jQuery.dir( elem, "parentNode", until );
5856
+ },
5857
+ next: function( elem ) {
5858
+ return sibling( elem, "nextSibling" );
5859
+ },
5860
+ prev: function( elem ) {
5861
+ return sibling( elem, "previousSibling" );
5862
+ },
5863
+ nextAll: function( elem ) {
5864
+ return jQuery.dir( elem, "nextSibling" );
5865
+ },
5866
+ prevAll: function( elem ) {
5867
+ return jQuery.dir( elem, "previousSibling" );
5868
+ },
5869
+ nextUntil: function( elem, i, until ) {
5870
+ return jQuery.dir( elem, "nextSibling", until );
5871
+ },
5872
+ prevUntil: function( elem, i, until ) {
5873
+ return jQuery.dir( elem, "previousSibling", until );
5874
+ },
5875
+ siblings: function( elem ) {
5876
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
5877
+ },
5878
+ children: function( elem ) {
5879
+ return jQuery.sibling( elem.firstChild );
5880
+ },
5881
+ contents: function( elem ) {
5882
+ return jQuery.nodeName( elem, "iframe" ) ?
5883
+ elem.contentDocument || elem.contentWindow.document :
5884
+ jQuery.merge( [], elem.childNodes );
5885
+ }
5886
+ }, function( name, fn ) {
5887
+ jQuery.fn[ name ] = function( until, selector ) {
5888
+ var ret = jQuery.map( this, fn, until );
5889
+
5890
+ if ( name.slice( -5 ) !== "Until" ) {
5891
+ selector = until;
5892
+ }
5893
+
5894
+ if ( selector && typeof selector === "string" ) {
5895
+ ret = jQuery.filter( selector, ret );
5896
+ }
5897
+
5898
+ if ( this.length > 1 ) {
5899
+ // Remove duplicates
5900
+ if ( !guaranteedUnique[ name ] ) {
5901
+ ret = jQuery.unique( ret );
5902
+ }
5903
+
5904
+ // Reverse order for parents* and prev-derivatives
5905
+ if ( rparentsprev.test( name ) ) {
5906
+ ret = ret.reverse();
5907
+ }
5908
+ }
5909
+
5910
+ return this.pushStack( ret );
5911
+ };
5912
+ });
5913
+
5914
+ jQuery.extend({
5915
+ filter: function( expr, elems, not ) {
5916
+ var elem = elems[ 0 ];
5917
+
5918
+ if ( not ) {
5919
+ expr = ":not(" + expr + ")";
5920
+ }
5921
+
5922
+ return elems.length === 1 && elem.nodeType === 1 ?
5923
+ jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
5924
+ jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
5925
+ return elem.nodeType === 1;
5926
+ }));
5927
+ },
5928
+
5929
+ dir: function( elem, dir, until ) {
5930
+ var matched = [],
5931
+ cur = elem[ dir ];
5932
+
5933
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
5934
+ if ( cur.nodeType === 1 ) {
5935
+ matched.push( cur );
5936
+ }
5937
+ cur = cur[dir];
5938
+ }
5939
+ return matched;
5940
+ },
5941
+
5942
+ sibling: function( n, elem ) {
5943
+ var r = [];
5944
+
5945
+ for ( ; n; n = n.nextSibling ) {
5946
+ if ( n.nodeType === 1 && n !== elem ) {
5947
+ r.push( n );
5948
+ }
5949
+ }
5950
+
5951
+ return r;
5952
+ }
5953
+ });
5954
+
5955
+ // Implement the identical functionality for filter and not
5956
+ function winnow( elements, qualifier, not ) {
5957
+ if ( jQuery.isFunction( qualifier ) ) {
5958
+ return jQuery.grep( elements, function( elem, i ) {
5959
+ /* jshint -W018 */
5960
+ return !!qualifier.call( elem, i, elem ) !== not;
5961
+ });
5962
+
5963
+ }
5964
+
5965
+ if ( qualifier.nodeType ) {
5966
+ return jQuery.grep( elements, function( elem ) {
5967
+ return ( elem === qualifier ) !== not;
5968
+ });
5969
+
5970
+ }
5971
+
5972
+ if ( typeof qualifier === "string" ) {
5973
+ if ( isSimple.test( qualifier ) ) {
5974
+ return jQuery.filter( qualifier, elements, not );
5975
+ }
5976
+
5977
+ qualifier = jQuery.filter( qualifier, elements );
5978
+ }
5979
+
5980
+ return jQuery.grep( elements, function( elem ) {
5981
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
5982
+ });
5983
+ }
5984
+ function createSafeFragment( document ) {
5985
+ var list = nodeNames.split( "|" ),
5986
+ safeFrag = document.createDocumentFragment();
5987
+
5988
+ if ( safeFrag.createElement ) {
5989
+ while ( list.length ) {
5990
+ safeFrag.createElement(
5991
+ list.pop()
5992
+ );
5993
+ }
5994
+ }
5995
+ return safeFrag;
5996
+ }
5997
+
5998
+ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
5999
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
6000
+ rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
6001
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
6002
+ rleadingWhitespace = /^\s+/,
6003
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
6004
+ rtagName = /<([\w:]+)/,
6005
+ rtbody = /<tbody/i,
6006
+ rhtml = /<|&#?\w+;/,
6007
+ rnoInnerhtml = /<(?:script|style|link)/i,
6008
+ manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
6009
+ // checked="checked" or checked
6010
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
6011
+ rscriptType = /^$|\/(?:java|ecma)script/i,
6012
+ rscriptTypeMasked = /^true\/(.*)/,
6013
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
6014
+
6015
+ // We have to close these tags to support XHTML (#13200)
6016
+ wrapMap = {
6017
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
6018
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
6019
+ area: [ 1, "<map>", "</map>" ],
6020
+ param: [ 1, "<object>", "</object>" ],
6021
+ thead: [ 1, "<table>", "</table>" ],
6022
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
6023
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
6024
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
6025
+
6026
+ // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
6027
+ // unless wrapped in a div with non-breaking characters in front of it.
6028
+ _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
6029
+ },
6030
+ safeFragment = createSafeFragment( document ),
6031
+ fragmentDiv = safeFragment.appendChild( document.createElement("div") );
6032
+
6033
+ wrapMap.optgroup = wrapMap.option;
6034
+ wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
6035
+ wrapMap.th = wrapMap.td;
6036
+
6037
+ jQuery.fn.extend({
6038
+ text: function( value ) {
6039
+ return jQuery.access( this, function( value ) {
6040
+ return value === undefined ?
6041
+ jQuery.text( this ) :
6042
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
6043
+ }, null, value, arguments.length );
6044
+ },
6045
+
6046
+ append: function() {
6047
+ return this.domManip( arguments, function( elem ) {
6048
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6049
+ var target = manipulationTarget( this, elem );
6050
+ target.appendChild( elem );
6051
+ }
6052
+ });
6053
+ },
6054
+
6055
+ prepend: function() {
6056
+ return this.domManip( arguments, function( elem ) {
6057
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6058
+ var target = manipulationTarget( this, elem );
6059
+ target.insertBefore( elem, target.firstChild );
6060
+ }
6061
+ });
6062
+ },
6063
+
6064
+ before: function() {
6065
+ return this.domManip( arguments, function( elem ) {
6066
+ if ( this.parentNode ) {
6067
+ this.parentNode.insertBefore( elem, this );
6068
+ }
6069
+ });
6070
+ },
6071
+
6072
+ after: function() {
6073
+ return this.domManip( arguments, function( elem ) {
6074
+ if ( this.parentNode ) {
6075
+ this.parentNode.insertBefore( elem, this.nextSibling );
6076
+ }
6077
+ });
6078
+ },
6079
+
6080
+ // keepData is for internal use only--do not document
6081
+ remove: function( selector, keepData ) {
6082
+ var elem,
6083
+ elems = selector ? jQuery.filter( selector, this ) : this,
6084
+ i = 0;
6085
+
6086
+ for ( ; (elem = elems[i]) != null; i++ ) {
6087
+
6088
+ if ( !keepData && elem.nodeType === 1 ) {
6089
+ jQuery.cleanData( getAll( elem ) );
6090
+ }
6091
+
6092
+ if ( elem.parentNode ) {
6093
+ if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
6094
+ setGlobalEval( getAll( elem, "script" ) );
6095
+ }
6096
+ elem.parentNode.removeChild( elem );
6097
+ }
6098
+ }
6099
+
6100
+ return this;
6101
+ },
6102
+
6103
+ empty: function() {
6104
+ var elem,
6105
+ i = 0;
6106
+
6107
+ for ( ; (elem = this[i]) != null; i++ ) {
6108
+ // Remove element nodes and prevent memory leaks
6109
+ if ( elem.nodeType === 1 ) {
6110
+ jQuery.cleanData( getAll( elem, false ) );
6111
+ }
6112
+
6113
+ // Remove any remaining nodes
6114
+ while ( elem.firstChild ) {
6115
+ elem.removeChild( elem.firstChild );
6116
+ }
6117
+
6118
+ // If this is a select, ensure that it displays empty (#12336)
6119
+ // Support: IE<9
6120
+ if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
6121
+ elem.options.length = 0;
6122
+ }
6123
+ }
6124
+
6125
+ return this;
6126
+ },
6127
+
6128
+ clone: function( dataAndEvents, deepDataAndEvents ) {
6129
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
6130
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
6131
+
6132
+ return this.map( function () {
6133
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
6134
+ });
6135
+ },
6136
+
6137
+ html: function( value ) {
6138
+ return jQuery.access( this, function( value ) {
6139
+ var elem = this[0] || {},
6140
+ i = 0,
6141
+ l = this.length;
6142
+
6143
+ if ( value === undefined ) {
6144
+ return elem.nodeType === 1 ?
6145
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
6146
+ undefined;
6147
+ }
6148
+
6149
+ // See if we can take a shortcut and just use innerHTML
6150
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
6151
+ ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
6152
+ ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
6153
+ !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
6154
+
6155
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
6156
+
6157
+ try {
6158
+ for (; i < l; i++ ) {
6159
+ // Remove element nodes and prevent memory leaks
6160
+ elem = this[i] || {};
6161
+ if ( elem.nodeType === 1 ) {
6162
+ jQuery.cleanData( getAll( elem, false ) );
6163
+ elem.innerHTML = value;
6164
+ }
6165
+ }
6166
+
6167
+ elem = 0;
6168
+
6169
+ // If using innerHTML throws an exception, use the fallback method
6170
+ } catch(e) {}
6171
+ }
6172
+
6173
+ if ( elem ) {
6174
+ this.empty().append( value );
6175
+ }
6176
+ }, null, value, arguments.length );
6177
+ },
6178
+
6179
+ replaceWith: function() {
6180
+ var
6181
+ // Snapshot the DOM in case .domManip sweeps something relevant into its fragment
6182
+ args = jQuery.map( this, function( elem ) {
6183
+ return [ elem.nextSibling, elem.parentNode ];
6184
+ }),
6185
+ i = 0;
6186
+
6187
+ // Make the changes, replacing each context element with the new content
6188
+ this.domManip( arguments, function( elem ) {
6189
+ var next = args[ i++ ],
6190
+ parent = args[ i++ ];
6191
+
6192
+ if ( parent ) {
6193
+ // Don't use the snapshot next if it has moved (#13810)
6194
+ if ( next && next.parentNode !== parent ) {
6195
+ next = this.nextSibling;
6196
+ }
6197
+ jQuery( this ).remove();
6198
+ parent.insertBefore( elem, next );
6199
+ }
6200
+ // Allow new content to include elements from the context set
6201
+ }, true );
6202
+
6203
+ // Force removal if there was no new content (e.g., from empty arguments)
6204
+ return i ? this : this.remove();
6205
+ },
6206
+
6207
+ detach: function( selector ) {
6208
+ return this.remove( selector, true );
6209
+ },
6210
+
6211
+ domManip: function( args, callback, allowIntersection ) {
6212
+
6213
+ // Flatten any nested arrays
6214
+ args = core_concat.apply( [], args );
6215
+
6216
+ var first, node, hasScripts,
6217
+ scripts, doc, fragment,
6218
+ i = 0,
6219
+ l = this.length,
6220
+ set = this,
6221
+ iNoClone = l - 1,
6222
+ value = args[0],
6223
+ isFunction = jQuery.isFunction( value );
6224
+
6225
+ // We can't cloneNode fragments that contain checked, in WebKit
6226
+ if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
6227
+ return this.each(function( index ) {
6228
+ var self = set.eq( index );
6229
+ if ( isFunction ) {
6230
+ args[0] = value.call( this, index, self.html() );
6231
+ }
6232
+ self.domManip( args, callback, allowIntersection );
6233
+ });
6234
+ }
6235
+
6236
+ if ( l ) {
6237
+ fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );
6238
+ first = fragment.firstChild;
6239
+
6240
+ if ( fragment.childNodes.length === 1 ) {
6241
+ fragment = first;
6242
+ }
6243
+
6244
+ if ( first ) {
6245
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
6246
+ hasScripts = scripts.length;
6247
+
6248
+ // Use the original fragment for the last item instead of the first because it can end up
6249
+ // being emptied incorrectly in certain situations (#8070).
6250
+ for ( ; i < l; i++ ) {
6251
+ node = fragment;
6252
+
6253
+ if ( i !== iNoClone ) {
6254
+ node = jQuery.clone( node, true, true );
6255
+
6256
+ // Keep references to cloned scripts for later restoration
6257
+ if ( hasScripts ) {
6258
+ jQuery.merge( scripts, getAll( node, "script" ) );
6259
+ }
6260
+ }
6261
+
6262
+ callback.call( this[i], node, i );
6263
+ }
6264
+
6265
+ if ( hasScripts ) {
6266
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
6267
+
6268
+ // Reenable scripts
6269
+ jQuery.map( scripts, restoreScript );
6270
+
6271
+ // Evaluate executable scripts on first document insertion
6272
+ for ( i = 0; i < hasScripts; i++ ) {
6273
+ node = scripts[ i ];
6274
+ if ( rscriptType.test( node.type || "" ) &&
6275
+ !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
6276
+
6277
+ if ( node.src ) {
6278
+ // Hope ajax is available...
6279
+ jQuery._evalUrl( node.src );
6280
+ } else {
6281
+ jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
6282
+ }
6283
+ }
6284
+ }
6285
+ }
6286
+
6287
+ // Fix #11809: Avoid leaking memory
6288
+ fragment = first = null;
6289
+ }
6290
+ }
6291
+
6292
+ return this;
6293
+ }
6294
+ });
6295
+
6296
+ // Support: IE<8
6297
+ // Manipulating tables requires a tbody
6298
+ function manipulationTarget( elem, content ) {
6299
+ return jQuery.nodeName( elem, "table" ) &&
6300
+ jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ?
6301
+
6302
+ elem.getElementsByTagName("tbody")[0] ||
6303
+ elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
6304
+ elem;
6305
+ }
6306
+
6307
+ // Replace/restore the type attribute of script elements for safe DOM manipulation
6308
+ function disableScript( elem ) {
6309
+ elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
6310
+ return elem;
6311
+ }
6312
+ function restoreScript( elem ) {
6313
+ var match = rscriptTypeMasked.exec( elem.type );
6314
+ if ( match ) {
6315
+ elem.type = match[1];
6316
+ } else {
6317
+ elem.removeAttribute("type");
6318
+ }
6319
+ return elem;
6320
+ }
6321
+
6322
+ // Mark scripts as having already been evaluated
6323
+ function setGlobalEval( elems, refElements ) {
6324
+ var elem,
6325
+ i = 0;
6326
+ for ( ; (elem = elems[i]) != null; i++ ) {
6327
+ jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
6328
+ }
6329
+ }
6330
+
6331
+ function cloneCopyEvent( src, dest ) {
6332
+
6333
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
6334
+ return;
6335
+ }
6336
+
6337
+ var type, i, l,
6338
+ oldData = jQuery._data( src ),
6339
+ curData = jQuery._data( dest, oldData ),
6340
+ events = oldData.events;
6341
+
6342
+ if ( events ) {
6343
+ delete curData.handle;
6344
+ curData.events = {};
6345
+
6346
+ for ( type in events ) {
6347
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
6348
+ jQuery.event.add( dest, type, events[ type ][ i ] );
6349
+ }
6350
+ }
6351
+ }
6352
+
6353
+ // make the cloned public data object a copy from the original
6354
+ if ( curData.data ) {
6355
+ curData.data = jQuery.extend( {}, curData.data );
6356
+ }
6357
+ }
6358
+
6359
+ function fixCloneNodeIssues( src, dest ) {
6360
+ var nodeName, e, data;
6361
+
6362
+ // We do not need to do anything for non-Elements
6363
+ if ( dest.nodeType !== 1 ) {
6364
+ return;
6365
+ }
6366
+
6367
+ nodeName = dest.nodeName.toLowerCase();
6368
+
6369
+ // IE6-8 copies events bound via attachEvent when using cloneNode.
6370
+ if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
6371
+ data = jQuery._data( dest );
6372
+
6373
+ for ( e in data.events ) {
6374
+ jQuery.removeEvent( dest, e, data.handle );
6375
+ }
6376
+
6377
+ // Event data gets referenced instead of copied if the expando gets copied too
6378
+ dest.removeAttribute( jQuery.expando );
6379
+ }
6380
+
6381
+ // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
6382
+ if ( nodeName === "script" && dest.text !== src.text ) {
6383
+ disableScript( dest ).text = src.text;
6384
+ restoreScript( dest );
6385
+
6386
+ // IE6-10 improperly clones children of object elements using classid.
6387
+ // IE10 throws NoModificationAllowedError if parent is null, #12132.
6388
+ } else if ( nodeName === "object" ) {
6389
+ if ( dest.parentNode ) {
6390
+ dest.outerHTML = src.outerHTML;
6391
+ }
6392
+
6393
+ // This path appears unavoidable for IE9. When cloning an object
6394
+ // element in IE9, the outerHTML strategy above is not sufficient.
6395
+ // If the src has innerHTML and the destination does not,
6396
+ // copy the src.innerHTML into the dest.innerHTML. #10324
6397
+ if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
6398
+ dest.innerHTML = src.innerHTML;
6399
+ }
6400
+
6401
+ } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
6402
+ // IE6-8 fails to persist the checked state of a cloned checkbox
6403
+ // or radio button. Worse, IE6-7 fail to give the cloned element
6404
+ // a checked appearance if the defaultChecked value isn't also set
6405
+
6406
+ dest.defaultChecked = dest.checked = src.checked;
6407
+
6408
+ // IE6-7 get confused and end up setting the value of a cloned
6409
+ // checkbox/radio button to an empty string instead of "on"
6410
+ if ( dest.value !== src.value ) {
6411
+ dest.value = src.value;
6412
+ }
6413
+
6414
+ // IE6-8 fails to return the selected option to the default selected
6415
+ // state when cloning options
6416
+ } else if ( nodeName === "option" ) {
6417
+ dest.defaultSelected = dest.selected = src.defaultSelected;
6418
+
6419
+ // IE6-8 fails to set the defaultValue to the correct value when
6420
+ // cloning other types of input fields
6421
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
6422
+ dest.defaultValue = src.defaultValue;
6423
+ }
6424
+ }
6425
+
6426
+ jQuery.each({
6427
+ appendTo: "append",
6428
+ prependTo: "prepend",
6429
+ insertBefore: "before",
6430
+ insertAfter: "after",
6431
+ replaceAll: "replaceWith"
6432
+ }, function( name, original ) {
6433
+ jQuery.fn[ name ] = function( selector ) {
6434
+ var elems,
6435
+ i = 0,
6436
+ ret = [],
6437
+ insert = jQuery( selector ),
6438
+ last = insert.length - 1;
6439
+
6440
+ for ( ; i <= last; i++ ) {
6441
+ elems = i === last ? this : this.clone(true);
6442
+ jQuery( insert[i] )[ original ]( elems );
6443
+
6444
+ // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
6445
+ core_push.apply( ret, elems.get() );
6446
+ }
6447
+
6448
+ return this.pushStack( ret );
6449
+ };
6450
+ });
6451
+
6452
+ function getAll( context, tag ) {
6453
+ var elems, elem,
6454
+ i = 0,
6455
+ found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
6456
+ typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
6457
+ undefined;
6458
+
6459
+ if ( !found ) {
6460
+ for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
6461
+ if ( !tag || jQuery.nodeName( elem, tag ) ) {
6462
+ found.push( elem );
6463
+ } else {
6464
+ jQuery.merge( found, getAll( elem, tag ) );
6465
+ }
6466
+ }
6467
+ }
6468
+
6469
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
6470
+ jQuery.merge( [ context ], found ) :
6471
+ found;
6472
+ }
6473
+
6474
+ // Used in buildFragment, fixes the defaultChecked property
6475
+ function fixDefaultChecked( elem ) {
6476
+ if ( manipulation_rcheckableType.test( elem.type ) ) {
6477
+ elem.defaultChecked = elem.checked;
6478
+ }
6479
+ }
6480
+
6481
+ jQuery.extend({
6482
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
6483
+ var destElements, node, clone, i, srcElements,
6484
+ inPage = jQuery.contains( elem.ownerDocument, elem );
6485
+
6486
+ if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
6487
+ clone = elem.cloneNode( true );
6488
+
6489
+ // IE<=8 does not properly clone detached, unknown element nodes
6490
+ } else {
6491
+ fragmentDiv.innerHTML = elem.outerHTML;
6492
+ fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
6493
+ }
6494
+
6495
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
6496
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
6497
+
6498
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
6499
+ destElements = getAll( clone );
6500
+ srcElements = getAll( elem );
6501
+
6502
+ // Fix all IE cloning issues
6503
+ for ( i = 0; (node = srcElements[i]) != null; ++i ) {
6504
+ // Ensure that the destination node is not null; Fixes #9587
6505
+ if ( destElements[i] ) {
6506
+ fixCloneNodeIssues( node, destElements[i] );
6507
+ }
6508
+ }
6509
+ }
6510
+
6511
+ // Copy the events from the original to the clone
6512
+ if ( dataAndEvents ) {
6513
+ if ( deepDataAndEvents ) {
6514
+ srcElements = srcElements || getAll( elem );
6515
+ destElements = destElements || getAll( clone );
6516
+
6517
+ for ( i = 0; (node = srcElements[i]) != null; i++ ) {
6518
+ cloneCopyEvent( node, destElements[i] );
6519
+ }
6520
+ } else {
6521
+ cloneCopyEvent( elem, clone );
6522
+ }
6523
+ }
6524
+
6525
+ // Preserve script evaluation history
6526
+ destElements = getAll( clone, "script" );
6527
+ if ( destElements.length > 0 ) {
6528
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
6529
+ }
6530
+
6531
+ destElements = srcElements = node = null;
6532
+
6533
+ // Return the cloned set
6534
+ return clone;
6535
+ },
6536
+
6537
+ buildFragment: function( elems, context, scripts, selection ) {
6538
+ var j, elem, contains,
6539
+ tmp, tag, tbody, wrap,
6540
+ l = elems.length,
6541
+
6542
+ // Ensure a safe fragment
6543
+ safe = createSafeFragment( context ),
6544
+
6545
+ nodes = [],
6546
+ i = 0;
6547
+
6548
+ for ( ; i < l; i++ ) {
6549
+ elem = elems[ i ];
6550
+
6551
+ if ( elem || elem === 0 ) {
6552
+
6553
+ // Add nodes directly
6554
+ if ( jQuery.type( elem ) === "object" ) {
6555
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
6556
+
6557
+ // Convert non-html into a text node
6558
+ } else if ( !rhtml.test( elem ) ) {
6559
+ nodes.push( context.createTextNode( elem ) );
6560
+
6561
+ // Convert html into DOM nodes
6562
+ } else {
6563
+ tmp = tmp || safe.appendChild( context.createElement("div") );
6564
+
6565
+ // Deserialize a standard representation
6566
+ tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
6567
+ wrap = wrapMap[ tag ] || wrapMap._default;
6568
+
6569
+ tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
6570
+
6571
+ // Descend through wrappers to the right content
6572
+ j = wrap[0];
6573
+ while ( j-- ) {
6574
+ tmp = tmp.lastChild;
6575
+ }
6576
+
6577
+ // Manually add leading whitespace removed by IE
6578
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
6579
+ nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
6580
+ }
6581
+
6582
+ // Remove IE's autoinserted <tbody> from table fragments
6583
+ if ( !jQuery.support.tbody ) {
6584
+
6585
+ // String was a <table>, *may* have spurious <tbody>
6586
+ elem = tag === "table" && !rtbody.test( elem ) ?
6587
+ tmp.firstChild :
6588
+
6589
+ // String was a bare <thead> or <tfoot>
6590
+ wrap[1] === "<table>" && !rtbody.test( elem ) ?
6591
+ tmp :
6592
+ 0;
6593
+
6594
+ j = elem && elem.childNodes.length;
6595
+ while ( j-- ) {
6596
+ if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
6597
+ elem.removeChild( tbody );
6598
+ }
6599
+ }
6600
+ }
6601
+
6602
+ jQuery.merge( nodes, tmp.childNodes );
6603
+
6604
+ // Fix #12392 for WebKit and IE > 9
6605
+ tmp.textContent = "";
6606
+
6607
+ // Fix #12392 for oldIE
6608
+ while ( tmp.firstChild ) {
6609
+ tmp.removeChild( tmp.firstChild );
6610
+ }
6611
+
6612
+ // Remember the top-level container for proper cleanup
6613
+ tmp = safe.lastChild;
6614
+ }
6615
+ }
6616
+ }
6617
+
6618
+ // Fix #11356: Clear elements from fragment
6619
+ if ( tmp ) {
6620
+ safe.removeChild( tmp );
6621
+ }
6622
+
6623
+ // Reset defaultChecked for any radios and checkboxes
6624
+ // about to be appended to the DOM in IE 6/7 (#8060)
6625
+ if ( !jQuery.support.appendChecked ) {
6626
+ jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
6627
+ }
6628
+
6629
+ i = 0;
6630
+ while ( (elem = nodes[ i++ ]) ) {
6631
+
6632
+ // #4087 - If origin and destination elements are the same, and this is
6633
+ // that element, do not do anything
6634
+ if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
6635
+ continue;
6636
+ }
6637
+
6638
+ contains = jQuery.contains( elem.ownerDocument, elem );
6639
+
6640
+ // Append to fragment
6641
+ tmp = getAll( safe.appendChild( elem ), "script" );
6642
+
6643
+ // Preserve script evaluation history
6644
+ if ( contains ) {
6645
+ setGlobalEval( tmp );
6646
+ }
6647
+
6648
+ // Capture executables
6649
+ if ( scripts ) {
6650
+ j = 0;
6651
+ while ( (elem = tmp[ j++ ]) ) {
6652
+ if ( rscriptType.test( elem.type || "" ) ) {
6653
+ scripts.push( elem );
6654
+ }
6655
+ }
6656
+ }
6657
+ }
6658
+
6659
+ tmp = null;
6660
+
6661
+ return safe;
6662
+ },
6663
+
6664
+ cleanData: function( elems, /* internal */ acceptData ) {
6665
+ var elem, type, id, data,
6666
+ i = 0,
6667
+ internalKey = jQuery.expando,
6668
+ cache = jQuery.cache,
6669
+ deleteExpando = jQuery.support.deleteExpando,
6670
+ special = jQuery.event.special;
6671
+
6672
+ for ( ; (elem = elems[i]) != null; i++ ) {
6673
+
6674
+ if ( acceptData || jQuery.acceptData( elem ) ) {
6675
+
6676
+ id = elem[ internalKey ];
6677
+ data = id && cache[ id ];
6678
+
6679
+ if ( data ) {
6680
+ if ( data.events ) {
6681
+ for ( type in data.events ) {
6682
+ if ( special[ type ] ) {
6683
+ jQuery.event.remove( elem, type );
6684
+
6685
+ // This is a shortcut to avoid jQuery.event.remove's overhead
6686
+ } else {
6687
+ jQuery.removeEvent( elem, type, data.handle );
6688
+ }
6689
+ }
6690
+ }
6691
+
6692
+ // Remove cache only if it was not already removed by jQuery.event.remove
6693
+ if ( cache[ id ] ) {
6694
+
6695
+ delete cache[ id ];
6696
+
6697
+ // IE does not allow us to delete expando properties from nodes,
6698
+ // nor does it have a removeAttribute function on Document nodes;
6699
+ // we must handle all of these cases
6700
+ if ( deleteExpando ) {
6701
+ delete elem[ internalKey ];
6702
+
6703
+ } else if ( typeof elem.removeAttribute !== core_strundefined ) {
6704
+ elem.removeAttribute( internalKey );
6705
+
6706
+ } else {
6707
+ elem[ internalKey ] = null;
6708
+ }
6709
+
6710
+ core_deletedIds.push( id );
6711
+ }
6712
+ }
6713
+ }
6714
+ }
6715
+ },
6716
+
6717
+ _evalUrl: function( url ) {
6718
+ return jQuery.ajax({
6719
+ url: url,
6720
+ type: "GET",
6721
+ dataType: "script",
6722
+ async: false,
6723
+ global: false,
6724
+ "throws": true
6725
+ });
6726
+ }
6727
+ });
6728
+ jQuery.fn.extend({
6729
+ wrapAll: function( html ) {
6730
+ if ( jQuery.isFunction( html ) ) {
6731
+ return this.each(function(i) {
6732
+ jQuery(this).wrapAll( html.call(this, i) );
6733
+ });
6734
+ }
6735
+
6736
+ if ( this[0] ) {
6737
+ // The elements to wrap the target around
6738
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
6739
+
6740
+ if ( this[0].parentNode ) {
6741
+ wrap.insertBefore( this[0] );
6742
+ }
6743
+
6744
+ wrap.map(function() {
6745
+ var elem = this;
6746
+
6747
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
6748
+ elem = elem.firstChild;
6749
+ }
6750
+
6751
+ return elem;
6752
+ }).append( this );
6753
+ }
6754
+
6755
+ return this;
6756
+ },
6757
+
6758
+ wrapInner: function( html ) {
6759
+ if ( jQuery.isFunction( html ) ) {
6760
+ return this.each(function(i) {
6761
+ jQuery(this).wrapInner( html.call(this, i) );
6762
+ });
6763
+ }
6764
+
6765
+ return this.each(function() {
6766
+ var self = jQuery( this ),
6767
+ contents = self.contents();
6768
+
6769
+ if ( contents.length ) {
6770
+ contents.wrapAll( html );
6771
+
6772
+ } else {
6773
+ self.append( html );
6774
+ }
6775
+ });
6776
+ },
6777
+
6778
+ wrap: function( html ) {
6779
+ var isFunction = jQuery.isFunction( html );
6780
+
6781
+ return this.each(function(i) {
6782
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
6783
+ });
6784
+ },
6785
+
6786
+ unwrap: function() {
6787
+ return this.parent().each(function() {
6788
+ if ( !jQuery.nodeName( this, "body" ) ) {
6789
+ jQuery( this ).replaceWith( this.childNodes );
6790
+ }
6791
+ }).end();
6792
+ }
6793
+ });
6794
+ var iframe, getStyles, curCSS,
6795
+ ralpha = /alpha\([^)]*\)/i,
6796
+ ropacity = /opacity\s*=\s*([^)]*)/,
6797
+ rposition = /^(top|right|bottom|left)$/,
6798
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
6799
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6800
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6801
+ rmargin = /^margin/,
6802
+ rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
6803
+ rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
6804
+ rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
6805
+ elemdisplay = { BODY: "block" },
6806
+
6807
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6808
+ cssNormalTransform = {
6809
+ letterSpacing: 0,
6810
+ fontWeight: 400
6811
+ },
6812
+
6813
+ cssExpand = [ "Top", "Right", "Bottom", "Left" ],
6814
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
6815
+
6816
+ // return a css property mapped to a potentially vendor prefixed property
6817
+ function vendorPropName( style, name ) {
6818
+
6819
+ // shortcut for names that are not vendor prefixed
6820
+ if ( name in style ) {
6821
+ return name;
6822
+ }
6823
+
6824
+ // check for vendor prefixed names
6825
+ var capName = name.charAt(0).toUpperCase() + name.slice(1),
6826
+ origName = name,
6827
+ i = cssPrefixes.length;
6828
+
6829
+ while ( i-- ) {
6830
+ name = cssPrefixes[ i ] + capName;
6831
+ if ( name in style ) {
6832
+ return name;
6833
+ }
6834
+ }
6835
+
6836
+ return origName;
6837
+ }
6838
+
6839
+ function isHidden( elem, el ) {
6840
+ // isHidden might be called from jQuery#filter function;
6841
+ // in that case, element will be second argument
6842
+ elem = el || elem;
6843
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
6844
+ }
6845
+
6846
+ function showHide( elements, show ) {
6847
+ var display, elem, hidden,
6848
+ values = [],
6849
+ index = 0,
6850
+ length = elements.length;
6851
+
6852
+ for ( ; index < length; index++ ) {
6853
+ elem = elements[ index ];
6854
+ if ( !elem.style ) {
6855
+ continue;
6856
+ }
6857
+
6858
+ values[ index ] = jQuery._data( elem, "olddisplay" );
6859
+ display = elem.style.display;
6860
+ if ( show ) {
6861
+ // Reset the inline display of this element to learn if it is
6862
+ // being hidden by cascaded rules or not
6863
+ if ( !values[ index ] && display === "none" ) {
6864
+ elem.style.display = "";
6865
+ }
6866
+
6867
+ // Set elements which have been overridden with display: none
6868
+ // in a stylesheet to whatever the default browser style is
6869
+ // for such an element
6870
+ if ( elem.style.display === "" && isHidden( elem ) ) {
6871
+ values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
6872
+ }
6873
+ } else {
6874
+
6875
+ if ( !values[ index ] ) {
6876
+ hidden = isHidden( elem );
6877
+
6878
+ if ( display && display !== "none" || !hidden ) {
6879
+ jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
6880
+ }
6881
+ }
6882
+ }
6883
+ }
6884
+
6885
+ // Set the display of most of the elements in a second loop
6886
+ // to avoid the constant reflow
6887
+ for ( index = 0; index < length; index++ ) {
6888
+ elem = elements[ index ];
6889
+ if ( !elem.style ) {
6890
+ continue;
6891
+ }
6892
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
6893
+ elem.style.display = show ? values[ index ] || "" : "none";
6894
+ }
6895
+ }
6896
+
6897
+ return elements;
6898
+ }
6899
+
6900
+ jQuery.fn.extend({
6901
+ css: function( name, value ) {
6902
+ return jQuery.access( this, function( elem, name, value ) {
6903
+ var len, styles,
6904
+ map = {},
6905
+ i = 0;
6906
+
6907
+ if ( jQuery.isArray( name ) ) {
6908
+ styles = getStyles( elem );
6909
+ len = name.length;
6910
+
6911
+ for ( ; i < len; i++ ) {
6912
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6913
+ }
6914
+
6915
+ return map;
6916
+ }
6917
+
6918
+ return value !== undefined ?
6919
+ jQuery.style( elem, name, value ) :
6920
+ jQuery.css( elem, name );
6921
+ }, name, value, arguments.length > 1 );
6922
+ },
6923
+ show: function() {
6924
+ return showHide( this, true );
6925
+ },
6926
+ hide: function() {
6927
+ return showHide( this );
6928
+ },
6929
+ toggle: function( state ) {
6930
+ if ( typeof state === "boolean" ) {
6931
+ return state ? this.show() : this.hide();
6932
+ }
6933
+
6934
+ return this.each(function() {
6935
+ if ( isHidden( this ) ) {
6936
+ jQuery( this ).show();
6937
+ } else {
6938
+ jQuery( this ).hide();
6939
+ }
6940
+ });
6941
+ }
6942
+ });
6943
+
6944
+ jQuery.extend({
6945
+ // Add in style property hooks for overriding the default
6946
+ // behavior of getting and setting a style property
6947
+ cssHooks: {
6948
+ opacity: {
6949
+ get: function( elem, computed ) {
6950
+ if ( computed ) {
6951
+ // We should always get a number back from opacity
6952
+ var ret = curCSS( elem, "opacity" );
6953
+ return ret === "" ? "1" : ret;
6954
+ }
6955
+ }
6956
+ }
6957
+ },
6958
+
6959
+ // Don't automatically add "px" to these possibly-unitless properties
6960
+ cssNumber: {
6961
+ "columnCount": true,
6962
+ "fillOpacity": true,
6963
+ "fontWeight": true,
6964
+ "lineHeight": true,
6965
+ "opacity": true,
6966
+ "order": true,
6967
+ "orphans": true,
6968
+ "widows": true,
6969
+ "zIndex": true,
6970
+ "zoom": true
6971
+ },
6972
+
6973
+ // Add in properties whose names you wish to fix before
6974
+ // setting or getting the value
6975
+ cssProps: {
6976
+ // normalize float css property
6977
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
6978
+ },
6979
+
6980
+ // Get and set the style property on a DOM Node
6981
+ style: function( elem, name, value, extra ) {
6982
+ // Don't set styles on text and comment nodes
6983
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6984
+ return;
6985
+ }
6986
+
6987
+ // Make sure that we're working with the right name
6988
+ var ret, type, hooks,
6989
+ origName = jQuery.camelCase( name ),
6990
+ style = elem.style;
6991
+
6992
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
6993
+
6994
+ // gets hook for the prefixed version
6995
+ // followed by the unprefixed version
6996
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6997
+
6998
+ // Check if we're setting a value
6999
+ if ( value !== undefined ) {
7000
+ type = typeof value;
7001
+
7002
+ // convert relative number strings (+= or -=) to relative numbers. #7345
7003
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
7004
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
7005
+ // Fixes bug #9237
7006
+ type = "number";
7007
+ }
7008
+
7009
+ // Make sure that NaN and null values aren't set. See: #7116
7010
+ if ( value == null || type === "number" && isNaN( value ) ) {
7011
+ return;
7012
+ }
7013
+
7014
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
7015
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
7016
+ value += "px";
7017
+ }
7018
+
7019
+ // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
7020
+ // but it would mean to define eight (for every problematic property) identical functions
7021
+ if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
7022
+ style[ name ] = "inherit";
7023
+ }
7024
+
7025
+ // If a hook was provided, use that value, otherwise just set the specified value
7026
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
7027
+
7028
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
7029
+ // Fixes bug #5509
7030
+ try {
7031
+ style[ name ] = value;
7032
+ } catch(e) {}
7033
+ }
7034
+
7035
+ } else {
7036
+ // If a hook was provided get the non-computed value from there
7037
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
7038
+ return ret;
7039
+ }
7040
+
7041
+ // Otherwise just get the value from the style object
7042
+ return style[ name ];
7043
+ }
7044
+ },
7045
+
7046
+ css: function( elem, name, extra, styles ) {
7047
+ var num, val, hooks,
7048
+ origName = jQuery.camelCase( name );
7049
+
7050
+ // Make sure that we're working with the right name
7051
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
7052
+
7053
+ // gets hook for the prefixed version
7054
+ // followed by the unprefixed version
7055
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
7056
+
7057
+ // If a hook was provided get the computed value from there
7058
+ if ( hooks && "get" in hooks ) {
7059
+ val = hooks.get( elem, true, extra );
7060
+ }
7061
+
7062
+ // Otherwise, if a way to get the computed value exists, use that
7063
+ if ( val === undefined ) {
7064
+ val = curCSS( elem, name, styles );
7065
+ }
7066
+
7067
+ //convert "normal" to computed value
7068
+ if ( val === "normal" && name in cssNormalTransform ) {
7069
+ val = cssNormalTransform[ name ];
7070
+ }
7071
+
7072
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
7073
+ if ( extra === "" || extra ) {
7074
+ num = parseFloat( val );
7075
+ return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
7076
+ }
7077
+ return val;
7078
+ }
7079
+ });
7080
+
7081
+ // NOTE: we've included the "window" in window.getComputedStyle
7082
+ // because jsdom on node.js will break without it.
7083
+ if ( window.getComputedStyle ) {
7084
+ getStyles = function( elem ) {
7085
+ return window.getComputedStyle( elem, null );
7086
+ };
7087
+
7088
+ curCSS = function( elem, name, _computed ) {
7089
+ var width, minWidth, maxWidth,
7090
+ computed = _computed || getStyles( elem ),
7091
+
7092
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
7093
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
7094
+ style = elem.style;
7095
+
7096
+ if ( computed ) {
7097
+
7098
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
7099
+ ret = jQuery.style( elem, name );
7100
+ }
7101
+
7102
+ // A tribute to the "awesome hack by Dean Edwards"
7103
+ // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
7104
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
7105
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
7106
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
7107
+
7108
+ // Remember the original values
7109
+ width = style.width;
7110
+ minWidth = style.minWidth;
7111
+ maxWidth = style.maxWidth;
7112
+
7113
+ // Put in the new values to get a computed value out
7114
+ style.minWidth = style.maxWidth = style.width = ret;
7115
+ ret = computed.width;
7116
+
7117
+ // Revert the changed values
7118
+ style.width = width;
7119
+ style.minWidth = minWidth;
7120
+ style.maxWidth = maxWidth;
7121
+ }
7122
+ }
7123
+
7124
+ return ret;
7125
+ };
7126
+ } else if ( document.documentElement.currentStyle ) {
7127
+ getStyles = function( elem ) {
7128
+ return elem.currentStyle;
7129
+ };
7130
+
7131
+ curCSS = function( elem, name, _computed ) {
7132
+ var left, rs, rsLeft,
7133
+ computed = _computed || getStyles( elem ),
7134
+ ret = computed ? computed[ name ] : undefined,
7135
+ style = elem.style;
7136
+
7137
+ // Avoid setting ret to empty string here
7138
+ // so we don't default to auto
7139
+ if ( ret == null && style && style[ name ] ) {
7140
+ ret = style[ name ];
7141
+ }
7142
+
7143
+ // From the awesome hack by Dean Edwards
7144
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
7145
+
7146
+ // If we're not dealing with a regular pixel number
7147
+ // but a number that has a weird ending, we need to convert it to pixels
7148
+ // but not position css attributes, as those are proportional to the parent element instead
7149
+ // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
7150
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
7151
+
7152
+ // Remember the original values
7153
+ left = style.left;
7154
+ rs = elem.runtimeStyle;
7155
+ rsLeft = rs && rs.left;
7156
+
7157
+ // Put in the new values to get a computed value out
7158
+ if ( rsLeft ) {
7159
+ rs.left = elem.currentStyle.left;
7160
+ }
7161
+ style.left = name === "fontSize" ? "1em" : ret;
7162
+ ret = style.pixelLeft + "px";
7163
+
7164
+ // Revert the changed values
7165
+ style.left = left;
7166
+ if ( rsLeft ) {
7167
+ rs.left = rsLeft;
7168
+ }
7169
+ }
7170
+
7171
+ return ret === "" ? "auto" : ret;
7172
+ };
7173
+ }
7174
+
7175
+ function setPositiveNumber( elem, value, subtract ) {
7176
+ var matches = rnumsplit.exec( value );
7177
+ return matches ?
7178
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
7179
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
7180
+ value;
7181
+ }
7182
+
7183
+ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
7184
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
7185
+ // If we already have the right measurement, avoid augmentation
7186
+ 4 :
7187
+ // Otherwise initialize for horizontal or vertical properties
7188
+ name === "width" ? 1 : 0,
7189
+
7190
+ val = 0;
7191
+
7192
+ for ( ; i < 4; i += 2 ) {
7193
+ // both box models exclude margin, so add it if we want it
7194
+ if ( extra === "margin" ) {
7195
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
7196
+ }
7197
+
7198
+ if ( isBorderBox ) {
7199
+ // border-box includes padding, so remove it if we want content
7200
+ if ( extra === "content" ) {
7201
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
7202
+ }
7203
+
7204
+ // at this point, extra isn't border nor margin, so remove border
7205
+ if ( extra !== "margin" ) {
7206
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
7207
+ }
7208
+ } else {
7209
+ // at this point, extra isn't content, so add padding
7210
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
7211
+
7212
+ // at this point, extra isn't content nor padding, so add border
7213
+ if ( extra !== "padding" ) {
7214
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
7215
+ }
7216
+ }
7217
+ }
7218
+
7219
+ return val;
7220
+ }
7221
+
7222
+ function getWidthOrHeight( elem, name, extra ) {
7223
+
7224
+ // Start with offset property, which is equivalent to the border-box value
7225
+ var valueIsBorderBox = true,
7226
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
7227
+ styles = getStyles( elem ),
7228
+ isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
7229
+
7230
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
7231
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
7232
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
7233
+ if ( val <= 0 || val == null ) {
7234
+ // Fall back to computed then uncomputed css if necessary
7235
+ val = curCSS( elem, name, styles );
7236
+ if ( val < 0 || val == null ) {
7237
+ val = elem.style[ name ];
7238
+ }
7239
+
7240
+ // Computed unit is not pixels. Stop here and return.
7241
+ if ( rnumnonpx.test(val) ) {
7242
+ return val;
7243
+ }
7244
+
7245
+ // we need the check for style in case a browser which returns unreliable values
7246
+ // for getComputedStyle silently falls back to the reliable elem.style
7247
+ valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
7248
+
7249
+ // Normalize "", auto, and prepare for extra
7250
+ val = parseFloat( val ) || 0;
7251
+ }
7252
+
7253
+ // use the active box-sizing model to add/subtract irrelevant styles
7254
+ return ( val +
7255
+ augmentWidthOrHeight(
7256
+ elem,
7257
+ name,
7258
+ extra || ( isBorderBox ? "border" : "content" ),
7259
+ valueIsBorderBox,
7260
+ styles
7261
+ )
7262
+ ) + "px";
7263
+ }
7264
+
7265
+ // Try to determine the default display value of an element
7266
+ function css_defaultDisplay( nodeName ) {
7267
+ var doc = document,
7268
+ display = elemdisplay[ nodeName ];
7269
+
7270
+ if ( !display ) {
7271
+ display = actualDisplay( nodeName, doc );
7272
+
7273
+ // If the simple way fails, read from inside an iframe
7274
+ if ( display === "none" || !display ) {
7275
+ // Use the already-created iframe if possible
7276
+ iframe = ( iframe ||
7277
+ jQuery("<iframe frameborder='0' width='0' height='0'/>")
7278
+ .css( "cssText", "display:block !important" )
7279
+ ).appendTo( doc.documentElement );
7280
+
7281
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
7282
+ doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
7283
+ doc.write("<!doctype html><html><body>");
7284
+ doc.close();
7285
+
7286
+ display = actualDisplay( nodeName, doc );
7287
+ iframe.detach();
7288
+ }
7289
+
7290
+ // Store the correct default display
7291
+ elemdisplay[ nodeName ] = display;
7292
+ }
7293
+
7294
+ return display;
7295
+ }
7296
+
7297
+ // Called ONLY from within css_defaultDisplay
7298
+ function actualDisplay( name, doc ) {
7299
+ var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
7300
+ display = jQuery.css( elem[0], "display" );
7301
+ elem.remove();
7302
+ return display;
7303
+ }
7304
+
7305
+ jQuery.each([ "height", "width" ], function( i, name ) {
7306
+ jQuery.cssHooks[ name ] = {
7307
+ get: function( elem, computed, extra ) {
7308
+ if ( computed ) {
7309
+ // certain elements can have dimension info if we invisibly show them
7310
+ // however, it must have a current display style that would benefit from this
7311
+ return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
7312
+ jQuery.swap( elem, cssShow, function() {
7313
+ return getWidthOrHeight( elem, name, extra );
7314
+ }) :
7315
+ getWidthOrHeight( elem, name, extra );
7316
+ }
7317
+ },
7318
+
7319
+ set: function( elem, value, extra ) {
7320
+ var styles = extra && getStyles( elem );
7321
+ return setPositiveNumber( elem, value, extra ?
7322
+ augmentWidthOrHeight(
7323
+ elem,
7324
+ name,
7325
+ extra,
7326
+ jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
7327
+ styles
7328
+ ) : 0
7329
+ );
7330
+ }
7331
+ };
7332
+ });
7333
+
7334
+ if ( !jQuery.support.opacity ) {
7335
+ jQuery.cssHooks.opacity = {
7336
+ get: function( elem, computed ) {
7337
+ // IE uses filters for opacity
7338
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
7339
+ ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
7340
+ computed ? "1" : "";
7341
+ },
7342
+
7343
+ set: function( elem, value ) {
7344
+ var style = elem.style,
7345
+ currentStyle = elem.currentStyle,
7346
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
7347
+ filter = currentStyle && currentStyle.filter || style.filter || "";
7348
+
7349
+ // IE has trouble with opacity if it does not have layout
7350
+ // Force it by setting the zoom level
7351
+ style.zoom = 1;
7352
+
7353
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
7354
+ // if value === "", then remove inline opacity #12685
7355
+ if ( ( value >= 1 || value === "" ) &&
7356
+ jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
7357
+ style.removeAttribute ) {
7358
+
7359
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
7360
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
7361
+ // style.removeAttribute is IE Only, but so apparently is this code path...
7362
+ style.removeAttribute( "filter" );
7363
+
7364
+ // if there is no filter style applied in a css rule or unset inline opacity, we are done
7365
+ if ( value === "" || currentStyle && !currentStyle.filter ) {
7366
+ return;
7367
+ }
7368
+ }
7369
+
7370
+ // otherwise, set new filter values
7371
+ style.filter = ralpha.test( filter ) ?
7372
+ filter.replace( ralpha, opacity ) :
7373
+ filter + " " + opacity;
7374
+ }
7375
+ };
7376
+ }
7377
+
7378
+ // These hooks cannot be added until DOM ready because the support test
7379
+ // for it is not run until after DOM ready
7380
+ jQuery(function() {
7381
+ if ( !jQuery.support.reliableMarginRight ) {
7382
+ jQuery.cssHooks.marginRight = {
7383
+ get: function( elem, computed ) {
7384
+ if ( computed ) {
7385
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
7386
+ // Work around by temporarily setting element display to inline-block
7387
+ return jQuery.swap( elem, { "display": "inline-block" },
7388
+ curCSS, [ elem, "marginRight" ] );
7389
+ }
7390
+ }
7391
+ };
7392
+ }
7393
+
7394
+ // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
7395
+ // getComputedStyle returns percent when specified for top/left/bottom/right
7396
+ // rather than make the css module depend on the offset module, we just check for it here
7397
+ if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
7398
+ jQuery.each( [ "top", "left" ], function( i, prop ) {
7399
+ jQuery.cssHooks[ prop ] = {
7400
+ get: function( elem, computed ) {
7401
+ if ( computed ) {
7402
+ computed = curCSS( elem, prop );
7403
+ // if curCSS returns percentage, fallback to offset
7404
+ return rnumnonpx.test( computed ) ?
7405
+ jQuery( elem ).position()[ prop ] + "px" :
7406
+ computed;
7407
+ }
7408
+ }
7409
+ };
7410
+ });
7411
+ }
7412
+
7413
+ });
7414
+
7415
+ if ( jQuery.expr && jQuery.expr.filters ) {
7416
+ jQuery.expr.filters.hidden = function( elem ) {
7417
+ // Support: Opera <= 12.12
7418
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
7419
+ return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
7420
+ (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
7421
+ };
7422
+
7423
+ jQuery.expr.filters.visible = function( elem ) {
7424
+ return !jQuery.expr.filters.hidden( elem );
7425
+ };
7426
+ }
7427
+
7428
+ // These hooks are used by animate to expand properties
7429
+ jQuery.each({
7430
+ margin: "",
7431
+ padding: "",
7432
+ border: "Width"
7433
+ }, function( prefix, suffix ) {
7434
+ jQuery.cssHooks[ prefix + suffix ] = {
7435
+ expand: function( value ) {
7436
+ var i = 0,
7437
+ expanded = {},
7438
+
7439
+ // assumes a single number if not a string
7440
+ parts = typeof value === "string" ? value.split(" ") : [ value ];
7441
+
7442
+ for ( ; i < 4; i++ ) {
7443
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
7444
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
7445
+ }
7446
+
7447
+ return expanded;
7448
+ }
7449
+ };
7450
+
7451
+ if ( !rmargin.test( prefix ) ) {
7452
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
7453
+ }
7454
+ });
7455
+ var r20 = /%20/g,
7456
+ rbracket = /\[\]$/,
7457
+ rCRLF = /\r?\n/g,
7458
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
7459
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
7460
+
7461
+ jQuery.fn.extend({
7462
+ serialize: function() {
7463
+ return jQuery.param( this.serializeArray() );
7464
+ },
7465
+ serializeArray: function() {
7466
+ return this.map(function(){
7467
+ // Can add propHook for "elements" to filter or add form elements
7468
+ var elements = jQuery.prop( this, "elements" );
7469
+ return elements ? jQuery.makeArray( elements ) : this;
7470
+ })
7471
+ .filter(function(){
7472
+ var type = this.type;
7473
+ // Use .is(":disabled") so that fieldset[disabled] works
7474
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
7475
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
7476
+ ( this.checked || !manipulation_rcheckableType.test( type ) );
7477
+ })
7478
+ .map(function( i, elem ){
7479
+ var val = jQuery( this ).val();
7480
+
7481
+ return val == null ?
7482
+ null :
7483
+ jQuery.isArray( val ) ?
7484
+ jQuery.map( val, function( val ){
7485
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7486
+ }) :
7487
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7488
+ }).get();
7489
+ }
7490
+ });
7491
+
7492
+ //Serialize an array of form elements or a set of
7493
+ //key/values into a query string
7494
+ jQuery.param = function( a, traditional ) {
7495
+ var prefix,
7496
+ s = [],
7497
+ add = function( key, value ) {
7498
+ // If value is a function, invoke it and return its value
7499
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
7500
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
7501
+ };
7502
+
7503
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
7504
+ if ( traditional === undefined ) {
7505
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
7506
+ }
7507
+
7508
+ // If an array was passed in, assume that it is an array of form elements.
7509
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
7510
+ // Serialize the form elements
7511
+ jQuery.each( a, function() {
7512
+ add( this.name, this.value );
7513
+ });
7514
+
7515
+ } else {
7516
+ // If traditional, encode the "old" way (the way 1.3.2 or older
7517
+ // did it), otherwise encode params recursively.
7518
+ for ( prefix in a ) {
7519
+ buildParams( prefix, a[ prefix ], traditional, add );
7520
+ }
7521
+ }
7522
+
7523
+ // Return the resulting serialization
7524
+ return s.join( "&" ).replace( r20, "+" );
7525
+ };
7526
+
7527
+ function buildParams( prefix, obj, traditional, add ) {
7528
+ var name;
7529
+
7530
+ if ( jQuery.isArray( obj ) ) {
7531
+ // Serialize array item.
7532
+ jQuery.each( obj, function( i, v ) {
7533
+ if ( traditional || rbracket.test( prefix ) ) {
7534
+ // Treat each array item as a scalar.
7535
+ add( prefix, v );
7536
+
7537
+ } else {
7538
+ // Item is non-scalar (array or object), encode its numeric index.
7539
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
7540
+ }
7541
+ });
7542
+
7543
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
7544
+ // Serialize object item.
7545
+ for ( name in obj ) {
7546
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
7547
+ }
7548
+
7549
+ } else {
7550
+ // Serialize scalar item.
7551
+ add( prefix, obj );
7552
+ }
7553
+ }
7554
+ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
7555
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
7556
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
7557
+
7558
+ // Handle event binding
7559
+ jQuery.fn[ name ] = function( data, fn ) {
7560
+ return arguments.length > 0 ?
7561
+ this.on( name, null, data, fn ) :
7562
+ this.trigger( name );
7563
+ };
7564
+ });
7565
+
7566
+ jQuery.fn.extend({
7567
+ hover: function( fnOver, fnOut ) {
7568
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
7569
+ },
7570
+
7571
+ bind: function( types, data, fn ) {
7572
+ return this.on( types, null, data, fn );
7573
+ },
7574
+ unbind: function( types, fn ) {
7575
+ return this.off( types, null, fn );
7576
+ },
7577
+
7578
+ delegate: function( selector, types, data, fn ) {
7579
+ return this.on( types, selector, data, fn );
7580
+ },
7581
+ undelegate: function( selector, types, fn ) {
7582
+ // ( namespace ) or ( selector, types [, fn] )
7583
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
7584
+ }
7585
+ });
7586
+ var
7587
+ // Document location
7588
+ ajaxLocParts,
7589
+ ajaxLocation,
7590
+ ajax_nonce = jQuery.now(),
7591
+
7592
+ ajax_rquery = /\?/,
7593
+ rhash = /#.*$/,
7594
+ rts = /([?&])_=[^&]*/,
7595
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
7596
+ // #7653, #8125, #8152: local protocol detection
7597
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
7598
+ rnoContent = /^(?:GET|HEAD)$/,
7599
+ rprotocol = /^\/\//,
7600
+ rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
7601
+
7602
+ // Keep a copy of the old load method
7603
+ _load = jQuery.fn.load,
7604
+
7605
+ /* Prefilters
7606
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
7607
+ * 2) These are called:
7608
+ * - BEFORE asking for a transport
7609
+ * - AFTER param serialization (s.data is a string if s.processData is true)
7610
+ * 3) key is the dataType
7611
+ * 4) the catchall symbol "*" can be used
7612
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
7613
+ */
7614
+ prefilters = {},
7615
+
7616
+ /* Transports bindings
7617
+ * 1) key is the dataType
7618
+ * 2) the catchall symbol "*" can be used
7619
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
7620
+ */
7621
+ transports = {},
7622
+
7623
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
7624
+ allTypes = "*/".concat("*");
7625
+
7626
+ // #8138, IE may throw an exception when accessing
7627
+ // a field from window.location if document.domain has been set
7628
+ try {
7629
+ ajaxLocation = location.href;
7630
+ } catch( e ) {
7631
+ // Use the href attribute of an A element
7632
+ // since IE will modify it given document.location
7633
+ ajaxLocation = document.createElement( "a" );
7634
+ ajaxLocation.href = "";
7635
+ ajaxLocation = ajaxLocation.href;
7636
+ }
7637
+
7638
+ // Segment location into parts
7639
+ ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
7640
+
7641
+ // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
7642
+ function addToPrefiltersOrTransports( structure ) {
7643
+
7644
+ // dataTypeExpression is optional and defaults to "*"
7645
+ return function( dataTypeExpression, func ) {
7646
+
7647
+ if ( typeof dataTypeExpression !== "string" ) {
7648
+ func = dataTypeExpression;
7649
+ dataTypeExpression = "*";
7650
+ }
7651
+
7652
+ var dataType,
7653
+ i = 0,
7654
+ dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
7655
+
7656
+ if ( jQuery.isFunction( func ) ) {
7657
+ // For each dataType in the dataTypeExpression
7658
+ while ( (dataType = dataTypes[i++]) ) {
7659
+ // Prepend if requested
7660
+ if ( dataType[0] === "+" ) {
7661
+ dataType = dataType.slice( 1 ) || "*";
7662
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
7663
+
7664
+ // Otherwise append
7665
+ } else {
7666
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
7667
+ }
7668
+ }
7669
+ }
7670
+ };
7671
+ }
7672
+
7673
+ // Base inspection function for prefilters and transports
7674
+ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
7675
+
7676
+ var inspected = {},
7677
+ seekingTransport = ( structure === transports );
7678
+
7679
+ function inspect( dataType ) {
7680
+ var selected;
7681
+ inspected[ dataType ] = true;
7682
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
7683
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
7684
+ if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
7685
+ options.dataTypes.unshift( dataTypeOrTransport );
7686
+ inspect( dataTypeOrTransport );
7687
+ return false;
7688
+ } else if ( seekingTransport ) {
7689
+ return !( selected = dataTypeOrTransport );
7690
+ }
7691
+ });
7692
+ return selected;
7693
+ }
7694
+
7695
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
7696
+ }
7697
+
7698
+ // A special extend for ajax options
7699
+ // that takes "flat" options (not to be deep extended)
7700
+ // Fixes #9887
7701
+ function ajaxExtend( target, src ) {
7702
+ var deep, key,
7703
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
7704
+
7705
+ for ( key in src ) {
7706
+ if ( src[ key ] !== undefined ) {
7707
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
7708
+ }
7709
+ }
7710
+ if ( deep ) {
7711
+ jQuery.extend( true, target, deep );
7712
+ }
7713
+
7714
+ return target;
7715
+ }
7716
+
7717
+ jQuery.fn.load = function( url, params, callback ) {
7718
+ if ( typeof url !== "string" && _load ) {
7719
+ return _load.apply( this, arguments );
7720
+ }
7721
+
7722
+ var selector, response, type,
7723
+ self = this,
7724
+ off = url.indexOf(" ");
7725
+
7726
+ if ( off >= 0 ) {
7727
+ selector = url.slice( off, url.length );
7728
+ url = url.slice( 0, off );
7729
+ }
7730
+
7731
+ // If it's a function
7732
+ if ( jQuery.isFunction( params ) ) {
7733
+
7734
+ // We assume that it's the callback
7735
+ callback = params;
7736
+ params = undefined;
7737
+
7738
+ // Otherwise, build a param string
7739
+ } else if ( params && typeof params === "object" ) {
7740
+ type = "POST";
7741
+ }
7742
+
7743
+ // If we have elements to modify, make the request
7744
+ if ( self.length > 0 ) {
7745
+ jQuery.ajax({
7746
+ url: url,
7747
+
7748
+ // if "type" variable is undefined, then "GET" method will be used
7749
+ type: type,
7750
+ dataType: "html",
7751
+ data: params
7752
+ }).done(function( responseText ) {
7753
+
7754
+ // Save response for use in complete callback
7755
+ response = arguments;
7756
+
7757
+ self.html( selector ?
7758
+
7759
+ // If a selector was specified, locate the right elements in a dummy div
7760
+ // Exclude scripts to avoid IE 'Permission Denied' errors
7761
+ jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
7762
+
7763
+ // Otherwise use the full result
7764
+ responseText );
7765
+
7766
+ }).complete( callback && function( jqXHR, status ) {
7767
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
7768
+ });
7769
+ }
7770
+
7771
+ return this;
7772
+ };
7773
+
7774
+ // Attach a bunch of functions for handling common AJAX events
7775
+ jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
7776
+ jQuery.fn[ type ] = function( fn ){
7777
+ return this.on( type, fn );
7778
+ };
7779
+ });
7780
+
7781
+ jQuery.extend({
7782
+
7783
+ // Counter for holding the number of active queries
7784
+ active: 0,
7785
+
7786
+ // Last-Modified header cache for next request
7787
+ lastModified: {},
7788
+ etag: {},
7789
+
7790
+ ajaxSettings: {
7791
+ url: ajaxLocation,
7792
+ type: "GET",
7793
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
7794
+ global: true,
7795
+ processData: true,
7796
+ async: true,
7797
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
7798
+ /*
7799
+ timeout: 0,
7800
+ data: null,
7801
+ dataType: null,
7802
+ username: null,
7803
+ password: null,
7804
+ cache: null,
7805
+ throws: false,
7806
+ traditional: false,
7807
+ headers: {},
7808
+ */
7809
+
7810
+ accepts: {
7811
+ "*": allTypes,
7812
+ text: "text/plain",
7813
+ html: "text/html",
7814
+ xml: "application/xml, text/xml",
7815
+ json: "application/json, text/javascript"
7816
+ },
7817
+
7818
+ contents: {
7819
+ xml: /xml/,
7820
+ html: /html/,
7821
+ json: /json/
7822
+ },
7823
+
7824
+ responseFields: {
7825
+ xml: "responseXML",
7826
+ text: "responseText",
7827
+ json: "responseJSON"
7828
+ },
7829
+
7830
+ // Data converters
7831
+ // Keys separate source (or catchall "*") and destination types with a single space
7832
+ converters: {
7833
+
7834
+ // Convert anything to text
7835
+ "* text": String,
7836
+
7837
+ // Text to html (true = no transformation)
7838
+ "text html": true,
7839
+
7840
+ // Evaluate text as a json expression
7841
+ "text json": jQuery.parseJSON,
7842
+
7843
+ // Parse text as xml
7844
+ "text xml": jQuery.parseXML
7845
+ },
7846
+
7847
+ // For options that shouldn't be deep extended:
7848
+ // you can add your own custom options here if
7849
+ // and when you create one that shouldn't be
7850
+ // deep extended (see ajaxExtend)
7851
+ flatOptions: {
7852
+ url: true,
7853
+ context: true
7854
+ }
7855
+ },
7856
+
7857
+ // Creates a full fledged settings object into target
7858
+ // with both ajaxSettings and settings fields.
7859
+ // If target is omitted, writes into ajaxSettings.
7860
+ ajaxSetup: function( target, settings ) {
7861
+ return settings ?
7862
+
7863
+ // Building a settings object
7864
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
7865
+
7866
+ // Extending ajaxSettings
7867
+ ajaxExtend( jQuery.ajaxSettings, target );
7868
+ },
7869
+
7870
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
7871
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
7872
+
7873
+ // Main method
7874
+ ajax: function( url, options ) {
7875
+
7876
+ // If url is an object, simulate pre-1.5 signature
7877
+ if ( typeof url === "object" ) {
7878
+ options = url;
7879
+ url = undefined;
7880
+ }
7881
+
7882
+ // Force options to be an object
7883
+ options = options || {};
7884
+
7885
+ var // Cross-domain detection vars
7886
+ parts,
7887
+ // Loop variable
7888
+ i,
7889
+ // URL without anti-cache param
7890
+ cacheURL,
7891
+ // Response headers as string
7892
+ responseHeadersString,
7893
+ // timeout handle
7894
+ timeoutTimer,
7895
+
7896
+ // To know if global events are to be dispatched
7897
+ fireGlobals,
7898
+
7899
+ transport,
7900
+ // Response headers
7901
+ responseHeaders,
7902
+ // Create the final options object
7903
+ s = jQuery.ajaxSetup( {}, options ),
7904
+ // Callbacks context
7905
+ callbackContext = s.context || s,
7906
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
7907
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
7908
+ jQuery( callbackContext ) :
7909
+ jQuery.event,
7910
+ // Deferreds
7911
+ deferred = jQuery.Deferred(),
7912
+ completeDeferred = jQuery.Callbacks("once memory"),
7913
+ // Status-dependent callbacks
7914
+ statusCode = s.statusCode || {},
7915
+ // Headers (they are sent all at once)
7916
+ requestHeaders = {},
7917
+ requestHeadersNames = {},
7918
+ // The jqXHR state
7919
+ state = 0,
7920
+ // Default abort message
7921
+ strAbort = "canceled",
7922
+ // Fake xhr
7923
+ jqXHR = {
7924
+ readyState: 0,
7925
+
7926
+ // Builds headers hashtable if needed
7927
+ getResponseHeader: function( key ) {
7928
+ var match;
7929
+ if ( state === 2 ) {
7930
+ if ( !responseHeaders ) {
7931
+ responseHeaders = {};
7932
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
7933
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
7934
+ }
7935
+ }
7936
+ match = responseHeaders[ key.toLowerCase() ];
7937
+ }
7938
+ return match == null ? null : match;
7939
+ },
7940
+
7941
+ // Raw string
7942
+ getAllResponseHeaders: function() {
7943
+ return state === 2 ? responseHeadersString : null;
7944
+ },
7945
+
7946
+ // Caches the header
7947
+ setRequestHeader: function( name, value ) {
7948
+ var lname = name.toLowerCase();
7949
+ if ( !state ) {
7950
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
7951
+ requestHeaders[ name ] = value;
7952
+ }
7953
+ return this;
7954
+ },
7955
+
7956
+ // Overrides response content-type header
7957
+ overrideMimeType: function( type ) {
7958
+ if ( !state ) {
7959
+ s.mimeType = type;
7960
+ }
7961
+ return this;
7962
+ },
7963
+
7964
+ // Status-dependent callbacks
7965
+ statusCode: function( map ) {
7966
+ var code;
7967
+ if ( map ) {
7968
+ if ( state < 2 ) {
7969
+ for ( code in map ) {
7970
+ // Lazy-add the new callback in a way that preserves old ones
7971
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
7972
+ }
7973
+ } else {
7974
+ // Execute the appropriate callbacks
7975
+ jqXHR.always( map[ jqXHR.status ] );
7976
+ }
7977
+ }
7978
+ return this;
7979
+ },
7980
+
7981
+ // Cancel the request
7982
+ abort: function( statusText ) {
7983
+ var finalText = statusText || strAbort;
7984
+ if ( transport ) {
7985
+ transport.abort( finalText );
7986
+ }
7987
+ done( 0, finalText );
7988
+ return this;
7989
+ }
7990
+ };
7991
+
7992
+ // Attach deferreds
7993
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
7994
+ jqXHR.success = jqXHR.done;
7995
+ jqXHR.error = jqXHR.fail;
7996
+
7997
+ // Remove hash character (#7531: and string promotion)
7998
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
7999
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
8000
+ // We also use the url parameter if available
8001
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
8002
+
8003
+ // Alias method option to type as per ticket #12004
8004
+ s.type = options.method || options.type || s.method || s.type;
8005
+
8006
+ // Extract dataTypes list
8007
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
8008
+
8009
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
8010
+ if ( s.crossDomain == null ) {
8011
+ parts = rurl.exec( s.url.toLowerCase() );
8012
+ s.crossDomain = !!( parts &&
8013
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
8014
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
8015
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
8016
+ );
8017
+ }
8018
+
8019
+ // Convert data if not already a string
8020
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
8021
+ s.data = jQuery.param( s.data, s.traditional );
8022
+ }
8023
+
8024
+ // Apply prefilters
8025
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
8026
+
8027
+ // If request was aborted inside a prefilter, stop there
8028
+ if ( state === 2 ) {
8029
+ return jqXHR;
8030
+ }
8031
+
8032
+ // We can fire global events as of now if asked to
8033
+ fireGlobals = s.global;
8034
+
8035
+ // Watch for a new set of requests
8036
+ if ( fireGlobals && jQuery.active++ === 0 ) {
8037
+ jQuery.event.trigger("ajaxStart");
8038
+ }
8039
+
8040
+ // Uppercase the type
8041
+ s.type = s.type.toUpperCase();
8042
+
8043
+ // Determine if request has content
8044
+ s.hasContent = !rnoContent.test( s.type );
8045
+
8046
+ // Save the URL in case we're toying with the If-Modified-Since
8047
+ // and/or If-None-Match header later on
8048
+ cacheURL = s.url;
8049
+
8050
+ // More options handling for requests with no content
8051
+ if ( !s.hasContent ) {
8052
+
8053
+ // If data is available, append data to url
8054
+ if ( s.data ) {
8055
+ cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
8056
+ // #9682: remove data so that it's not used in an eventual retry
8057
+ delete s.data;
8058
+ }
8059
+
8060
+ // Add anti-cache in url if needed
8061
+ if ( s.cache === false ) {
8062
+ s.url = rts.test( cacheURL ) ?
8063
+
8064
+ // If there is already a '_' parameter, set its value
8065
+ cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
8066
+
8067
+ // Otherwise add one to the end
8068
+ cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
8069
+ }
8070
+ }
8071
+
8072
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8073
+ if ( s.ifModified ) {
8074
+ if ( jQuery.lastModified[ cacheURL ] ) {
8075
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
8076
+ }
8077
+ if ( jQuery.etag[ cacheURL ] ) {
8078
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
8079
+ }
8080
+ }
8081
+
8082
+ // Set the correct header, if data is being sent
8083
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
8084
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
8085
+ }
8086
+
8087
+ // Set the Accepts header for the server, depending on the dataType
8088
+ jqXHR.setRequestHeader(
8089
+ "Accept",
8090
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
8091
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
8092
+ s.accepts[ "*" ]
8093
+ );
8094
+
8095
+ // Check for headers option
8096
+ for ( i in s.headers ) {
8097
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
8098
+ }
8099
+
8100
+ // Allow custom headers/mimetypes and early abort
8101
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
8102
+ // Abort if not done already and return
8103
+ return jqXHR.abort();
8104
+ }
8105
+
8106
+ // aborting is no longer a cancellation
8107
+ strAbort = "abort";
8108
+
8109
+ // Install callbacks on deferreds
8110
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
8111
+ jqXHR[ i ]( s[ i ] );
8112
+ }
8113
+
8114
+ // Get transport
8115
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
8116
+
8117
+ // If no transport, we auto-abort
8118
+ if ( !transport ) {
8119
+ done( -1, "No Transport" );
8120
+ } else {
8121
+ jqXHR.readyState = 1;
8122
+
8123
+ // Send global event
8124
+ if ( fireGlobals ) {
8125
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
8126
+ }
8127
+ // Timeout
8128
+ if ( s.async && s.timeout > 0 ) {
8129
+ timeoutTimer = setTimeout(function() {
8130
+ jqXHR.abort("timeout");
8131
+ }, s.timeout );
8132
+ }
8133
+
8134
+ try {
8135
+ state = 1;
8136
+ transport.send( requestHeaders, done );
8137
+ } catch ( e ) {
8138
+ // Propagate exception as error if not done
8139
+ if ( state < 2 ) {
8140
+ done( -1, e );
8141
+ // Simply rethrow otherwise
8142
+ } else {
8143
+ throw e;
8144
+ }
8145
+ }
8146
+ }
8147
+
8148
+ // Callback for when everything is done
8149
+ function done( status, nativeStatusText, responses, headers ) {
8150
+ var isSuccess, success, error, response, modified,
8151
+ statusText = nativeStatusText;
8152
+
8153
+ // Called once
8154
+ if ( state === 2 ) {
8155
+ return;
8156
+ }
8157
+
8158
+ // State is "done" now
8159
+ state = 2;
8160
+
8161
+ // Clear timeout if it exists
8162
+ if ( timeoutTimer ) {
8163
+ clearTimeout( timeoutTimer );
8164
+ }
8165
+
8166
+ // Dereference transport for early garbage collection
8167
+ // (no matter how long the jqXHR object will be used)
8168
+ transport = undefined;
8169
+
8170
+ // Cache response headers
8171
+ responseHeadersString = headers || "";
8172
+
8173
+ // Set readyState
8174
+ jqXHR.readyState = status > 0 ? 4 : 0;
8175
+
8176
+ // Determine if successful
8177
+ isSuccess = status >= 200 && status < 300 || status === 304;
8178
+
8179
+ // Get response data
8180
+ if ( responses ) {
8181
+ response = ajaxHandleResponses( s, jqXHR, responses );
8182
+ }
8183
+
8184
+ // Convert no matter what (that way responseXXX fields are always set)
8185
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
8186
+
8187
+ // If successful, handle type chaining
8188
+ if ( isSuccess ) {
8189
+
8190
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8191
+ if ( s.ifModified ) {
8192
+ modified = jqXHR.getResponseHeader("Last-Modified");
8193
+ if ( modified ) {
8194
+ jQuery.lastModified[ cacheURL ] = modified;
8195
+ }
8196
+ modified = jqXHR.getResponseHeader("etag");
8197
+ if ( modified ) {
8198
+ jQuery.etag[ cacheURL ] = modified;
8199
+ }
8200
+ }
8201
+
8202
+ // if no content
8203
+ if ( status === 204 || s.type === "HEAD" ) {
8204
+ statusText = "nocontent";
8205
+
8206
+ // if not modified
8207
+ } else if ( status === 304 ) {
8208
+ statusText = "notmodified";
8209
+
8210
+ // If we have data, let's convert it
8211
+ } else {
8212
+ statusText = response.state;
8213
+ success = response.data;
8214
+ error = response.error;
8215
+ isSuccess = !error;
8216
+ }
8217
+ } else {
8218
+ // We extract error from statusText
8219
+ // then normalize statusText and status for non-aborts
8220
+ error = statusText;
8221
+ if ( status || !statusText ) {
8222
+ statusText = "error";
8223
+ if ( status < 0 ) {
8224
+ status = 0;
8225
+ }
8226
+ }
8227
+ }
8228
+
8229
+ // Set data for the fake xhr object
8230
+ jqXHR.status = status;
8231
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
8232
+
8233
+ // Success/Error
8234
+ if ( isSuccess ) {
8235
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
8236
+ } else {
8237
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
8238
+ }
8239
+
8240
+ // Status-dependent callbacks
8241
+ jqXHR.statusCode( statusCode );
8242
+ statusCode = undefined;
8243
+
8244
+ if ( fireGlobals ) {
8245
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
8246
+ [ jqXHR, s, isSuccess ? success : error ] );
8247
+ }
8248
+
8249
+ // Complete
8250
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
8251
+
8252
+ if ( fireGlobals ) {
8253
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
8254
+ // Handle the global AJAX counter
8255
+ if ( !( --jQuery.active ) ) {
8256
+ jQuery.event.trigger("ajaxStop");
8257
+ }
8258
+ }
8259
+ }
8260
+
8261
+ return jqXHR;
8262
+ },
8263
+
8264
+ getJSON: function( url, data, callback ) {
8265
+ return jQuery.get( url, data, callback, "json" );
8266
+ },
8267
+
8268
+ getScript: function( url, callback ) {
8269
+ return jQuery.get( url, undefined, callback, "script" );
8270
+ }
8271
+ });
8272
+
8273
+ jQuery.each( [ "get", "post" ], function( i, method ) {
8274
+ jQuery[ method ] = function( url, data, callback, type ) {
8275
+ // shift arguments if data argument was omitted
8276
+ if ( jQuery.isFunction( data ) ) {
8277
+ type = type || callback;
8278
+ callback = data;
8279
+ data = undefined;
8280
+ }
8281
+
8282
+ return jQuery.ajax({
8283
+ url: url,
8284
+ type: method,
8285
+ dataType: type,
8286
+ data: data,
8287
+ success: callback
8288
+ });
8289
+ };
8290
+ });
8291
+
8292
+ /* Handles responses to an ajax request:
8293
+ * - finds the right dataType (mediates between content-type and expected dataType)
8294
+ * - returns the corresponding response
8295
+ */
8296
+ function ajaxHandleResponses( s, jqXHR, responses ) {
8297
+ var firstDataType, ct, finalDataType, type,
8298
+ contents = s.contents,
8299
+ dataTypes = s.dataTypes;
8300
+
8301
+ // Remove auto dataType and get content-type in the process
8302
+ while( dataTypes[ 0 ] === "*" ) {
8303
+ dataTypes.shift();
8304
+ if ( ct === undefined ) {
8305
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
8306
+ }
8307
+ }
8308
+
8309
+ // Check if we're dealing with a known content-type
8310
+ if ( ct ) {
8311
+ for ( type in contents ) {
8312
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
8313
+ dataTypes.unshift( type );
8314
+ break;
8315
+ }
8316
+ }
8317
+ }
8318
+
8319
+ // Check to see if we have a response for the expected dataType
8320
+ if ( dataTypes[ 0 ] in responses ) {
8321
+ finalDataType = dataTypes[ 0 ];
8322
+ } else {
8323
+ // Try convertible dataTypes
8324
+ for ( type in responses ) {
8325
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
8326
+ finalDataType = type;
8327
+ break;
8328
+ }
8329
+ if ( !firstDataType ) {
8330
+ firstDataType = type;
8331
+ }
8332
+ }
8333
+ // Or just use first one
8334
+ finalDataType = finalDataType || firstDataType;
8335
+ }
8336
+
8337
+ // If we found a dataType
8338
+ // We add the dataType to the list if needed
8339
+ // and return the corresponding response
8340
+ if ( finalDataType ) {
8341
+ if ( finalDataType !== dataTypes[ 0 ] ) {
8342
+ dataTypes.unshift( finalDataType );
8343
+ }
8344
+ return responses[ finalDataType ];
8345
+ }
8346
+ }
8347
+
8348
+ /* Chain conversions given the request and the original response
8349
+ * Also sets the responseXXX fields on the jqXHR instance
8350
+ */
8351
+ function ajaxConvert( s, response, jqXHR, isSuccess ) {
8352
+ var conv2, current, conv, tmp, prev,
8353
+ converters = {},
8354
+ // Work with a copy of dataTypes in case we need to modify it for conversion
8355
+ dataTypes = s.dataTypes.slice();
8356
+
8357
+ // Create converters map with lowercased keys
8358
+ if ( dataTypes[ 1 ] ) {
8359
+ for ( conv in s.converters ) {
8360
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
8361
+ }
8362
+ }
8363
+
8364
+ current = dataTypes.shift();
8365
+
8366
+ // Convert to each sequential dataType
8367
+ while ( current ) {
8368
+
8369
+ if ( s.responseFields[ current ] ) {
8370
+ jqXHR[ s.responseFields[ current ] ] = response;
8371
+ }
8372
+
8373
+ // Apply the dataFilter if provided
8374
+ if ( !prev && isSuccess && s.dataFilter ) {
8375
+ response = s.dataFilter( response, s.dataType );
8376
+ }
8377
+
8378
+ prev = current;
8379
+ current = dataTypes.shift();
8380
+
8381
+ if ( current ) {
8382
+
8383
+ // There's only work to do if current dataType is non-auto
8384
+ if ( current === "*" ) {
8385
+
8386
+ current = prev;
8387
+
8388
+ // Convert response if prev dataType is non-auto and differs from current
8389
+ } else if ( prev !== "*" && prev !== current ) {
8390
+
8391
+ // Seek a direct converter
8392
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
8393
+
8394
+ // If none found, seek a pair
8395
+ if ( !conv ) {
8396
+ for ( conv2 in converters ) {
8397
+
8398
+ // If conv2 outputs current
8399
+ tmp = conv2.split( " " );
8400
+ if ( tmp[ 1 ] === current ) {
8401
+
8402
+ // If prev can be converted to accepted input
8403
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
8404
+ converters[ "* " + tmp[ 0 ] ];
8405
+ if ( conv ) {
8406
+ // Condense equivalence converters
8407
+ if ( conv === true ) {
8408
+ conv = converters[ conv2 ];
8409
+
8410
+ // Otherwise, insert the intermediate dataType
8411
+ } else if ( converters[ conv2 ] !== true ) {
8412
+ current = tmp[ 0 ];
8413
+ dataTypes.unshift( tmp[ 1 ] );
8414
+ }
8415
+ break;
8416
+ }
8417
+ }
8418
+ }
8419
+ }
8420
+
8421
+ // Apply converter (if not an equivalence)
8422
+ if ( conv !== true ) {
8423
+
8424
+ // Unless errors are allowed to bubble, catch and return them
8425
+ if ( conv && s[ "throws" ] ) {
8426
+ response = conv( response );
8427
+ } else {
8428
+ try {
8429
+ response = conv( response );
8430
+ } catch ( e ) {
8431
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
8432
+ }
8433
+ }
8434
+ }
8435
+ }
8436
+ }
8437
+ }
8438
+
8439
+ return { state: "success", data: response };
8440
+ }
8441
+ // Install script dataType
8442
+ jQuery.ajaxSetup({
8443
+ accepts: {
8444
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
8445
+ },
8446
+ contents: {
8447
+ script: /(?:java|ecma)script/
8448
+ },
8449
+ converters: {
8450
+ "text script": function( text ) {
8451
+ jQuery.globalEval( text );
8452
+ return text;
8453
+ }
8454
+ }
8455
+ });
8456
+
8457
+ // Handle cache's special case and global
8458
+ jQuery.ajaxPrefilter( "script", function( s ) {
8459
+ if ( s.cache === undefined ) {
8460
+ s.cache = false;
8461
+ }
8462
+ if ( s.crossDomain ) {
8463
+ s.type = "GET";
8464
+ s.global = false;
8465
+ }
8466
+ });
8467
+
8468
+ // Bind script tag hack transport
8469
+ jQuery.ajaxTransport( "script", function(s) {
8470
+
8471
+ // This transport only deals with cross domain requests
8472
+ if ( s.crossDomain ) {
8473
+
8474
+ var script,
8475
+ head = document.head || jQuery("head")[0] || document.documentElement;
8476
+
8477
+ return {
8478
+
8479
+ send: function( _, callback ) {
8480
+
8481
+ script = document.createElement("script");
8482
+
8483
+ script.async = true;
8484
+
8485
+ if ( s.scriptCharset ) {
8486
+ script.charset = s.scriptCharset;
8487
+ }
8488
+
8489
+ script.src = s.url;
8490
+
8491
+ // Attach handlers for all browsers
8492
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
8493
+
8494
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
8495
+
8496
+ // Handle memory leak in IE
8497
+ script.onload = script.onreadystatechange = null;
8498
+
8499
+ // Remove the script
8500
+ if ( script.parentNode ) {
8501
+ script.parentNode.removeChild( script );
8502
+ }
8503
+
8504
+ // Dereference the script
8505
+ script = null;
8506
+
8507
+ // Callback if not abort
8508
+ if ( !isAbort ) {
8509
+ callback( 200, "success" );
8510
+ }
8511
+ }
8512
+ };
8513
+
8514
+ // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
8515
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
8516
+ head.insertBefore( script, head.firstChild );
8517
+ },
8518
+
8519
+ abort: function() {
8520
+ if ( script ) {
8521
+ script.onload( undefined, true );
8522
+ }
8523
+ }
8524
+ };
8525
+ }
8526
+ });
8527
+ var oldCallbacks = [],
8528
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
8529
+
8530
+ // Default jsonp settings
8531
+ jQuery.ajaxSetup({
8532
+ jsonp: "callback",
8533
+ jsonpCallback: function() {
8534
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
8535
+ this[ callback ] = true;
8536
+ return callback;
8537
+ }
8538
+ });
8539
+
8540
+ // Detect, normalize options and install callbacks for jsonp requests
8541
+ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
8542
+
8543
+ var callbackName, overwritten, responseContainer,
8544
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
8545
+ "url" :
8546
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
8547
+ );
8548
+
8549
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
8550
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
8551
+
8552
+ // Get callback name, remembering preexisting value associated with it
8553
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
8554
+ s.jsonpCallback() :
8555
+ s.jsonpCallback;
8556
+
8557
+ // Insert callback into url or form data
8558
+ if ( jsonProp ) {
8559
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
8560
+ } else if ( s.jsonp !== false ) {
8561
+ s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
8562
+ }
8563
+
8564
+ // Use data converter to retrieve json after script execution
8565
+ s.converters["script json"] = function() {
8566
+ if ( !responseContainer ) {
8567
+ jQuery.error( callbackName + " was not called" );
8568
+ }
8569
+ return responseContainer[ 0 ];
8570
+ };
8571
+
8572
+ // force json dataType
8573
+ s.dataTypes[ 0 ] = "json";
8574
+
8575
+ // Install callback
8576
+ overwritten = window[ callbackName ];
8577
+ window[ callbackName ] = function() {
8578
+ responseContainer = arguments;
8579
+ };
8580
+
8581
+ // Clean-up function (fires after converters)
8582
+ jqXHR.always(function() {
8583
+ // Restore preexisting value
8584
+ window[ callbackName ] = overwritten;
8585
+
8586
+ // Save back as free
8587
+ if ( s[ callbackName ] ) {
8588
+ // make sure that re-using the options doesn't screw things around
8589
+ s.jsonpCallback = originalSettings.jsonpCallback;
8590
+
8591
+ // save the callback name for future use
8592
+ oldCallbacks.push( callbackName );
8593
+ }
8594
+
8595
+ // Call if it was a function and we have a response
8596
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
8597
+ overwritten( responseContainer[ 0 ] );
8598
+ }
8599
+
8600
+ responseContainer = overwritten = undefined;
8601
+ });
8602
+
8603
+ // Delegate to script
8604
+ return "script";
8605
+ }
8606
+ });
8607
+ var xhrCallbacks, xhrSupported,
8608
+ xhrId = 0,
8609
+ // #5280: Internet Explorer will keep connections alive if we don't abort on unload
8610
+ xhrOnUnloadAbort = window.ActiveXObject && function() {
8611
+ // Abort all pending requests
8612
+ var key;
8613
+ for ( key in xhrCallbacks ) {
8614
+ xhrCallbacks[ key ]( undefined, true );
8615
+ }
8616
+ };
8617
+
8618
+ // Functions to create xhrs
8619
+ function createStandardXHR() {
8620
+ try {
8621
+ return new window.XMLHttpRequest();
8622
+ } catch( e ) {}
8623
+ }
8624
+
8625
+ function createActiveXHR() {
8626
+ try {
8627
+ return new window.ActiveXObject("Microsoft.XMLHTTP");
8628
+ } catch( e ) {}
8629
+ }
8630
+
8631
+ // Create the request object
8632
+ // (This is still attached to ajaxSettings for backward compatibility)
8633
+ jQuery.ajaxSettings.xhr = window.ActiveXObject ?
8634
+ /* Microsoft failed to properly
8635
+ * implement the XMLHttpRequest in IE7 (can't request local files),
8636
+ * so we use the ActiveXObject when it is available
8637
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
8638
+ * we need a fallback.
8639
+ */
8640
+ function() {
8641
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
8642
+ } :
8643
+ // For all other browsers, use the standard XMLHttpRequest object
8644
+ createStandardXHR;
8645
+
8646
+ // Determine support properties
8647
+ xhrSupported = jQuery.ajaxSettings.xhr();
8648
+ jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
8649
+ xhrSupported = jQuery.support.ajax = !!xhrSupported;
8650
+
8651
+ // Create transport if the browser can provide an xhr
8652
+ if ( xhrSupported ) {
8653
+
8654
+ jQuery.ajaxTransport(function( s ) {
8655
+ // Cross domain only allowed if supported through XMLHttpRequest
8656
+ if ( !s.crossDomain || jQuery.support.cors ) {
8657
+
8658
+ var callback;
8659
+
8660
+ return {
8661
+ send: function( headers, complete ) {
8662
+
8663
+ // Get a new xhr
8664
+ var handle, i,
8665
+ xhr = s.xhr();
8666
+
8667
+ // Open the socket
8668
+ // Passing null username, generates a login popup on Opera (#2865)
8669
+ if ( s.username ) {
8670
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
8671
+ } else {
8672
+ xhr.open( s.type, s.url, s.async );
8673
+ }
8674
+
8675
+ // Apply custom fields if provided
8676
+ if ( s.xhrFields ) {
8677
+ for ( i in s.xhrFields ) {
8678
+ xhr[ i ] = s.xhrFields[ i ];
8679
+ }
8680
+ }
8681
+
8682
+ // Override mime type if needed
8683
+ if ( s.mimeType && xhr.overrideMimeType ) {
8684
+ xhr.overrideMimeType( s.mimeType );
8685
+ }
8686
+
8687
+ // X-Requested-With header
8688
+ // For cross-domain requests, seeing as conditions for a preflight are
8689
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
8690
+ // (it can always be set on a per-request basis or even using ajaxSetup)
8691
+ // For same-domain requests, won't change header if already provided.
8692
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
8693
+ headers["X-Requested-With"] = "XMLHttpRequest";
8694
+ }
8695
+
8696
+ // Need an extra try/catch for cross domain requests in Firefox 3
8697
+ try {
8698
+ for ( i in headers ) {
8699
+ xhr.setRequestHeader( i, headers[ i ] );
8700
+ }
8701
+ } catch( err ) {}
8702
+
8703
+ // Do send the request
8704
+ // This may raise an exception which is actually
8705
+ // handled in jQuery.ajax (so no try/catch here)
8706
+ xhr.send( ( s.hasContent && s.data ) || null );
8707
+
8708
+ // Listener
8709
+ callback = function( _, isAbort ) {
8710
+ var status, responseHeaders, statusText, responses;
8711
+
8712
+ // Firefox throws exceptions when accessing properties
8713
+ // of an xhr when a network error occurred
8714
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
8715
+ try {
8716
+
8717
+ // Was never called and is aborted or complete
8718
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
8719
+
8720
+ // Only called once
8721
+ callback = undefined;
8722
+
8723
+ // Do not keep as active anymore
8724
+ if ( handle ) {
8725
+ xhr.onreadystatechange = jQuery.noop;
8726
+ if ( xhrOnUnloadAbort ) {
8727
+ delete xhrCallbacks[ handle ];
8728
+ }
8729
+ }
8730
+
8731
+ // If it's an abort
8732
+ if ( isAbort ) {
8733
+ // Abort it manually if needed
8734
+ if ( xhr.readyState !== 4 ) {
8735
+ xhr.abort();
8736
+ }
8737
+ } else {
8738
+ responses = {};
8739
+ status = xhr.status;
8740
+ responseHeaders = xhr.getAllResponseHeaders();
8741
+
8742
+ // When requesting binary data, IE6-9 will throw an exception
8743
+ // on any attempt to access responseText (#11426)
8744
+ if ( typeof xhr.responseText === "string" ) {
8745
+ responses.text = xhr.responseText;
8746
+ }
8747
+
8748
+ // Firefox throws an exception when accessing
8749
+ // statusText for faulty cross-domain requests
8750
+ try {
8751
+ statusText = xhr.statusText;
8752
+ } catch( e ) {
8753
+ // We normalize with Webkit giving an empty statusText
8754
+ statusText = "";
8755
+ }
8756
+
8757
+ // Filter status for non standard behaviors
8758
+
8759
+ // If the request is local and we have data: assume a success
8760
+ // (success with no data won't get notified, that's the best we
8761
+ // can do given current implementations)
8762
+ if ( !status && s.isLocal && !s.crossDomain ) {
8763
+ status = responses.text ? 200 : 404;
8764
+ // IE - #1450: sometimes returns 1223 when it should be 204
8765
+ } else if ( status === 1223 ) {
8766
+ status = 204;
8767
+ }
8768
+ }
8769
+ }
8770
+ } catch( firefoxAccessException ) {
8771
+ if ( !isAbort ) {
8772
+ complete( -1, firefoxAccessException );
8773
+ }
8774
+ }
8775
+
8776
+ // Call complete if needed
8777
+ if ( responses ) {
8778
+ complete( status, statusText, responses, responseHeaders );
8779
+ }
8780
+ };
8781
+
8782
+ if ( !s.async ) {
8783
+ // if we're in sync mode we fire the callback
8784
+ callback();
8785
+ } else if ( xhr.readyState === 4 ) {
8786
+ // (IE6 & IE7) if it's in cache and has been
8787
+ // retrieved directly we need to fire the callback
8788
+ setTimeout( callback );
8789
+ } else {
8790
+ handle = ++xhrId;
8791
+ if ( xhrOnUnloadAbort ) {
8792
+ // Create the active xhrs callbacks list if needed
8793
+ // and attach the unload handler
8794
+ if ( !xhrCallbacks ) {
8795
+ xhrCallbacks = {};
8796
+ jQuery( window ).unload( xhrOnUnloadAbort );
8797
+ }
8798
+ // Add to list of active xhrs callbacks
8799
+ xhrCallbacks[ handle ] = callback;
8800
+ }
8801
+ xhr.onreadystatechange = callback;
8802
+ }
8803
+ },
8804
+
8805
+ abort: function() {
8806
+ if ( callback ) {
8807
+ callback( undefined, true );
8808
+ }
8809
+ }
8810
+ };
8811
+ }
8812
+ });
8813
+ }
8814
+ var fxNow, timerId,
8815
+ rfxtypes = /^(?:toggle|show|hide)$/,
8816
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
8817
+ rrun = /queueHooks$/,
8818
+ animationPrefilters = [ defaultPrefilter ],
8819
+ tweeners = {
8820
+ "*": [function( prop, value ) {
8821
+ var tween = this.createTween( prop, value ),
8822
+ target = tween.cur(),
8823
+ parts = rfxnum.exec( value ),
8824
+ unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
8825
+
8826
+ // Starting value computation is required for potential unit mismatches
8827
+ start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
8828
+ rfxnum.exec( jQuery.css( tween.elem, prop ) ),
8829
+ scale = 1,
8830
+ maxIterations = 20;
8831
+
8832
+ if ( start && start[ 3 ] !== unit ) {
8833
+ // Trust units reported by jQuery.css
8834
+ unit = unit || start[ 3 ];
8835
+
8836
+ // Make sure we update the tween properties later on
8837
+ parts = parts || [];
8838
+
8839
+ // Iteratively approximate from a nonzero starting point
8840
+ start = +target || 1;
8841
+
8842
+ do {
8843
+ // If previous iteration zeroed out, double until we get *something*
8844
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
8845
+ scale = scale || ".5";
8846
+
8847
+ // Adjust and apply
8848
+ start = start / scale;
8849
+ jQuery.style( tween.elem, prop, start + unit );
8850
+
8851
+ // Update scale, tolerating zero or NaN from tween.cur()
8852
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
8853
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
8854
+ }
8855
+
8856
+ // Update tween properties
8857
+ if ( parts ) {
8858
+ start = tween.start = +start || +target || 0;
8859
+ tween.unit = unit;
8860
+ // If a +=/-= token was provided, we're doing a relative animation
8861
+ tween.end = parts[ 1 ] ?
8862
+ start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
8863
+ +parts[ 2 ];
8864
+ }
8865
+
8866
+ return tween;
8867
+ }]
8868
+ };
8869
+
8870
+ // Animations created synchronously will run synchronously
8871
+ function createFxNow() {
8872
+ setTimeout(function() {
8873
+ fxNow = undefined;
8874
+ });
8875
+ return ( fxNow = jQuery.now() );
8876
+ }
8877
+
8878
+ function createTween( value, prop, animation ) {
8879
+ var tween,
8880
+ collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
8881
+ index = 0,
8882
+ length = collection.length;
8883
+ for ( ; index < length; index++ ) {
8884
+ if ( (tween = collection[ index ].call( animation, prop, value )) ) {
8885
+
8886
+ // we're done with this property
8887
+ return tween;
8888
+ }
8889
+ }
8890
+ }
8891
+
8892
+ function Animation( elem, properties, options ) {
8893
+ var result,
8894
+ stopped,
8895
+ index = 0,
8896
+ length = animationPrefilters.length,
8897
+ deferred = jQuery.Deferred().always( function() {
8898
+ // don't match elem in the :animated selector
8899
+ delete tick.elem;
8900
+ }),
8901
+ tick = function() {
8902
+ if ( stopped ) {
8903
+ return false;
8904
+ }
8905
+ var currentTime = fxNow || createFxNow(),
8906
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
8907
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
8908
+ temp = remaining / animation.duration || 0,
8909
+ percent = 1 - temp,
8910
+ index = 0,
8911
+ length = animation.tweens.length;
8912
+
8913
+ for ( ; index < length ; index++ ) {
8914
+ animation.tweens[ index ].run( percent );
8915
+ }
8916
+
8917
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
8918
+
8919
+ if ( percent < 1 && length ) {
8920
+ return remaining;
8921
+ } else {
8922
+ deferred.resolveWith( elem, [ animation ] );
8923
+ return false;
8924
+ }
8925
+ },
8926
+ animation = deferred.promise({
8927
+ elem: elem,
8928
+ props: jQuery.extend( {}, properties ),
8929
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
8930
+ originalProperties: properties,
8931
+ originalOptions: options,
8932
+ startTime: fxNow || createFxNow(),
8933
+ duration: options.duration,
8934
+ tweens: [],
8935
+ createTween: function( prop, end ) {
8936
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
8937
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
8938
+ animation.tweens.push( tween );
8939
+ return tween;
8940
+ },
8941
+ stop: function( gotoEnd ) {
8942
+ var index = 0,
8943
+ // if we are going to the end, we want to run all the tweens
8944
+ // otherwise we skip this part
8945
+ length = gotoEnd ? animation.tweens.length : 0;
8946
+ if ( stopped ) {
8947
+ return this;
8948
+ }
8949
+ stopped = true;
8950
+ for ( ; index < length ; index++ ) {
8951
+ animation.tweens[ index ].run( 1 );
8952
+ }
8953
+
8954
+ // resolve when we played the last frame
8955
+ // otherwise, reject
8956
+ if ( gotoEnd ) {
8957
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
8958
+ } else {
8959
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
8960
+ }
8961
+ return this;
8962
+ }
8963
+ }),
8964
+ props = animation.props;
8965
+
8966
+ propFilter( props, animation.opts.specialEasing );
8967
+
8968
+ for ( ; index < length ; index++ ) {
8969
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
8970
+ if ( result ) {
8971
+ return result;
8972
+ }
8973
+ }
8974
+
8975
+ jQuery.map( props, createTween, animation );
8976
+
8977
+ if ( jQuery.isFunction( animation.opts.start ) ) {
8978
+ animation.opts.start.call( elem, animation );
8979
+ }
8980
+
8981
+ jQuery.fx.timer(
8982
+ jQuery.extend( tick, {
8983
+ elem: elem,
8984
+ anim: animation,
8985
+ queue: animation.opts.queue
8986
+ })
8987
+ );
8988
+
8989
+ // attach callbacks from options
8990
+ return animation.progress( animation.opts.progress )
8991
+ .done( animation.opts.done, animation.opts.complete )
8992
+ .fail( animation.opts.fail )
8993
+ .always( animation.opts.always );
8994
+ }
8995
+
8996
+ function propFilter( props, specialEasing ) {
8997
+ var index, name, easing, value, hooks;
8998
+
8999
+ // camelCase, specialEasing and expand cssHook pass
9000
+ for ( index in props ) {
9001
+ name = jQuery.camelCase( index );
9002
+ easing = specialEasing[ name ];
9003
+ value = props[ index ];
9004
+ if ( jQuery.isArray( value ) ) {
9005
+ easing = value[ 1 ];
9006
+ value = props[ index ] = value[ 0 ];
9007
+ }
9008
+
9009
+ if ( index !== name ) {
9010
+ props[ name ] = value;
9011
+ delete props[ index ];
9012
+ }
9013
+
9014
+ hooks = jQuery.cssHooks[ name ];
9015
+ if ( hooks && "expand" in hooks ) {
9016
+ value = hooks.expand( value );
9017
+ delete props[ name ];
9018
+
9019
+ // not quite $.extend, this wont overwrite keys already present.
9020
+ // also - reusing 'index' from above because we have the correct "name"
9021
+ for ( index in value ) {
9022
+ if ( !( index in props ) ) {
9023
+ props[ index ] = value[ index ];
9024
+ specialEasing[ index ] = easing;
9025
+ }
9026
+ }
9027
+ } else {
9028
+ specialEasing[ name ] = easing;
9029
+ }
9030
+ }
9031
+ }
9032
+
9033
+ jQuery.Animation = jQuery.extend( Animation, {
9034
+
9035
+ tweener: function( props, callback ) {
9036
+ if ( jQuery.isFunction( props ) ) {
9037
+ callback = props;
9038
+ props = [ "*" ];
9039
+ } else {
9040
+ props = props.split(" ");
9041
+ }
9042
+
9043
+ var prop,
9044
+ index = 0,
9045
+ length = props.length;
9046
+
9047
+ for ( ; index < length ; index++ ) {
9048
+ prop = props[ index ];
9049
+ tweeners[ prop ] = tweeners[ prop ] || [];
9050
+ tweeners[ prop ].unshift( callback );
9051
+ }
9052
+ },
9053
+
9054
+ prefilter: function( callback, prepend ) {
9055
+ if ( prepend ) {
9056
+ animationPrefilters.unshift( callback );
9057
+ } else {
9058
+ animationPrefilters.push( callback );
9059
+ }
9060
+ }
9061
+ });
9062
+
9063
+ function defaultPrefilter( elem, props, opts ) {
9064
+ /* jshint validthis: true */
9065
+ var prop, value, toggle, tween, hooks, oldfire,
9066
+ anim = this,
9067
+ orig = {},
9068
+ style = elem.style,
9069
+ hidden = elem.nodeType && isHidden( elem ),
9070
+ dataShow = jQuery._data( elem, "fxshow" );
9071
+
9072
+ // handle queue: false promises
9073
+ if ( !opts.queue ) {
9074
+ hooks = jQuery._queueHooks( elem, "fx" );
9075
+ if ( hooks.unqueued == null ) {
9076
+ hooks.unqueued = 0;
9077
+ oldfire = hooks.empty.fire;
9078
+ hooks.empty.fire = function() {
9079
+ if ( !hooks.unqueued ) {
9080
+ oldfire();
9081
+ }
9082
+ };
9083
+ }
9084
+ hooks.unqueued++;
9085
+
9086
+ anim.always(function() {
9087
+ // doing this makes sure that the complete handler will be called
9088
+ // before this completes
9089
+ anim.always(function() {
9090
+ hooks.unqueued--;
9091
+ if ( !jQuery.queue( elem, "fx" ).length ) {
9092
+ hooks.empty.fire();
9093
+ }
9094
+ });
9095
+ });
9096
+ }
9097
+
9098
+ // height/width overflow pass
9099
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
9100
+ // Make sure that nothing sneaks out
9101
+ // Record all 3 overflow attributes because IE does not
9102
+ // change the overflow attribute when overflowX and
9103
+ // overflowY are set to the same value
9104
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
9105
+
9106
+ // Set display property to inline-block for height/width
9107
+ // animations on inline elements that are having width/height animated
9108
+ if ( jQuery.css( elem, "display" ) === "inline" &&
9109
+ jQuery.css( elem, "float" ) === "none" ) {
9110
+
9111
+ // inline-level elements accept inline-block;
9112
+ // block-level elements need to be inline with layout
9113
+ if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
9114
+ style.display = "inline-block";
9115
+
9116
+ } else {
9117
+ style.zoom = 1;
9118
+ }
9119
+ }
9120
+ }
9121
+
9122
+ if ( opts.overflow ) {
9123
+ style.overflow = "hidden";
9124
+ if ( !jQuery.support.shrinkWrapBlocks ) {
9125
+ anim.always(function() {
9126
+ style.overflow = opts.overflow[ 0 ];
9127
+ style.overflowX = opts.overflow[ 1 ];
9128
+ style.overflowY = opts.overflow[ 2 ];
9129
+ });
9130
+ }
9131
+ }
9132
+
9133
+
9134
+ // show/hide pass
9135
+ for ( prop in props ) {
9136
+ value = props[ prop ];
9137
+ if ( rfxtypes.exec( value ) ) {
9138
+ delete props[ prop ];
9139
+ toggle = toggle || value === "toggle";
9140
+ if ( value === ( hidden ? "hide" : "show" ) ) {
9141
+ continue;
9142
+ }
9143
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
9144
+ }
9145
+ }
9146
+
9147
+ if ( !jQuery.isEmptyObject( orig ) ) {
9148
+ if ( dataShow ) {
9149
+ if ( "hidden" in dataShow ) {
9150
+ hidden = dataShow.hidden;
9151
+ }
9152
+ } else {
9153
+ dataShow = jQuery._data( elem, "fxshow", {} );
9154
+ }
9155
+
9156
+ // store state if its toggle - enables .stop().toggle() to "reverse"
9157
+ if ( toggle ) {
9158
+ dataShow.hidden = !hidden;
9159
+ }
9160
+ if ( hidden ) {
9161
+ jQuery( elem ).show();
9162
+ } else {
9163
+ anim.done(function() {
9164
+ jQuery( elem ).hide();
9165
+ });
9166
+ }
9167
+ anim.done(function() {
9168
+ var prop;
9169
+ jQuery._removeData( elem, "fxshow" );
9170
+ for ( prop in orig ) {
9171
+ jQuery.style( elem, prop, orig[ prop ] );
9172
+ }
9173
+ });
9174
+ for ( prop in orig ) {
9175
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
9176
+
9177
+ if ( !( prop in dataShow ) ) {
9178
+ dataShow[ prop ] = tween.start;
9179
+ if ( hidden ) {
9180
+ tween.end = tween.start;
9181
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
9182
+ }
9183
+ }
9184
+ }
9185
+ }
9186
+ }
9187
+
9188
+ function Tween( elem, options, prop, end, easing ) {
9189
+ return new Tween.prototype.init( elem, options, prop, end, easing );
9190
+ }
9191
+ jQuery.Tween = Tween;
9192
+
9193
+ Tween.prototype = {
9194
+ constructor: Tween,
9195
+ init: function( elem, options, prop, end, easing, unit ) {
9196
+ this.elem = elem;
9197
+ this.prop = prop;
9198
+ this.easing = easing || "swing";
9199
+ this.options = options;
9200
+ this.start = this.now = this.cur();
9201
+ this.end = end;
9202
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
9203
+ },
9204
+ cur: function() {
9205
+ var hooks = Tween.propHooks[ this.prop ];
9206
+
9207
+ return hooks && hooks.get ?
9208
+ hooks.get( this ) :
9209
+ Tween.propHooks._default.get( this );
9210
+ },
9211
+ run: function( percent ) {
9212
+ var eased,
9213
+ hooks = Tween.propHooks[ this.prop ];
9214
+
9215
+ if ( this.options.duration ) {
9216
+ this.pos = eased = jQuery.easing[ this.easing ](
9217
+ percent, this.options.duration * percent, 0, 1, this.options.duration
9218
+ );
9219
+ } else {
9220
+ this.pos = eased = percent;
9221
+ }
9222
+ this.now = ( this.end - this.start ) * eased + this.start;
9223
+
9224
+ if ( this.options.step ) {
9225
+ this.options.step.call( this.elem, this.now, this );
9226
+ }
9227
+
9228
+ if ( hooks && hooks.set ) {
9229
+ hooks.set( this );
9230
+ } else {
9231
+ Tween.propHooks._default.set( this );
9232
+ }
9233
+ return this;
9234
+ }
9235
+ };
9236
+
9237
+ Tween.prototype.init.prototype = Tween.prototype;
9238
+
9239
+ Tween.propHooks = {
9240
+ _default: {
9241
+ get: function( tween ) {
9242
+ var result;
9243
+
9244
+ if ( tween.elem[ tween.prop ] != null &&
9245
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
9246
+ return tween.elem[ tween.prop ];
9247
+ }
9248
+
9249
+ // passing an empty string as a 3rd parameter to .css will automatically
9250
+ // attempt a parseFloat and fallback to a string if the parse fails
9251
+ // so, simple values such as "10px" are parsed to Float.
9252
+ // complex values such as "rotate(1rad)" are returned as is.
9253
+ result = jQuery.css( tween.elem, tween.prop, "" );
9254
+ // Empty strings, null, undefined and "auto" are converted to 0.
9255
+ return !result || result === "auto" ? 0 : result;
9256
+ },
9257
+ set: function( tween ) {
9258
+ // use step hook for back compat - use cssHook if its there - use .style if its
9259
+ // available and use plain properties where available
9260
+ if ( jQuery.fx.step[ tween.prop ] ) {
9261
+ jQuery.fx.step[ tween.prop ]( tween );
9262
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
9263
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
9264
+ } else {
9265
+ tween.elem[ tween.prop ] = tween.now;
9266
+ }
9267
+ }
9268
+ }
9269
+ };
9270
+
9271
+ // Support: IE <=9
9272
+ // Panic based approach to setting things on disconnected nodes
9273
+
9274
+ Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
9275
+ set: function( tween ) {
9276
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
9277
+ tween.elem[ tween.prop ] = tween.now;
9278
+ }
9279
+ }
9280
+ };
9281
+
9282
+ jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
9283
+ var cssFn = jQuery.fn[ name ];
9284
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
9285
+ return speed == null || typeof speed === "boolean" ?
9286
+ cssFn.apply( this, arguments ) :
9287
+ this.animate( genFx( name, true ), speed, easing, callback );
9288
+ };
9289
+ });
9290
+
9291
+ jQuery.fn.extend({
9292
+ fadeTo: function( speed, to, easing, callback ) {
9293
+
9294
+ // show any hidden elements after setting opacity to 0
9295
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
9296
+
9297
+ // animate to the value specified
9298
+ .end().animate({ opacity: to }, speed, easing, callback );
9299
+ },
9300
+ animate: function( prop, speed, easing, callback ) {
9301
+ var empty = jQuery.isEmptyObject( prop ),
9302
+ optall = jQuery.speed( speed, easing, callback ),
9303
+ doAnimation = function() {
9304
+ // Operate on a copy of prop so per-property easing won't be lost
9305
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
9306
+
9307
+ // Empty animations, or finishing resolves immediately
9308
+ if ( empty || jQuery._data( this, "finish" ) ) {
9309
+ anim.stop( true );
9310
+ }
9311
+ };
9312
+ doAnimation.finish = doAnimation;
9313
+
9314
+ return empty || optall.queue === false ?
9315
+ this.each( doAnimation ) :
9316
+ this.queue( optall.queue, doAnimation );
9317
+ },
9318
+ stop: function( type, clearQueue, gotoEnd ) {
9319
+ var stopQueue = function( hooks ) {
9320
+ var stop = hooks.stop;
9321
+ delete hooks.stop;
9322
+ stop( gotoEnd );
9323
+ };
9324
+
9325
+ if ( typeof type !== "string" ) {
9326
+ gotoEnd = clearQueue;
9327
+ clearQueue = type;
9328
+ type = undefined;
9329
+ }
9330
+ if ( clearQueue && type !== false ) {
9331
+ this.queue( type || "fx", [] );
9332
+ }
9333
+
9334
+ return this.each(function() {
9335
+ var dequeue = true,
9336
+ index = type != null && type + "queueHooks",
9337
+ timers = jQuery.timers,
9338
+ data = jQuery._data( this );
9339
+
9340
+ if ( index ) {
9341
+ if ( data[ index ] && data[ index ].stop ) {
9342
+ stopQueue( data[ index ] );
9343
+ }
9344
+ } else {
9345
+ for ( index in data ) {
9346
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
9347
+ stopQueue( data[ index ] );
9348
+ }
9349
+ }
9350
+ }
9351
+
9352
+ for ( index = timers.length; index--; ) {
9353
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
9354
+ timers[ index ].anim.stop( gotoEnd );
9355
+ dequeue = false;
9356
+ timers.splice( index, 1 );
9357
+ }
9358
+ }
9359
+
9360
+ // start the next in the queue if the last step wasn't forced
9361
+ // timers currently will call their complete callbacks, which will dequeue
9362
+ // but only if they were gotoEnd
9363
+ if ( dequeue || !gotoEnd ) {
9364
+ jQuery.dequeue( this, type );
9365
+ }
9366
+ });
9367
+ },
9368
+ finish: function( type ) {
9369
+ if ( type !== false ) {
9370
+ type = type || "fx";
9371
+ }
9372
+ return this.each(function() {
9373
+ var index,
9374
+ data = jQuery._data( this ),
9375
+ queue = data[ type + "queue" ],
9376
+ hooks = data[ type + "queueHooks" ],
9377
+ timers = jQuery.timers,
9378
+ length = queue ? queue.length : 0;
9379
+
9380
+ // enable finishing flag on private data
9381
+ data.finish = true;
9382
+
9383
+ // empty the queue first
9384
+ jQuery.queue( this, type, [] );
9385
+
9386
+ if ( hooks && hooks.stop ) {
9387
+ hooks.stop.call( this, true );
9388
+ }
9389
+
9390
+ // look for any active animations, and finish them
9391
+ for ( index = timers.length; index--; ) {
9392
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
9393
+ timers[ index ].anim.stop( true );
9394
+ timers.splice( index, 1 );
9395
+ }
9396
+ }
9397
+
9398
+ // look for any animations in the old queue and finish them
9399
+ for ( index = 0; index < length; index++ ) {
9400
+ if ( queue[ index ] && queue[ index ].finish ) {
9401
+ queue[ index ].finish.call( this );
9402
+ }
9403
+ }
9404
+
9405
+ // turn off finishing flag
9406
+ delete data.finish;
9407
+ });
9408
+ }
9409
+ });
9410
+
9411
+ // Generate parameters to create a standard animation
9412
+ function genFx( type, includeWidth ) {
9413
+ var which,
9414
+ attrs = { height: type },
9415
+ i = 0;
9416
+
9417
+ // if we include width, step value is 1 to do all cssExpand values,
9418
+ // if we don't include width, step value is 2 to skip over Left and Right
9419
+ includeWidth = includeWidth? 1 : 0;
9420
+ for( ; i < 4 ; i += 2 - includeWidth ) {
9421
+ which = cssExpand[ i ];
9422
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
9423
+ }
9424
+
9425
+ if ( includeWidth ) {
9426
+ attrs.opacity = attrs.width = type;
9427
+ }
9428
+
9429
+ return attrs;
9430
+ }
9431
+
9432
+ // Generate shortcuts for custom animations
9433
+ jQuery.each({
9434
+ slideDown: genFx("show"),
9435
+ slideUp: genFx("hide"),
9436
+ slideToggle: genFx("toggle"),
9437
+ fadeIn: { opacity: "show" },
9438
+ fadeOut: { opacity: "hide" },
9439
+ fadeToggle: { opacity: "toggle" }
9440
+ }, function( name, props ) {
9441
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
9442
+ return this.animate( props, speed, easing, callback );
9443
+ };
9444
+ });
9445
+
9446
+ jQuery.speed = function( speed, easing, fn ) {
9447
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
9448
+ complete: fn || !fn && easing ||
9449
+ jQuery.isFunction( speed ) && speed,
9450
+ duration: speed,
9451
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
9452
+ };
9453
+
9454
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
9455
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
9456
+
9457
+ // normalize opt.queue - true/undefined/null -> "fx"
9458
+ if ( opt.queue == null || opt.queue === true ) {
9459
+ opt.queue = "fx";
9460
+ }
9461
+
9462
+ // Queueing
9463
+ opt.old = opt.complete;
9464
+
9465
+ opt.complete = function() {
9466
+ if ( jQuery.isFunction( opt.old ) ) {
9467
+ opt.old.call( this );
9468
+ }
9469
+
9470
+ if ( opt.queue ) {
9471
+ jQuery.dequeue( this, opt.queue );
9472
+ }
9473
+ };
9474
+
9475
+ return opt;
9476
+ };
9477
+
9478
+ jQuery.easing = {
9479
+ linear: function( p ) {
9480
+ return p;
9481
+ },
9482
+ swing: function( p ) {
9483
+ return 0.5 - Math.cos( p*Math.PI ) / 2;
9484
+ }
9485
+ };
9486
+
9487
+ jQuery.timers = [];
9488
+ jQuery.fx = Tween.prototype.init;
9489
+ jQuery.fx.tick = function() {
9490
+ var timer,
9491
+ timers = jQuery.timers,
9492
+ i = 0;
9493
+
9494
+ fxNow = jQuery.now();
9495
+
9496
+ for ( ; i < timers.length; i++ ) {
9497
+ timer = timers[ i ];
9498
+ // Checks the timer has not already been removed
9499
+ if ( !timer() && timers[ i ] === timer ) {
9500
+ timers.splice( i--, 1 );
9501
+ }
9502
+ }
9503
+
9504
+ if ( !timers.length ) {
9505
+ jQuery.fx.stop();
9506
+ }
9507
+ fxNow = undefined;
9508
+ };
9509
+
9510
+ jQuery.fx.timer = function( timer ) {
9511
+ if ( timer() && jQuery.timers.push( timer ) ) {
9512
+ jQuery.fx.start();
9513
+ }
9514
+ };
9515
+
9516
+ jQuery.fx.interval = 13;
9517
+
9518
+ jQuery.fx.start = function() {
9519
+ if ( !timerId ) {
9520
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
9521
+ }
9522
+ };
9523
+
9524
+ jQuery.fx.stop = function() {
9525
+ clearInterval( timerId );
9526
+ timerId = null;
9527
+ };
9528
+
9529
+ jQuery.fx.speeds = {
9530
+ slow: 600,
9531
+ fast: 200,
9532
+ // Default speed
9533
+ _default: 400
9534
+ };
9535
+
9536
+ // Back Compat <1.8 extension point
9537
+ jQuery.fx.step = {};
9538
+
9539
+ if ( jQuery.expr && jQuery.expr.filters ) {
9540
+ jQuery.expr.filters.animated = function( elem ) {
9541
+ return jQuery.grep(jQuery.timers, function( fn ) {
9542
+ return elem === fn.elem;
9543
+ }).length;
9544
+ };
9545
+ }
9546
+ jQuery.fn.offset = function( options ) {
9547
+ if ( arguments.length ) {
9548
+ return options === undefined ?
9549
+ this :
9550
+ this.each(function( i ) {
9551
+ jQuery.offset.setOffset( this, options, i );
9552
+ });
9553
+ }
9554
+
9555
+ var docElem, win,
9556
+ box = { top: 0, left: 0 },
9557
+ elem = this[ 0 ],
9558
+ doc = elem && elem.ownerDocument;
9559
+
9560
+ if ( !doc ) {
9561
+ return;
9562
+ }
9563
+
9564
+ docElem = doc.documentElement;
9565
+
9566
+ // Make sure it's not a disconnected DOM node
9567
+ if ( !jQuery.contains( docElem, elem ) ) {
9568
+ return box;
9569
+ }
9570
+
9571
+ // If we don't have gBCR, just use 0,0 rather than error
9572
+ // BlackBerry 5, iOS 3 (original iPhone)
9573
+ if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
9574
+ box = elem.getBoundingClientRect();
9575
+ }
9576
+ win = getWindow( doc );
9577
+ return {
9578
+ top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
9579
+ left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
9580
+ };
9581
+ };
9582
+
9583
+ jQuery.offset = {
9584
+
9585
+ setOffset: function( elem, options, i ) {
9586
+ var position = jQuery.css( elem, "position" );
9587
+
9588
+ // set position first, in-case top/left are set even on static elem
9589
+ if ( position === "static" ) {
9590
+ elem.style.position = "relative";
9591
+ }
9592
+
9593
+ var curElem = jQuery( elem ),
9594
+ curOffset = curElem.offset(),
9595
+ curCSSTop = jQuery.css( elem, "top" ),
9596
+ curCSSLeft = jQuery.css( elem, "left" ),
9597
+ calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
9598
+ props = {}, curPosition = {}, curTop, curLeft;
9599
+
9600
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
9601
+ if ( calculatePosition ) {
9602
+ curPosition = curElem.position();
9603
+ curTop = curPosition.top;
9604
+ curLeft = curPosition.left;
9605
+ } else {
9606
+ curTop = parseFloat( curCSSTop ) || 0;
9607
+ curLeft = parseFloat( curCSSLeft ) || 0;
9608
+ }
9609
+
9610
+ if ( jQuery.isFunction( options ) ) {
9611
+ options = options.call( elem, i, curOffset );
9612
+ }
9613
+
9614
+ if ( options.top != null ) {
9615
+ props.top = ( options.top - curOffset.top ) + curTop;
9616
+ }
9617
+ if ( options.left != null ) {
9618
+ props.left = ( options.left - curOffset.left ) + curLeft;
9619
+ }
9620
+
9621
+ if ( "using" in options ) {
9622
+ options.using.call( elem, props );
9623
+ } else {
9624
+ curElem.css( props );
9625
+ }
9626
+ }
9627
+ };
9628
+
9629
+
9630
+ jQuery.fn.extend({
9631
+
9632
+ position: function() {
9633
+ if ( !this[ 0 ] ) {
9634
+ return;
9635
+ }
9636
+
9637
+ var offsetParent, offset,
9638
+ parentOffset = { top: 0, left: 0 },
9639
+ elem = this[ 0 ];
9640
+
9641
+ // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
9642
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
9643
+ // we assume that getBoundingClientRect is available when computed position is fixed
9644
+ offset = elem.getBoundingClientRect();
9645
+ } else {
9646
+ // Get *real* offsetParent
9647
+ offsetParent = this.offsetParent();
9648
+
9649
+ // Get correct offsets
9650
+ offset = this.offset();
9651
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
9652
+ parentOffset = offsetParent.offset();
9653
+ }
9654
+
9655
+ // Add offsetParent borders
9656
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
9657
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
9658
+ }
9659
+
9660
+ // Subtract parent offsets and element margins
9661
+ // note: when an element has margin: auto the offsetLeft and marginLeft
9662
+ // are the same in Safari causing offset.left to incorrectly be 0
9663
+ return {
9664
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
9665
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
9666
+ };
9667
+ },
9668
+
9669
+ offsetParent: function() {
9670
+ return this.map(function() {
9671
+ var offsetParent = this.offsetParent || docElem;
9672
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
9673
+ offsetParent = offsetParent.offsetParent;
9674
+ }
9675
+ return offsetParent || docElem;
9676
+ });
9677
+ }
9678
+ });
9679
+
9680
+
9681
+ // Create scrollLeft and scrollTop methods
9682
+ jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
9683
+ var top = /Y/.test( prop );
9684
+
9685
+ jQuery.fn[ method ] = function( val ) {
9686
+ return jQuery.access( this, function( elem, method, val ) {
9687
+ var win = getWindow( elem );
9688
+
9689
+ if ( val === undefined ) {
9690
+ return win ? (prop in win) ? win[ prop ] :
9691
+ win.document.documentElement[ method ] :
9692
+ elem[ method ];
9693
+ }
9694
+
9695
+ if ( win ) {
9696
+ win.scrollTo(
9697
+ !top ? val : jQuery( win ).scrollLeft(),
9698
+ top ? val : jQuery( win ).scrollTop()
9699
+ );
9700
+
9701
+ } else {
9702
+ elem[ method ] = val;
9703
+ }
9704
+ }, method, val, arguments.length, null );
9705
+ };
9706
+ });
9707
+
9708
+ function getWindow( elem ) {
9709
+ return jQuery.isWindow( elem ) ?
9710
+ elem :
9711
+ elem.nodeType === 9 ?
9712
+ elem.defaultView || elem.parentWindow :
9713
+ false;
9714
+ }
9715
+ // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
9716
+ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
9717
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
9718
+ // margin is only for outerHeight, outerWidth
9719
+ jQuery.fn[ funcName ] = function( margin, value ) {
9720
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
9721
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
9722
+
9723
+ return jQuery.access( this, function( elem, type, value ) {
9724
+ var doc;
9725
+
9726
+ if ( jQuery.isWindow( elem ) ) {
9727
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
9728
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
9729
+ // https://github.com/jquery/jquery/pull/764
9730
+ return elem.document.documentElement[ "client" + name ];
9731
+ }
9732
+
9733
+ // Get document width or height
9734
+ if ( elem.nodeType === 9 ) {
9735
+ doc = elem.documentElement;
9736
+
9737
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
9738
+ // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
9739
+ return Math.max(
9740
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
9741
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
9742
+ doc[ "client" + name ]
9743
+ );
9744
+ }
9745
+
9746
+ return value === undefined ?
9747
+ // Get width or height on the element, requesting but not forcing parseFloat
9748
+ jQuery.css( elem, type, extra ) :
9749
+
9750
+ // Set width or height on the element
9751
+ jQuery.style( elem, type, value, extra );
9752
+ }, type, chainable ? margin : undefined, chainable, null );
9753
+ };
9754
+ });
9755
+ });
9756
+ // Limit scope pollution from any deprecated API
9757
+ // (function() {
9758
+
9759
+ // The number of elements contained in the matched element set
9760
+ jQuery.fn.size = function() {
9761
+ return this.length;
9762
+ };
9763
+
9764
+ jQuery.fn.andSelf = jQuery.fn.addBack;
9765
+
9766
+ // })();
9767
+ if ( typeof module === "object" && module && typeof module.exports === "object" ) {
9768
+ // Expose jQuery as module.exports in loaders that implement the Node
9769
+ // module pattern (including browserify). Do not create the global, since
9770
+ // the user will be storing it themselves locally, and globals are frowned
9771
+ // upon in the Node module world.
9772
+ module.exports = jQuery;
9773
+ } else {
9774
+ // Otherwise expose jQuery to the global object as usual
9775
+ window.jQuery = window.$ = jQuery;
9776
+
9777
+ // Register as a named AMD module, since jQuery can be concatenated with other
9778
+ // files that may use define, but not via a proper concatenation script that
9779
+ // understands anonymous AMD modules. A named AMD is safest and most robust
9780
+ // way to register. Lowercase jquery is used because AMD module names are
9781
+ // derived from file names, and jQuery is normally delivered in a lowercase
9782
+ // file name. Do this after creating the global so that if an AMD module wants
9783
+ // to call noConflict to hide this version of jQuery, it will work.
9784
+ if ( typeof define === "function" && define.amd ) {
9785
+ define( "jquery", [], function () { return jQuery; } );
9786
+ }
9787
+ }
9788
+
9789
+ })( window );
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-icons_222222_256x240.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-icons_454545_256x240.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-icons_888888_256x240.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/index.html ADDED
@@ -0,0 +1,371 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="us">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>jQuery UI Example Page</title>
6
+ <link href="jquery-ui.css" rel="stylesheet">
7
+ <style>
8
+ body{
9
+ font: 62.5% "Trebuchet MS", sans-serif;
10
+ margin: 50px;
11
+ }
12
+ .demoHeaders {
13
+ margin-top: 2em;
14
+ }
15
+ #dialog-link {
16
+ padding: .4em 1em .4em 20px;
17
+ text-decoration: none;
18
+ position: relative;
19
+ }
20
+ #dialog-link span.ui-icon {
21
+ margin: 0 5px 0 0;
22
+ position: absolute;
23
+ left: .2em;
24
+ top: 50%;
25
+ margin-top: -8px;
26
+ }
27
+ #icons {
28
+ margin: 0;
29
+ padding: 0;
30
+ }
31
+ #icons li {
32
+ margin: 2px;
33
+ position: relative;
34
+ padding: 4px 0;
35
+ cursor: pointer;
36
+ float: left;
37
+ list-style: none;
38
+ }
39
+ #icons span.ui-icon {
40
+ float: left;
41
+ margin: 0 4px;
42
+ }
43
+ .fakewindowcontain .ui-widget-overlay {
44
+ position: absolute;
45
+ }
46
+ select {
47
+ width: 200px;
48
+ }
49
+ </style>
50
+ </head>
51
+ <body>
52
+
53
+ <h1>Welcome to jQuery UI!</h1>
54
+
55
+ <div class="ui-widget">
56
+ <p>This page demonstrates the widgets and theme you selected in Download Builder. Please make sure you are using them with a compatible jQuery version.</p>
57
+ </div>
58
+
59
+ <h1>YOUR COMPONENTS:</h1>
60
+
61
+
62
+
63
+
64
+ <!-- Autocomplete -->
65
+ <h2 class="demoHeaders">Autocomplete</h2>
66
+ <div>
67
+ <input id="autocomplete" title="type &quot;a&quot;">
68
+ </div>
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+ <h2 class="demoHeaders">Framework Icons (content color preview)</h2>
79
+ <ul id="icons" class="ui-widget ui-helper-clearfix">
80
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-carat-1-n"></span></li>
81
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-ne"><span class="ui-icon ui-icon-carat-1-ne"></span></li>
82
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-e"><span class="ui-icon ui-icon-carat-1-e"></span></li>
83
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-se"><span class="ui-icon ui-icon-carat-1-se"></span></li>
84
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-s"><span class="ui-icon ui-icon-carat-1-s"></span></li>
85
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-sw"><span class="ui-icon ui-icon-carat-1-sw"></span></li>
86
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-w"><span class="ui-icon ui-icon-carat-1-w"></span></li>
87
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-nw"><span class="ui-icon ui-icon-carat-1-nw"></span></li>
88
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-2-n-s"><span class="ui-icon ui-icon-carat-2-n-s"></span></li>
89
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-2-e-w"><span class="ui-icon ui-icon-carat-2-e-w"></span></li>
90
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-n"><span class="ui-icon ui-icon-triangle-1-n"></span></li>
91
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-ne"><span class="ui-icon ui-icon-triangle-1-ne"></span></li>
92
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-e"><span class="ui-icon ui-icon-triangle-1-e"></span></li>
93
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-se"><span class="ui-icon ui-icon-triangle-1-se"></span></li>
94
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-s"><span class="ui-icon ui-icon-triangle-1-s"></span></li>
95
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-sw"><span class="ui-icon ui-icon-triangle-1-sw"></span></li>
96
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-w"><span class="ui-icon ui-icon-triangle-1-w"></span></li>
97
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-nw"><span class="ui-icon ui-icon-triangle-1-nw"></span></li>
98
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-n-s"><span class="ui-icon ui-icon-triangle-2-n-s"></span></li>
99
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-e-w"><span class="ui-icon ui-icon-triangle-2-e-w"></span></li>
100
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-n"><span class="ui-icon ui-icon-arrow-1-n"></span></li>
101
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-ne"><span class="ui-icon ui-icon-arrow-1-ne"></span></li>
102
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-e"><span class="ui-icon ui-icon-arrow-1-e"></span></li>
103
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-se"><span class="ui-icon ui-icon-arrow-1-se"></span></li>
104
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-s"><span class="ui-icon ui-icon-arrow-1-s"></span></li>
105
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-sw"><span class="ui-icon ui-icon-arrow-1-sw"></span></li>
106
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-w"><span class="ui-icon ui-icon-arrow-1-w"></span></li>
107
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-nw"><span class="ui-icon ui-icon-arrow-1-nw"></span></li>
108
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-n-s"><span class="ui-icon ui-icon-arrow-2-n-s"></span></li>
109
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-ne-sw"><span class="ui-icon ui-icon-arrow-2-ne-sw"></span></li>
110
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-e-w"><span class="ui-icon ui-icon-arrow-2-e-w"></span></li>
111
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-se-nw"><span class="ui-icon ui-icon-arrow-2-se-nw"></span></li>
112
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-n"><span class="ui-icon ui-icon-arrowstop-1-n"></span></li>
113
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-e"><span class="ui-icon ui-icon-arrowstop-1-e"></span></li>
114
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-s"><span class="ui-icon ui-icon-arrowstop-1-s"></span></li>
115
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-w"><span class="ui-icon ui-icon-arrowstop-1-w"></span></li>
116
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-n"><span class="ui-icon ui-icon-arrowthick-1-n"></span></li>
117
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-ne"><span class="ui-icon ui-icon-arrowthick-1-ne"></span></li>
118
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-e"><span class="ui-icon ui-icon-arrowthick-1-e"></span></li>
119
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-se"><span class="ui-icon ui-icon-arrowthick-1-se"></span></li>
120
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-s"><span class="ui-icon ui-icon-arrowthick-1-s"></span></li>
121
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-sw"><span class="ui-icon ui-icon-arrowthick-1-sw"></span></li>
122
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-w"><span class="ui-icon ui-icon-arrowthick-1-w"></span></li>
123
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-nw"><span class="ui-icon ui-icon-arrowthick-1-nw"></span></li>
124
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-n-s"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span></li>
125
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-ne-sw"><span class="ui-icon ui-icon-arrowthick-2-ne-sw"></span></li>
126
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-e-w"><span class="ui-icon ui-icon-arrowthick-2-e-w"></span></li>
127
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-se-nw"><span class="ui-icon ui-icon-arrowthick-2-se-nw"></span></li>
128
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-n"><span class="ui-icon ui-icon-arrowthickstop-1-n"></span></li>
129
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-e"><span class="ui-icon ui-icon-arrowthickstop-1-e"></span></li>
130
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-s"><span class="ui-icon ui-icon-arrowthickstop-1-s"></span></li>
131
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-w"><span class="ui-icon ui-icon-arrowthickstop-1-w"></span></li>
132
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-w"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span></li>
133
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-n"><span class="ui-icon ui-icon-arrowreturnthick-1-n"></span></li>
134
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-e"><span class="ui-icon ui-icon-arrowreturnthick-1-e"></span></li>
135
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-s"><span class="ui-icon ui-icon-arrowreturnthick-1-s"></span></li>
136
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-w"><span class="ui-icon ui-icon-arrowreturn-1-w"></span></li>
137
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-n"><span class="ui-icon ui-icon-arrowreturn-1-n"></span></li>
138
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-e"><span class="ui-icon ui-icon-arrowreturn-1-e"></span></li>
139
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-s"><span class="ui-icon ui-icon-arrowreturn-1-s"></span></li>
140
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-w"><span class="ui-icon ui-icon-arrowrefresh-1-w"></span></li>
141
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-n"><span class="ui-icon ui-icon-arrowrefresh-1-n"></span></li>
142
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-e"><span class="ui-icon ui-icon-arrowrefresh-1-e"></span></li>
143
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-s"><span class="ui-icon ui-icon-arrowrefresh-1-s"></span></li>
144
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4"><span class="ui-icon ui-icon-arrow-4"></span></li>
145
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4-diag"><span class="ui-icon ui-icon-arrow-4-diag"></span></li>
146
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-extlink"><span class="ui-icon ui-icon-extlink"></span></li>
147
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-newwin"><span class="ui-icon ui-icon-newwin"></span></li>
148
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-refresh"><span class="ui-icon ui-icon-refresh"></span></li>
149
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-shuffle"><span class="ui-icon ui-icon-shuffle"></span></li>
150
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-transfer-e-w"><span class="ui-icon ui-icon-transfer-e-w"></span></li>
151
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-transferthick-e-w"><span class="ui-icon ui-icon-transferthick-e-w"></span></li>
152
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-folder-collapsed"><span class="ui-icon ui-icon-folder-collapsed"></span></li>
153
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-folder-open"><span class="ui-icon ui-icon-folder-open"></span></li>
154
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-document"><span class="ui-icon ui-icon-document"></span></li>
155
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-document-b"><span class="ui-icon ui-icon-document-b"></span></li>
156
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-note"><span class="ui-icon ui-icon-note"></span></li>
157
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-mail-closed"><span class="ui-icon ui-icon-mail-closed"></span></li>
158
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-mail-open"><span class="ui-icon ui-icon-mail-open"></span></li>
159
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-suitcase"><span class="ui-icon ui-icon-suitcase"></span></li>
160
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-comment"><span class="ui-icon ui-icon-comment"></span></li>
161
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-person"><span class="ui-icon ui-icon-person"></span></li>
162
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-print"><span class="ui-icon ui-icon-print"></span></li>
163
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-trash"><span class="ui-icon ui-icon-trash"></span></li>
164
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-locked"><span class="ui-icon ui-icon-locked"></span></li>
165
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-unlocked"><span class="ui-icon ui-icon-unlocked"></span></li>
166
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-bookmark"><span class="ui-icon ui-icon-bookmark"></span></li>
167
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-tag"><span class="ui-icon ui-icon-tag"></span></li>
168
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-home"><span class="ui-icon ui-icon-home"></span></li>
169
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-flag"><span class="ui-icon ui-icon-flag"></span></li>
170
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-calculator"><span class="ui-icon ui-icon-calculator"></span></li>
171
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-cart"><span class="ui-icon ui-icon-cart"></span></li>
172
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pencil"><span class="ui-icon ui-icon-pencil"></span></li>
173
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-clock"><span class="ui-icon ui-icon-clock"></span></li>
174
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-disk"><span class="ui-icon ui-icon-disk"></span></li>
175
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-calendar"><span class="ui-icon ui-icon-calendar"></span></li>
176
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-zoomin"><span class="ui-icon ui-icon-zoomin"></span></li>
177
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-zoomout"><span class="ui-icon ui-icon-zoomout"></span></li>
178
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-search"><span class="ui-icon ui-icon-search"></span></li>
179
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-wrench"><span class="ui-icon ui-icon-wrench"></span></li>
180
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-gear"><span class="ui-icon ui-icon-gear"></span></li>
181
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-heart"><span class="ui-icon ui-icon-heart"></span></li>
182
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-star"><span class="ui-icon ui-icon-star"></span></li>
183
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-link"><span class="ui-icon ui-icon-link"></span></li>
184
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-cancel"><span class="ui-icon ui-icon-cancel"></span></li>
185
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-plus"><span class="ui-icon ui-icon-plus"></span></li>
186
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-plusthick"><span class="ui-icon ui-icon-plusthick"></span></li>
187
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-minus"><span class="ui-icon ui-icon-minus"></span></li>
188
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-minusthick"><span class="ui-icon ui-icon-minusthick"></span></li>
189
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-close"><span class="ui-icon ui-icon-close"></span></li>
190
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-closethick"><span class="ui-icon ui-icon-closethick"></span></li>
191
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-key"><span class="ui-icon ui-icon-key"></span></li>
192
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-lightbulb"><span class="ui-icon ui-icon-lightbulb"></span></li>
193
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-scissors"><span class="ui-icon ui-icon-scissors"></span></li>
194
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-clipboard"><span class="ui-icon ui-icon-clipboard"></span></li>
195
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-copy"><span class="ui-icon ui-icon-copy"></span></li>
196
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-contact"><span class="ui-icon ui-icon-contact"></span></li>
197
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-image"><span class="ui-icon ui-icon-image"></span></li>
198
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-video"><span class="ui-icon ui-icon-video"></span></li>
199
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-script"><span class="ui-icon ui-icon-script"></span></li>
200
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-alert"><span class="ui-icon ui-icon-alert"></span></li>
201
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-info"><span class="ui-icon ui-icon-info"></span></li>
202
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-notice"><span class="ui-icon ui-icon-notice"></span></li>
203
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-help"><span class="ui-icon ui-icon-help"></span></li>
204
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-check"><span class="ui-icon ui-icon-check"></span></li>
205
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-bullet"><span class="ui-icon ui-icon-bullet"></span></li>
206
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-radio-off"><span class="ui-icon ui-icon-radio-off"></span></li>
207
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-radio-on"><span class="ui-icon ui-icon-radio-on"></span></li>
208
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pin-w"><span class="ui-icon ui-icon-pin-w"></span></li>
209
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pin-s"><span class="ui-icon ui-icon-pin-s"></span></li>
210
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-play"><span class="ui-icon ui-icon-play"></span></li>
211
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pause"><span class="ui-icon ui-icon-pause"></span></li>
212
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-next"><span class="ui-icon ui-icon-seek-next"></span></li>
213
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-prev"><span class="ui-icon ui-icon-seek-prev"></span></li>
214
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-end"><span class="ui-icon ui-icon-seek-end"></span></li>
215
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-first"><span class="ui-icon ui-icon-seek-first"></span></li>
216
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-stop"><span class="ui-icon ui-icon-stop"></span></li>
217
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-eject"><span class="ui-icon ui-icon-eject"></span></li>
218
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-volume-off"><span class="ui-icon ui-icon-volume-off"></span></li>
219
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-volume-on"><span class="ui-icon ui-icon-volume-on"></span></li>
220
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-power"><span class="ui-icon ui-icon-power"></span></li>
221
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-signal-diag"><span class="ui-icon ui-icon-signal-diag"></span></li>
222
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-signal"><span class="ui-icon ui-icon-signal"></span></li>
223
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-0"><span class="ui-icon ui-icon-battery-0"></span></li>
224
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-1"><span class="ui-icon ui-icon-battery-1"></span></li>
225
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-2"><span class="ui-icon ui-icon-battery-2"></span></li>
226
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-3"><span class="ui-icon ui-icon-battery-3"></span></li>
227
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-plus"><span class="ui-icon ui-icon-circle-plus"></span></li>
228
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-minus"><span class="ui-icon ui-icon-circle-minus"></span></li>
229
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-close"><span class="ui-icon ui-icon-circle-close"></span></li>
230
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-e"><span class="ui-icon ui-icon-circle-triangle-e"></span></li>
231
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-s"><span class="ui-icon ui-icon-circle-triangle-s"></span></li>
232
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-w"><span class="ui-icon ui-icon-circle-triangle-w"></span></li>
233
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-n"><span class="ui-icon ui-icon-circle-triangle-n"></span></li>
234
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-e"><span class="ui-icon ui-icon-circle-arrow-e"></span></li>
235
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-s"><span class="ui-icon ui-icon-circle-arrow-s"></span></li>
236
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-w"><span class="ui-icon ui-icon-circle-arrow-w"></span></li>
237
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-n"><span class="ui-icon ui-icon-circle-arrow-n"></span></li>
238
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomin"><span class="ui-icon ui-icon-circle-zoomin"></span></li>
239
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomout"><span class="ui-icon ui-icon-circle-zoomout"></span></li>
240
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-check"><span class="ui-icon ui-icon-circle-check"></span></li>
241
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-plus"><span class="ui-icon ui-icon-circlesmall-plus"></span></li>
242
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-minus"><span class="ui-icon ui-icon-circlesmall-minus"></span></li>
243
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-close"><span class="ui-icon ui-icon-circlesmall-close"></span></li>
244
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-plus"><span class="ui-icon ui-icon-squaresmall-plus"></span></li>
245
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-minus"><span class="ui-icon ui-icon-squaresmall-minus"></span></li>
246
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-close"><span class="ui-icon ui-icon-squaresmall-close"></span></li>
247
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-vertical"><span class="ui-icon ui-icon-grip-dotted-vertical"></span></li>
248
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-horizontal"><span class="ui-icon ui-icon-grip-dotted-horizontal"></span></li>
249
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-vertical"><span class="ui-icon ui-icon-grip-solid-vertical"></span></li>
250
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-horizontal"><span class="ui-icon ui-icon-grip-solid-horizontal"></span></li>
251
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-gripsmall-diagonal-se"><span class="ui-icon ui-icon-gripsmall-diagonal-se"></span></li>
252
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-diagonal-se"><span class="ui-icon ui-icon-grip-diagonal-se"></span></li>
253
+ </ul>
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+ <!-- Menu -->
267
+ <h2 class="demoHeaders">Menu</h2>
268
+ <ul style="width:100px;" id="menu">
269
+ <li>Item 1</li>
270
+ <li>Item 2</li>
271
+ <li>Item 3
272
+ <ul>
273
+ <li>Item 3-1</li>
274
+ <li>Item 3-2</li>
275
+ <li>Item 3-3</li>
276
+ <li>Item 3-4</li>
277
+ <li>Item 3-5</li>
278
+ </ul>
279
+ </li>
280
+ <li>Item 4</li>
281
+ <li>Item 5</li>
282
+ </ul>
283
+
284
+
285
+
286
+
287
+ <!-- Highlight / Error -->
288
+ <h2 class="demoHeaders">Highlight / Error</h2>
289
+ <div class="ui-widget">
290
+ <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
291
+ <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
292
+ <strong>Hey!</strong> Sample ui-state-highlight style.</p>
293
+ </div>
294
+ </div>
295
+ <br>
296
+ <div class="ui-widget">
297
+ <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
298
+ <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
299
+ <strong>Alert:</strong> Sample ui-state-error style.</p>
300
+ </div>
301
+ </div>
302
+
303
+ <script src="external/jquery/jquery.js"></script>
304
+ <script src="jquery-ui.js"></script>
305
+ <script>
306
+
307
+
308
+
309
+ var availableTags = [
310
+ "ActionScript",
311
+ "AppleScript",
312
+ "Asp",
313
+ "BASIC",
314
+ "C",
315
+ "C++",
316
+ "Clojure",
317
+ "COBOL",
318
+ "ColdFusion",
319
+ "Erlang",
320
+ "Fortran",
321
+ "Groovy",
322
+ "Haskell",
323
+ "Java",
324
+ "JavaScript",
325
+ "Lisp",
326
+ "Perl",
327
+ "PHP",
328
+ "Python",
329
+ "Ruby",
330
+ "Scala",
331
+ "Scheme"
332
+ ];
333
+ $( "#autocomplete" ).autocomplete({
334
+ source: availableTags
335
+ });
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+ $( "#menu" ).menu();
354
+
355
+
356
+
357
+
358
+
359
+
360
+ // Hover states on the static widgets
361
+ $( "#dialog-link, #icons li" ).hover(
362
+ function() {
363
+ $( this ).addClass( "ui-state-hover" );
364
+ },
365
+ function() {
366
+ $( this ).removeClass( "ui-state-hover" );
367
+ }
368
+ );
369
+ </script>
370
+ </body>
371
+ </html>
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.css ADDED
@@ -0,0 +1,544 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.4 - 2015-05-28
2
+ * http://jqueryui.com
3
+ * Includes: core.css, autocomplete.css, menu.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/
5
+ * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden {
10
+ display: none;
11
+ }
12
+ .ui-helper-hidden-accessible {
13
+ border: 0;
14
+ clip: rect(0 0 0 0);
15
+ height: 1px;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ padding: 0;
19
+ position: absolute;
20
+ width: 1px;
21
+ }
22
+ .ui-helper-reset {
23
+ margin: 0;
24
+ padding: 0;
25
+ border: 0;
26
+ outline: 0;
27
+ line-height: 1.3;
28
+ text-decoration: none;
29
+ font-size: 100%;
30
+ list-style: none;
31
+ }
32
+ .ui-helper-clearfix:before,
33
+ .ui-helper-clearfix:after {
34
+ content: "";
35
+ display: table;
36
+ border-collapse: collapse;
37
+ }
38
+ .ui-helper-clearfix:after {
39
+ clear: both;
40
+ }
41
+ .ui-helper-clearfix {
42
+ min-height: 0; /* support: IE7 */
43
+ }
44
+ .ui-helper-zfix {
45
+ width: 100%;
46
+ height: 100%;
47
+ top: 0;
48
+ left: 0;
49
+ position: absolute;
50
+ opacity: 0;
51
+ filter:Alpha(Opacity=0); /* support: IE8 */
52
+ }
53
+
54
+ .ui-front {
55
+ z-index: 100;
56
+ }
57
+
58
+
59
+ /* Interaction Cues
60
+ ----------------------------------*/
61
+ .ui-state-disabled {
62
+ cursor: default !important;
63
+ }
64
+
65
+
66
+ /* Icons
67
+ ----------------------------------*/
68
+
69
+ /* states and images */
70
+ .ui-icon {
71
+ display: block;
72
+ text-indent: -99999px;
73
+ overflow: hidden;
74
+ background-repeat: no-repeat;
75
+ }
76
+
77
+
78
+ /* Misc visuals
79
+ ----------------------------------*/
80
+
81
+ /* Overlays */
82
+ .ui-widget-overlay {
83
+ position: fixed;
84
+ top: 0;
85
+ left: 0;
86
+ width: 100%;
87
+ height: 100%;
88
+ }
89
+ .ui-autocomplete {
90
+ position: absolute;
91
+ top: 0;
92
+ left: 0;
93
+ cursor: default;
94
+ }
95
+ .ui-menu {
96
+ list-style: none;
97
+ padding: 0;
98
+ margin: 0;
99
+ display: block;
100
+ outline: none;
101
+ }
102
+ .ui-menu .ui-menu {
103
+ position: absolute;
104
+ }
105
+ .ui-menu .ui-menu-item {
106
+ position: relative;
107
+ margin: 0;
108
+ padding: 3px 1em 3px .4em;
109
+ cursor: pointer;
110
+ min-height: 0; /* support: IE7 */
111
+ /* support: IE10, see #8844 */
112
+ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
113
+ }
114
+ .ui-menu .ui-menu-divider {
115
+ margin: 5px 0;
116
+ height: 0;
117
+ font-size: 0;
118
+ line-height: 0;
119
+ border-width: 1px 0 0 0;
120
+ }
121
+ .ui-menu .ui-state-focus,
122
+ .ui-menu .ui-state-active {
123
+ margin: -1px;
124
+ }
125
+
126
+ /* icon support */
127
+ .ui-menu-icons {
128
+ position: relative;
129
+ }
130
+ .ui-menu-icons .ui-menu-item {
131
+ padding-left: 2em;
132
+ }
133
+
134
+ /* left-aligned */
135
+ .ui-menu .ui-icon {
136
+ position: absolute;
137
+ top: 0;
138
+ bottom: 0;
139
+ left: .2em;
140
+ margin: auto 0;
141
+ }
142
+
143
+ /* right-aligned */
144
+ .ui-menu .ui-menu-icon {
145
+ left: auto;
146
+ right: 0;
147
+ }
148
+
149
+ /* Component containers
150
+ ----------------------------------*/
151
+ .ui-widget {
152
+ font-family: Verdana,Arial,sans-serif;
153
+ font-size: 1.1em;
154
+ }
155
+ .ui-widget .ui-widget {
156
+ font-size: 1em;
157
+ }
158
+ .ui-widget input,
159
+ .ui-widget select,
160
+ .ui-widget textarea,
161
+ .ui-widget button {
162
+ font-family: Verdana,Arial,sans-serif;
163
+ font-size: 1em;
164
+ }
165
+ .ui-widget-content {
166
+ border: 1px solid #aaaaaa;
167
+ background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
168
+ color: #222222;
169
+ }
170
+ .ui-widget-content a {
171
+ color: #222222;
172
+ }
173
+ .ui-widget-header {
174
+ border: 1px solid #aaaaaa;
175
+ background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
176
+ color: #222222;
177
+ font-weight: bold;
178
+ }
179
+ .ui-widget-header a {
180
+ color: #222222;
181
+ }
182
+
183
+ /* Interaction states
184
+ ----------------------------------*/
185
+ .ui-state-default,
186
+ .ui-widget-content .ui-state-default,
187
+ .ui-widget-header .ui-state-default {
188
+ border: 1px solid #d3d3d3;
189
+ background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
190
+ font-weight: normal;
191
+ color: #555555;
192
+ }
193
+ .ui-state-default a,
194
+ .ui-state-default a:link,
195
+ .ui-state-default a:visited {
196
+ color: #555555;
197
+ text-decoration: none;
198
+ }
199
+ .ui-state-hover,
200
+ .ui-widget-content .ui-state-hover,
201
+ .ui-widget-header .ui-state-hover,
202
+ .ui-state-focus,
203
+ .ui-widget-content .ui-state-focus,
204
+ .ui-widget-header .ui-state-focus {
205
+ border: 1px solid #999999;
206
+ background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
207
+ font-weight: normal;
208
+ color: #212121;
209
+ }
210
+ .ui-state-hover a,
211
+ .ui-state-hover a:hover,
212
+ .ui-state-hover a:link,
213
+ .ui-state-hover a:visited,
214
+ .ui-state-focus a,
215
+ .ui-state-focus a:hover,
216
+ .ui-state-focus a:link,
217
+ .ui-state-focus a:visited {
218
+ color: #212121;
219
+ text-decoration: none;
220
+ }
221
+ .ui-state-active,
222
+ .ui-widget-content .ui-state-active,
223
+ .ui-widget-header .ui-state-active {
224
+ border: 1px solid #aaaaaa;
225
+ background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
226
+ font-weight: normal;
227
+ color: #212121;
228
+ }
229
+ .ui-state-active a,
230
+ .ui-state-active a:link,
231
+ .ui-state-active a:visited {
232
+ color: #212121;
233
+ text-decoration: none;
234
+ }
235
+
236
+ /* Interaction Cues
237
+ ----------------------------------*/
238
+ .ui-state-highlight,
239
+ .ui-widget-content .ui-state-highlight,
240
+ .ui-widget-header .ui-state-highlight {
241
+ border: 1px solid #fcefa1;
242
+ background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
243
+ color: #363636;
244
+ }
245
+ .ui-state-highlight a,
246
+ .ui-widget-content .ui-state-highlight a,
247
+ .ui-widget-header .ui-state-highlight a {
248
+ color: #363636;
249
+ }
250
+ .ui-state-error,
251
+ .ui-widget-content .ui-state-error,
252
+ .ui-widget-header .ui-state-error {
253
+ border: 1px solid #cd0a0a;
254
+ background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
255
+ color: #cd0a0a;
256
+ }
257
+ .ui-state-error a,
258
+ .ui-widget-content .ui-state-error a,
259
+ .ui-widget-header .ui-state-error a {
260
+ color: #cd0a0a;
261
+ }
262
+ .ui-state-error-text,
263
+ .ui-widget-content .ui-state-error-text,
264
+ .ui-widget-header .ui-state-error-text {
265
+ color: #cd0a0a;
266
+ }
267
+ .ui-priority-primary,
268
+ .ui-widget-content .ui-priority-primary,
269
+ .ui-widget-header .ui-priority-primary {
270
+ font-weight: bold;
271
+ }
272
+ .ui-priority-secondary,
273
+ .ui-widget-content .ui-priority-secondary,
274
+ .ui-widget-header .ui-priority-secondary {
275
+ opacity: .7;
276
+ filter:Alpha(Opacity=70); /* support: IE8 */
277
+ font-weight: normal;
278
+ }
279
+ .ui-state-disabled,
280
+ .ui-widget-content .ui-state-disabled,
281
+ .ui-widget-header .ui-state-disabled {
282
+ opacity: .35;
283
+ filter:Alpha(Opacity=35); /* support: IE8 */
284
+ background-image: none;
285
+ }
286
+ .ui-state-disabled .ui-icon {
287
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
288
+ }
289
+
290
+ /* Icons
291
+ ----------------------------------*/
292
+
293
+ /* states and images */
294
+ .ui-icon {
295
+ width: 16px;
296
+ height: 16px;
297
+ }
298
+ .ui-icon,
299
+ .ui-widget-content .ui-icon {
300
+ background-image: url("images/ui-icons_222222_256x240.png");
301
+ }
302
+ .ui-widget-header .ui-icon {
303
+ background-image: url("images/ui-icons_222222_256x240.png");
304
+ }
305
+ .ui-state-default .ui-icon {
306
+ background-image: url("images/ui-icons_888888_256x240.png");
307
+ }
308
+ .ui-state-hover .ui-icon,
309
+ .ui-state-focus .ui-icon {
310
+ background-image: url("images/ui-icons_454545_256x240.png");
311
+ }
312
+ .ui-state-active .ui-icon {
313
+ background-image: url("images/ui-icons_454545_256x240.png");
314
+ }
315
+ .ui-state-highlight .ui-icon {
316
+ background-image: url("images/ui-icons_2e83ff_256x240.png");
317
+ }
318
+ .ui-state-error .ui-icon,
319
+ .ui-state-error-text .ui-icon {
320
+ background-image: url("images/ui-icons_cd0a0a_256x240.png");
321
+ }
322
+
323
+ /* positioning */
324
+ .ui-icon-blank { background-position: 16px 16px; }
325
+ .ui-icon-carat-1-n { background-position: 0 0; }
326
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
327
+ .ui-icon-carat-1-e { background-position: -32px 0; }
328
+ .ui-icon-carat-1-se { background-position: -48px 0; }
329
+ .ui-icon-carat-1-s { background-position: -64px 0; }
330
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
331
+ .ui-icon-carat-1-w { background-position: -96px 0; }
332
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
333
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
334
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
335
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
336
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
337
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
338
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
339
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
340
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
341
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
342
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
343
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
344
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
345
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
346
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
347
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
348
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
349
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
350
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
351
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
352
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
353
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
354
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
355
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
356
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
357
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
358
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
359
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
360
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
361
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
362
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
363
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
364
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
365
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
366
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
367
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
368
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
369
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
370
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
371
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
372
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
373
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
374
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
375
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
376
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
377
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
378
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
379
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
380
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
381
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
382
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
383
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
384
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
385
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
386
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
387
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
388
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
389
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
390
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
391
+ .ui-icon-extlink { background-position: -32px -80px; }
392
+ .ui-icon-newwin { background-position: -48px -80px; }
393
+ .ui-icon-refresh { background-position: -64px -80px; }
394
+ .ui-icon-shuffle { background-position: -80px -80px; }
395
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
396
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
397
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
398
+ .ui-icon-folder-open { background-position: -16px -96px; }
399
+ .ui-icon-document { background-position: -32px -96px; }
400
+ .ui-icon-document-b { background-position: -48px -96px; }
401
+ .ui-icon-note { background-position: -64px -96px; }
402
+ .ui-icon-mail-closed { background-position: -80px -96px; }
403
+ .ui-icon-mail-open { background-position: -96px -96px; }
404
+ .ui-icon-suitcase { background-position: -112px -96px; }
405
+ .ui-icon-comment { background-position: -128px -96px; }
406
+ .ui-icon-person { background-position: -144px -96px; }
407
+ .ui-icon-print { background-position: -160px -96px; }
408
+ .ui-icon-trash { background-position: -176px -96px; }
409
+ .ui-icon-locked { background-position: -192px -96px; }
410
+ .ui-icon-unlocked { background-position: -208px -96px; }
411
+ .ui-icon-bookmark { background-position: -224px -96px; }
412
+ .ui-icon-tag { background-position: -240px -96px; }
413
+ .ui-icon-home { background-position: 0 -112px; }
414
+ .ui-icon-flag { background-position: -16px -112px; }
415
+ .ui-icon-calendar { background-position: -32px -112px; }
416
+ .ui-icon-cart { background-position: -48px -112px; }
417
+ .ui-icon-pencil { background-position: -64px -112px; }
418
+ .ui-icon-clock { background-position: -80px -112px; }
419
+ .ui-icon-disk { background-position: -96px -112px; }
420
+ .ui-icon-calculator { background-position: -112px -112px; }
421
+ .ui-icon-zoomin { background-position: -128px -112px; }
422
+ .ui-icon-zoomout { background-position: -144px -112px; }
423
+ .ui-icon-search { background-position: -160px -112px; }
424
+ .ui-icon-wrench { background-position: -176px -112px; }
425
+ .ui-icon-gear { background-position: -192px -112px; }
426
+ .ui-icon-heart { background-position: -208px -112px; }
427
+ .ui-icon-star { background-position: -224px -112px; }
428
+ .ui-icon-link { background-position: -240px -112px; }
429
+ .ui-icon-cancel { background-position: 0 -128px; }
430
+ .ui-icon-plus { background-position: -16px -128px; }
431
+ .ui-icon-plusthick { background-position: -32px -128px; }
432
+ .ui-icon-minus { background-position: -48px -128px; }
433
+ .ui-icon-minusthick { background-position: -64px -128px; }
434
+ .ui-icon-close { background-position: -80px -128px; }
435
+ .ui-icon-closethick { background-position: -96px -128px; }
436
+ .ui-icon-key { background-position: -112px -128px; }
437
+ .ui-icon-lightbulb { background-position: -128px -128px; }
438
+ .ui-icon-scissors { background-position: -144px -128px; }
439
+ .ui-icon-clipboard { background-position: -160px -128px; }
440
+ .ui-icon-copy { background-position: -176px -128px; }
441
+ .ui-icon-contact { background-position: -192px -128px; }
442
+ .ui-icon-image { background-position: -208px -128px; }
443
+ .ui-icon-video { background-position: -224px -128px; }
444
+ .ui-icon-script { background-position: -240px -128px; }
445
+ .ui-icon-alert { background-position: 0 -144px; }
446
+ .ui-icon-info { background-position: -16px -144px; }
447
+ .ui-icon-notice { background-position: -32px -144px; }
448
+ .ui-icon-help { background-position: -48px -144px; }
449
+ .ui-icon-check { background-position: -64px -144px; }
450
+ .ui-icon-bullet { background-position: -80px -144px; }
451
+ .ui-icon-radio-on { background-position: -96px -144px; }
452
+ .ui-icon-radio-off { background-position: -112px -144px; }
453
+ .ui-icon-pin-w { background-position: -128px -144px; }
454
+ .ui-icon-pin-s { background-position: -144px -144px; }
455
+ .ui-icon-play { background-position: 0 -160px; }
456
+ .ui-icon-pause { background-position: -16px -160px; }
457
+ .ui-icon-seek-next { background-position: -32px -160px; }
458
+ .ui-icon-seek-prev { background-position: -48px -160px; }
459
+ .ui-icon-seek-end { background-position: -64px -160px; }
460
+ .ui-icon-seek-start { background-position: -80px -160px; }
461
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
462
+ .ui-icon-seek-first { background-position: -80px -160px; }
463
+ .ui-icon-stop { background-position: -96px -160px; }
464
+ .ui-icon-eject { background-position: -112px -160px; }
465
+ .ui-icon-volume-off { background-position: -128px -160px; }
466
+ .ui-icon-volume-on { background-position: -144px -160px; }
467
+ .ui-icon-power { background-position: 0 -176px; }
468
+ .ui-icon-signal-diag { background-position: -16px -176px; }
469
+ .ui-icon-signal { background-position: -32px -176px; }
470
+ .ui-icon-battery-0 { background-position: -48px -176px; }
471
+ .ui-icon-battery-1 { background-position: -64px -176px; }
472
+ .ui-icon-battery-2 { background-position: -80px -176px; }
473
+ .ui-icon-battery-3 { background-position: -96px -176px; }
474
+ .ui-icon-circle-plus { background-position: 0 -192px; }
475
+ .ui-icon-circle-minus { background-position: -16px -192px; }
476
+ .ui-icon-circle-close { background-position: -32px -192px; }
477
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
478
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
479
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
480
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
481
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
482
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
483
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
484
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
485
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
486
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
487
+ .ui-icon-circle-check { background-position: -208px -192px; }
488
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
489
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
490
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
491
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
492
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
493
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
494
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
495
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
496
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
497
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
498
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
499
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
500
+
501
+
502
+ /* Misc visuals
503
+ ----------------------------------*/
504
+
505
+ /* Corner radius */
506
+ .ui-corner-all,
507
+ .ui-corner-top,
508
+ .ui-corner-left,
509
+ .ui-corner-tl {
510
+ border-top-left-radius: 4px;
511
+ }
512
+ .ui-corner-all,
513
+ .ui-corner-top,
514
+ .ui-corner-right,
515
+ .ui-corner-tr {
516
+ border-top-right-radius: 4px;
517
+ }
518
+ .ui-corner-all,
519
+ .ui-corner-bottom,
520
+ .ui-corner-left,
521
+ .ui-corner-bl {
522
+ border-bottom-left-radius: 4px;
523
+ }
524
+ .ui-corner-all,
525
+ .ui-corner-bottom,
526
+ .ui-corner-right,
527
+ .ui-corner-br {
528
+ border-bottom-right-radius: 4px;
529
+ }
530
+
531
+ /* Overlays */
532
+ .ui-widget-overlay {
533
+ background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
534
+ opacity: .3;
535
+ filter: Alpha(Opacity=30); /* support: IE8 */
536
+ }
537
+ .ui-widget-shadow {
538
+ margin: -8px 0 0 -8px;
539
+ padding: 8px;
540
+ background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
541
+ opacity: .3;
542
+ filter: Alpha(Opacity=30); /* support: IE8 */
543
+ border-radius: 8px;
544
+ }
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.js ADDED
@@ -0,0 +1,2610 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.4 - 2015-05-28
2
+ * http://jqueryui.com
3
+ * Includes: core.js, widget.js, position.js, autocomplete.js, menu.js
4
+ * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
5
+
6
+ (function( factory ) {
7
+ if ( typeof define === "function" && define.amd ) {
8
+
9
+ // AMD. Register as an anonymous module.
10
+ define([ "jquery" ], factory );
11
+ } else {
12
+
13
+ // Browser globals
14
+ factory( jQuery );
15
+ }
16
+ }(function( $ ) {
17
+ /*!
18
+ * jQuery UI Core 1.11.4
19
+ * http://jqueryui.com
20
+ *
21
+ * Copyright jQuery Foundation and other contributors
22
+ * Released under the MIT license.
23
+ * http://jquery.org/license
24
+ *
25
+ * http://api.jqueryui.com/category/ui-core/
26
+ */
27
+
28
+
29
+ // $.ui might exist from components with no dependencies, e.g., $.ui.position
30
+ $.ui = $.ui || {};
31
+
32
+ $.extend( $.ui, {
33
+ version: "1.11.4",
34
+
35
+ keyCode: {
36
+ BACKSPACE: 8,
37
+ COMMA: 188,
38
+ DELETE: 46,
39
+ DOWN: 40,
40
+ END: 35,
41
+ ENTER: 13,
42
+ ESCAPE: 27,
43
+ HOME: 36,
44
+ LEFT: 37,
45
+ PAGE_DOWN: 34,
46
+ PAGE_UP: 33,
47
+ PERIOD: 190,
48
+ RIGHT: 39,
49
+ SPACE: 32,
50
+ TAB: 9,
51
+ UP: 38
52
+ }
53
+ });
54
+
55
+ // plugins
56
+ $.fn.extend({
57
+ scrollParent: function( includeHidden ) {
58
+ var position = this.css( "position" ),
59
+ excludeStaticParent = position === "absolute",
60
+ overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
61
+ scrollParent = this.parents().filter( function() {
62
+ var parent = $( this );
63
+ if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
64
+ return false;
65
+ }
66
+ return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
67
+ }).eq( 0 );
68
+
69
+ return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
70
+ },
71
+
72
+ uniqueId: (function() {
73
+ var uuid = 0;
74
+
75
+ return function() {
76
+ return this.each(function() {
77
+ if ( !this.id ) {
78
+ this.id = "ui-id-" + ( ++uuid );
79
+ }
80
+ });
81
+ };
82
+ })(),
83
+
84
+ removeUniqueId: function() {
85
+ return this.each(function() {
86
+ if ( /^ui-id-\d+$/.test( this.id ) ) {
87
+ $( this ).removeAttr( "id" );
88
+ }
89
+ });
90
+ }
91
+ });
92
+
93
+ // selectors
94
+ function focusable( element, isTabIndexNotNaN ) {
95
+ var map, mapName, img,
96
+ nodeName = element.nodeName.toLowerCase();
97
+ if ( "area" === nodeName ) {
98
+ map = element.parentNode;
99
+ mapName = map.name;
100
+ if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
101
+ return false;
102
+ }
103
+ img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
104
+ return !!img && visible( img );
105
+ }
106
+ return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
107
+ !element.disabled :
108
+ "a" === nodeName ?
109
+ element.href || isTabIndexNotNaN :
110
+ isTabIndexNotNaN) &&
111
+ // the element and all of its ancestors must be visible
112
+ visible( element );
113
+ }
114
+
115
+ function visible( element ) {
116
+ return $.expr.filters.visible( element ) &&
117
+ !$( element ).parents().addBack().filter(function() {
118
+ return $.css( this, "visibility" ) === "hidden";
119
+ }).length;
120
+ }
121
+
122
+ $.extend( $.expr[ ":" ], {
123
+ data: $.expr.createPseudo ?
124
+ $.expr.createPseudo(function( dataName ) {
125
+ return function( elem ) {
126
+ return !!$.data( elem, dataName );
127
+ };
128
+ }) :
129
+ // support: jQuery <1.8
130
+ function( elem, i, match ) {
131
+ return !!$.data( elem, match[ 3 ] );
132
+ },
133
+
134
+ focusable: function( element ) {
135
+ return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
136
+ },
137
+
138
+ tabbable: function( element ) {
139
+ var tabIndex = $.attr( element, "tabindex" ),
140
+ isTabIndexNaN = isNaN( tabIndex );
141
+ return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
142
+ }
143
+ });
144
+
145
+ // support: jQuery <1.8
146
+ if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
147
+ $.each( [ "Width", "Height" ], function( i, name ) {
148
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
149
+ type = name.toLowerCase(),
150
+ orig = {
151
+ innerWidth: $.fn.innerWidth,
152
+ innerHeight: $.fn.innerHeight,
153
+ outerWidth: $.fn.outerWidth,
154
+ outerHeight: $.fn.outerHeight
155
+ };
156
+
157
+ function reduce( elem, size, border, margin ) {
158
+ $.each( side, function() {
159
+ size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
160
+ if ( border ) {
161
+ size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
162
+ }
163
+ if ( margin ) {
164
+ size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
165
+ }
166
+ });
167
+ return size;
168
+ }
169
+
170
+ $.fn[ "inner" + name ] = function( size ) {
171
+ if ( size === undefined ) {
172
+ return orig[ "inner" + name ].call( this );
173
+ }
174
+
175
+ return this.each(function() {
176
+ $( this ).css( type, reduce( this, size ) + "px" );
177
+ });
178
+ };
179
+
180
+ $.fn[ "outer" + name] = function( size, margin ) {
181
+ if ( typeof size !== "number" ) {
182
+ return orig[ "outer" + name ].call( this, size );
183
+ }
184
+
185
+ return this.each(function() {
186
+ $( this).css( type, reduce( this, size, true, margin ) + "px" );
187
+ });
188
+ };
189
+ });
190
+ }
191
+
192
+ // support: jQuery <1.8
193
+ if ( !$.fn.addBack ) {
194
+ $.fn.addBack = function( selector ) {
195
+ return this.add( selector == null ?
196
+ this.prevObject : this.prevObject.filter( selector )
197
+ );
198
+ };
199
+ }
200
+
201
+ // support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
202
+ if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
203
+ $.fn.removeData = (function( removeData ) {
204
+ return function( key ) {
205
+ if ( arguments.length ) {
206
+ return removeData.call( this, $.camelCase( key ) );
207
+ } else {
208
+ return removeData.call( this );
209
+ }
210
+ };
211
+ })( $.fn.removeData );
212
+ }
213
+
214
+ // deprecated
215
+ $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
216
+
217
+ $.fn.extend({
218
+ focus: (function( orig ) {
219
+ return function( delay, fn ) {
220
+ return typeof delay === "number" ?
221
+ this.each(function() {
222
+ var elem = this;
223
+ setTimeout(function() {
224
+ $( elem ).focus();
225
+ if ( fn ) {
226
+ fn.call( elem );
227
+ }
228
+ }, delay );
229
+ }) :
230
+ orig.apply( this, arguments );
231
+ };
232
+ })( $.fn.focus ),
233
+
234
+ disableSelection: (function() {
235
+ var eventType = "onselectstart" in document.createElement( "div" ) ?
236
+ "selectstart" :
237
+ "mousedown";
238
+
239
+ return function() {
240
+ return this.bind( eventType + ".ui-disableSelection", function( event ) {
241
+ event.preventDefault();
242
+ });
243
+ };
244
+ })(),
245
+
246
+ enableSelection: function() {
247
+ return this.unbind( ".ui-disableSelection" );
248
+ },
249
+
250
+ zIndex: function( zIndex ) {
251
+ if ( zIndex !== undefined ) {
252
+ return this.css( "zIndex", zIndex );
253
+ }
254
+
255
+ if ( this.length ) {
256
+ var elem = $( this[ 0 ] ), position, value;
257
+ while ( elem.length && elem[ 0 ] !== document ) {
258
+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
259
+ // This makes behavior of this function consistent across browsers
260
+ // WebKit always returns auto if the element is positioned
261
+ position = elem.css( "position" );
262
+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
263
+ // IE returns 0 when zIndex is not specified
264
+ // other browsers return a string
265
+ // we ignore the case of nested elements with an explicit value of 0
266
+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
267
+ value = parseInt( elem.css( "zIndex" ), 10 );
268
+ if ( !isNaN( value ) && value !== 0 ) {
269
+ return value;
270
+ }
271
+ }
272
+ elem = elem.parent();
273
+ }
274
+ }
275
+
276
+ return 0;
277
+ }
278
+ });
279
+
280
+ // $.ui.plugin is deprecated. Use $.widget() extensions instead.
281
+ $.ui.plugin = {
282
+ add: function( module, option, set ) {
283
+ var i,
284
+ proto = $.ui[ module ].prototype;
285
+ for ( i in set ) {
286
+ proto.plugins[ i ] = proto.plugins[ i ] || [];
287
+ proto.plugins[ i ].push( [ option, set[ i ] ] );
288
+ }
289
+ },
290
+ call: function( instance, name, args, allowDisconnected ) {
291
+ var i,
292
+ set = instance.plugins[ name ];
293
+
294
+ if ( !set ) {
295
+ return;
296
+ }
297
+
298
+ if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
299
+ return;
300
+ }
301
+
302
+ for ( i = 0; i < set.length; i++ ) {
303
+ if ( instance.options[ set[ i ][ 0 ] ] ) {
304
+ set[ i ][ 1 ].apply( instance.element, args );
305
+ }
306
+ }
307
+ }
308
+ };
309
+
310
+
311
+ /*!
312
+ * jQuery UI Widget 1.11.4
313
+ * http://jqueryui.com
314
+ *
315
+ * Copyright jQuery Foundation and other contributors
316
+ * Released under the MIT license.
317
+ * http://jquery.org/license
318
+ *
319
+ * http://api.jqueryui.com/jQuery.widget/
320
+ */
321
+
322
+
323
+ var widget_uuid = 0,
324
+ widget_slice = Array.prototype.slice;
325
+
326
+ $.cleanData = (function( orig ) {
327
+ return function( elems ) {
328
+ var events, elem, i;
329
+ for ( i = 0; (elem = elems[i]) != null; i++ ) {
330
+ try {
331
+
332
+ // Only trigger remove when necessary to save time
333
+ events = $._data( elem, "events" );
334
+ if ( events && events.remove ) {
335
+ $( elem ).triggerHandler( "remove" );
336
+ }
337
+
338
+ // http://bugs.jquery.com/ticket/8235
339
+ } catch ( e ) {}
340
+ }
341
+ orig( elems );
342
+ };
343
+ })( $.cleanData );
344
+
345
+ $.widget = function( name, base, prototype ) {
346
+ var fullName, existingConstructor, constructor, basePrototype,
347
+ // proxiedPrototype allows the provided prototype to remain unmodified
348
+ // so that it can be used as a mixin for multiple widgets (#8876)
349
+ proxiedPrototype = {},
350
+ namespace = name.split( "." )[ 0 ];
351
+
352
+ name = name.split( "." )[ 1 ];
353
+ fullName = namespace + "-" + name;
354
+
355
+ if ( !prototype ) {
356
+ prototype = base;
357
+ base = $.Widget;
358
+ }
359
+
360
+ // create selector for plugin
361
+ $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
362
+ return !!$.data( elem, fullName );
363
+ };
364
+
365
+ $[ namespace ] = $[ namespace ] || {};
366
+ existingConstructor = $[ namespace ][ name ];
367
+ constructor = $[ namespace ][ name ] = function( options, element ) {
368
+ // allow instantiation without "new" keyword
369
+ if ( !this._createWidget ) {
370
+ return new constructor( options, element );
371
+ }
372
+
373
+ // allow instantiation without initializing for simple inheritance
374
+ // must use "new" keyword (the code above always passes args)
375
+ if ( arguments.length ) {
376
+ this._createWidget( options, element );
377
+ }
378
+ };
379
+ // extend with the existing constructor to carry over any static properties
380
+ $.extend( constructor, existingConstructor, {
381
+ version: prototype.version,
382
+ // copy the object used to create the prototype in case we need to
383
+ // redefine the widget later
384
+ _proto: $.extend( {}, prototype ),
385
+ // track widgets that inherit from this widget in case this widget is
386
+ // redefined after a widget inherits from it
387
+ _childConstructors: []
388
+ });
389
+
390
+ basePrototype = new base();
391
+ // we need to make the options hash a property directly on the new instance
392
+ // otherwise we'll modify the options hash on the prototype that we're
393
+ // inheriting from
394
+ basePrototype.options = $.widget.extend( {}, basePrototype.options );
395
+ $.each( prototype, function( prop, value ) {
396
+ if ( !$.isFunction( value ) ) {
397
+ proxiedPrototype[ prop ] = value;
398
+ return;
399
+ }
400
+ proxiedPrototype[ prop ] = (function() {
401
+ var _super = function() {
402
+ return base.prototype[ prop ].apply( this, arguments );
403
+ },
404
+ _superApply = function( args ) {
405
+ return base.prototype[ prop ].apply( this, args );
406
+ };
407
+ return function() {
408
+ var __super = this._super,
409
+ __superApply = this._superApply,
410
+ returnValue;
411
+
412
+ this._super = _super;
413
+ this._superApply = _superApply;
414
+
415
+ returnValue = value.apply( this, arguments );
416
+
417
+ this._super = __super;
418
+ this._superApply = __superApply;
419
+
420
+ return returnValue;
421
+ };
422
+ })();
423
+ });
424
+ constructor.prototype = $.widget.extend( basePrototype, {
425
+ // TODO: remove support for widgetEventPrefix
426
+ // always use the name + a colon as the prefix, e.g., draggable:start
427
+ // don't prefix for widgets that aren't DOM-based
428
+ widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
429
+ }, proxiedPrototype, {
430
+ constructor: constructor,
431
+ namespace: namespace,
432
+ widgetName: name,
433
+ widgetFullName: fullName
434
+ });
435
+
436
+ // If this widget is being redefined then we need to find all widgets that
437
+ // are inheriting from it and redefine all of them so that they inherit from
438
+ // the new version of this widget. We're essentially trying to replace one
439
+ // level in the prototype chain.
440
+ if ( existingConstructor ) {
441
+ $.each( existingConstructor._childConstructors, function( i, child ) {
442
+ var childPrototype = child.prototype;
443
+
444
+ // redefine the child widget using the same prototype that was
445
+ // originally used, but inherit from the new version of the base
446
+ $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
447
+ });
448
+ // remove the list of existing child constructors from the old constructor
449
+ // so the old child constructors can be garbage collected
450
+ delete existingConstructor._childConstructors;
451
+ } else {
452
+ base._childConstructors.push( constructor );
453
+ }
454
+
455
+ $.widget.bridge( name, constructor );
456
+
457
+ return constructor;
458
+ };
459
+
460
+ $.widget.extend = function( target ) {
461
+ var input = widget_slice.call( arguments, 1 ),
462
+ inputIndex = 0,
463
+ inputLength = input.length,
464
+ key,
465
+ value;
466
+ for ( ; inputIndex < inputLength; inputIndex++ ) {
467
+ for ( key in input[ inputIndex ] ) {
468
+ value = input[ inputIndex ][ key ];
469
+ if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
470
+ // Clone objects
471
+ if ( $.isPlainObject( value ) ) {
472
+ target[ key ] = $.isPlainObject( target[ key ] ) ?
473
+ $.widget.extend( {}, target[ key ], value ) :
474
+ // Don't extend strings, arrays, etc. with objects
475
+ $.widget.extend( {}, value );
476
+ // Copy everything else by reference
477
+ } else {
478
+ target[ key ] = value;
479
+ }
480
+ }
481
+ }
482
+ }
483
+ return target;
484
+ };
485
+
486
+ $.widget.bridge = function( name, object ) {
487
+ var fullName = object.prototype.widgetFullName || name;
488
+ $.fn[ name ] = function( options ) {
489
+ var isMethodCall = typeof options === "string",
490
+ args = widget_slice.call( arguments, 1 ),
491
+ returnValue = this;
492
+
493
+ if ( isMethodCall ) {
494
+ this.each(function() {
495
+ var methodValue,
496
+ instance = $.data( this, fullName );
497
+ if ( options === "instance" ) {
498
+ returnValue = instance;
499
+ return false;
500
+ }
501
+ if ( !instance ) {
502
+ return $.error( "cannot call methods on " + name + " prior to initialization; " +
503
+ "attempted to call method '" + options + "'" );
504
+ }
505
+ if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
506
+ return $.error( "no such method '" + options + "' for " + name + " widget instance" );
507
+ }
508
+ methodValue = instance[ options ].apply( instance, args );
509
+ if ( methodValue !== instance && methodValue !== undefined ) {
510
+ returnValue = methodValue && methodValue.jquery ?
511
+ returnValue.pushStack( methodValue.get() ) :
512
+ methodValue;
513
+ return false;
514
+ }
515
+ });
516
+ } else {
517
+
518
+ // Allow multiple hashes to be passed on init
519
+ if ( args.length ) {
520
+ options = $.widget.extend.apply( null, [ options ].concat(args) );
521
+ }
522
+
523
+ this.each(function() {
524
+ var instance = $.data( this, fullName );
525
+ if ( instance ) {
526
+ instance.option( options || {} );
527
+ if ( instance._init ) {
528
+ instance._init();
529
+ }
530
+ } else {
531
+ $.data( this, fullName, new object( options, this ) );
532
+ }
533
+ });
534
+ }
535
+
536
+ return returnValue;
537
+ };
538
+ };
539
+
540
+ $.Widget = function( /* options, element */ ) {};
541
+ $.Widget._childConstructors = [];
542
+
543
+ $.Widget.prototype = {
544
+ widgetName: "widget",
545
+ widgetEventPrefix: "",
546
+ defaultElement: "<div>",
547
+ options: {
548
+ disabled: false,
549
+
550
+ // callbacks
551
+ create: null
552
+ },
553
+ _createWidget: function( options, element ) {
554
+ element = $( element || this.defaultElement || this )[ 0 ];
555
+ this.element = $( element );
556
+ this.uuid = widget_uuid++;
557
+ this.eventNamespace = "." + this.widgetName + this.uuid;
558
+
559
+ this.bindings = $();
560
+ this.hoverable = $();
561
+ this.focusable = $();
562
+
563
+ if ( element !== this ) {
564
+ $.data( element, this.widgetFullName, this );
565
+ this._on( true, this.element, {
566
+ remove: function( event ) {
567
+ if ( event.target === element ) {
568
+ this.destroy();
569
+ }
570
+ }
571
+ });
572
+ this.document = $( element.style ?
573
+ // element within the document
574
+ element.ownerDocument :
575
+ // element is window or document
576
+ element.document || element );
577
+ this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
578
+ }
579
+
580
+ this.options = $.widget.extend( {},
581
+ this.options,
582
+ this._getCreateOptions(),
583
+ options );
584
+
585
+ this._create();
586
+ this._trigger( "create", null, this._getCreateEventData() );
587
+ this._init();
588
+ },
589
+ _getCreateOptions: $.noop,
590
+ _getCreateEventData: $.noop,
591
+ _create: $.noop,
592
+ _init: $.noop,
593
+
594
+ destroy: function() {
595
+ this._destroy();
596
+ // we can probably remove the unbind calls in 2.0
597
+ // all event bindings should go through this._on()
598
+ this.element
599
+ .unbind( this.eventNamespace )
600
+ .removeData( this.widgetFullName )
601
+ // support: jquery <1.6.3
602
+ // http://bugs.jquery.com/ticket/9413
603
+ .removeData( $.camelCase( this.widgetFullName ) );
604
+ this.widget()
605
+ .unbind( this.eventNamespace )
606
+ .removeAttr( "aria-disabled" )
607
+ .removeClass(
608
+ this.widgetFullName + "-disabled " +
609
+ "ui-state-disabled" );
610
+
611
+ // clean up events and states
612
+ this.bindings.unbind( this.eventNamespace );
613
+ this.hoverable.removeClass( "ui-state-hover" );
614
+ this.focusable.removeClass( "ui-state-focus" );
615
+ },
616
+ _destroy: $.noop,
617
+
618
+ widget: function() {
619
+ return this.element;
620
+ },
621
+
622
+ option: function( key, value ) {
623
+ var options = key,
624
+ parts,
625
+ curOption,
626
+ i;
627
+
628
+ if ( arguments.length === 0 ) {
629
+ // don't return a reference to the internal hash
630
+ return $.widget.extend( {}, this.options );
631
+ }
632
+
633
+ if ( typeof key === "string" ) {
634
+ // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
635
+ options = {};
636
+ parts = key.split( "." );
637
+ key = parts.shift();
638
+ if ( parts.length ) {
639
+ curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
640
+ for ( i = 0; i < parts.length - 1; i++ ) {
641
+ curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
642
+ curOption = curOption[ parts[ i ] ];
643
+ }
644
+ key = parts.pop();
645
+ if ( arguments.length === 1 ) {
646
+ return curOption[ key ] === undefined ? null : curOption[ key ];
647
+ }
648
+ curOption[ key ] = value;
649
+ } else {
650
+ if ( arguments.length === 1 ) {
651
+ return this.options[ key ] === undefined ? null : this.options[ key ];
652
+ }
653
+ options[ key ] = value;
654
+ }
655
+ }
656
+
657
+ this._setOptions( options );
658
+
659
+ return this;
660
+ },
661
+ _setOptions: function( options ) {
662
+ var key;
663
+
664
+ for ( key in options ) {
665
+ this._setOption( key, options[ key ] );
666
+ }
667
+
668
+ return this;
669
+ },
670
+ _setOption: function( key, value ) {
671
+ this.options[ key ] = value;
672
+
673
+ if ( key === "disabled" ) {
674
+ this.widget()
675
+ .toggleClass( this.widgetFullName + "-disabled", !!value );
676
+
677
+ // If the widget is becoming disabled, then nothing is interactive
678
+ if ( value ) {
679
+ this.hoverable.removeClass( "ui-state-hover" );
680
+ this.focusable.removeClass( "ui-state-focus" );
681
+ }
682
+ }
683
+
684
+ return this;
685
+ },
686
+
687
+ enable: function() {
688
+ return this._setOptions({ disabled: false });
689
+ },
690
+ disable: function() {
691
+ return this._setOptions({ disabled: true });
692
+ },
693
+
694
+ _on: function( suppressDisabledCheck, element, handlers ) {
695
+ var delegateElement,
696
+ instance = this;
697
+
698
+ // no suppressDisabledCheck flag, shuffle arguments
699
+ if ( typeof suppressDisabledCheck !== "boolean" ) {
700
+ handlers = element;
701
+ element = suppressDisabledCheck;
702
+ suppressDisabledCheck = false;
703
+ }
704
+
705
+ // no element argument, shuffle and use this.element
706
+ if ( !handlers ) {
707
+ handlers = element;
708
+ element = this.element;
709
+ delegateElement = this.widget();
710
+ } else {
711
+ element = delegateElement = $( element );
712
+ this.bindings = this.bindings.add( element );
713
+ }
714
+
715
+ $.each( handlers, function( event, handler ) {
716
+ function handlerProxy() {
717
+ // allow widgets to customize the disabled handling
718
+ // - disabled as an array instead of boolean
719
+ // - disabled class as method for disabling individual parts
720
+ if ( !suppressDisabledCheck &&
721
+ ( instance.options.disabled === true ||
722
+ $( this ).hasClass( "ui-state-disabled" ) ) ) {
723
+ return;
724
+ }
725
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
726
+ .apply( instance, arguments );
727
+ }
728
+
729
+ // copy the guid so direct unbinding works
730
+ if ( typeof handler !== "string" ) {
731
+ handlerProxy.guid = handler.guid =
732
+ handler.guid || handlerProxy.guid || $.guid++;
733
+ }
734
+
735
+ var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
736
+ eventName = match[1] + instance.eventNamespace,
737
+ selector = match[2];
738
+ if ( selector ) {
739
+ delegateElement.delegate( selector, eventName, handlerProxy );
740
+ } else {
741
+ element.bind( eventName, handlerProxy );
742
+ }
743
+ });
744
+ },
745
+
746
+ _off: function( element, eventName ) {
747
+ eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
748
+ this.eventNamespace;
749
+ element.unbind( eventName ).undelegate( eventName );
750
+
751
+ // Clear the stack to avoid memory leaks (#10056)
752
+ this.bindings = $( this.bindings.not( element ).get() );
753
+ this.focusable = $( this.focusable.not( element ).get() );
754
+ this.hoverable = $( this.hoverable.not( element ).get() );
755
+ },
756
+
757
+ _delay: function( handler, delay ) {
758
+ function handlerProxy() {
759
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
760
+ .apply( instance, arguments );
761
+ }
762
+ var instance = this;
763
+ return setTimeout( handlerProxy, delay || 0 );
764
+ },
765
+
766
+ _hoverable: function( element ) {
767
+ this.hoverable = this.hoverable.add( element );
768
+ this._on( element, {
769
+ mouseenter: function( event ) {
770
+ $( event.currentTarget ).addClass( "ui-state-hover" );
771
+ },
772
+ mouseleave: function( event ) {
773
+ $( event.currentTarget ).removeClass( "ui-state-hover" );
774
+ }
775
+ });
776
+ },
777
+
778
+ _focusable: function( element ) {
779
+ this.focusable = this.focusable.add( element );
780
+ this._on( element, {
781
+ focusin: function( event ) {
782
+ $( event.currentTarget ).addClass( "ui-state-focus" );
783
+ },
784
+ focusout: function( event ) {
785
+ $( event.currentTarget ).removeClass( "ui-state-focus" );
786
+ }
787
+ });
788
+ },
789
+
790
+ _trigger: function( type, event, data ) {
791
+ var prop, orig,
792
+ callback = this.options[ type ];
793
+
794
+ data = data || {};
795
+ event = $.Event( event );
796
+ event.type = ( type === this.widgetEventPrefix ?
797
+ type :
798
+ this.widgetEventPrefix + type ).toLowerCase();
799
+ // the original event may come from any element
800
+ // so we need to reset the target on the new event
801
+ event.target = this.element[ 0 ];
802
+
803
+ // copy original event properties over to the new event
804
+ orig = event.originalEvent;
805
+ if ( orig ) {
806
+ for ( prop in orig ) {
807
+ if ( !( prop in event ) ) {
808
+ event[ prop ] = orig[ prop ];
809
+ }
810
+ }
811
+ }
812
+
813
+ this.element.trigger( event, data );
814
+ return !( $.isFunction( callback ) &&
815
+ callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
816
+ event.isDefaultPrevented() );
817
+ }
818
+ };
819
+
820
+ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
821
+ $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
822
+ if ( typeof options === "string" ) {
823
+ options = { effect: options };
824
+ }
825
+ var hasOptions,
826
+ effectName = !options ?
827
+ method :
828
+ options === true || typeof options === "number" ?
829
+ defaultEffect :
830
+ options.effect || defaultEffect;
831
+ options = options || {};
832
+ if ( typeof options === "number" ) {
833
+ options = { duration: options };
834
+ }
835
+ hasOptions = !$.isEmptyObject( options );
836
+ options.complete = callback;
837
+ if ( options.delay ) {
838
+ element.delay( options.delay );
839
+ }
840
+ if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
841
+ element[ method ]( options );
842
+ } else if ( effectName !== method && element[ effectName ] ) {
843
+ element[ effectName ]( options.duration, options.easing, callback );
844
+ } else {
845
+ element.queue(function( next ) {
846
+ $( this )[ method ]();
847
+ if ( callback ) {
848
+ callback.call( element[ 0 ] );
849
+ }
850
+ next();
851
+ });
852
+ }
853
+ };
854
+ });
855
+
856
+ var widget = $.widget;
857
+
858
+
859
+ /*!
860
+ * jQuery UI Position 1.11.4
861
+ * http://jqueryui.com
862
+ *
863
+ * Copyright jQuery Foundation and other contributors
864
+ * Released under the MIT license.
865
+ * http://jquery.org/license
866
+ *
867
+ * http://api.jqueryui.com/position/
868
+ */
869
+
870
+ (function() {
871
+
872
+ $.ui = $.ui || {};
873
+
874
+ var cachedScrollbarWidth, supportsOffsetFractions,
875
+ max = Math.max,
876
+ abs = Math.abs,
877
+ round = Math.round,
878
+ rhorizontal = /left|center|right/,
879
+ rvertical = /top|center|bottom/,
880
+ roffset = /[\+\-]\d+(\.[\d]+)?%?/,
881
+ rposition = /^\w+/,
882
+ rpercent = /%$/,
883
+ _position = $.fn.position;
884
+
885
+ function getOffsets( offsets, width, height ) {
886
+ return [
887
+ parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
888
+ parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
889
+ ];
890
+ }
891
+
892
+ function parseCss( element, property ) {
893
+ return parseInt( $.css( element, property ), 10 ) || 0;
894
+ }
895
+
896
+ function getDimensions( elem ) {
897
+ var raw = elem[0];
898
+ if ( raw.nodeType === 9 ) {
899
+ return {
900
+ width: elem.width(),
901
+ height: elem.height(),
902
+ offset: { top: 0, left: 0 }
903
+ };
904
+ }
905
+ if ( $.isWindow( raw ) ) {
906
+ return {
907
+ width: elem.width(),
908
+ height: elem.height(),
909
+ offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
910
+ };
911
+ }
912
+ if ( raw.preventDefault ) {
913
+ return {
914
+ width: 0,
915
+ height: 0,
916
+ offset: { top: raw.pageY, left: raw.pageX }
917
+ };
918
+ }
919
+ return {
920
+ width: elem.outerWidth(),
921
+ height: elem.outerHeight(),
922
+ offset: elem.offset()
923
+ };
924
+ }
925
+
926
+ $.position = {
927
+ scrollbarWidth: function() {
928
+ if ( cachedScrollbarWidth !== undefined ) {
929
+ return cachedScrollbarWidth;
930
+ }
931
+ var w1, w2,
932
+ div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
933
+ innerDiv = div.children()[0];
934
+
935
+ $( "body" ).append( div );
936
+ w1 = innerDiv.offsetWidth;
937
+ div.css( "overflow", "scroll" );
938
+
939
+ w2 = innerDiv.offsetWidth;
940
+
941
+ if ( w1 === w2 ) {
942
+ w2 = div[0].clientWidth;
943
+ }
944
+
945
+ div.remove();
946
+
947
+ return (cachedScrollbarWidth = w1 - w2);
948
+ },
949
+ getScrollInfo: function( within ) {
950
+ var overflowX = within.isWindow || within.isDocument ? "" :
951
+ within.element.css( "overflow-x" ),
952
+ overflowY = within.isWindow || within.isDocument ? "" :
953
+ within.element.css( "overflow-y" ),
954
+ hasOverflowX = overflowX === "scroll" ||
955
+ ( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
956
+ hasOverflowY = overflowY === "scroll" ||
957
+ ( overflowY === "auto" && within.height < within.element[0].scrollHeight );
958
+ return {
959
+ width: hasOverflowY ? $.position.scrollbarWidth() : 0,
960
+ height: hasOverflowX ? $.position.scrollbarWidth() : 0
961
+ };
962
+ },
963
+ getWithinInfo: function( element ) {
964
+ var withinElement = $( element || window ),
965
+ isWindow = $.isWindow( withinElement[0] ),
966
+ isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
967
+ return {
968
+ element: withinElement,
969
+ isWindow: isWindow,
970
+ isDocument: isDocument,
971
+ offset: withinElement.offset() || { left: 0, top: 0 },
972
+ scrollLeft: withinElement.scrollLeft(),
973
+ scrollTop: withinElement.scrollTop(),
974
+
975
+ // support: jQuery 1.6.x
976
+ // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
977
+ width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
978
+ height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
979
+ };
980
+ }
981
+ };
982
+
983
+ $.fn.position = function( options ) {
984
+ if ( !options || !options.of ) {
985
+ return _position.apply( this, arguments );
986
+ }
987
+
988
+ // make a copy, we don't want to modify arguments
989
+ options = $.extend( {}, options );
990
+
991
+ var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
992
+ target = $( options.of ),
993
+ within = $.position.getWithinInfo( options.within ),
994
+ scrollInfo = $.position.getScrollInfo( within ),
995
+ collision = ( options.collision || "flip" ).split( " " ),
996
+ offsets = {};
997
+
998
+ dimensions = getDimensions( target );
999
+ if ( target[0].preventDefault ) {
1000
+ // force left top to allow flipping
1001
+ options.at = "left top";
1002
+ }
1003
+ targetWidth = dimensions.width;
1004
+ targetHeight = dimensions.height;
1005
+ targetOffset = dimensions.offset;
1006
+ // clone to reuse original targetOffset later
1007
+ basePosition = $.extend( {}, targetOffset );
1008
+
1009
+ // force my and at to have valid horizontal and vertical positions
1010
+ // if a value is missing or invalid, it will be converted to center
1011
+ $.each( [ "my", "at" ], function() {
1012
+ var pos = ( options[ this ] || "" ).split( " " ),
1013
+ horizontalOffset,
1014
+ verticalOffset;
1015
+
1016
+ if ( pos.length === 1) {
1017
+ pos = rhorizontal.test( pos[ 0 ] ) ?
1018
+ pos.concat( [ "center" ] ) :
1019
+ rvertical.test( pos[ 0 ] ) ?
1020
+ [ "center" ].concat( pos ) :
1021
+ [ "center", "center" ];
1022
+ }
1023
+ pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
1024
+ pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
1025
+
1026
+ // calculate offsets
1027
+ horizontalOffset = roffset.exec( pos[ 0 ] );
1028
+ verticalOffset = roffset.exec( pos[ 1 ] );
1029
+ offsets[ this ] = [
1030
+ horizontalOffset ? horizontalOffset[ 0 ] : 0,
1031
+ verticalOffset ? verticalOffset[ 0 ] : 0
1032
+ ];
1033
+
1034
+ // reduce to just the positions without the offsets
1035
+ options[ this ] = [
1036
+ rposition.exec( pos[ 0 ] )[ 0 ],
1037
+ rposition.exec( pos[ 1 ] )[ 0 ]
1038
+ ];
1039
+ });
1040
+
1041
+ // normalize collision option
1042
+ if ( collision.length === 1 ) {
1043
+ collision[ 1 ] = collision[ 0 ];
1044
+ }
1045
+
1046
+ if ( options.at[ 0 ] === "right" ) {
1047
+ basePosition.left += targetWidth;
1048
+ } else if ( options.at[ 0 ] === "center" ) {
1049
+ basePosition.left += targetWidth / 2;
1050
+ }
1051
+
1052
+ if ( options.at[ 1 ] === "bottom" ) {
1053
+ basePosition.top += targetHeight;
1054
+ } else if ( options.at[ 1 ] === "center" ) {
1055
+ basePosition.top += targetHeight / 2;
1056
+ }
1057
+
1058
+ atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
1059
+ basePosition.left += atOffset[ 0 ];
1060
+ basePosition.top += atOffset[ 1 ];
1061
+
1062
+ return this.each(function() {
1063
+ var collisionPosition, using,
1064
+ elem = $( this ),
1065
+ elemWidth = elem.outerWidth(),
1066
+ elemHeight = elem.outerHeight(),
1067
+ marginLeft = parseCss( this, "marginLeft" ),
1068
+ marginTop = parseCss( this, "marginTop" ),
1069
+ collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
1070
+ collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
1071
+ position = $.extend( {}, basePosition ),
1072
+ myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
1073
+
1074
+ if ( options.my[ 0 ] === "right" ) {
1075
+ position.left -= elemWidth;
1076
+ } else if ( options.my[ 0 ] === "center" ) {
1077
+ position.left -= elemWidth / 2;
1078
+ }
1079
+
1080
+ if ( options.my[ 1 ] === "bottom" ) {
1081
+ position.top -= elemHeight;
1082
+ } else if ( options.my[ 1 ] === "center" ) {
1083
+ position.top -= elemHeight / 2;
1084
+ }
1085
+
1086
+ position.left += myOffset[ 0 ];
1087
+ position.top += myOffset[ 1 ];
1088
+
1089
+ // if the browser doesn't support fractions, then round for consistent results
1090
+ if ( !supportsOffsetFractions ) {
1091
+ position.left = round( position.left );
1092
+ position.top = round( position.top );
1093
+ }
1094
+
1095
+ collisionPosition = {
1096
+ marginLeft: marginLeft,
1097
+ marginTop: marginTop
1098
+ };
1099
+
1100
+ $.each( [ "left", "top" ], function( i, dir ) {
1101
+ if ( $.ui.position[ collision[ i ] ] ) {
1102
+ $.ui.position[ collision[ i ] ][ dir ]( position, {
1103
+ targetWidth: targetWidth,
1104
+ targetHeight: targetHeight,
1105
+ elemWidth: elemWidth,
1106
+ elemHeight: elemHeight,
1107
+ collisionPosition: collisionPosition,
1108
+ collisionWidth: collisionWidth,
1109
+ collisionHeight: collisionHeight,
1110
+ offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
1111
+ my: options.my,
1112
+ at: options.at,
1113
+ within: within,
1114
+ elem: elem
1115
+ });
1116
+ }
1117
+ });
1118
+
1119
+ if ( options.using ) {
1120
+ // adds feedback as second argument to using callback, if present
1121
+ using = function( props ) {
1122
+ var left = targetOffset.left - position.left,
1123
+ right = left + targetWidth - elemWidth,
1124
+ top = targetOffset.top - position.top,
1125
+ bottom = top + targetHeight - elemHeight,
1126
+ feedback = {
1127
+ target: {
1128
+ element: target,
1129
+ left: targetOffset.left,
1130
+ top: targetOffset.top,
1131
+ width: targetWidth,
1132
+ height: targetHeight
1133
+ },
1134
+ element: {
1135
+ element: elem,
1136
+ left: position.left,
1137
+ top: position.top,
1138
+ width: elemWidth,
1139
+ height: elemHeight
1140
+ },
1141
+ horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
1142
+ vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
1143
+ };
1144
+ if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
1145
+ feedback.horizontal = "center";
1146
+ }
1147
+ if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
1148
+ feedback.vertical = "middle";
1149
+ }
1150
+ if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
1151
+ feedback.important = "horizontal";
1152
+ } else {
1153
+ feedback.important = "vertical";
1154
+ }
1155
+ options.using.call( this, props, feedback );
1156
+ };
1157
+ }
1158
+
1159
+ elem.offset( $.extend( position, { using: using } ) );
1160
+ });
1161
+ };
1162
+
1163
+ $.ui.position = {
1164
+ fit: {
1165
+ left: function( position, data ) {
1166
+ var within = data.within,
1167
+ withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
1168
+ outerWidth = within.width,
1169
+ collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1170
+ overLeft = withinOffset - collisionPosLeft,
1171
+ overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
1172
+ newOverRight;
1173
+
1174
+ // element is wider than within
1175
+ if ( data.collisionWidth > outerWidth ) {
1176
+ // element is initially over the left side of within
1177
+ if ( overLeft > 0 && overRight <= 0 ) {
1178
+ newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
1179
+ position.left += overLeft - newOverRight;
1180
+ // element is initially over right side of within
1181
+ } else if ( overRight > 0 && overLeft <= 0 ) {
1182
+ position.left = withinOffset;
1183
+ // element is initially over both left and right sides of within
1184
+ } else {
1185
+ if ( overLeft > overRight ) {
1186
+ position.left = withinOffset + outerWidth - data.collisionWidth;
1187
+ } else {
1188
+ position.left = withinOffset;
1189
+ }
1190
+ }
1191
+ // too far left -> align with left edge
1192
+ } else if ( overLeft > 0 ) {
1193
+ position.left += overLeft;
1194
+ // too far right -> align with right edge
1195
+ } else if ( overRight > 0 ) {
1196
+ position.left -= overRight;
1197
+ // adjust based on position and margin
1198
+ } else {
1199
+ position.left = max( position.left - collisionPosLeft, position.left );
1200
+ }
1201
+ },
1202
+ top: function( position, data ) {
1203
+ var within = data.within,
1204
+ withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
1205
+ outerHeight = data.within.height,
1206
+ collisionPosTop = position.top - data.collisionPosition.marginTop,
1207
+ overTop = withinOffset - collisionPosTop,
1208
+ overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
1209
+ newOverBottom;
1210
+
1211
+ // element is taller than within
1212
+ if ( data.collisionHeight > outerHeight ) {
1213
+ // element is initially over the top of within
1214
+ if ( overTop > 0 && overBottom <= 0 ) {
1215
+ newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
1216
+ position.top += overTop - newOverBottom;
1217
+ // element is initially over bottom of within
1218
+ } else if ( overBottom > 0 && overTop <= 0 ) {
1219
+ position.top = withinOffset;
1220
+ // element is initially over both top and bottom of within
1221
+ } else {
1222
+ if ( overTop > overBottom ) {
1223
+ position.top = withinOffset + outerHeight - data.collisionHeight;
1224
+ } else {
1225
+ position.top = withinOffset;
1226
+ }
1227
+ }
1228
+ // too far up -> align with top
1229
+ } else if ( overTop > 0 ) {
1230
+ position.top += overTop;
1231
+ // too far down -> align with bottom edge
1232
+ } else if ( overBottom > 0 ) {
1233
+ position.top -= overBottom;
1234
+ // adjust based on position and margin
1235
+ } else {
1236
+ position.top = max( position.top - collisionPosTop, position.top );
1237
+ }
1238
+ }
1239
+ },
1240
+ flip: {
1241
+ left: function( position, data ) {
1242
+ var within = data.within,
1243
+ withinOffset = within.offset.left + within.scrollLeft,
1244
+ outerWidth = within.width,
1245
+ offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
1246
+ collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1247
+ overLeft = collisionPosLeft - offsetLeft,
1248
+ overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
1249
+ myOffset = data.my[ 0 ] === "left" ?
1250
+ -data.elemWidth :
1251
+ data.my[ 0 ] === "right" ?
1252
+ data.elemWidth :
1253
+ 0,
1254
+ atOffset = data.at[ 0 ] === "left" ?
1255
+ data.targetWidth :
1256
+ data.at[ 0 ] === "right" ?
1257
+ -data.targetWidth :
1258
+ 0,
1259
+ offset = -2 * data.offset[ 0 ],
1260
+ newOverRight,
1261
+ newOverLeft;
1262
+
1263
+ if ( overLeft < 0 ) {
1264
+ newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
1265
+ if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
1266
+ position.left += myOffset + atOffset + offset;
1267
+ }
1268
+ } else if ( overRight > 0 ) {
1269
+ newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
1270
+ if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
1271
+ position.left += myOffset + atOffset + offset;
1272
+ }
1273
+ }
1274
+ },
1275
+ top: function( position, data ) {
1276
+ var within = data.within,
1277
+ withinOffset = within.offset.top + within.scrollTop,
1278
+ outerHeight = within.height,
1279
+ offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
1280
+ collisionPosTop = position.top - data.collisionPosition.marginTop,
1281
+ overTop = collisionPosTop - offsetTop,
1282
+ overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
1283
+ top = data.my[ 1 ] === "top",
1284
+ myOffset = top ?
1285
+ -data.elemHeight :
1286
+ data.my[ 1 ] === "bottom" ?
1287
+ data.elemHeight :
1288
+ 0,
1289
+ atOffset = data.at[ 1 ] === "top" ?
1290
+ data.targetHeight :
1291
+ data.at[ 1 ] === "bottom" ?
1292
+ -data.targetHeight :
1293
+ 0,
1294
+ offset = -2 * data.offset[ 1 ],
1295
+ newOverTop,
1296
+ newOverBottom;
1297
+ if ( overTop < 0 ) {
1298
+ newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
1299
+ if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
1300
+ position.top += myOffset + atOffset + offset;
1301
+ }
1302
+ } else if ( overBottom > 0 ) {
1303
+ newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
1304
+ if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
1305
+ position.top += myOffset + atOffset + offset;
1306
+ }
1307
+ }
1308
+ }
1309
+ },
1310
+ flipfit: {
1311
+ left: function() {
1312
+ $.ui.position.flip.left.apply( this, arguments );
1313
+ $.ui.position.fit.left.apply( this, arguments );
1314
+ },
1315
+ top: function() {
1316
+ $.ui.position.flip.top.apply( this, arguments );
1317
+ $.ui.position.fit.top.apply( this, arguments );
1318
+ }
1319
+ }
1320
+ };
1321
+
1322
+ // fraction support test
1323
+ (function() {
1324
+ var testElement, testElementParent, testElementStyle, offsetLeft, i,
1325
+ body = document.getElementsByTagName( "body" )[ 0 ],
1326
+ div = document.createElement( "div" );
1327
+
1328
+ //Create a "fake body" for testing based on method used in jQuery.support
1329
+ testElement = document.createElement( body ? "div" : "body" );
1330
+ testElementStyle = {
1331
+ visibility: "hidden",
1332
+ width: 0,
1333
+ height: 0,
1334
+ border: 0,
1335
+ margin: 0,
1336
+ background: "none"
1337
+ };
1338
+ if ( body ) {
1339
+ $.extend( testElementStyle, {
1340
+ position: "absolute",
1341
+ left: "-1000px",
1342
+ top: "-1000px"
1343
+ });
1344
+ }
1345
+ for ( i in testElementStyle ) {
1346
+ testElement.style[ i ] = testElementStyle[ i ];
1347
+ }
1348
+ testElement.appendChild( div );
1349
+ testElementParent = body || document.documentElement;
1350
+ testElementParent.insertBefore( testElement, testElementParent.firstChild );
1351
+
1352
+ div.style.cssText = "position: absolute; left: 10.7432222px;";
1353
+
1354
+ offsetLeft = $( div ).offset().left;
1355
+ supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
1356
+
1357
+ testElement.innerHTML = "";
1358
+ testElementParent.removeChild( testElement );
1359
+ })();
1360
+
1361
+ })();
1362
+
1363
+ var position = $.ui.position;
1364
+
1365
+
1366
+ /*!
1367
+ * jQuery UI Menu 1.11.4
1368
+ * http://jqueryui.com
1369
+ *
1370
+ * Copyright jQuery Foundation and other contributors
1371
+ * Released under the MIT license.
1372
+ * http://jquery.org/license
1373
+ *
1374
+ * http://api.jqueryui.com/menu/
1375
+ */
1376
+
1377
+
1378
+ var menu = $.widget( "ui.menu", {
1379
+ version: "1.11.4",
1380
+ defaultElement: "<ul>",
1381
+ delay: 300,
1382
+ options: {
1383
+ icons: {
1384
+ submenu: "ui-icon-carat-1-e"
1385
+ },
1386
+ items: "> *",
1387
+ menus: "ul",
1388
+ position: {
1389
+ my: "left-1 top",
1390
+ at: "right top"
1391
+ },
1392
+ role: "menu",
1393
+
1394
+ // callbacks
1395
+ blur: null,
1396
+ focus: null,
1397
+ select: null
1398
+ },
1399
+
1400
+ _create: function() {
1401
+ this.activeMenu = this.element;
1402
+
1403
+ // Flag used to prevent firing of the click handler
1404
+ // as the event bubbles up through nested menus
1405
+ this.mouseHandled = false;
1406
+ this.element
1407
+ .uniqueId()
1408
+ .addClass( "ui-menu ui-widget ui-widget-content" )
1409
+ .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
1410
+ .attr({
1411
+ role: this.options.role,
1412
+ tabIndex: 0
1413
+ });
1414
+
1415
+ if ( this.options.disabled ) {
1416
+ this.element
1417
+ .addClass( "ui-state-disabled" )
1418
+ .attr( "aria-disabled", "true" );
1419
+ }
1420
+
1421
+ this._on({
1422
+ // Prevent focus from sticking to links inside menu after clicking
1423
+ // them (focus should always stay on UL during navigation).
1424
+ "mousedown .ui-menu-item": function( event ) {
1425
+ event.preventDefault();
1426
+ },
1427
+ "click .ui-menu-item": function( event ) {
1428
+ var target = $( event.target );
1429
+ if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
1430
+ this.select( event );
1431
+
1432
+ // Only set the mouseHandled flag if the event will bubble, see #9469.
1433
+ if ( !event.isPropagationStopped() ) {
1434
+ this.mouseHandled = true;
1435
+ }
1436
+
1437
+ // Open submenu on click
1438
+ if ( target.has( ".ui-menu" ).length ) {
1439
+ this.expand( event );
1440
+ } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
1441
+
1442
+ // Redirect focus to the menu
1443
+ this.element.trigger( "focus", [ true ] );
1444
+
1445
+ // If the active item is on the top level, let it stay active.
1446
+ // Otherwise, blur the active item since it is no longer visible.
1447
+ if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
1448
+ clearTimeout( this.timer );
1449
+ }
1450
+ }
1451
+ }
1452
+ },
1453
+ "mouseenter .ui-menu-item": function( event ) {
1454
+ // Ignore mouse events while typeahead is active, see #10458.
1455
+ // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
1456
+ // is over an item in the menu
1457
+ if ( this.previousFilter ) {
1458
+ return;
1459
+ }
1460
+ var target = $( event.currentTarget );
1461
+ // Remove ui-state-active class from siblings of the newly focused menu item
1462
+ // to avoid a jump caused by adjacent elements both having a class with a border
1463
+ target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
1464
+ this.focus( event, target );
1465
+ },
1466
+ mouseleave: "collapseAll",
1467
+ "mouseleave .ui-menu": "collapseAll",
1468
+ focus: function( event, keepActiveItem ) {
1469
+ // If there's already an active item, keep it active
1470
+ // If not, activate the first item
1471
+ var item = this.active || this.element.find( this.options.items ).eq( 0 );
1472
+
1473
+ if ( !keepActiveItem ) {
1474
+ this.focus( event, item );
1475
+ }
1476
+ },
1477
+ blur: function( event ) {
1478
+ this._delay(function() {
1479
+ if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
1480
+ this.collapseAll( event );
1481
+ }
1482
+ });
1483
+ },
1484
+ keydown: "_keydown"
1485
+ });
1486
+
1487
+ this.refresh();
1488
+
1489
+ // Clicks outside of a menu collapse any open menus
1490
+ this._on( this.document, {
1491
+ click: function( event ) {
1492
+ if ( this._closeOnDocumentClick( event ) ) {
1493
+ this.collapseAll( event );
1494
+ }
1495
+
1496
+ // Reset the mouseHandled flag
1497
+ this.mouseHandled = false;
1498
+ }
1499
+ });
1500
+ },
1501
+
1502
+ _destroy: function() {
1503
+ // Destroy (sub)menus
1504
+ this.element
1505
+ .removeAttr( "aria-activedescendant" )
1506
+ .find( ".ui-menu" ).addBack()
1507
+ .removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
1508
+ .removeAttr( "role" )
1509
+ .removeAttr( "tabIndex" )
1510
+ .removeAttr( "aria-labelledby" )
1511
+ .removeAttr( "aria-expanded" )
1512
+ .removeAttr( "aria-hidden" )
1513
+ .removeAttr( "aria-disabled" )
1514
+ .removeUniqueId()
1515
+ .show();
1516
+
1517
+ // Destroy menu items
1518
+ this.element.find( ".ui-menu-item" )
1519
+ .removeClass( "ui-menu-item" )
1520
+ .removeAttr( "role" )
1521
+ .removeAttr( "aria-disabled" )
1522
+ .removeUniqueId()
1523
+ .removeClass( "ui-state-hover" )
1524
+ .removeAttr( "tabIndex" )
1525
+ .removeAttr( "role" )
1526
+ .removeAttr( "aria-haspopup" )
1527
+ .children().each( function() {
1528
+ var elem = $( this );
1529
+ if ( elem.data( "ui-menu-submenu-carat" ) ) {
1530
+ elem.remove();
1531
+ }
1532
+ });
1533
+
1534
+ // Destroy menu dividers
1535
+ this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
1536
+ },
1537
+
1538
+ _keydown: function( event ) {
1539
+ var match, prev, character, skip,
1540
+ preventDefault = true;
1541
+
1542
+ switch ( event.keyCode ) {
1543
+ case $.ui.keyCode.PAGE_UP:
1544
+ this.previousPage( event );
1545
+ break;
1546
+ case $.ui.keyCode.PAGE_DOWN:
1547
+ this.nextPage( event );
1548
+ break;
1549
+ case $.ui.keyCode.HOME:
1550
+ this._move( "first", "first", event );
1551
+ break;
1552
+ case $.ui.keyCode.END:
1553
+ this._move( "last", "last", event );
1554
+ break;
1555
+ case $.ui.keyCode.UP:
1556
+ this.previous( event );
1557
+ break;
1558
+ case $.ui.keyCode.DOWN:
1559
+ this.next( event );
1560
+ break;
1561
+ case $.ui.keyCode.LEFT:
1562
+ this.collapse( event );
1563
+ break;
1564
+ case $.ui.keyCode.RIGHT:
1565
+ if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
1566
+ this.expand( event );
1567
+ }
1568
+ break;
1569
+ case $.ui.keyCode.ENTER:
1570
+ case $.ui.keyCode.SPACE:
1571
+ this._activate( event );
1572
+ break;
1573
+ case $.ui.keyCode.ESCAPE:
1574
+ this.collapse( event );
1575
+ break;
1576
+ default:
1577
+ preventDefault = false;
1578
+ prev = this.previousFilter || "";
1579
+ character = String.fromCharCode( event.keyCode );
1580
+ skip = false;
1581
+
1582
+ clearTimeout( this.filterTimer );
1583
+
1584
+ if ( character === prev ) {
1585
+ skip = true;
1586
+ } else {
1587
+ character = prev + character;
1588
+ }
1589
+
1590
+ match = this._filterMenuItems( character );
1591
+ match = skip && match.index( this.active.next() ) !== -1 ?
1592
+ this.active.nextAll( ".ui-menu-item" ) :
1593
+ match;
1594
+
1595
+ // If no matches on the current filter, reset to the last character pressed
1596
+ // to move down the menu to the first item that starts with that character
1597
+ if ( !match.length ) {
1598
+ character = String.fromCharCode( event.keyCode );
1599
+ match = this._filterMenuItems( character );
1600
+ }
1601
+
1602
+ if ( match.length ) {
1603
+ this.focus( event, match );
1604
+ this.previousFilter = character;
1605
+ this.filterTimer = this._delay(function() {
1606
+ delete this.previousFilter;
1607
+ }, 1000 );
1608
+ } else {
1609
+ delete this.previousFilter;
1610
+ }
1611
+ }
1612
+
1613
+ if ( preventDefault ) {
1614
+ event.preventDefault();
1615
+ }
1616
+ },
1617
+
1618
+ _activate: function( event ) {
1619
+ if ( !this.active.is( ".ui-state-disabled" ) ) {
1620
+ if ( this.active.is( "[aria-haspopup='true']" ) ) {
1621
+ this.expand( event );
1622
+ } else {
1623
+ this.select( event );
1624
+ }
1625
+ }
1626
+ },
1627
+
1628
+ refresh: function() {
1629
+ var menus, items,
1630
+ that = this,
1631
+ icon = this.options.icons.submenu,
1632
+ submenus = this.element.find( this.options.menus );
1633
+
1634
+ this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
1635
+
1636
+ // Initialize nested menus
1637
+ submenus.filter( ":not(.ui-menu)" )
1638
+ .addClass( "ui-menu ui-widget ui-widget-content ui-front" )
1639
+ .hide()
1640
+ .attr({
1641
+ role: this.options.role,
1642
+ "aria-hidden": "true",
1643
+ "aria-expanded": "false"
1644
+ })
1645
+ .each(function() {
1646
+ var menu = $( this ),
1647
+ item = menu.parent(),
1648
+ submenuCarat = $( "<span>" )
1649
+ .addClass( "ui-menu-icon ui-icon " + icon )
1650
+ .data( "ui-menu-submenu-carat", true );
1651
+
1652
+ item
1653
+ .attr( "aria-haspopup", "true" )
1654
+ .prepend( submenuCarat );
1655
+ menu.attr( "aria-labelledby", item.attr( "id" ) );
1656
+ });
1657
+
1658
+ menus = submenus.add( this.element );
1659
+ items = menus.find( this.options.items );
1660
+
1661
+ // Initialize menu-items containing spaces and/or dashes only as dividers
1662
+ items.not( ".ui-menu-item" ).each(function() {
1663
+ var item = $( this );
1664
+ if ( that._isDivider( item ) ) {
1665
+ item.addClass( "ui-widget-content ui-menu-divider" );
1666
+ }
1667
+ });
1668
+
1669
+ // Don't refresh list items that are already adapted
1670
+ items.not( ".ui-menu-item, .ui-menu-divider" )
1671
+ .addClass( "ui-menu-item" )
1672
+ .uniqueId()
1673
+ .attr({
1674
+ tabIndex: -1,
1675
+ role: this._itemRole()
1676
+ });
1677
+
1678
+ // Add aria-disabled attribute to any disabled menu item
1679
+ items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
1680
+
1681
+ // If the active item has been removed, blur the menu
1682
+ if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
1683
+ this.blur();
1684
+ }
1685
+ },
1686
+
1687
+ _itemRole: function() {
1688
+ return {
1689
+ menu: "menuitem",
1690
+ listbox: "option"
1691
+ }[ this.options.role ];
1692
+ },
1693
+
1694
+ _setOption: function( key, value ) {
1695
+ if ( key === "icons" ) {
1696
+ this.element.find( ".ui-menu-icon" )
1697
+ .removeClass( this.options.icons.submenu )
1698
+ .addClass( value.submenu );
1699
+ }
1700
+ if ( key === "disabled" ) {
1701
+ this.element
1702
+ .toggleClass( "ui-state-disabled", !!value )
1703
+ .attr( "aria-disabled", value );
1704
+ }
1705
+ this._super( key, value );
1706
+ },
1707
+
1708
+ focus: function( event, item ) {
1709
+ var nested, focused;
1710
+ this.blur( event, event && event.type === "focus" );
1711
+
1712
+ this._scrollIntoView( item );
1713
+
1714
+ this.active = item.first();
1715
+ focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
1716
+ // Only update aria-activedescendant if there's a role
1717
+ // otherwise we assume focus is managed elsewhere
1718
+ if ( this.options.role ) {
1719
+ this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
1720
+ }
1721
+
1722
+ // Highlight active parent menu item, if any
1723
+ this.active
1724
+ .parent()
1725
+ .closest( ".ui-menu-item" )
1726
+ .addClass( "ui-state-active" );
1727
+
1728
+ if ( event && event.type === "keydown" ) {
1729
+ this._close();
1730
+ } else {
1731
+ this.timer = this._delay(function() {
1732
+ this._close();
1733
+ }, this.delay );
1734
+ }
1735
+
1736
+ nested = item.children( ".ui-menu" );
1737
+ if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
1738
+ this._startOpening(nested);
1739
+ }
1740
+ this.activeMenu = item.parent();
1741
+
1742
+ this._trigger( "focus", event, { item: item } );
1743
+ },
1744
+
1745
+ _scrollIntoView: function( item ) {
1746
+ var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
1747
+ if ( this._hasScroll() ) {
1748
+ borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
1749
+ paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
1750
+ offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
1751
+ scroll = this.activeMenu.scrollTop();
1752
+ elementHeight = this.activeMenu.height();
1753
+ itemHeight = item.outerHeight();
1754
+
1755
+ if ( offset < 0 ) {
1756
+ this.activeMenu.scrollTop( scroll + offset );
1757
+ } else if ( offset + itemHeight > elementHeight ) {
1758
+ this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
1759
+ }
1760
+ }
1761
+ },
1762
+
1763
+ blur: function( event, fromFocus ) {
1764
+ if ( !fromFocus ) {
1765
+ clearTimeout( this.timer );
1766
+ }
1767
+
1768
+ if ( !this.active ) {
1769
+ return;
1770
+ }
1771
+
1772
+ this.active.removeClass( "ui-state-focus" );
1773
+ this.active = null;
1774
+
1775
+ this._trigger( "blur", event, { item: this.active } );
1776
+ },
1777
+
1778
+ _startOpening: function( submenu ) {
1779
+ clearTimeout( this.timer );
1780
+
1781
+ // Don't open if already open fixes a Firefox bug that caused a .5 pixel
1782
+ // shift in the submenu position when mousing over the carat icon
1783
+ if ( submenu.attr( "aria-hidden" ) !== "true" ) {
1784
+ return;
1785
+ }
1786
+
1787
+ this.timer = this._delay(function() {
1788
+ this._close();
1789
+ this._open( submenu );
1790
+ }, this.delay );
1791
+ },
1792
+
1793
+ _open: function( submenu ) {
1794
+ var position = $.extend({
1795
+ of: this.active
1796
+ }, this.options.position );
1797
+
1798
+ clearTimeout( this.timer );
1799
+ this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
1800
+ .hide()
1801
+ .attr( "aria-hidden", "true" );
1802
+
1803
+ submenu
1804
+ .show()
1805
+ .removeAttr( "aria-hidden" )
1806
+ .attr( "aria-expanded", "true" )
1807
+ .position( position );
1808
+ },
1809
+
1810
+ collapseAll: function( event, all ) {
1811
+ clearTimeout( this.timer );
1812
+ this.timer = this._delay(function() {
1813
+ // If we were passed an event, look for the submenu that contains the event
1814
+ var currentMenu = all ? this.element :
1815
+ $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
1816
+
1817
+ // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
1818
+ if ( !currentMenu.length ) {
1819
+ currentMenu = this.element;
1820
+ }
1821
+
1822
+ this._close( currentMenu );
1823
+
1824
+ this.blur( event );
1825
+ this.activeMenu = currentMenu;
1826
+ }, this.delay );
1827
+ },
1828
+
1829
+ // With no arguments, closes the currently active menu - if nothing is active
1830
+ // it closes all menus. If passed an argument, it will search for menus BELOW
1831
+ _close: function( startMenu ) {
1832
+ if ( !startMenu ) {
1833
+ startMenu = this.active ? this.active.parent() : this.element;
1834
+ }
1835
+
1836
+ startMenu
1837
+ .find( ".ui-menu" )
1838
+ .hide()
1839
+ .attr( "aria-hidden", "true" )
1840
+ .attr( "aria-expanded", "false" )
1841
+ .end()
1842
+ .find( ".ui-state-active" ).not( ".ui-state-focus" )
1843
+ .removeClass( "ui-state-active" );
1844
+ },
1845
+
1846
+ _closeOnDocumentClick: function( event ) {
1847
+ return !$( event.target ).closest( ".ui-menu" ).length;
1848
+ },
1849
+
1850
+ _isDivider: function( item ) {
1851
+
1852
+ // Match hyphen, em dash, en dash
1853
+ return !/[^\-\u2014\u2013\s]/.test( item.text() );
1854
+ },
1855
+
1856
+ collapse: function( event ) {
1857
+ var newItem = this.active &&
1858
+ this.active.parent().closest( ".ui-menu-item", this.element );
1859
+ if ( newItem && newItem.length ) {
1860
+ this._close();
1861
+ this.focus( event, newItem );
1862
+ }
1863
+ },
1864
+
1865
+ expand: function( event ) {
1866
+ var newItem = this.active &&
1867
+ this.active
1868
+ .children( ".ui-menu " )
1869
+ .find( this.options.items )
1870
+ .first();
1871
+
1872
+ if ( newItem && newItem.length ) {
1873
+ this._open( newItem.parent() );
1874
+
1875
+ // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
1876
+ this._delay(function() {
1877
+ this.focus( event, newItem );
1878
+ });
1879
+ }
1880
+ },
1881
+
1882
+ next: function( event ) {
1883
+ this._move( "next", "first", event );
1884
+ },
1885
+
1886
+ previous: function( event ) {
1887
+ this._move( "prev", "last", event );
1888
+ },
1889
+
1890
+ isFirstItem: function() {
1891
+ return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
1892
+ },
1893
+
1894
+ isLastItem: function() {
1895
+ return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
1896
+ },
1897
+
1898
+ _move: function( direction, filter, event ) {
1899
+ var next;
1900
+ if ( this.active ) {
1901
+ if ( direction === "first" || direction === "last" ) {
1902
+ next = this.active
1903
+ [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
1904
+ .eq( -1 );
1905
+ } else {
1906
+ next = this.active
1907
+ [ direction + "All" ]( ".ui-menu-item" )
1908
+ .eq( 0 );
1909
+ }
1910
+ }
1911
+ if ( !next || !next.length || !this.active ) {
1912
+ next = this.activeMenu.find( this.options.items )[ filter ]();
1913
+ }
1914
+
1915
+ this.focus( event, next );
1916
+ },
1917
+
1918
+ nextPage: function( event ) {
1919
+ var item, base, height;
1920
+
1921
+ if ( !this.active ) {
1922
+ this.next( event );
1923
+ return;
1924
+ }
1925
+ if ( this.isLastItem() ) {
1926
+ return;
1927
+ }
1928
+ if ( this._hasScroll() ) {
1929
+ base = this.active.offset().top;
1930
+ height = this.element.height();
1931
+ this.active.nextAll( ".ui-menu-item" ).each(function() {
1932
+ item = $( this );
1933
+ return item.offset().top - base - height < 0;
1934
+ });
1935
+
1936
+ this.focus( event, item );
1937
+ } else {
1938
+ this.focus( event, this.activeMenu.find( this.options.items )
1939
+ [ !this.active ? "first" : "last" ]() );
1940
+ }
1941
+ },
1942
+
1943
+ previousPage: function( event ) {
1944
+ var item, base, height;
1945
+ if ( !this.active ) {
1946
+ this.next( event );
1947
+ return;
1948
+ }
1949
+ if ( this.isFirstItem() ) {
1950
+ return;
1951
+ }
1952
+ if ( this._hasScroll() ) {
1953
+ base = this.active.offset().top;
1954
+ height = this.element.height();
1955
+ this.active.prevAll( ".ui-menu-item" ).each(function() {
1956
+ item = $( this );
1957
+ return item.offset().top - base + height > 0;
1958
+ });
1959
+
1960
+ this.focus( event, item );
1961
+ } else {
1962
+ this.focus( event, this.activeMenu.find( this.options.items ).first() );
1963
+ }
1964
+ },
1965
+
1966
+ _hasScroll: function() {
1967
+ return this.element.outerHeight() < this.element.prop( "scrollHeight" );
1968
+ },
1969
+
1970
+ select: function( event ) {
1971
+ // TODO: It should never be possible to not have an active item at this
1972
+ // point, but the tests don't trigger mouseenter before click.
1973
+ this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
1974
+ var ui = { item: this.active };
1975
+ if ( !this.active.has( ".ui-menu" ).length ) {
1976
+ this.collapseAll( event, true );
1977
+ }
1978
+ this._trigger( "select", event, ui );
1979
+ },
1980
+
1981
+ _filterMenuItems: function(character) {
1982
+ var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
1983
+ regex = new RegExp( "^" + escapedCharacter, "i" );
1984
+
1985
+ return this.activeMenu
1986
+ .find( this.options.items )
1987
+
1988
+ // Only match on items, not dividers or other content (#10571)
1989
+ .filter( ".ui-menu-item" )
1990
+ .filter(function() {
1991
+ return regex.test( $.trim( $( this ).text() ) );
1992
+ });
1993
+ }
1994
+ });
1995
+
1996
+
1997
+ /*!
1998
+ * jQuery UI Autocomplete 1.11.4
1999
+ * http://jqueryui.com
2000
+ *
2001
+ * Copyright jQuery Foundation and other contributors
2002
+ * Released under the MIT license.
2003
+ * http://jquery.org/license
2004
+ *
2005
+ * http://api.jqueryui.com/autocomplete/
2006
+ */
2007
+
2008
+
2009
+ $.widget( "ui.autocomplete", {
2010
+ version: "1.11.4",
2011
+ defaultElement: "<input>",
2012
+ options: {
2013
+ appendTo: null,
2014
+ autoFocus: false,
2015
+ delay: 300,
2016
+ minLength: 1,
2017
+ position: {
2018
+ my: "left top",
2019
+ at: "left bottom",
2020
+ collision: "none"
2021
+ },
2022
+ source: null,
2023
+
2024
+ // callbacks
2025
+ change: null,
2026
+ close: null,
2027
+ focus: null,
2028
+ open: null,
2029
+ response: null,
2030
+ search: null,
2031
+ select: null
2032
+ },
2033
+
2034
+ requestIndex: 0,
2035
+ pending: 0,
2036
+
2037
+ _create: function() {
2038
+ // Some browsers only repeat keydown events, not keypress events,
2039
+ // so we use the suppressKeyPress flag to determine if we've already
2040
+ // handled the keydown event. #7269
2041
+ // Unfortunately the code for & in keypress is the same as the up arrow,
2042
+ // so we use the suppressKeyPressRepeat flag to avoid handling keypress
2043
+ // events when we know the keydown event was used to modify the
2044
+ // search term. #7799
2045
+ var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
2046
+ nodeName = this.element[ 0 ].nodeName.toLowerCase(),
2047
+ isTextarea = nodeName === "textarea",
2048
+ isInput = nodeName === "input";
2049
+
2050
+ this.isMultiLine =
2051
+ // Textareas are always multi-line
2052
+ isTextarea ? true :
2053
+ // Inputs are always single-line, even if inside a contentEditable element
2054
+ // IE also treats inputs as contentEditable
2055
+ isInput ? false :
2056
+ // All other element types are determined by whether or not they're contentEditable
2057
+ this.element.prop( "isContentEditable" );
2058
+
2059
+ this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
2060
+ this.isNewMenu = true;
2061
+
2062
+ this.element
2063
+ .addClass( "ui-autocomplete-input" )
2064
+ .attr( "autocomplete", "off" );
2065
+
2066
+ this._on( this.element, {
2067
+ keydown: function( event ) {
2068
+ if ( this.element.prop( "readOnly" ) ) {
2069
+ suppressKeyPress = true;
2070
+ suppressInput = true;
2071
+ suppressKeyPressRepeat = true;
2072
+ return;
2073
+ }
2074
+
2075
+ suppressKeyPress = false;
2076
+ suppressInput = false;
2077
+ suppressKeyPressRepeat = false;
2078
+ var keyCode = $.ui.keyCode;
2079
+ switch ( event.keyCode ) {
2080
+ case keyCode.PAGE_UP:
2081
+ suppressKeyPress = true;
2082
+ this._move( "previousPage", event );
2083
+ break;
2084
+ case keyCode.PAGE_DOWN:
2085
+ suppressKeyPress = true;
2086
+ this._move( "nextPage", event );
2087
+ break;
2088
+ case keyCode.UP:
2089
+ suppressKeyPress = true;
2090
+ this._keyEvent( "previous", event );
2091
+ break;
2092
+ case keyCode.DOWN:
2093
+ suppressKeyPress = true;
2094
+ this._keyEvent( "next", event );
2095
+ break;
2096
+ case keyCode.ENTER:
2097
+ // when menu is open and has focus
2098
+ if ( this.menu.active ) {
2099
+ // #6055 - Opera still allows the keypress to occur
2100
+ // which causes forms to submit
2101
+ suppressKeyPress = true;
2102
+ event.preventDefault();
2103
+ this.menu.select( event );
2104
+ }
2105
+ break;
2106
+ case keyCode.TAB:
2107
+ if ( this.menu.active ) {
2108
+ this.menu.select( event );
2109
+ }
2110
+ break;
2111
+ case keyCode.ESCAPE:
2112
+ if ( this.menu.element.is( ":visible" ) ) {
2113
+ if ( !this.isMultiLine ) {
2114
+ this._value( this.term );
2115
+ }
2116
+ this.close( event );
2117
+ // Different browsers have different default behavior for escape
2118
+ // Single press can mean undo or clear
2119
+ // Double press in IE means clear the whole form
2120
+ event.preventDefault();
2121
+ }
2122
+ break;
2123
+ default:
2124
+ suppressKeyPressRepeat = true;
2125
+ // search timeout should be triggered before the input value is changed
2126
+ this._searchTimeout( event );
2127
+ break;
2128
+ }
2129
+ },
2130
+ keypress: function( event ) {
2131
+ if ( suppressKeyPress ) {
2132
+ suppressKeyPress = false;
2133
+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
2134
+ event.preventDefault();
2135
+ }
2136
+ return;
2137
+ }
2138
+ if ( suppressKeyPressRepeat ) {
2139
+ return;
2140
+ }
2141
+
2142
+ // replicate some key handlers to allow them to repeat in Firefox and Opera
2143
+ var keyCode = $.ui.keyCode;
2144
+ switch ( event.keyCode ) {
2145
+ case keyCode.PAGE_UP:
2146
+ this._move( "previousPage", event );
2147
+ break;
2148
+ case keyCode.PAGE_DOWN:
2149
+ this._move( "nextPage", event );
2150
+ break;
2151
+ case keyCode.UP:
2152
+ this._keyEvent( "previous", event );
2153
+ break;
2154
+ case keyCode.DOWN:
2155
+ this._keyEvent( "next", event );
2156
+ break;
2157
+ }
2158
+ },
2159
+ input: function( event ) {
2160
+ if ( suppressInput ) {
2161
+ suppressInput = false;
2162
+ event.preventDefault();
2163
+ return;
2164
+ }
2165
+ this._searchTimeout( event );
2166
+ },
2167
+ focus: function() {
2168
+ this.selectedItem = null;
2169
+ this.previous = this._value();
2170
+ },
2171
+ blur: function( event ) {
2172
+ if ( this.cancelBlur ) {
2173
+ delete this.cancelBlur;
2174
+ return;
2175
+ }
2176
+
2177
+ clearTimeout( this.searching );
2178
+ this.close( event );
2179
+ this._change( event );
2180
+ }
2181
+ });
2182
+
2183
+ this._initSource();
2184
+ this.menu = $( "<ul>" )
2185
+ .addClass( "ui-autocomplete ui-front" )
2186
+ .appendTo( this._appendTo() )
2187
+ .menu({
2188
+ // disable ARIA support, the live region takes care of that
2189
+ role: null
2190
+ })
2191
+ .hide()
2192
+ .menu( "instance" );
2193
+
2194
+ this._on( this.menu.element, {
2195
+ mousedown: function( event ) {
2196
+ // prevent moving focus out of the text field
2197
+ event.preventDefault();
2198
+
2199
+ // IE doesn't prevent moving focus even with event.preventDefault()
2200
+ // so we set a flag to know when we should ignore the blur event
2201
+ this.cancelBlur = true;
2202
+ this._delay(function() {
2203
+ delete this.cancelBlur;
2204
+ });
2205
+
2206
+ // clicking on the scrollbar causes focus to shift to the body
2207
+ // but we can't detect a mouseup or a click immediately afterward
2208
+ // so we have to track the next mousedown and close the menu if
2209
+ // the user clicks somewhere outside of the autocomplete
2210
+ var menuElement = this.menu.element[ 0 ];
2211
+ if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
2212
+ this._delay(function() {
2213
+ var that = this;
2214
+ this.document.one( "mousedown", function( event ) {
2215
+ if ( event.target !== that.element[ 0 ] &&
2216
+ event.target !== menuElement &&
2217
+ !$.contains( menuElement, event.target ) ) {
2218
+ that.close();
2219
+ }
2220
+ });
2221
+ });
2222
+ }
2223
+ },
2224
+ menufocus: function( event, ui ) {
2225
+ var label, item;
2226
+ // support: Firefox
2227
+ // Prevent accidental activation of menu items in Firefox (#7024 #9118)
2228
+ if ( this.isNewMenu ) {
2229
+ this.isNewMenu = false;
2230
+ if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
2231
+ this.menu.blur();
2232
+
2233
+ this.document.one( "mousemove", function() {
2234
+ $( event.target ).trigger( event.originalEvent );
2235
+ });
2236
+
2237
+ return;
2238
+ }
2239
+ }
2240
+
2241
+ item = ui.item.data( "ui-autocomplete-item" );
2242
+ if ( false !== this._trigger( "focus", event, { item: item } ) ) {
2243
+ // use value to match what will end up in the input, if it was a key event
2244
+ if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
2245
+ this._value( item.value );
2246
+ }
2247
+ }
2248
+
2249
+ // Announce the value in the liveRegion
2250
+ label = ui.item.attr( "aria-label" ) || item.value;
2251
+ if ( label && $.trim( label ).length ) {
2252
+ this.liveRegion.children().hide();
2253
+ $( "<div>" ).text( label ).appendTo( this.liveRegion );
2254
+ }
2255
+ },
2256
+ menuselect: function( event, ui ) {
2257
+ var item = ui.item.data( "ui-autocomplete-item" ),
2258
+ previous = this.previous;
2259
+
2260
+ // only trigger when focus was lost (click on menu)
2261
+ if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
2262
+ this.element.focus();
2263
+ this.previous = previous;
2264
+ // #6109 - IE triggers two focus events and the second
2265
+ // is asynchronous, so we need to reset the previous
2266
+ // term synchronously and asynchronously :-(
2267
+ this._delay(function() {
2268
+ this.previous = previous;
2269
+ this.selectedItem = item;
2270
+ });
2271
+ }
2272
+
2273
+ if ( false !== this._trigger( "select", event, { item: item } ) ) {
2274
+ this._value( item.value );
2275
+ }
2276
+ // reset the term after the select event
2277
+ // this allows custom select handling to work properly
2278
+ this.term = this._value();
2279
+
2280
+ this.close( event );
2281
+ this.selectedItem = item;
2282
+ }
2283
+ });
2284
+
2285
+ this.liveRegion = $( "<span>", {
2286
+ role: "status",
2287
+ "aria-live": "assertive",
2288
+ "aria-relevant": "additions"
2289
+ })
2290
+ .addClass( "ui-helper-hidden-accessible" )
2291
+ .appendTo( this.document[ 0 ].body );
2292
+
2293
+ // turning off autocomplete prevents the browser from remembering the
2294
+ // value when navigating through history, so we re-enable autocomplete
2295
+ // if the page is unloaded before the widget is destroyed. #7790
2296
+ this._on( this.window, {
2297
+ beforeunload: function() {
2298
+ this.element.removeAttr( "autocomplete" );
2299
+ }
2300
+ });
2301
+ },
2302
+
2303
+ _destroy: function() {
2304
+ clearTimeout( this.searching );
2305
+ this.element
2306
+ .removeClass( "ui-autocomplete-input" )
2307
+ .removeAttr( "autocomplete" );
2308
+ this.menu.element.remove();
2309
+ this.liveRegion.remove();
2310
+ },
2311
+
2312
+ _setOption: function( key, value ) {
2313
+ this._super( key, value );
2314
+ if ( key === "source" ) {
2315
+ this._initSource();
2316
+ }
2317
+ if ( key === "appendTo" ) {
2318
+ this.menu.element.appendTo( this._appendTo() );
2319
+ }
2320
+ if ( key === "disabled" && value && this.xhr ) {
2321
+ this.xhr.abort();
2322
+ }
2323
+ },
2324
+
2325
+ _appendTo: function() {
2326
+ var element = this.options.appendTo;
2327
+
2328
+ if ( element ) {
2329
+ element = element.jquery || element.nodeType ?
2330
+ $( element ) :
2331
+ this.document.find( element ).eq( 0 );
2332
+ }
2333
+
2334
+ if ( !element || !element[ 0 ] ) {
2335
+ element = this.element.closest( ".ui-front" );
2336
+ }
2337
+
2338
+ if ( !element.length ) {
2339
+ element = this.document[ 0 ].body;
2340
+ }
2341
+
2342
+ return element;
2343
+ },
2344
+
2345
+ _initSource: function() {
2346
+ var array, url,
2347
+ that = this;
2348
+ if ( $.isArray( this.options.source ) ) {
2349
+ array = this.options.source;
2350
+ this.source = function( request, response ) {
2351
+ response( $.ui.autocomplete.filter( array, request.term ) );
2352
+ };
2353
+ } else if ( typeof this.options.source === "string" ) {
2354
+ url = this.options.source;
2355
+ this.source = function( request, response ) {
2356
+ if ( that.xhr ) {
2357
+ that.xhr.abort();
2358
+ }
2359
+ that.xhr = $.ajax({
2360
+ url: url,
2361
+ data: request,
2362
+ dataType: "json",
2363
+ success: function( data ) {
2364
+ response( data );
2365
+ },
2366
+ error: function() {
2367
+ response([]);
2368
+ }
2369
+ });
2370
+ };
2371
+ } else {
2372
+ this.source = this.options.source;
2373
+ }
2374
+ },
2375
+
2376
+ _searchTimeout: function( event ) {
2377
+ clearTimeout( this.searching );
2378
+ this.searching = this._delay(function() {
2379
+
2380
+ // Search if the value has changed, or if the user retypes the same value (see #7434)
2381
+ var equalValues = this.term === this._value(),
2382
+ menuVisible = this.menu.element.is( ":visible" ),
2383
+ modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
2384
+
2385
+ if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
2386
+ this.selectedItem = null;
2387
+ this.search( null, event );
2388
+ }
2389
+ }, this.options.delay );
2390
+ },
2391
+
2392
+ search: function( value, event ) {
2393
+ value = value != null ? value : this._value();
2394
+
2395
+ // always save the actual value, not the one passed as an argument
2396
+ this.term = this._value();
2397
+
2398
+ if ( value.length < this.options.minLength ) {
2399
+ return this.close( event );
2400
+ }
2401
+
2402
+ if ( this._trigger( "search", event ) === false ) {
2403
+ return;
2404
+ }
2405
+
2406
+ return this._search( value );
2407
+ },
2408
+
2409
+ _search: function( value ) {
2410
+ this.pending++;
2411
+ this.element.addClass( "ui-autocomplete-loading" );
2412
+ this.cancelSearch = false;
2413
+
2414
+ this.source( { term: value }, this._response() );
2415
+ },
2416
+
2417
+ _response: function() {
2418
+ var index = ++this.requestIndex;
2419
+
2420
+ return $.proxy(function( content ) {
2421
+ if ( index === this.requestIndex ) {
2422
+ this.__response( content );
2423
+ }
2424
+
2425
+ this.pending--;
2426
+ if ( !this.pending ) {
2427
+ this.element.removeClass( "ui-autocomplete-loading" );
2428
+ }
2429
+ }, this );
2430
+ },
2431
+
2432
+ __response: function( content ) {
2433
+ if ( content ) {
2434
+ content = this._normalize( content );
2435
+ }
2436
+ this._trigger( "response", null, { content: content } );
2437
+ if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
2438
+ this._suggest( content );
2439
+ this._trigger( "open" );
2440
+ } else {
2441
+ // use ._close() instead of .close() so we don't cancel future searches
2442
+ this._close();
2443
+ }
2444
+ },
2445
+
2446
+ close: function( event ) {
2447
+ this.cancelSearch = true;
2448
+ this._close( event );
2449
+ },
2450
+
2451
+ _close: function( event ) {
2452
+ if ( this.menu.element.is( ":visible" ) ) {
2453
+ this.menu.element.hide();
2454
+ this.menu.blur();
2455
+ this.isNewMenu = true;
2456
+ this._trigger( "close", event );
2457
+ }
2458
+ },
2459
+
2460
+ _change: function( event ) {
2461
+ if ( this.previous !== this._value() ) {
2462
+ this._trigger( "change", event, { item: this.selectedItem } );
2463
+ }
2464
+ },
2465
+
2466
+ _normalize: function( items ) {
2467
+ // assume all items have the right format when the first item is complete
2468
+ if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
2469
+ return items;
2470
+ }
2471
+ return $.map( items, function( item ) {
2472
+ if ( typeof item === "string" ) {
2473
+ return {
2474
+ label: item,
2475
+ value: item
2476
+ };
2477
+ }
2478
+ return $.extend( {}, item, {
2479
+ label: item.label || item.value,
2480
+ value: item.value || item.label
2481
+ });
2482
+ });
2483
+ },
2484
+
2485
+ _suggest: function( items ) {
2486
+ var ul = this.menu.element.empty();
2487
+ this._renderMenu( ul, items );
2488
+ this.isNewMenu = true;
2489
+ this.menu.refresh();
2490
+
2491
+ // size and position menu
2492
+ ul.show();
2493
+ this._resizeMenu();
2494
+ ul.position( $.extend({
2495
+ of: this.element
2496
+ }, this.options.position ) );
2497
+
2498
+ if ( this.options.autoFocus ) {
2499
+ this.menu.next();
2500
+ }
2501
+ },
2502
+
2503
+ _resizeMenu: function() {
2504
+ var ul = this.menu.element;
2505
+ ul.outerWidth( Math.max(
2506
+ // Firefox wraps long text (possibly a rounding bug)
2507
+ // so we add 1px to avoid the wrapping (#7513)
2508
+ ul.width( "" ).outerWidth() + 1,
2509
+ this.element.outerWidth()
2510
+ ) );
2511
+ },
2512
+
2513
+ _renderMenu: function( ul, items ) {
2514
+ var that = this;
2515
+ $.each( items, function( index, item ) {
2516
+ that._renderItemData( ul, item );
2517
+ });
2518
+ },
2519
+
2520
+ _renderItemData: function( ul, item ) {
2521
+ return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
2522
+ },
2523
+
2524
+ _renderItem: function( ul, item ) {
2525
+ return $( "<li>" ).text( item.label ).appendTo( ul );
2526
+ },
2527
+
2528
+ _move: function( direction, event ) {
2529
+ if ( !this.menu.element.is( ":visible" ) ) {
2530
+ this.search( null, event );
2531
+ return;
2532
+ }
2533
+ if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
2534
+ this.menu.isLastItem() && /^next/.test( direction ) ) {
2535
+
2536
+ if ( !this.isMultiLine ) {
2537
+ this._value( this.term );
2538
+ }
2539
+
2540
+ this.menu.blur();
2541
+ return;
2542
+ }
2543
+ this.menu[ direction ]( event );
2544
+ },
2545
+
2546
+ widget: function() {
2547
+ return this.menu.element;
2548
+ },
2549
+
2550
+ _value: function() {
2551
+ return this.valueMethod.apply( this.element, arguments );
2552
+ },
2553
+
2554
+ _keyEvent: function( keyEvent, event ) {
2555
+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
2556
+ this._move( keyEvent, event );
2557
+
2558
+ // prevents moving cursor to beginning/end of the text field in some browsers
2559
+ event.preventDefault();
2560
+ }
2561
+ }
2562
+ });
2563
+
2564
+ $.extend( $.ui.autocomplete, {
2565
+ escapeRegex: function( value ) {
2566
+ return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
2567
+ },
2568
+ filter: function( array, term ) {
2569
+ var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
2570
+ return $.grep( array, function( value ) {
2571
+ return matcher.test( value.label || value.value || value );
2572
+ });
2573
+ }
2574
+ });
2575
+
2576
+ // live region extension, adding a `messages` option
2577
+ // NOTE: This is an experimental API. We are still investigating
2578
+ // a full solution for string manipulation and internationalization.
2579
+ $.widget( "ui.autocomplete", $.ui.autocomplete, {
2580
+ options: {
2581
+ messages: {
2582
+ noResults: "No search results.",
2583
+ results: function( amount ) {
2584
+ return amount + ( amount > 1 ? " results are" : " result is" ) +
2585
+ " available, use up and down arrow keys to navigate.";
2586
+ }
2587
+ }
2588
+ },
2589
+
2590
+ __response: function( content ) {
2591
+ var message;
2592
+ this._superApply( arguments );
2593
+ if ( this.options.disabled || this.cancelSearch ) {
2594
+ return;
2595
+ }
2596
+ if ( content && content.length ) {
2597
+ message = this.options.messages.results( content.length );
2598
+ } else {
2599
+ message = this.options.messages.noResults;
2600
+ }
2601
+ this.liveRegion.children().hide();
2602
+ $( "<div>" ).text( message ).appendTo( this.liveRegion );
2603
+ }
2604
+ });
2605
+
2606
+ var autocomplete = $.ui.autocomplete;
2607
+
2608
+
2609
+
2610
+ }));
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.min.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.4 - 2015-05-28
2
+ * http://jqueryui.com
3
+ * Includes: core.css, autocomplete.css, menu.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/
5
+ * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.4 - 2015-05-28
2
+ * http://jqueryui.com
3
+ * Includes: core.js, widget.js, position.js, autocomplete.js, menu.js
4
+ * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
5
+
6
+ (function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var s=0,n=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,a=n.call(arguments,1),o=0,r=a.length;r>o;o++)for(i in a[o])s=a[o][i],a[o].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(a){var o="string"==typeof a,r=n.call(arguments,1),h=this;return o?this.each(function(){var i,n=e.data(this,s);return"instance"===a?(h=n,!1):n?e.isFunction(n[a])&&"_"!==a.charAt(0)?(i=n[a].apply(n,r),i!==n&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+a+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+a+"'")}):(r.length&&(a=e.widget.extend.apply(null,[a].concat(r))),this.each(function(){var t=e.data(this,s);t?(t.option(a||{}),t._init&&t._init()):e.data(this,s,new i(a,this))})),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget,function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,N=e.extend({},y),M=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?N.left-=d:"center"===n.my[0]&&(N.left-=d/2),"bottom"===n.my[1]?N.top-=c:"center"===n.my[1]&&(N.top-=c/2),N.left+=M[0],N.top+=M[1],a||(N.left=h(N.left),N.top=h(N.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](N,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+M[0],p[1]+M[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-N.left,i=t+m-d,s=v.top-N.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:N.left,top:N.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(N,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()
7
+ },_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete});
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.structure.css ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery UI CSS Framework 1.11.4
3
+ * http://jqueryui.com
4
+ *
5
+ * Copyright jQuery Foundation and other contributors
6
+ * Released under the MIT license.
7
+ * http://jquery.org/license
8
+ *
9
+ * http://api.jqueryui.com/category/theming/
10
+ */
11
+
12
+ /* Layout helpers
13
+ ----------------------------------*/
14
+ .ui-helper-hidden {
15
+ display: none;
16
+ }
17
+ .ui-helper-hidden-accessible {
18
+ border: 0;
19
+ clip: rect(0 0 0 0);
20
+ height: 1px;
21
+ margin: -1px;
22
+ overflow: hidden;
23
+ padding: 0;
24
+ position: absolute;
25
+ width: 1px;
26
+ }
27
+ .ui-helper-reset {
28
+ margin: 0;
29
+ padding: 0;
30
+ border: 0;
31
+ outline: 0;
32
+ line-height: 1.3;
33
+ text-decoration: none;
34
+ font-size: 100%;
35
+ list-style: none;
36
+ }
37
+ .ui-helper-clearfix:before,
38
+ .ui-helper-clearfix:after {
39
+ content: "";
40
+ display: table;
41
+ border-collapse: collapse;
42
+ }
43
+ .ui-helper-clearfix:after {
44
+ clear: both;
45
+ }
46
+ .ui-helper-clearfix {
47
+ min-height: 0; /* support: IE7 */
48
+ }
49
+ .ui-helper-zfix {
50
+ width: 100%;
51
+ height: 100%;
52
+ top: 0;
53
+ left: 0;
54
+ position: absolute;
55
+ opacity: 0;
56
+ filter:Alpha(Opacity=0); /* support: IE8 */
57
+ }
58
+
59
+ .ui-front {
60
+ z-index: 100;
61
+ }
62
+
63
+
64
+ /* Interaction Cues
65
+ ----------------------------------*/
66
+ .ui-state-disabled {
67
+ cursor: default !important;
68
+ }
69
+
70
+
71
+ /* Icons
72
+ ----------------------------------*/
73
+
74
+ /* states and images */
75
+ .ui-icon {
76
+ display: block;
77
+ text-indent: -99999px;
78
+ overflow: hidden;
79
+ background-repeat: no-repeat;
80
+ }
81
+
82
+
83
+ /* Misc visuals
84
+ ----------------------------------*/
85
+
86
+ /* Overlays */
87
+ .ui-widget-overlay {
88
+ position: fixed;
89
+ top: 0;
90
+ left: 0;
91
+ width: 100%;
92
+ height: 100%;
93
+ }
94
+ .ui-autocomplete {
95
+ position: absolute;
96
+ top: 0;
97
+ left: 0;
98
+ cursor: default;
99
+ }
100
+ .ui-menu {
101
+ list-style: none;
102
+ padding: 0;
103
+ margin: 0;
104
+ display: block;
105
+ outline: none;
106
+ }
107
+ .ui-menu .ui-menu {
108
+ position: absolute;
109
+ }
110
+ .ui-menu .ui-menu-item {
111
+ position: relative;
112
+ margin: 0;
113
+ padding: 3px 1em 3px .4em;
114
+ cursor: pointer;
115
+ min-height: 0; /* support: IE7 */
116
+ /* support: IE10, see #8844 */
117
+ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
118
+ }
119
+ .ui-menu .ui-menu-divider {
120
+ margin: 5px 0;
121
+ height: 0;
122
+ font-size: 0;
123
+ line-height: 0;
124
+ border-width: 1px 0 0 0;
125
+ }
126
+ .ui-menu .ui-state-focus,
127
+ .ui-menu .ui-state-active {
128
+ margin: -1px;
129
+ }
130
+
131
+ /* icon support */
132
+ .ui-menu-icons {
133
+ position: relative;
134
+ }
135
+ .ui-menu-icons .ui-menu-item {
136
+ padding-left: 2em;
137
+ }
138
+
139
+ /* left-aligned */
140
+ .ui-menu .ui-icon {
141
+ position: absolute;
142
+ top: 0;
143
+ bottom: 0;
144
+ left: .2em;
145
+ margin: auto 0;
146
+ }
147
+
148
+ /* right-aligned */
149
+ .ui-menu .ui-menu-icon {
150
+ left: auto;
151
+ right: 0;
152
+ }
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.structure.min.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.4 - 2015-05-28
2
+ * http://jqueryui.com
3
+ * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
4
+
5
+ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.theme.css ADDED
@@ -0,0 +1,410 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery UI CSS Framework 1.11.4
3
+ * http://jqueryui.com
4
+ *
5
+ * Copyright jQuery Foundation and other contributors
6
+ * Released under the MIT license.
7
+ * http://jquery.org/license
8
+ *
9
+ * http://api.jqueryui.com/category/theming/
10
+ *
11
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/
12
+ */
13
+
14
+
15
+ /* Component containers
16
+ ----------------------------------*/
17
+ .ui-widget {
18
+ font-family: Verdana,Arial,sans-serif;
19
+ font-size: 1.1em;
20
+ }
21
+ .ui-widget .ui-widget {
22
+ font-size: 1em;
23
+ }
24
+ .ui-widget input,
25
+ .ui-widget select,
26
+ .ui-widget textarea,
27
+ .ui-widget button {
28
+ font-family: Verdana,Arial,sans-serif;
29
+ font-size: 1em;
30
+ }
31
+ .ui-widget-content {
32
+ border: 1px solid #aaaaaa;
33
+ background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
34
+ color: #222222;
35
+ }
36
+ .ui-widget-content a {
37
+ color: #222222;
38
+ }
39
+ .ui-widget-header {
40
+ border: 1px solid #aaaaaa;
41
+ background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
42
+ color: #222222;
43
+ font-weight: bold;
44
+ }
45
+ .ui-widget-header a {
46
+ color: #222222;
47
+ }
48
+
49
+ /* Interaction states
50
+ ----------------------------------*/
51
+ .ui-state-default,
52
+ .ui-widget-content .ui-state-default,
53
+ .ui-widget-header .ui-state-default {
54
+ border: 1px solid #d3d3d3;
55
+ background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
56
+ font-weight: normal;
57
+ color: #555555;
58
+ }
59
+ .ui-state-default a,
60
+ .ui-state-default a:link,
61
+ .ui-state-default a:visited {
62
+ color: #555555;
63
+ text-decoration: none;
64
+ }
65
+ .ui-state-hover,
66
+ .ui-widget-content .ui-state-hover,
67
+ .ui-widget-header .ui-state-hover,
68
+ .ui-state-focus,
69
+ .ui-widget-content .ui-state-focus,
70
+ .ui-widget-header .ui-state-focus {
71
+ border: 1px solid #999999;
72
+ background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
73
+ font-weight: normal;
74
+ color: #212121;
75
+ }
76
+ .ui-state-hover a,
77
+ .ui-state-hover a:hover,
78
+ .ui-state-hover a:link,
79
+ .ui-state-hover a:visited,
80
+ .ui-state-focus a,
81
+ .ui-state-focus a:hover,
82
+ .ui-state-focus a:link,
83
+ .ui-state-focus a:visited {
84
+ color: #212121;
85
+ text-decoration: none;
86
+ }
87
+ .ui-state-active,
88
+ .ui-widget-content .ui-state-active,
89
+ .ui-widget-header .ui-state-active {
90
+ border: 1px solid #aaaaaa;
91
+ background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
92
+ font-weight: normal;
93
+ color: #212121;
94
+ }
95
+ .ui-state-active a,
96
+ .ui-state-active a:link,
97
+ .ui-state-active a:visited {
98
+ color: #212121;
99
+ text-decoration: none;
100
+ }
101
+
102
+ /* Interaction Cues
103
+ ----------------------------------*/
104
+ .ui-state-highlight,
105
+ .ui-widget-content .ui-state-highlight,
106
+ .ui-widget-header .ui-state-highlight {
107
+ border: 1px solid #fcefa1;
108
+ background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
109
+ color: #363636;
110
+ }
111
+ .ui-state-highlight a,
112
+ .ui-widget-content .ui-state-highlight a,
113
+ .ui-widget-header .ui-state-highlight a {
114
+ color: #363636;
115
+ }
116
+ .ui-state-error,
117
+ .ui-widget-content .ui-state-error,
118
+ .ui-widget-header .ui-state-error {
119
+ border: 1px solid #cd0a0a;
120
+ background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
121
+ color: #cd0a0a;
122
+ }
123
+ .ui-state-error a,
124
+ .ui-widget-content .ui-state-error a,
125
+ .ui-widget-header .ui-state-error a {
126
+ color: #cd0a0a;
127
+ }
128
+ .ui-state-error-text,
129
+ .ui-widget-content .ui-state-error-text,
130
+ .ui-widget-header .ui-state-error-text {
131
+ color: #cd0a0a;
132
+ }
133
+ .ui-priority-primary,
134
+ .ui-widget-content .ui-priority-primary,
135
+ .ui-widget-header .ui-priority-primary {
136
+ font-weight: bold;
137
+ }
138
+ .ui-priority-secondary,
139
+ .ui-widget-content .ui-priority-secondary,
140
+ .ui-widget-header .ui-priority-secondary {
141
+ opacity: .7;
142
+ filter:Alpha(Opacity=70); /* support: IE8 */
143
+ font-weight: normal;
144
+ }
145
+ .ui-state-disabled,
146
+ .ui-widget-content .ui-state-disabled,
147
+ .ui-widget-header .ui-state-disabled {
148
+ opacity: .35;
149
+ filter:Alpha(Opacity=35); /* support: IE8 */
150
+ background-image: none;
151
+ }
152
+ .ui-state-disabled .ui-icon {
153
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
154
+ }
155
+
156
+ /* Icons
157
+ ----------------------------------*/
158
+
159
+ /* states and images */
160
+ .ui-icon {
161
+ width: 16px;
162
+ height: 16px;
163
+ }
164
+ .ui-icon,
165
+ .ui-widget-content .ui-icon {
166
+ background-image: url("images/ui-icons_222222_256x240.png");
167
+ }
168
+ .ui-widget-header .ui-icon {
169
+ background-image: url("images/ui-icons_222222_256x240.png");
170
+ }
171
+ .ui-state-default .ui-icon {
172
+ background-image: url("images/ui-icons_888888_256x240.png");
173
+ }
174
+ .ui-state-hover .ui-icon,
175
+ .ui-state-focus .ui-icon {
176
+ background-image: url("images/ui-icons_454545_256x240.png");
177
+ }
178
+ .ui-state-active .ui-icon {
179
+ background-image: url("images/ui-icons_454545_256x240.png");
180
+ }
181
+ .ui-state-highlight .ui-icon {
182
+ background-image: url("images/ui-icons_2e83ff_256x240.png");
183
+ }
184
+ .ui-state-error .ui-icon,
185
+ .ui-state-error-text .ui-icon {
186
+ background-image: url("images/ui-icons_cd0a0a_256x240.png");
187
+ }
188
+
189
+ /* positioning */
190
+ .ui-icon-blank { background-position: 16px 16px; }
191
+ .ui-icon-carat-1-n { background-position: 0 0; }
192
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
193
+ .ui-icon-carat-1-e { background-position: -32px 0; }
194
+ .ui-icon-carat-1-se { background-position: -48px 0; }
195
+ .ui-icon-carat-1-s { background-position: -64px 0; }
196
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
197
+ .ui-icon-carat-1-w { background-position: -96px 0; }
198
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
199
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
200
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
201
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
202
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
203
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
204
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
205
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
206
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
207
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
208
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
209
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
210
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
211
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
212
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
213
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
214
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
215
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
216
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
217
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
218
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
219
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
220
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
221
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
222
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
223
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
224
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
225
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
226
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
227
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
228
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
229
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
230
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
231
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
232
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
233
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
234
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
235
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
236
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
237
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
238
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
239
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
240
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
241
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
242
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
243
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
244
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
245
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
246
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
247
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
248
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
249
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
250
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
251
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
252
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
253
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
254
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
255
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
256
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
257
+ .ui-icon-extlink { background-position: -32px -80px; }
258
+ .ui-icon-newwin { background-position: -48px -80px; }
259
+ .ui-icon-refresh { background-position: -64px -80px; }
260
+ .ui-icon-shuffle { background-position: -80px -80px; }
261
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
262
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
263
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
264
+ .ui-icon-folder-open { background-position: -16px -96px; }
265
+ .ui-icon-document { background-position: -32px -96px; }
266
+ .ui-icon-document-b { background-position: -48px -96px; }
267
+ .ui-icon-note { background-position: -64px -96px; }
268
+ .ui-icon-mail-closed { background-position: -80px -96px; }
269
+ .ui-icon-mail-open { background-position: -96px -96px; }
270
+ .ui-icon-suitcase { background-position: -112px -96px; }
271
+ .ui-icon-comment { background-position: -128px -96px; }
272
+ .ui-icon-person { background-position: -144px -96px; }
273
+ .ui-icon-print { background-position: -160px -96px; }
274
+ .ui-icon-trash { background-position: -176px -96px; }
275
+ .ui-icon-locked { background-position: -192px -96px; }
276
+ .ui-icon-unlocked { background-position: -208px -96px; }
277
+ .ui-icon-bookmark { background-position: -224px -96px; }
278
+ .ui-icon-tag { background-position: -240px -96px; }
279
+ .ui-icon-home { background-position: 0 -112px; }
280
+ .ui-icon-flag { background-position: -16px -112px; }
281
+ .ui-icon-calendar { background-position: -32px -112px; }
282
+ .ui-icon-cart { background-position: -48px -112px; }
283
+ .ui-icon-pencil { background-position: -64px -112px; }
284
+ .ui-icon-clock { background-position: -80px -112px; }
285
+ .ui-icon-disk { background-position: -96px -112px; }
286
+ .ui-icon-calculator { background-position: -112px -112px; }
287
+ .ui-icon-zoomin { background-position: -128px -112px; }
288
+ .ui-icon-zoomout { background-position: -144px -112px; }
289
+ .ui-icon-search { background-position: -160px -112px; }
290
+ .ui-icon-wrench { background-position: -176px -112px; }
291
+ .ui-icon-gear { background-position: -192px -112px; }
292
+ .ui-icon-heart { background-position: -208px -112px; }
293
+ .ui-icon-star { background-position: -224px -112px; }
294
+ .ui-icon-link { background-position: -240px -112px; }
295
+ .ui-icon-cancel { background-position: 0 -128px; }
296
+ .ui-icon-plus { background-position: -16px -128px; }
297
+ .ui-icon-plusthick { background-position: -32px -128px; }
298
+ .ui-icon-minus { background-position: -48px -128px; }
299
+ .ui-icon-minusthick { background-position: -64px -128px; }
300
+ .ui-icon-close { background-position: -80px -128px; }
301
+ .ui-icon-closethick { background-position: -96px -128px; }
302
+ .ui-icon-key { background-position: -112px -128px; }
303
+ .ui-icon-lightbulb { background-position: -128px -128px; }
304
+ .ui-icon-scissors { background-position: -144px -128px; }
305
+ .ui-icon-clipboard { background-position: -160px -128px; }
306
+ .ui-icon-copy { background-position: -176px -128px; }
307
+ .ui-icon-contact { background-position: -192px -128px; }
308
+ .ui-icon-image { background-position: -208px -128px; }
309
+ .ui-icon-video { background-position: -224px -128px; }
310
+ .ui-icon-script { background-position: -240px -128px; }
311
+ .ui-icon-alert { background-position: 0 -144px; }
312
+ .ui-icon-info { background-position: -16px -144px; }
313
+ .ui-icon-notice { background-position: -32px -144px; }
314
+ .ui-icon-help { background-position: -48px -144px; }
315
+ .ui-icon-check { background-position: -64px -144px; }
316
+ .ui-icon-bullet { background-position: -80px -144px; }
317
+ .ui-icon-radio-on { background-position: -96px -144px; }
318
+ .ui-icon-radio-off { background-position: -112px -144px; }
319
+ .ui-icon-pin-w { background-position: -128px -144px; }
320
+ .ui-icon-pin-s { background-position: -144px -144px; }
321
+ .ui-icon-play { background-position: 0 -160px; }
322
+ .ui-icon-pause { background-position: -16px -160px; }
323
+ .ui-icon-seek-next { background-position: -32px -160px; }
324
+ .ui-icon-seek-prev { background-position: -48px -160px; }
325
+ .ui-icon-seek-end { background-position: -64px -160px; }
326
+ .ui-icon-seek-start { background-position: -80px -160px; }
327
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
328
+ .ui-icon-seek-first { background-position: -80px -160px; }
329
+ .ui-icon-stop { background-position: -96px -160px; }
330
+ .ui-icon-eject { background-position: -112px -160px; }
331
+ .ui-icon-volume-off { background-position: -128px -160px; }
332
+ .ui-icon-volume-on { background-position: -144px -160px; }
333
+ .ui-icon-power { background-position: 0 -176px; }
334
+ .ui-icon-signal-diag { background-position: -16px -176px; }
335
+ .ui-icon-signal { background-position: -32px -176px; }
336
+ .ui-icon-battery-0 { background-position: -48px -176px; }
337
+ .ui-icon-battery-1 { background-position: -64px -176px; }
338
+ .ui-icon-battery-2 { background-position: -80px -176px; }
339
+ .ui-icon-battery-3 { background-position: -96px -176px; }
340
+ .ui-icon-circle-plus { background-position: 0 -192px; }
341
+ .ui-icon-circle-minus { background-position: -16px -192px; }
342
+ .ui-icon-circle-close { background-position: -32px -192px; }
343
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
344
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
345
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
346
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
347
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
348
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
349
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
350
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
351
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
352
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
353
+ .ui-icon-circle-check { background-position: -208px -192px; }
354
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
355
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
356
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
357
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
358
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
359
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
360
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
361
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
362
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
363
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
364
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
365
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
366
+
367
+
368
+ /* Misc visuals
369
+ ----------------------------------*/
370
+
371
+ /* Corner radius */
372
+ .ui-corner-all,
373
+ .ui-corner-top,
374
+ .ui-corner-left,
375
+ .ui-corner-tl {
376
+ border-top-left-radius: 4px;
377
+ }
378
+ .ui-corner-all,
379
+ .ui-corner-top,
380
+ .ui-corner-right,
381
+ .ui-corner-tr {
382
+ border-top-right-radius: 4px;
383
+ }
384
+ .ui-corner-all,
385
+ .ui-corner-bottom,
386
+ .ui-corner-left,
387
+ .ui-corner-bl {
388
+ border-bottom-left-radius: 4px;
389
+ }
390
+ .ui-corner-all,
391
+ .ui-corner-bottom,
392
+ .ui-corner-right,
393
+ .ui-corner-br {
394
+ border-bottom-right-radius: 4px;
395
+ }
396
+
397
+ /* Overlays */
398
+ .ui-widget-overlay {
399
+ background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
400
+ opacity: .3;
401
+ filter: Alpha(Opacity=30); /* support: IE8 */
402
+ }
403
+ .ui-widget-shadow {
404
+ margin: -8px 0 0 -8px;
405
+ padding: 8px;
406
+ background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
407
+ opacity: .3;
408
+ filter: Alpha(Opacity=30); /* support: IE8 */
409
+ border-radius: 8px;
410
+ }
skin/frontend/base/default/js/inktonerfinder_jquery-ui-1.11.4.custom/jquery-ui.theme.min.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.4 - 2015-05-28
2
+ * http://jqueryui.com
3
+ * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
4
+
5
+ .ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}