AShop_Slider - Version 1.0.0

Version Notes

Features:
1. Can add as many slider and manage banner accordingly.
2.Awesome slider animation.
3.Responsive view

Download this release

Release Info

Developer AccessShop Themes
Extension AShop_Slider
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (49) hide show
  1. app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager.php +39 -0
  2. app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Custom.php +31 -0
  3. app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Edit.php +71 -0
  4. app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Edit/Form.php +45 -0
  5. app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Edit/Tab/Custom.php +172 -0
  6. app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Edit/Tab/Form.php +77 -0
  7. app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Edit/Tabs.php +65 -0
  8. app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Grid.php +134 -0
  9. app/code/local/AShop/Slidermanager/Block/Adminhtml/Renderer/bannerimage.php +39 -0
  10. app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager.php +39 -0
  11. app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager/Edit.php +71 -0
  12. app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager/Edit/Form.php +45 -0
  13. app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager/Edit/Tab/Form.php +137 -0
  14. app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager/Edit/Tabs.php +50 -0
  15. app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager/Grid.php +141 -0
  16. app/code/local/AShop/Slidermanager/Block/Adminhtml/System/Configuration/Implementcode.php +96 -0
  17. app/code/local/AShop/Slidermanager/Block/Slidermanager.php +44 -0
  18. app/code/local/AShop/Slidermanager/Helper/Data.php +73 -0
  19. app/code/local/AShop/Slidermanager/Model/Bannermanager.php +51 -0
  20. app/code/local/AShop/Slidermanager/Model/Mysql4/Bannermanager.php +35 -0
  21. app/code/local/AShop/Slidermanager/Model/Mysql4/Bannermanager/Collection.php +36 -0
  22. app/code/local/AShop/Slidermanager/Model/Mysql4/Slidermanager.php +35 -0
  23. app/code/local/AShop/Slidermanager/Model/Mysql4/Slidermanager/Collection.php +36 -0
  24. app/code/local/AShop/Slidermanager/Model/Select.php +53 -0
  25. app/code/local/AShop/Slidermanager/Model/Slidermanager.php +51 -0
  26. app/code/local/AShop/Slidermanager/Model/Status.php +41 -0
  27. app/code/local/AShop/Slidermanager/Model/Target.php +40 -0
  28. app/code/local/AShop/Slidermanager/controllers/Adminhtml/BannermanagerController.php +251 -0
  29. app/code/local/AShop/Slidermanager/controllers/Adminhtml/SlidermanagerController.php +242 -0
  30. app/code/local/AShop/Slidermanager/controllers/IndexController.php +36 -0
  31. app/code/local/AShop/Slidermanager/etc/config.xml +170 -0
  32. app/code/local/AShop/Slidermanager/etc/system.xml +69 -0
  33. app/code/local/AShop/Slidermanager/sql/slidermanager_setup/mysql4-install-1.0.0.php +66 -0
  34. app/design/adminhtml/default/default/layout/slidermanager.xml +64 -0
  35. app/design/frontend/base/default/layout/slidermanager.xml +49 -0
  36. app/design/frontend/base/default/template/slidermanager/slidermanager.phtml +95 -0
  37. app/etc/modules/AShop_Slidermanager.xml +38 -0
  38. media/slidermanager/bg-sequence.jpg +0 -0
  39. package.xml +21 -0
  40. skin/frontend/base/default/css/accessshop/images/Thumbs.db +0 -0
  41. skin/frontend/base/default/css/accessshop/images/bg-sequence.jpg +0 -0
  42. skin/frontend/base/default/css/accessshop/images/bt-next.png +0 -0
  43. skin/frontend/base/default/css/accessshop/images/bt-prev.png +0 -0
  44. skin/frontend/base/default/css/accessshop/slidermanager/accessshop-custom.css +278 -0
  45. skin/frontend/base/default/css/accessshop/slidermanager/accessshop-responsive.css +192 -0
  46. skin/frontend/base/default/css/accessshop/slidermanager/sequencejs-theme.modern-slide-in-accessshop.css +335 -0
  47. skin/frontend/base/default/js/jquery-2.1.1.js +9190 -0
  48. skin/frontend/base/default/js/jquery.sequence.js +1308 -0
  49. skin/frontend/base/default/js/sequencejs-options.modern-slide-in.js +27 -0
app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Bannermanager extends Mage_Adminhtml_Block_Widget_Grid_Container
30
+ {
31
+ public function __construct()
32
+ {
33
+ $this->_controller = 'adminhtml_bannermanager';
34
+ $this->_blockGroup = 'slidermanager';
35
+ $this->_headerText = Mage::helper('slidermanager')->__('Slider Manager');
36
+ $this->_addButtonLabel = Mage::helper('slidermanager')->__('Add Slider');
37
+ parent::__construct();
38
+ }
39
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Custom.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Bannermanager_Custom extends Mage_Adminhtml_Block_Widget_Grid {
30
+
31
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Edit.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Bannermanager_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
30
+ {
31
+ public function __construct()
32
+ {
33
+ parent::__construct();
34
+
35
+ $this->_objectId = 'id';
36
+ $this->_blockGroup = 'slidermanager';
37
+ $this->_controller = 'adminhtml_bannermanager';
38
+
39
+ $this->_updateButton('save', 'label', Mage::helper('slidermanager')->__('Save Slider'));
40
+ $this->_updateButton('delete', 'label', Mage::helper('slidermanager')->__('Delete Slider'));
41
+
42
+ $this->_addButton('saveandcontinue', array(
43
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
44
+ 'onclick' => 'saveAndContinueEdit()',
45
+ 'class' => 'save',
46
+ ), -100);
47
+
48
+ $this->_formScripts[] = "
49
+ function toggleEditor() {
50
+ if (tinyMCE.getInstanceById('slidermanager_content') == null) {
51
+ tinyMCE.execCommand('mceAddControl', false, 'slidermanager_content');
52
+ } else {
53
+ tinyMCE.execCommand('mceRemoveControl', false, 'slidermanager_content');
54
+ }
55
+ }
56
+
57
+ function saveAndContinueEdit(){
58
+ editForm.submit($('edit_form').action+'back/edit/');
59
+ }
60
+ ";
61
+ }
62
+
63
+ public function getHeaderText()
64
+ {
65
+ if( Mage::registry('bannermanager_data') && Mage::registry('bannermanager_data')->getId() ) {
66
+ return Mage::helper('slidermanager')->__("Edit Slider '%s'", ucwords($this->htmlEscape(Mage::registry('bannermanager_data')->getSlidername())));
67
+ } else {
68
+ return Mage::helper('slidermanager')->__('Add Slider');
69
+ }
70
+ }
71
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Edit/Form.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Bannermanager_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
30
+ {
31
+ protected function _prepareForm()
32
+ {
33
+ $form = new Varien_Data_Form(array(
34
+ 'id' => 'edit_form',
35
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
36
+ 'method' => 'post',
37
+ 'enctype' => 'multipart/form-data'
38
+ )
39
+ );
40
+
41
+ $form->setUseContainer(true);
42
+ $this->setForm($form);
43
+ return parent::_prepareForm();
44
+ }
45
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Edit/Tab/Custom.php ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Bannermanager_Edit_Tab_Custom extends Mage_Adminhtml_Block_Widget_Grid {
30
+
31
+ public function __construct() {
32
+ parent::__construct();
33
+ $this->setId('customgrid');
34
+ $this->setDefaultSort('bannermanager_id');
35
+ $this->setUseAjax(true);
36
+ if ($this->getRequest()->getParam('id')) {
37
+ $this->setDefaultFilter(array('in_custom' => 1));
38
+ }
39
+ }
40
+
41
+ protected function _addColumnFilterToCollection($column) {
42
+ if ($column->getId() == 'in_custom') {
43
+ $bannerIds = $this->_getSelectedBanners();
44
+
45
+ if (empty($bannerIds)) {
46
+ $bannerIds = 0;
47
+ }
48
+ if ($column->getFilter()->getValue()) {
49
+ $this->getCollection()->addFieldToFilter('slidermanager_id', array('in' => $bannerIds));
50
+ } else {
51
+ if ($bannerIds) {
52
+ $this->getCollection()->addFieldToFilter('slidermanager_id', array('nin' => $bannerIds));
53
+ }
54
+ }
55
+ } else {
56
+ parent::_addColumnFilterToCollection($column);
57
+ }
58
+ return $this;
59
+ }
60
+
61
+ protected function _prepareCollection() {
62
+ $collection = Mage::getModel('slidermanager/slidermanager')->getCollection();
63
+ $this->setCollection($collection);
64
+ return parent::_prepareCollection();
65
+ }
66
+
67
+ protected function _prepareColumns()
68
+ {
69
+ $this->addColumn('in_custom', array(
70
+ 'header_css_class' => 'a-center',
71
+ 'type' => 'checkbox',
72
+ 'name' => 'in_custom',
73
+ 'align' => 'center',
74
+ 'index' => 'slidermanager_id',
75
+ 'values' => $this->_getSelectedBanners(),
76
+ ));
77
+
78
+ $this->addColumn('slidermanager_id', array(
79
+ 'header' => Mage::helper('slidermanager')->__('ID'),
80
+ 'align' =>'right',
81
+ 'width' => '50px',
82
+ 'index' => 'slidermanager_id',
83
+ ));
84
+
85
+ $this->addColumn('bannermanager_id', array(
86
+ 'header' => Mage::helper('slidermanager')->__('Current Slider'),
87
+ 'index' => 'bannermanager_id',
88
+ 'type' => 'options',
89
+ 'options' => Mage::getSingleton('slidermanager/select')->getOptionHash(),
90
+ ));
91
+
92
+ $this->addColumn('title', array(
93
+ 'header' => Mage::helper('slidermanager')->__('Slider Name'),
94
+ 'align' =>'left',
95
+ 'index' => 'title',
96
+ ));
97
+
98
+ $this->addColumn('created_time', array(
99
+ 'header' => Mage::helper('slidermanager')->__('Start Date'),
100
+ 'type' => 'datetime',
101
+ 'index' => 'created_time'
102
+ ));
103
+
104
+ $this->addColumn('update_time', array(
105
+ 'header' => Mage::helper('slidermanager')->__('End Date'),
106
+ 'type' => 'datetime',
107
+ 'index' => 'update_time'
108
+ ));
109
+
110
+ $this->addColumn('order_banner_slider', array(
111
+ 'header' => Mage::helper('slidermanager')->__('Order'),
112
+ 'name' => 'order_banner_slider',
113
+ 'index' => 'order_banner_slider',
114
+ 'width' => 0,
115
+ 'editable' => true,
116
+ ));
117
+
118
+ $this->addColumn('action',
119
+ array(
120
+ 'header' => Mage::helper('slidermanager')->__('Action'),
121
+ 'width' => '100',
122
+ 'type' => 'action',
123
+ 'getter' => 'getId',
124
+ 'actions' => array(
125
+ array(
126
+ 'caption' => Mage::helper('slidermanager')->__('Edit'),
127
+ 'url' => array('base'=> '*/*/edit'),
128
+ 'field' => 'id'
129
+ )
130
+ ),
131
+ 'filter' => false,
132
+ 'sortable' => false,
133
+ 'index' => 'stores',
134
+ 'is_system' => true,
135
+ ));
136
+
137
+ return parent::_prepareColumns();
138
+ }
139
+
140
+ public function getGridUrl() {
141
+ return $this->getData('grid_url') ? $this->getData('grid_url') : $this->getUrl('*/*/customGrid', array('_current' => true, 'id' => $this->getRequest()->getParam('id')));
142
+ }
143
+
144
+ public function getRowUrl($row) {
145
+ return '';
146
+ }
147
+
148
+ public function getSelectedSliderBanners() {
149
+
150
+ $tm_id = $this->getRequest()->getParam('id');
151
+ if (!isset($tm_id)) {
152
+ return array();
153
+ }
154
+ $collection = Mage::getModel('slidermanager/slidermanager')->getCollection();
155
+ $collection->addFieldToFilter('bannermanager_id', $tm_id);
156
+
157
+ $bannerIds = array();
158
+ foreach ($collection as $obj) {
159
+ $bannerIds[$obj->getId()] = array('order_banner_slider' => $obj->getOrderBanner());
160
+ }
161
+ return $bannerIds;
162
+ }
163
+
164
+ protected function _getSelectedBanners() {
165
+ $banners = $this->getRequest()->getParam('slidermanager');
166
+ if (!is_array($banners)) {
167
+ $banners = array_keys($this->getSelectedSliderBanners());
168
+ }
169
+ return $banners;
170
+ }
171
+
172
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Edit/Tab/Form.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Bannermanager_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
30
+ {
31
+ protected function _prepareForm()
32
+ {
33
+ $form = new Varien_Data_Form();
34
+ $this->setForm($form);
35
+ $fieldset = $form->addFieldset('bannermanager_form', array('legend'=>Mage::helper('slidermanager')->__('Slider information')));
36
+
37
+ $fieldset->addField('slidername', 'text', array(
38
+ 'label' => Mage::helper('slidermanager')->__('Slider Name'),
39
+ 'class' => 'required-entry',
40
+ 'required' => true,
41
+ 'name' => 'slidername',
42
+ ));
43
+
44
+ $fieldset->addField('slider_key', 'text', array(
45
+ 'label' => Mage::helper('slidermanager')->__('Identifier'),
46
+ 'required' => true,
47
+ 'name' => 'slider_key',
48
+ 'note' => 'Identifier should be unique.',
49
+ ));
50
+
51
+ $fieldset->addField('status', 'select', array(
52
+ 'label' => Mage::helper('slidermanager')->__('Status'),
53
+ 'name' => 'status',
54
+ 'values' => array(
55
+ array(
56
+ 'value' => 1,
57
+ 'label' => Mage::helper('slidermanager')->__('Enabled'),
58
+ ),
59
+
60
+ array(
61
+ 'value' => 2,
62
+ 'label' => Mage::helper('slidermanager')->__('Disabled'),
63
+ ),
64
+ ),
65
+ ));
66
+
67
+
68
+ if ( Mage::getSingleton('adminhtml/session')->getBannermanagerData() )
69
+ {
70
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getBannermanagerData());
71
+ Mage::getSingleton('adminhtml/session')->setBannermanagerData(null);
72
+ } elseif ( Mage::registry('bannermanager_data') ) {
73
+ $form->setValues(Mage::registry('bannermanager_data')->getData());
74
+ }
75
+ return parent::_prepareForm();
76
+ }
77
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Edit/Tabs.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Bannermanager_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
30
+ {
31
+
32
+ public function __construct()
33
+ {
34
+ parent::__construct();
35
+ $this->setId('bannermanager_tabs');
36
+ $this->setDestElementId('edit_form');
37
+ $this->setTitle(Mage::helper('slidermanager')->__('Slider Manager'));
38
+ }
39
+
40
+ protected function _beforeToHtml()
41
+ {
42
+ $this->addTab('form_section', array(
43
+ 'label' => Mage::helper('slidermanager')->__('Slider Information'),
44
+ 'title' => Mage::helper('slidermanager')->__('Slider Information'),
45
+ 'content' => $this->getLayout()->createBlock('slidermanager/adminhtml_bannermanager_edit_tab_form')->toHtml(),
46
+ ));
47
+ if ($this->getRequest()->getParam('active_tab') == 'custom') {
48
+ $this->addTab('banner_section', array(
49
+ 'label' => Mage::helper('slidermanager')->__('Banner of Slider'),
50
+ 'title' => Mage::helper('slidermanager')->__('Banner of Slider'),
51
+ 'url' => $this->getUrl('*/*/custom', array('_current' => true, 'id' => $this->getRequest()->getParam('id'))),
52
+ 'class' => 'ajax',
53
+ 'active' => true,
54
+ ));
55
+ } else {
56
+ $this->addTab('banner_section', array(
57
+ 'label' => Mage::helper('slidermanager')->__('Banner(s) of Slider'),
58
+ 'title' => Mage::helper('slidermanager')->__('Banner(s) of Slider'),
59
+ 'url' => $this->getUrl('*/*/custom', array('_current' => true, 'id' => $this->getRequest()->getParam('id'))),
60
+ 'class' => 'ajax',
61
+ ));
62
+ }
63
+ return parent::_beforeToHtml();
64
+ }
65
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Bannermanager/Grid.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Bannermanager_Grid extends Mage_Adminhtml_Block_Widget_Grid
30
+ {
31
+ public function __construct()
32
+ {
33
+ parent::__construct();
34
+ $this->setId('bannermanagerGrid');
35
+ $this->setDefaultSort('bannermanager_id');
36
+ $this->setDefaultDir('ASC');
37
+ $this->setSaveParametersInSession(true);
38
+ }
39
+
40
+ protected function _prepareCollection()
41
+ {
42
+ $collection = Mage::getModel('slidermanager/bannermanager')->getCollection();
43
+ $this->setCollection($collection);
44
+ return parent::_prepareCollection();
45
+ }
46
+
47
+ protected function _prepareColumns()
48
+ {
49
+ $this->addColumn('bannermanager_id', array(
50
+ 'header' => Mage::helper('slidermanager')->__('ID'),
51
+ 'align' =>'right',
52
+ 'width' => '50px',
53
+ 'index' => 'bannermanager_id',
54
+ ));
55
+
56
+ $this->addColumn('slidername', array(
57
+ 'header' => Mage::helper('slidermanager')->__('Slider Name'),
58
+ 'align' =>'left',
59
+ 'index' => 'slidername',
60
+ ));
61
+
62
+ $this->addColumn('status', array(
63
+ 'header' => Mage::helper('slidermanager')->__('Status'),
64
+ 'align' => 'left',
65
+ 'width' => '80px',
66
+ 'index' => 'status',
67
+ 'type' => 'options',
68
+ 'options' => array(
69
+ 1 => 'Enabled',
70
+ 2 => 'Disabled',
71
+ ),
72
+ ));
73
+
74
+ $this->addColumn('action',
75
+ array(
76
+ 'header' => Mage::helper('slidermanager')->__('Action'),
77
+ 'width' => '100',
78
+ 'type' => 'action',
79
+ 'getter' => 'getId',
80
+ 'actions' => array(
81
+ array(
82
+ 'caption' => Mage::helper('slidermanager')->__('Edit'),
83
+ 'url' => array('base'=> '*/*/edit'),
84
+ 'field' => 'id'
85
+ )
86
+ ),
87
+ 'filter' => false,
88
+ 'sortable' => false,
89
+ 'index' => 'stores',
90
+ 'is_system' => true,
91
+ ));
92
+
93
+ $this->addExportType('*/*/exportCsv', Mage::helper('slidermanager')->__('CSV'));
94
+ $this->addExportType('*/*/exportXml', Mage::helper('slidermanager')->__('XML'));
95
+
96
+ return parent::_prepareColumns();
97
+ }
98
+
99
+ protected function _prepareMassaction()
100
+ {
101
+ $this->setMassactionIdField('bannermanager_id');
102
+ $this->getMassactionBlock()->setFormFieldName('bannermanager');
103
+
104
+ $this->getMassactionBlock()->addItem('delete', array(
105
+ 'label' => Mage::helper('slidermanager')->__('Delete'),
106
+ 'url' => $this->getUrl('*/*/massDelete'),
107
+ 'confirm' => Mage::helper('slidermanager')->__('Are you sure?')
108
+ ));
109
+
110
+ $statuses = Mage::getSingleton('slidermanager/status')->getOptionArray();
111
+
112
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
113
+ $this->getMassactionBlock()->addItem('status', array(
114
+ 'label'=> Mage::helper('slidermanager')->__('Change status'),
115
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
116
+ 'additional' => array(
117
+ 'visibility' => array(
118
+ 'name' => 'status',
119
+ 'type' => 'select',
120
+ 'class' => 'required-entry',
121
+ 'label' => Mage::helper('slidermanager')->__('Status'),
122
+ 'values' => $statuses
123
+ )
124
+ )
125
+ ));
126
+ return $this;
127
+ }
128
+
129
+ public function getRowUrl($row)
130
+ {
131
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
132
+ }
133
+
134
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Renderer/bannerimage.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Renderer_bannerimage extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
30
+
31
+ public function render(Varien_Object $row) {
32
+ $image_id = $row->getId();
33
+ $image = Mage::getModel('slidermanager/slidermanager')->load($image_id)->getFilename();
34
+ $mediaUrl = Mage::getBaseUrl('media');
35
+ $imagename = $mediaUrl.'slidermanager/'.$image;
36
+ return '<img id="image_banner' . $image_id . '" src="' . $imagename . '" height="50px"/>';
37
+ }
38
+
39
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Slidermanager extends Mage_Adminhtml_Block_Widget_Grid_Container
30
+ {
31
+ public function __construct()
32
+ {
33
+ $this->_controller = 'adminhtml_slidermanager';
34
+ $this->_blockGroup = 'slidermanager';
35
+ $this->_headerText = Mage::helper('slidermanager')->__('Banner Manager');
36
+ $this->_addButtonLabel = Mage::helper('slidermanager')->__('Add Banner');
37
+ parent::__construct();
38
+ }
39
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager/Edit.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Slidermanager_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
30
+ {
31
+ public function __construct()
32
+ {
33
+ parent::__construct();
34
+
35
+ $this->_objectId = 'id';
36
+ $this->_blockGroup = 'slidermanager';
37
+ $this->_controller = 'adminhtml_slidermanager';
38
+
39
+ $this->_updateButton('save', 'label', Mage::helper('slidermanager')->__('Save Banner'));
40
+ $this->_updateButton('delete', 'label', Mage::helper('slidermanager')->__('Delete Banner'));
41
+
42
+ $this->_addButton('saveandcontinue', array(
43
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
44
+ 'onclick' => 'saveAndContinueEdit()',
45
+ 'class' => 'save',
46
+ ), -100);
47
+
48
+ $this->_formScripts[] = "
49
+ function toggleEditor() {
50
+ if (tinyMCE.getInstanceById('slidermanager_content') == null) {
51
+ tinyMCE.execCommand('mceAddControl', false, 'slidermanager_content');
52
+ } else {
53
+ tinyMCE.execCommand('mceRemoveControl', false, 'slidermanager_content');
54
+ }
55
+ }
56
+
57
+ function saveAndContinueEdit(){
58
+ editForm.submit($('edit_form').action+'back/edit/');
59
+ }
60
+ ";
61
+ }
62
+
63
+ public function getHeaderText()
64
+ {
65
+ if( Mage::registry('slidermanager_data') && Mage::registry('slidermanager_data')->getId() ) {
66
+ return Mage::helper('slidermanager')->__("Edit Banner '%s'", ucwords($this->htmlEscape(Mage::registry('slidermanager_data')->getTitle())));
67
+ } else {
68
+ return Mage::helper('slidermanager')->__('Add Banner');
69
+ }
70
+ }
71
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager/Edit/Form.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Slidermanager_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
30
+ {
31
+ protected function _prepareForm()
32
+ {
33
+ $form = new Varien_Data_Form(array(
34
+ 'id' => 'edit_form',
35
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
36
+ 'method' => 'post',
37
+ 'enctype' => 'multipart/form-data'
38
+ )
39
+ );
40
+
41
+ $form->setUseContainer(true);
42
+ $this->setForm($form);
43
+ return parent::_prepareForm();
44
+ }
45
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager/Edit/Tab/Form.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Slidermanager_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
30
+ {
31
+ protected function _prepareForm()
32
+ {
33
+ $form = new Varien_Data_Form();
34
+ $this->setForm($form);
35
+ $fieldset = $form->addFieldset('slidermanager_form', array('legend'=>Mage::helper('slidermanager')->__('Banner information')));
36
+
37
+ $fieldset->addField('title', 'text', array(
38
+ 'label' => Mage::helper('slidermanager')->__('Banner Title'),
39
+ 'class' => 'required-entry',
40
+ 'required' => true,
41
+ 'name' => 'title',
42
+ 'note' => 'Best View With 15 characters.'
43
+ ));
44
+
45
+ $fieldset->addField('content', 'editor', array(
46
+ 'name' => 'content',
47
+ 'label' => Mage::helper('slidermanager')->__('Banner Subtitle'),
48
+ 'title' => Mage::helper('slidermanager')->__('Banner Subtitle'),
49
+ 'style' => 'width:450px; height:75px;',
50
+ 'wysiwyg' => false,
51
+ 'required' => true,
52
+ 'note' => 'Best View With 160 characters.'
53
+ ));
54
+
55
+
56
+ $fieldset->addField('background_image', 'file', array(
57
+ 'label' => Mage::helper('slidermanager')->__('Background Image'),
58
+ 'required' => false,
59
+ 'name' => 'background_image',
60
+ ));
61
+
62
+ $fieldset->addField('filename', 'file', array(
63
+ 'label' => Mage::helper('slidermanager')->__('Banner Main Image'),
64
+ 'required' => false,
65
+ 'name' => 'filename',
66
+ ));
67
+
68
+ $fieldset->addField('link_button', 'select', array(
69
+ 'label' => Mage::helper('slidermanager')->__('Show Link Button'),
70
+ 'name' => 'link_button',
71
+ 'values' => array(
72
+ array(
73
+ 'value' => 1,
74
+ 'label' => Mage::helper('slidermanager')->__('Enabled'),
75
+ ),
76
+
77
+ array(
78
+ 'value' => 2,
79
+ 'label' => Mage::helper('slidermanager')->__('Disabled'),
80
+ ),
81
+ ),
82
+ ));
83
+
84
+ $fieldset->addField('button_title', 'text', array(
85
+ 'label' => Mage::helper('slidermanager')->__('Button Title'),
86
+ 'required' => false,
87
+ 'name' => 'button_title',
88
+ ));
89
+
90
+ $fieldset->addField('link', 'text', array(
91
+ 'label' => Mage::helper('slidermanager')->__('Button Link'),
92
+ 'required' => false,
93
+ 'name' => 'link',
94
+ 'class' => 'validate-url',
95
+ ));
96
+
97
+ $fieldset->addField('status', 'select', array(
98
+ 'label' => Mage::helper('slidermanager')->__('Status'),
99
+ 'name' => 'status',
100
+ 'values' => array(
101
+ array(
102
+ 'value' => 1,
103
+ 'label' => Mage::helper('slidermanager')->__('Enabled'),
104
+ ),
105
+
106
+ array(
107
+ 'value' => 2,
108
+ 'label' => Mage::helper('slidermanager')->__('Disabled'),
109
+ ),
110
+ ),
111
+ ));
112
+
113
+ if ($this->getRequest()->getParam('id') || count(Mage::helper('slidermanager')->getOptionSliderId()) > 1){
114
+ $fieldset->addField('bannermanager_id', 'select', array(
115
+ 'label' => Mage::helper('slidermanager')->__('Select Slider'),
116
+ 'name' => 'bannermanager_id',
117
+ 'values' => Mage::helper('slidermanager')->getOptionSliderId(),
118
+ ));
119
+ }
120
+
121
+ $fieldset->addField('target', 'select', array(
122
+ 'label' => Mage::helper('slidermanager')->__('Select Target'),
123
+ 'name' => 'target',
124
+ 'values' => Mage::getModel('slidermanager/target')->getTargetOption(),
125
+ ));
126
+
127
+
128
+ if ( Mage::getSingleton('adminhtml/session')->getSlidermanagerData() )
129
+ {
130
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getSlidermanagerData());
131
+ Mage::getSingleton('adminhtml/session')->setSlidermanagerData(null);
132
+ } elseif ( Mage::registry('slidermanager_data') ) {
133
+ $form->setValues(Mage::registry('slidermanager_data')->getData());
134
+ }
135
+ return parent::_prepareForm();
136
+ }
137
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager/Edit/Tabs.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Slidermanager_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
30
+ {
31
+
32
+ public function __construct()
33
+ {
34
+ parent::__construct();
35
+ $this->setId('slidermanager_tabs');
36
+ $this->setDestElementId('edit_form');
37
+ $this->setTitle(Mage::helper('slidermanager')->__('Banner Manager'));
38
+ }
39
+
40
+ protected function _beforeToHtml()
41
+ {
42
+ $this->addTab('form_section', array(
43
+ 'label' => Mage::helper('slidermanager')->__('Banner Information'),
44
+ 'title' => Mage::helper('slidermanager')->__('Banner Information'),
45
+ 'content' => $this->getLayout()->createBlock('slidermanager/adminhtml_slidermanager_edit_tab_form')->toHtml(),
46
+ ));
47
+
48
+ return parent::_beforeToHtml();
49
+ }
50
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/Slidermanager/Grid.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_Slidermanager_Grid extends Mage_Adminhtml_Block_Widget_Grid
30
+ {
31
+ public function __construct()
32
+ {
33
+ parent::__construct();
34
+ $this->setId('slidermanagerGrid');
35
+ $this->setDefaultSort('slidermanager_id');
36
+ $this->setDefaultDir('ASC');
37
+ $this->setSaveParametersInSession(true);
38
+ }
39
+
40
+ protected function _prepareCollection()
41
+ {
42
+ $collection = Mage::getModel('slidermanager/slidermanager')->getCollection();
43
+ $this->setCollection($collection);
44
+ return parent::_prepareCollection();
45
+ }
46
+
47
+ protected function _prepareColumns()
48
+ {
49
+ $this->addColumn('slidermanager_id', array(
50
+ 'header' => Mage::helper('slidermanager')->__('ID'),
51
+ 'align' =>'right',
52
+ 'width' => '50px',
53
+ 'index' => 'slidermanager_id',
54
+ ));
55
+
56
+ $this->addColumn('title', array(
57
+ 'header' => Mage::helper('slidermanager')->__('Title'),
58
+ 'align' =>'left',
59
+ 'index' => 'title',
60
+ ));
61
+
62
+ $this->addColumn('filename', array(
63
+ 'header' => Mage::helper('slidermanager')->__('Banner Image'),
64
+ 'align' =>'left',
65
+ 'index' => 'filename',
66
+ 'renderer' => 'slidermanager/adminhtml_renderer_bannerimage'
67
+ ));
68
+
69
+ $this->addColumn('status', array(
70
+ 'header' => Mage::helper('slidermanager')->__('Status'),
71
+ 'align' => 'left',
72
+ 'width' => '80px',
73
+ 'index' => 'status',
74
+ 'type' => 'options',
75
+ 'options' => array(
76
+ 1 => 'Enabled',
77
+ 2 => 'Disabled',
78
+ ),
79
+ ));
80
+
81
+ $this->addColumn('action',
82
+ array(
83
+ 'header' => Mage::helper('slidermanager')->__('Action'),
84
+ 'width' => '100',
85
+ 'type' => 'action',
86
+ 'getter' => 'getId',
87
+ 'actions' => array(
88
+ array(
89
+ 'caption' => Mage::helper('slidermanager')->__('Edit'),
90
+ 'url' => array('base'=> '*/*/edit'),
91
+ 'field' => 'id'
92
+ )
93
+ ),
94
+ 'filter' => false,
95
+ 'sortable' => false,
96
+ 'index' => 'stores',
97
+ 'is_system' => true,
98
+ ));
99
+
100
+ $this->addExportType('*/*/exportCsv', Mage::helper('slidermanager')->__('CSV'));
101
+ $this->addExportType('*/*/exportXml', Mage::helper('slidermanager')->__('XML'));
102
+
103
+ return parent::_prepareColumns();
104
+ }
105
+
106
+ protected function _prepareMassaction()
107
+ {
108
+ $this->setMassactionIdField('slidermanager_id');
109
+ $this->getMassactionBlock()->setFormFieldName('slidermanager');
110
+
111
+ $this->getMassactionBlock()->addItem('delete', array(
112
+ 'label' => Mage::helper('slidermanager')->__('Delete'),
113
+ 'url' => $this->getUrl('*/*/massDelete'),
114
+ 'confirm' => Mage::helper('slidermanager')->__('Are you sure?')
115
+ ));
116
+
117
+ $statuses = Mage::getSingleton('slidermanager/status')->getOptionArray();
118
+
119
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
120
+ $this->getMassactionBlock()->addItem('status', array(
121
+ 'label'=> Mage::helper('slidermanager')->__('Change status'),
122
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
123
+ 'additional' => array(
124
+ 'visibility' => array(
125
+ 'name' => 'status',
126
+ 'type' => 'select',
127
+ 'class' => 'required-entry',
128
+ 'label' => Mage::helper('slidermanager')->__('Status'),
129
+ 'values' => $statuses
130
+ )
131
+ )
132
+ ));
133
+ return $this;
134
+ }
135
+
136
+ public function getRowUrl($row)
137
+ {
138
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
139
+ }
140
+
141
+ }
app/code/local/AShop/Slidermanager/Block/Adminhtml/System/Configuration/Implementcode.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Adminhtml_System_Configuration_Implementcode extends Mage_Adminhtml_Block_System_Config_Form_Field
30
+ {
31
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element){
32
+ return '
33
+ <div class="entry-edit-head collapseable"><a onclick="Fieldset.toggleCollapse(\'slidermanager_template\'); return false;" href="#" id="slidermanager_template-head" class="open">Implement Code</a></div>
34
+ <input id="slidermanager_template-state" type="hidden" value="1" name="config_state[slidermanager_template]">
35
+ <fieldset id="slidermanager_template" class="config collapseable" style="">
36
+ <h4 class="icon-head head-edit-form fieldset-legend">Code for AShop Slidermanager</h4>
37
+
38
+ <div id="messages">
39
+ <ul class="messages">
40
+ <li class="notice-msg">
41
+ <ul>
42
+ <li>'.Mage::helper('slidermanager')->__('Add code below to a template file, where slidermanager_id is active slider_id').'</li>
43
+ </ul>
44
+ </li>
45
+ </ul>
46
+ </div>
47
+ <br>
48
+ <ul>
49
+ <li>
50
+ <code>
51
+ $this->getLayout()->createBlock('.'slidermanager/slidermanager'.')->setTemplate('.'slidermanager/slidermanager.phtml'.')->setSlidermanagerId(slider_id)->toHtml();
52
+ </code>
53
+ </li>
54
+ </ul>
55
+ <br>
56
+ <div id="messages">
57
+ <ul class="messages">
58
+ <li class="notice-msg">
59
+ <ul>
60
+ <li>'.Mage::helper('slidermanager')->__('Add code below to a cms page, where slidermanager_id is active slider_id').'</li>
61
+ </ul>
62
+ </li>
63
+ </ul>
64
+ </div>
65
+ <br>
66
+ <ul>
67
+ <li>
68
+ <code>
69
+ {{block type="slidermanager/slidermanager" name="slidermanager" template="slidermanager/slidermanager.phtml" slidermanager_id="slider_id"}}
70
+ </code>
71
+ </li>
72
+ </ul>
73
+ <br>
74
+ <div id="messages">
75
+ <ul class="messages">
76
+ <li class="notice-msg">
77
+ <ul>
78
+ <li>'.Mage::helper('slidermanager')->__('Please copy and paste the code below on one of xml layout files where you want to show the banner. where slidermanager_id is active slider_id').'</li>
79
+ </ul>
80
+ </li>
81
+ </ul>
82
+ </div>
83
+
84
+ <ul>
85
+ <li>
86
+ <code>
87
+ &lt;block type="slidermanager/slidermanager" name="slidermanager" template="slidermanager/slidermanager.phtml"&gt;<br>
88
+ &nbsp;&nbsp;&nbsp;&nbsp;&lt;action method="addData"&gt;&lt;slidermanager_id&gt;slider_id&lt;/slidermanager_id&gt;&lt;/action&gt;<br>
89
+ &lt;/block&gt;
90
+ </code>
91
+ </li>
92
+ </ul>
93
+ </fieldset>';
94
+ }
95
+ }
96
+
app/code/local/AShop/Slidermanager/Block/Slidermanager.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Block_Slidermanager extends Mage_Core_Block_Template
30
+ {
31
+ public function _prepareLayout()
32
+ {
33
+ return parent::_prepareLayout();
34
+ }
35
+
36
+ public function getSlidermanager()
37
+ {
38
+ if (!$this->hasData('slidermanager')) {
39
+ $this->setData('slidermanager', Mage::registry('slidermanager'));
40
+ }
41
+ return $this->getData('slidermanager');
42
+
43
+ }
44
+ }
app/code/local/AShop/Slidermanager/Helper/Data.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Helper_Data extends Mage_Core_Helper_Abstract
30
+ {
31
+ public function getBannerImage($image)
32
+ {
33
+ $name = $this->reImageName($image);
34
+ $mediaUrl = Mage::getBaseUrl('media');
35
+ return $mediaUrl.'slidermanager/'.$name;
36
+ }
37
+
38
+ public function reImageName($imageName)
39
+ {
40
+
41
+ $subname = substr($imageName, 0, 2);
42
+ $array = array();
43
+ $subDir1 = substr($subname, 0, 1);
44
+ $subDir2 = substr($subname, 1, 1);
45
+ $array[0] = $subDir1;
46
+ $array[1] = $subDir2;
47
+ $name = $array[0] . '/' . $array[1] . '/' . $imageName;
48
+ return strtolower($name);
49
+ }
50
+
51
+ public function getOptionSliderId() {
52
+ $option = array();
53
+ $option[] = array(
54
+ 'value' => '',
55
+ 'label' => Mage::helper('slidermanager')->__('<<<< Please Select A Slider >>>>'),
56
+ );
57
+ $slider = Mage::getModel('slidermanager/bannermanager')->getCollection();
58
+ foreach ($slider as $value) {
59
+ $option[] = array(
60
+ 'value' => $value->getId(),
61
+ 'label' => $value->getSlidername(),
62
+ );
63
+ }
64
+
65
+ return $option;
66
+ }
67
+
68
+ function getId()
69
+ {
70
+ return $this->getBannermanagerId();
71
+ }
72
+
73
+ }
app/code/local/AShop/Slidermanager/Model/Bannermanager.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Model_Bannermanager extends Mage_Core_Model_Abstract
30
+ {
31
+ public function _construct()
32
+ {
33
+ parent::_construct();
34
+ $this->_init('slidermanager/bannermanager');
35
+ if ($storeId = Mage::app()->getStore()->getId())
36
+ {
37
+ $this->setStoreId($storeId);
38
+ }
39
+
40
+ }
41
+
42
+ public function load($id, $field = null)
43
+ {
44
+ parent::load($id, $field);
45
+ if ($this->getStoreId())
46
+ {
47
+ $this->getMultiStoreValue();
48
+ }
49
+ return $this;
50
+ }
51
+ }
app/code/local/AShop/Slidermanager/Model/Mysql4/Bannermanager.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Model_Mysql4_Bannermanager extends Mage_Core_Model_Mysql4_Abstract
30
+ {
31
+ public function _construct()
32
+ {
33
+ $this->_init('slidermanager/bannermanager', 'bannermanager_id');
34
+ }
35
+ }
app/code/local/AShop/Slidermanager/Model/Mysql4/Bannermanager/Collection.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Model_Mysql4_Bannermanager_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
30
+ {
31
+ public function _construct()
32
+ {
33
+ parent::_construct();
34
+ $this->_init('slidermanager/bannermanager');
35
+ }
36
+ }
app/code/local/AShop/Slidermanager/Model/Mysql4/Slidermanager.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Model_Mysql4_Slidermanager extends Mage_Core_Model_Mysql4_Abstract
30
+ {
31
+ public function _construct()
32
+ {
33
+ $this->_init('slidermanager/slidermanager', 'slidermanager_id');
34
+ }
35
+ }
app/code/local/AShop/Slidermanager/Model/Mysql4/Slidermanager/Collection.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Model_Mysql4_Slidermanager_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
30
+ {
31
+ public function _construct()
32
+ {
33
+ parent::_construct();
34
+ $this->_init('slidermanager/slidermanager');
35
+ }
36
+ }
app/code/local/AShop/Slidermanager/Model/Select.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Model_Select extends Varien_Object {
30
+
31
+ static public function getOptionArray() {
32
+ $block = Mage::getSingleton('slidermanager/slidermanager')->getCollection();
33
+
34
+ $data = array();
35
+ foreach ($block as $row) {
36
+ $data[] = array(
37
+ 'value' => $row->getId(),
38
+ 'label' => $row->getTitle(),
39
+ );
40
+ }
41
+ return $data;
42
+ }
43
+
44
+ static public function getOptionHash() {
45
+ $block = Mage::getSingleton('slidermanager/slidermanager')->getCollection();
46
+ $data = array();
47
+ foreach ($block as $row) {
48
+ $data[$row->getId()] = $row->getTitle();
49
+ }
50
+ return $data;
51
+ }
52
+
53
+ }
app/code/local/AShop/Slidermanager/Model/Slidermanager.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Model_Slidermanager extends Mage_Core_Model_Abstract
30
+ {
31
+ public function _construct()
32
+ {
33
+ parent::_construct();
34
+ $this->_init('slidermanager/slidermanager');
35
+ if ($storeId = Mage::app()->getStore()->getId())
36
+ {
37
+ $this->setStoreId($storeId);
38
+ }
39
+
40
+ }
41
+
42
+ public function load($id, $field = null)
43
+ {
44
+ parent::load($id, $field);
45
+ if ($this->getStoreId())
46
+ {
47
+ $this->getMultiStoreValue();
48
+ }
49
+ return $this;
50
+ }
51
+ }
app/code/local/AShop/Slidermanager/Model/Status.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Model_Status extends Varien_Object
30
+ {
31
+ const STATUS_ENABLED = 1;
32
+ const STATUS_DISABLED = 2;
33
+
34
+ static public function getOptionArray()
35
+ {
36
+ return array(
37
+ self::STATUS_ENABLED => Mage::helper('slidermanager')->__('Enabled'),
38
+ self::STATUS_DISABLED => Mage::helper('slidermanager')->__('Disabled')
39
+ );
40
+ }
41
+ }
app/code/local/AShop/Slidermanager/Model/Target.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_slidermanager_Model_Target
30
+ {
31
+ public function getTargetOption()
32
+ {
33
+ return array(
34
+ array('value' => '_blank', 'label' => Mage::helper('slidermanager')->__('_blank')),
35
+ array('value' => '_self', 'label' => Mage::helper('slidermanager')->__('_self')),
36
+ array('value' => '_parent', 'label' => Mage::helper('slidermanager')->__('_parent')),
37
+ array('value' => '_top', 'label' => Mage::helper('slidermanager')->__('_top'))
38
+ );
39
+ }
40
+ }
app/code/local/AShop/Slidermanager/controllers/Adminhtml/BannermanagerController.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Adminhtml_BannermanagerController extends Mage_Adminhtml_Controller_action
30
+ {
31
+
32
+ protected function _initAction() {
33
+ $this->loadLayout()
34
+ ->_setActiveMenu('slidermanager/slider')
35
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Slider Manager'), Mage::helper('adminhtml')->__('Slider Manager'));
36
+
37
+ return $this;
38
+ }
39
+
40
+ public function indexAction() {
41
+ $this->_initAction()
42
+ ->renderLayout();
43
+ }
44
+
45
+ public function editAction() {
46
+ $id = $this->getRequest()->getParam('id');
47
+ $model = Mage::getModel('slidermanager/bannermanager')->load($id);
48
+
49
+ if ($model->getId() || $id == 0) {
50
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
51
+ if (!empty($data)) {
52
+ $model->setData($data);
53
+ }
54
+
55
+ Mage::register('bannermanager_data', $model);
56
+
57
+ $this->loadLayout();
58
+ $this->_setActiveMenu('slidermanager/slider');
59
+
60
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Slider Manager'), Mage::helper('adminhtml')->__('Slider Manager'));
61
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Slider Manager'), Mage::helper('adminhtml')->__('Slider Manager'));
62
+
63
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
64
+
65
+ $this->_addContent($this->getLayout()->createBlock('slidermanager/adminhtml_bannermanager_edit'))
66
+ ->_addLeft($this->getLayout()->createBlock('slidermanager/adminhtml_bannermanager_edit_tabs'));
67
+
68
+ $this->renderLayout();
69
+ } else {
70
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('slidermanager')->__('Slider does not exist'));
71
+ $this->_redirect('*/*/');
72
+ }
73
+ }
74
+
75
+ public function newAction() {
76
+ $this->_forward('edit');
77
+ }
78
+
79
+ public function saveAction() {
80
+ if ($data = $this->getRequest()->getPost()) {
81
+ $model = Mage::getModel('slidermanager/bannermanager');
82
+ $model->setData($data)
83
+ ->setId($this->getRequest()->getParam('id'));
84
+ try {
85
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
86
+ $model->setCreatedTime(now())
87
+ ->setUpdateTime(now());
88
+ } else {
89
+ $model->setUpdateTime(now());
90
+ }
91
+ $model->save();
92
+ if (isset($data['slider_banner'])) {
93
+ $bannerIds = array();
94
+ $bannerOrders = array();
95
+
96
+ $test = Mage::helper('adminhtml/js')->decodeGridSerializedInput($data['slider_banner']);
97
+ foreach ($test as $key => $value) {
98
+ $bannerIds[] = $key;
99
+ $bannerOrders[] = $value['order_banner_slider'];
100
+ }
101
+
102
+ $unSelecteds = Mage::getResourceModel('slidermanager/slidermanager_collection')
103
+ ->addFieldToFilter('bannermanager_id', $model->getId());
104
+ if (count($bannerIds))
105
+ $unSelecteds->addFieldToFilter('slidermanager_id', array('nin' => $bannerIds));
106
+ foreach ($unSelecteds as $banner) {
107
+ $banner->setBannermanagerId(0)
108
+ ->setOrderBanner(0)->save();
109
+ }
110
+
111
+ $selectBanner = Mage::getResourceModel('slidermanager/slidermanager_collection')
112
+ ->addFieldToFilter('slidermanager_id', array('in' => $bannerIds));
113
+ $i = -1;
114
+ foreach ($selectBanner as $banner) {
115
+ $banner->setBannermanagerId($model->getId())
116
+ ->setOrderBanner($bannerOrders[++$i])->save();
117
+
118
+ }
119
+ }
120
+
121
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('slidermanager')->__('Slider was successfully saved'));
122
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
123
+
124
+ if ($this->getRequest()->getParam('back')) {
125
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
126
+ return;
127
+ }
128
+ $this->_redirect('*/*/');
129
+ return;
130
+ } catch (Exception $e) {
131
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
132
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
133
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
134
+ return;
135
+ }
136
+ }
137
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('slidermanager')->__('Unable to find slider to save'));
138
+ $this->_redirect('*/*/');
139
+ }
140
+
141
+ public function deleteAction() {
142
+ if( $this->getRequest()->getParam('id') > 0 ) {
143
+ try {
144
+ $model = Mage::getModel('slidermanager/bannermanager');
145
+
146
+ $model->setId($this->getRequest()->getParam('id'))
147
+ ->delete();
148
+
149
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Slider was successfully deleted'));
150
+ $this->_redirect('*/*/');
151
+ } catch (Exception $e) {
152
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
153
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
154
+ }
155
+ }
156
+ $this->_redirect('*/*/');
157
+ }
158
+
159
+ public function massDeleteAction() {
160
+ $slidermanagerIds = $this->getRequest()->getParam('bannermanager');
161
+ if(!is_array($slidermanagerIds)) {
162
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select slider(s)'));
163
+ } else {
164
+ try {
165
+ foreach ($slidermanagerIds as $slidermanagerId) {
166
+ $slidermanager = Mage::getModel('slidermanager/bannermanager')->load($slidermanagerId);
167
+ $slidermanager->delete();
168
+ }
169
+ Mage::getSingleton('adminhtml/session')->addSuccess(
170
+ Mage::helper('adminhtml')->__(
171
+ 'Total of %d record(s) were successfully deleted', count($slidermanagerIds)
172
+ )
173
+ );
174
+ } catch (Exception $e) {
175
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
176
+ }
177
+ }
178
+ $this->_redirect('*/*/index');
179
+ }
180
+
181
+ public function massStatusAction()
182
+ {
183
+ $slidermanagerIds = $this->getRequest()->getParam('bannermanager');
184
+ if(!is_array($slidermanagerIds)) {
185
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select slider(s)'));
186
+ } else {
187
+ try {
188
+ foreach ($slidermanagerIds as $slidermanagerId) {
189
+ $slidermanager = Mage::getSingleton('slidermanager/bannermanager')
190
+ ->load($slidermanagerId)
191
+ ->setStatus($this->getRequest()->getParam('status'))
192
+ ->setIsMassupdate(true)
193
+ ->save();
194
+ }
195
+ $this->_getSession()->addSuccess(
196
+ $this->__('Total of %d record(s) were successfully updated', count($slidermanagerIds))
197
+ );
198
+ } catch (Exception $e) {
199
+ $this->_getSession()->addError($e->getMessage());
200
+ }
201
+ }
202
+ $this->_redirect('*/*/index');
203
+ }
204
+
205
+ public function exportCsvAction()
206
+ {
207
+ $fileName = 'slidermanager.csv';
208
+ $content = $this->getLayout()->createBlock('slidermanager/adminhtml_bannermanager_grid')
209
+ ->getCsv();
210
+
211
+ $this->_sendUploadResponse($fileName, $content);
212
+ }
213
+
214
+ public function exportXmlAction()
215
+ {
216
+ $fileName = 'slidermanager.xml';
217
+ $content = $this->getLayout()->createBlock('slidermanager/adminhtml_bannermanager_grid')
218
+ ->getXml();
219
+
220
+ $this->_sendUploadResponse($fileName, $content);
221
+ }
222
+ protected function customAction() {
223
+ $this->loadLayout();
224
+ $this->getLayout()->getBlock('slider.edit.tab.custom')
225
+ ->setCustom($this->getRequest()->getPost('banner', null));
226
+ $this->renderLayout();
227
+ }
228
+
229
+ public function customgridAction() {
230
+ $this->loadLayout();
231
+ $this->getLayout()->getBlock('slider.edit.tab.custom')
232
+ ->setCustom($this->getRequest()->getPost('banner', null));
233
+ $this->renderLayout();
234
+ }
235
+
236
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
237
+ {
238
+ $response = $this->getResponse();
239
+ $response->setHeader('HTTP/1.1 200 OK','');
240
+ $response->setHeader('Pragma', 'public', true);
241
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
242
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
243
+ $response->setHeader('Last-Modified', date('r'));
244
+ $response->setHeader('Accept-Ranges', 'bytes');
245
+ $response->setHeader('Content-Length', strlen($content));
246
+ $response->setHeader('Content-type', $contentType);
247
+ $response->setBody($content);
248
+ $response->sendResponse();
249
+ die;
250
+ }
251
+ }
app/code/local/AShop/Slidermanager/controllers/Adminhtml/SlidermanagerController.php ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_Adminhtml_SlidermanagerController extends Mage_Adminhtml_Controller_action
30
+ {
31
+
32
+ protected function _initAction() {
33
+ $this->loadLayout()
34
+ ->_setActiveMenu('slidermanager/items')
35
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Banner Manager'), Mage::helper('adminhtml')->__('Banner Manager'));
36
+
37
+ return $this;
38
+ }
39
+
40
+ public function indexAction() {
41
+ $this->_initAction()
42
+ ->renderLayout();
43
+ }
44
+
45
+ public function editAction() {
46
+ $id = $this->getRequest()->getParam('id');
47
+ $model = Mage::getModel('slidermanager/slidermanager')->load($id);
48
+
49
+ if ($model->getId() || $id == 0) {
50
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
51
+ if (!empty($data)) {
52
+ $model->setData($data);
53
+ }
54
+
55
+ Mage::register('slidermanager_data', $model);
56
+
57
+ $this->loadLayout();
58
+ $this->_setActiveMenu('slidermanager/items');
59
+
60
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Banner Manager'), Mage::helper('adminhtml')->__('Banner Manager'));
61
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Banner Manager'), Mage::helper('adminhtml')->__('Banner Manager'));
62
+
63
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
64
+
65
+ $this->_addContent($this->getLayout()->createBlock('slidermanager/adminhtml_slidermanager_edit'))
66
+ ->_addLeft($this->getLayout()->createBlock('slidermanager/adminhtml_slidermanager_edit_tabs'));
67
+
68
+ $this->renderLayout();
69
+ } else {
70
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('slidermanager')->__('Banner does not exist'));
71
+ $this->_redirect('*/*/');
72
+ }
73
+ }
74
+
75
+ public function newAction() {
76
+ $this->_forward('edit');
77
+ }
78
+
79
+ public function saveAction() {
80
+ if ($data = $this->getRequest()->getPost()) {
81
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
82
+ try {
83
+ $uploader = new Varien_File_Uploader('filename');
84
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
85
+ $uploader->setAllowRenameFiles(false);
86
+ $uploader->setFilesDispersion(false);
87
+ $path = Mage::getBaseDir('media').'\slidermanager' . DS ;
88
+ $uploader->save($path, $_FILES['filename']['name'] );
89
+
90
+ } catch (Exception $e) {
91
+
92
+ }
93
+ $data['filename'] = $_FILES['filename']['name'];
94
+ }
95
+
96
+ if(isset($_FILES['background_image']['name']) && $_FILES['background_image']['name'] != '') {
97
+ try {
98
+ $uploader = new Varien_File_Uploader('background_image');
99
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
100
+ $uploader->setAllowRenameFiles(false);
101
+ $uploader->setFilesDispersion(false);
102
+ $path = Mage::getBaseDir('media').'\slidermanager' . DS ;
103
+ $uploader->save($path, $_FILES['background_image']['name'] );
104
+
105
+ } catch (Exception $e) {
106
+
107
+ }
108
+ $data['background_image'] = $_FILES['background_image']['name'];
109
+ }
110
+
111
+
112
+ $model = Mage::getModel('slidermanager/slidermanager');
113
+ $model->setData($data)
114
+ ->setId($this->getRequest()->getParam('id'));
115
+
116
+ try {
117
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
118
+ $model->setCreatedTime(now())
119
+ ->setUpdateTime(now());
120
+ } else {
121
+ $model->setUpdateTime(now());
122
+ }
123
+
124
+ $model->save();
125
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('slidermanager')->__('Banner was successfully saved'));
126
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
127
+
128
+ if ($this->getRequest()->getParam('back')) {
129
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
130
+ return;
131
+ }
132
+ $this->_redirect('*/*/');
133
+ return;
134
+ } catch (Exception $e) {
135
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
136
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
137
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
138
+ return;
139
+ }
140
+ }
141
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('slidermanager')->__('Unable to find banner to save'));
142
+ $this->_redirect('*/*/');
143
+ }
144
+
145
+ public function deleteAction() {
146
+ if( $this->getRequest()->getParam('id') > 0 ) {
147
+ try {
148
+ $model = Mage::getModel('slidermanager/slidermanager');
149
+
150
+ $model->setId($this->getRequest()->getParam('id'))
151
+ ->delete();
152
+
153
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Banner was successfully deleted'));
154
+ $this->_redirect('*/*/');
155
+ } catch (Exception $e) {
156
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
157
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
158
+ }
159
+ }
160
+ $this->_redirect('*/*/');
161
+ }
162
+
163
+ public function massDeleteAction() {
164
+ $slidermanagerIds = $this->getRequest()->getParam('slidermanager');
165
+ if(!is_array($slidermanagerIds)) {
166
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select banner(s)'));
167
+ } else {
168
+ try {
169
+ foreach ($slidermanagerIds as $slidermanagerId) {
170
+ $slidermanager = Mage::getModel('slidermanager/slidermanager')->load($slidermanagerId);
171
+ $slidermanager->delete();
172
+ }
173
+ Mage::getSingleton('adminhtml/session')->addSuccess(
174
+ Mage::helper('adminhtml')->__(
175
+ 'Total of %d record(s) were successfully deleted', count($slidermanagerIds)
176
+ )
177
+ );
178
+ } catch (Exception $e) {
179
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
180
+ }
181
+ }
182
+ $this->_redirect('*/*/index');
183
+ }
184
+
185
+ public function massStatusAction()
186
+ {
187
+ $slidermanagerIds = $this->getRequest()->getParam('slidermanager');
188
+ if(!is_array($slidermanagerIds)) {
189
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select banner(s)'));
190
+ } else {
191
+ try {
192
+ foreach ($slidermanagerIds as $slidermanagerId) {
193
+ $slidermanager = Mage::getSingleton('slidermanager/slidermanager')
194
+ ->load($slidermanagerId)
195
+ ->setStatus($this->getRequest()->getParam('status'))
196
+ ->setIsMassupdate(true)
197
+ ->save();
198
+ }
199
+ $this->_getSession()->addSuccess(
200
+ $this->__('Total of %d record(s) were successfully updated', count($slidermanagerIds))
201
+ );
202
+ } catch (Exception $e) {
203
+ $this->_getSession()->addError($e->getMessage());
204
+ }
205
+ }
206
+ $this->_redirect('*/*/index');
207
+ }
208
+
209
+ public function exportCsvAction()
210
+ {
211
+ $fileName = 'slidermanager.csv';
212
+ $content = $this->getLayout()->createBlock('slidermanager/adminhtml_slidermanager_grid')
213
+ ->getCsv();
214
+
215
+ $this->_sendUploadResponse($fileName, $content);
216
+ }
217
+
218
+ public function exportXmlAction()
219
+ {
220
+ $fileName = 'slidermanager.xml';
221
+ $content = $this->getLayout()->createBlock('slidermanager/adminhtml_slidermanager_grid')
222
+ ->getXml();
223
+
224
+ $this->_sendUploadResponse($fileName, $content);
225
+ }
226
+
227
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
228
+ {
229
+ $response = $this->getResponse();
230
+ $response->setHeader('HTTP/1.1 200 OK','');
231
+ $response->setHeader('Pragma', 'public', true);
232
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
233
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
234
+ $response->setHeader('Last-Modified', date('r'));
235
+ $response->setHeader('Accept-Ranges', 'bytes');
236
+ $response->setHeader('Content-Length', strlen($content));
237
+ $response->setHeader('Content-type', $contentType);
238
+ $response->setBody($content);
239
+ $response->sendResponse();
240
+ die;
241
+ }
242
+ }
app/code/local/AShop/Slidermanager/controllers/IndexController.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ class AShop_Slidermanager_IndexController extends Mage_Core_Controller_Front_Action
30
+ {
31
+ public function indexAction()
32
+ {
33
+ $this->loadLayout();
34
+ $this->renderLayout();
35
+ }
36
+ }
app/code/local/AShop/Slidermanager/etc/config.xml ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * AShop Slider
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the AccessshopThemes.com license that is
9
+ * available through the world-wide-web at this URL:
10
+ * http://www.accessshopThemes.com
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
15
+ * version in the future.
16
+ *
17
+ * @category AShop Slider
18
+ * @package AShop_Slidermanager
19
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
20
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
21
+ */
22
+
23
+ /**
24
+ * Accessshop Block
25
+ *
26
+ * @category AShop Slider
27
+ * @package AShop_Slidermanager
28
+ * @author AccessShop Developer
29
+ */
30
+ -->
31
+ <config>
32
+ <modules>
33
+ <AShop_Slidermanager>
34
+ <version>1.0.0</version>
35
+ </AShop_Slidermanager>
36
+ </modules>
37
+ <frontend>
38
+ <routers>
39
+ <slidermanager>
40
+ <use>standard</use>
41
+ <args>
42
+ <module>AShop_Slidermanager</module>
43
+ <frontName>slidermanager</frontName>
44
+ </args>
45
+ </slidermanager>
46
+ </routers>
47
+ <layout>
48
+ <updates>
49
+ <slidermanager module='slidermanager'>
50
+ <file>slidermanager.xml</file>
51
+ </slidermanager>
52
+ </updates>
53
+ </layout>
54
+ </frontend>
55
+ <admin>
56
+ <routers>
57
+ <slidermanager>
58
+ <use>admin</use>
59
+ <args>
60
+ <module>AShop_Slidermanager</module>
61
+ <frontName>slidermanager</frontName>
62
+ </args>
63
+ </slidermanager>
64
+ </routers>
65
+ </admin>
66
+ <adminhtml>
67
+ <menu>
68
+ <slidermanager module="slidermanager">
69
+ <title>Slidermanager</title>
70
+ <sort_order>71</sort_order>
71
+ <children>
72
+ <items module="slidermanager">
73
+ <title>Manage Banners</title>
74
+ <sort_order>0</sort_order>
75
+ <action>slidermanager/adminhtml_slidermanager</action>
76
+ </items>
77
+ <slider module="slidermanager" translate="title">
78
+ <title>Manage Sliders</title>
79
+ <sort_order>1</sort_order>
80
+ <action>slidermanager/adminhtml_bannermanager</action>
81
+ </slider>
82
+ </children>
83
+ </slidermanager>
84
+ </menu>
85
+ <acl>
86
+ <resources>
87
+ <all>
88
+ <title>Allow Everything</title>
89
+ </all>
90
+ <admin>
91
+ <children>
92
+ <system>
93
+ <children>
94
+ <config>
95
+ <children>
96
+ <AShop module="slidermanger" translate="title">
97
+ <title>AShop - All</title>
98
+ </AShop>
99
+ </children>
100
+ </config>
101
+ </children>
102
+ </system>
103
+ </children>
104
+ <children>
105
+ <AShop_Slidermanager>
106
+ <title>Slidermanager Module</title>
107
+ <sort_order>10</sort_order>
108
+ </AShop_Slidermanager>
109
+ </children>
110
+ </admin>
111
+ </resources>
112
+ </acl>
113
+ <layout>
114
+ <updates>
115
+ <slidermanager>
116
+ <file>slidermanager.xml</file>
117
+ </slidermanager>
118
+ </updates>
119
+ </layout>
120
+ </adminhtml>
121
+ <global>
122
+ <models>
123
+ <slidermanager>
124
+ <class>AShop_Slidermanager_Model</class>
125
+ <resourceModel>slidermanager_mysql4</resourceModel>
126
+ </slidermanager>
127
+ <slidermanager_mysql4>
128
+ <class>AShop_Slidermanager_Model_Mysql4</class>
129
+ <entities>
130
+ <slidermanager>
131
+ <table>slidermanager</table>
132
+ </slidermanager>
133
+ <bannermanager>
134
+ <table>bannermanager</table>
135
+ </bannermanager>
136
+ </entities>
137
+ </slidermanager_mysql4>
138
+ </models>
139
+ <resources>
140
+ <slidermanager_setup>
141
+ <setup>
142
+ <module>AShop_Slidermanager</module>
143
+ </setup>
144
+ <connection>
145
+ <use>core_setup</use>
146
+ </connection>
147
+ </slidermanager_setup>
148
+ <slidermanager_write>
149
+ <connection>
150
+ <use>core_write</use>
151
+ </connection>
152
+ </slidermanager_write>
153
+ <slidermanager_read>
154
+ <connection>
155
+ <use>core_read</use>
156
+ </connection>
157
+ </slidermanager_read>
158
+ </resources>
159
+ <blocks>
160
+ <slidermanager>
161
+ <class>AShop_Slidermanager_Block</class>
162
+ </slidermanager>
163
+ </blocks>
164
+ <helpers>
165
+ <slidermanager>
166
+ <class>AShop_Slidermanager_Helper</class>
167
+ </slidermanager>
168
+ </helpers>
169
+ </global>
170
+ </config>
app/code/local/AShop/Slidermanager/etc/system.xml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * AShop Slider
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the AccessshopThemes.com license that is
9
+ * available through the world-wide-web at this URL:
10
+ * http://www.accessshopThemes.com
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
15
+ * version in the future.
16
+ *
17
+ * @category AShop Slider
18
+ * @package AShop_Slidermanager
19
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
20
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
21
+ */
22
+
23
+ /**
24
+ * Accessshop Block
25
+ *
26
+ * @category AShop Slider
27
+ * @package AShop_Slidermanager
28
+ * @author AccessShop Developer
29
+ */
30
+ -->
31
+ <config>
32
+ <tabs>
33
+ <AShop translate="label">
34
+ <label>AShop Slidermanager</label>
35
+ <sort_order>000</sort_order>
36
+ </AShop>
37
+ </tabs>
38
+ <sections>
39
+ <AShop translate="label">
40
+ <label>Slider Option</label>
41
+ <tab>AShop</tab>
42
+ <frontend_type>text</frontend_type>
43
+ <sort_order>1000</sort_order>
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
+ <groups>
48
+ <aboutus translate="label">
49
+ <label>About Us</label>
50
+ <comment><![CDATA[<h4>Visit Us:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://accessshopthemes.com" target="_blank">AccessShopThemes.com</a></h2>]]></comment>
51
+ <frontend_type>text</frontend_type>
52
+ <sort_order>1</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>1</show_in_store>
56
+ </aboutus>
57
+ <implement translate="label">
58
+ <label>Implement Code</label>
59
+ <frontend_type>text</frontend_type>
60
+ <frontend_model>slidermanager/adminhtml_system_configuration_implementcode</frontend_model>
61
+ <sort_order>2</sort_order>
62
+ <show_in_default>1</show_in_default>
63
+ <show_in_website>1</show_in_website>
64
+ <show_in_store>1</show_in_store>
65
+ </implement>
66
+ </groups>
67
+ </AShop>
68
+ </sections>
69
+ </config>
app/code/local/AShop/Slidermanager/sql/slidermanager_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Accessshop
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category Accessshop
17
+ * @package Accessshop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category Accessshop
26
+ * @package Accessshop_Slidermanager
27
+ * @author Accessshop Developer
28
+ */
29
+ $installer = $this;
30
+
31
+ $installer->startSetup();
32
+
33
+ $installer->run("
34
+
35
+ DROP TABLE IF EXISTS {$this->getTable('slidermanager')};
36
+ DROP TABLE IF EXISTS {$this->getTable('bannermanager')};
37
+
38
+ CREATE TABLE {$this->getTable('slidermanager')} (
39
+ `slidermanager_id` int(11) unsigned NOT NULL auto_increment,
40
+ `title` varchar(255) NOT NULL default '',
41
+ `content` varchar(255) NOT NULL default '',
42
+ `filename` varchar(255) NOT NULL default '',
43
+ `background_image` varchar(255) NOT NULL default '',
44
+ `status` smallint(6) NOT NULL default '0',
45
+ `created_time` datetime NULL,
46
+ `update_time` datetime NULL,
47
+ `link_button` smallint(6) NOT NULL default '0',
48
+ `link` text NOT NULL default '',
49
+ `button_title` varchar(255) NOT NULL default '',
50
+ `bannermanager_id` int(11) NOT NULL default '0',
51
+ `target` varchar(255) NOT NULL default '',
52
+ PRIMARY KEY (`slidermanager_id`)
53
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
54
+
55
+ CREATE TABLE {$this->getTable('bannermanager')} (
56
+ `bannermanager_id` int(11) unsigned NOT NULL auto_increment,
57
+ `slidername` varchar(255) NOT NULL default '',
58
+ `slider_key` varchar(255) NOT NULL default '',
59
+ `status` smallint(6) NOT NULL default '0',
60
+ `created_time` datetime NULL,
61
+ `update_time` datetime NULL,
62
+ PRIMARY KEY (`bannermanager_id`)
63
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
64
+ ");
65
+
66
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/slidermanager.xml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * AShop Slider
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the AccessshopThemes.com license that is
9
+ * available through the world-wide-web at this URL:
10
+ * http://www.accessshopThemes.com
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
15
+ * version in the future.
16
+ *
17
+ * @category AShop Slider
18
+ * @package AShop_Slidermanager
19
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
20
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
21
+ */
22
+
23
+ /**
24
+ * Accessshop Block
25
+ *
26
+ * @category AShop Slider
27
+ * @package AShop_Slidermanager
28
+ * @author AccessShop Developer
29
+ */
30
+ -->
31
+ <layout version="0.1.0">
32
+ <slidermanager_adminhtml_slidermanager_index>
33
+ <reference name='head'>
34
+ <action method="setTitle" translate="title"><title>Slidermanager | Mangento Admin</title></action>
35
+ </reference>
36
+ <reference name="content">
37
+ <block type="slidermanager/adminhtml_slidermanager" name="slidermanager" />
38
+ </reference>
39
+ </slidermanager_adminhtml_slidermanager_index>
40
+ <slidermanager_adminhtml_bannermanager_index>
41
+ <reference name='head'>
42
+ <action method="setTitle" translate="title"><title>Slidermanager | Mangento Admin</title></action>
43
+ </reference>
44
+ <reference name="content">
45
+ <block type="slidermanager/adminhtml_bannermanager" name="bannermanager" />
46
+ </reference>
47
+ </slidermanager_adminhtml_bannermanager_index>
48
+ <slidermanager_adminhtml_bannermanager_custom>
49
+ <block type="core/text_list" name="root">
50
+ <block type="slidermanager/adminhtml_bannermanager_edit_tab_custom" name="slider.edit.tab.custom"/>
51
+ <block type="adminhtml/widget_grid_serializer" name="related_grid_serializer">
52
+ <action method="initSerializerBlock">
53
+ <grid_block_name>slider.edit.tab.custom</grid_block_name>
54
+ <data_callback>getSelectedSliderBanners</data_callback>
55
+ <hidden_input_name>slider_banner</hidden_input_name>
56
+ <reload_param_name>banner</reload_param_name>
57
+ </action>
58
+ <action method="addColumnInputName">
59
+ <input_name>order_banner_slider</input_name>
60
+ </action>
61
+ </block>
62
+ </block>
63
+ </slidermanager_adminhtml_bannermanager_custom>
64
+ </layout>
app/design/frontend/base/default/layout/slidermanager.xml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * AShop Slider
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the AccessshopThemes.com license that is
9
+ * available through the world-wide-web at this URL:
10
+ * http://www.accessshopThemes.com
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
15
+ * version in the future.
16
+ *
17
+ * @category AShop Slider
18
+ * @package AShop_Slidermanager
19
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
20
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
21
+ */
22
+
23
+ /**
24
+ * Accessshop Block
25
+ *
26
+ * @category AShop Slider
27
+ * @package AShop_Slidermanager
28
+ * @author AccessShop Developer
29
+ */
30
+ -->
31
+ <layout version="0.1.0">
32
+ <default>
33
+ <reference name="head">
34
+ <action method="addItem"><type>skin_css</type><stylesheet>css/accessshop/slidermanager/sequencejs-theme.modern-slide-in-accessshop.css</stylesheet></action>
35
+ <action method="addItem"><type>skin_css</type><stylesheet>css/accessshop/slidermanager/accessshop-custom.css</stylesheet></action>
36
+ <action method="addItem"><type>skin_css</type><stylesheet>css/accessshop/slidermanager/accessshop-responsive.css</stylesheet></action>
37
+ <action method="addItem"><type>skin_js</type><name>js/jquery-2.1.1.js</name></action>
38
+ <action method="addItem"><type>skin_js</type><name>js/jquery.sequence.js</name></action>
39
+ <action method="addItem"><type>skin_js</type><name>js/sequencejs-options.modern-slide-in.js</name></action>
40
+ </reference>
41
+ </default>
42
+ <cms_index_index>
43
+ <reference name="content">
44
+ <block type="slidermanager/slidermanager" name="slidermanager" as="slidermanager" before="-" template="slidermanager/slidermanager.phtml">
45
+ <action method="addData"><data><slidermanager_id>1</slidermanager_id></data></action>
46
+ </block>
47
+ </reference>
48
+ </cms_index_index>
49
+ </layout>
app/design/frontend/base/default/template/slidermanager/slidermanager.phtml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ ?>
30
+ <link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:300italic,400italic,700italic,400,300,700' rel='stylesheet' type='text/css'/>
31
+ <?php
32
+ $version=Mage::getVersion();
33
+ $version=explode('.',$version);
34
+ ?>
35
+ <div class="<?php echo ($version[1]<9)?"lower":"higher";?>">
36
+ <?php
37
+ $slider_id=$this->getData('slidermanager_id');
38
+ $data = Mage::getModel('slidermanager/slidermanager')->getCollection()->addFieldToFilter('bannermanager_id',$slider_id);
39
+ $data->addFieldToFilter('status','1');
40
+ $dataOne=Mage::getModel('slidermanager/bannermanager')->getCollection()->addFieldToFilter('bannermanager_id',$slider_id);
41
+ $status=0;
42
+ $count=count($data);
43
+ foreach($dataOne as $rowOne)
44
+ {
45
+ $status=$rowOne->getStatus();
46
+ }
47
+ if($status==$slider_id&&$count>0)
48
+ {
49
+ ?>
50
+ <div class="sequence-theme">
51
+ <div id="sequence">
52
+ <img class="sequence-prev" src="<?php echo $this->getSkinUrl('css/accessshop/images/bt-prev.png');?>" alt="Previous Frame" />
53
+ <img class="sequence-next" src="<?php echo $this->getSkinUrl('css/accessshop/images/bt-next.png');?>" alt="Next Frame" />
54
+ <ul class="sequence-canvas">
55
+ <?php
56
+ foreach($data as $row)
57
+ {
58
+ ?>
59
+ <li class="animate-in" style="background-repeat: no-repeat; background-image: url(<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'slidermanager/'.$row->getBackgroundImage();?>);">
60
+ <div class="<?php echo ($version[1]<9)?"slider-wrapper-old":"slider-wrapper";?>">
61
+ <h2 class="title"><?php echo $row->getTitle();?></h2>
62
+ <h3 class="subtitle"><?php echo $row->getContent();?></h3>
63
+ <?php
64
+ if($row->getLinkButton()=='1')
65
+ {
66
+ ?>
67
+ <a class="link" href="<?php echo $row->getLink();?>" target="<?php echo $row->getTarget();?>">
68
+ <?php echo ucwords($row->getButtonTitle());if($row->getButtonTitle()==''){echo 'Button';}?>
69
+ </a>
70
+ <?php
71
+ }
72
+ ?>
73
+ <img class="model" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'slidermanager/'.$row->getFilename(); ?>" alt="<?php echo $row->getTitle();?>" />
74
+ </div>
75
+ </li>
76
+ <?php
77
+ }
78
+ ?>
79
+ </ul>
80
+ <ul class="sequence-pagination">
81
+ <?php
82
+ for($i=0;$i<count($data);$i++)
83
+ {
84
+ ?>
85
+ <li><?php echo $i;?></li>
86
+ <?php
87
+ }
88
+ ?>
89
+ </ul>
90
+ </div>
91
+ </div>
92
+ <?php
93
+ }
94
+ ?>
95
+ </div>
app/etc/modules/AShop_Slidermanager.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * AShop Slider
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the AccessshopThemes.com license that is
9
+ * available through the world-wide-web at this URL:
10
+ * http://www.accessshopThemes.com
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
15
+ * version in the future.
16
+ *
17
+ * @category AShop Slider
18
+ * @package AShop_Slidermanager
19
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
20
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
21
+ */
22
+
23
+ /**
24
+ * Accessshop Block
25
+ *
26
+ * @category AShop Slider
27
+ * @package AShop_Slidermanager
28
+ * @author AccessShop Developer
29
+ */
30
+ -->
31
+ <config>
32
+ <modules>
33
+ <AShop_Slidermanager>
34
+ <active>true</active>
35
+ <codePool>local</codePool>
36
+ </AShop_Slidermanager>
37
+ </modules>
38
+ </config>
media/slidermanager/bg-sequence.jpg ADDED
Binary file
package.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>AShop_Slider</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Free awesome slider for magento store with best animation and responsive effect.</summary>
10
+ <description>AShop Slider has best animation effect and responsive view.You can add as many slider you want and manage banner accordingly to each slider. It is completely free developed by Accessshop Developer.</description>
11
+ <notes>Features:&#xD;
12
+ 1. Can add as many slider and manage banner accordingly.&#xD;
13
+ 2.Awesome slider animation.&#xD;
14
+ 3.Responsive view</notes>
15
+ <authors><author><name>AccessShop Themes</name><user>accessshopthemes</user><email>magento@access-keys.com</email></author></authors>
16
+ <date>2015-01-26</date>
17
+ <time>12:28:51</time>
18
+ <contents><target name="magelocal"><dir name="AShop"><dir name="Slidermanager"><dir name="Block"><dir name="Adminhtml"><dir name="Bannermanager"><file name="Custom.php" hash="396f3dbd6491745c5afd04d978d7fcab"/><dir name="Edit"><file name="Form.php" hash="0e97f186c5ed8e4f4d30e097996bd932"/><dir name="Tab"><file name="Custom.php" hash="25d1f6b8a7559f750c85eb188d8114bb"/><file name="Form.php" hash="908631344fd9d374486c7090dfb5d149"/></dir><file name="Tabs.php" hash="ab99c9fd6197b4e6e223f44dde31a285"/></dir><file name="Edit.php" hash="8c524367c93cdb07057c85fec6318425"/><file name="Grid.php" hash="b2bb40289fd020424800cb7d4da76659"/></dir><file name="Bannermanager.php" hash="a9166a84dd184cc8d8a77a56152268ad"/><dir name="Renderer"><file name="bannerimage.php" hash="cfb0fdbaf0a026e4100fb2be8433f208"/></dir><dir name="Slidermanager"><dir name="Edit"><file name="Form.php" hash="91e99b7ab2c881ce43eee4b94fc73724"/><dir name="Tab"><file name="Form.php" hash="af6daf55b724c2a2fdad593f6d9bd4f7"/></dir><file name="Tabs.php" hash="8984f9bd94fae4c18d8629958db85aa2"/></dir><file name="Edit.php" hash="d4254bd5904ee4ef1e0a37500a1d09dd"/><file name="Grid.php" hash="41b8a566f4a58526d50987aaf755c511"/></dir><file name="Slidermanager.php" hash="773deda701eb4cd27b92c15c53c20368"/><dir name="System"><dir name="Configuration"><file name="Implementcode.php" hash="54381fb6b43bac1b2bbd9e808375a89b"/></dir></dir></dir><file name="Slidermanager.php" hash="7857c7bc7fda35cc36945d1cc2aa435e"/></dir><dir name="Helper"><file name="Data.php" hash="1f4de9bef5987fc2b20ba817a37ffe20"/></dir><dir name="Model"><file name="Bannermanager.php" hash="e7393504ac06a351d22f4a153869a5bb"/><dir name="Mysql4"><dir name="Bannermanager"><file name="Collection.php" hash="3d06e79a7fcb6603b361b6b36d14e37e"/></dir><file name="Bannermanager.php" hash="1bf06cae29f062b04e73c23b6295bfd0"/><dir name="Slidermanager"><file name="Collection.php" hash="b67a6a10a1b042c87dc1dfde41f000d8"/></dir><file name="Slidermanager.php" hash="7b163fab15c72793cd7bc53ed7b03911"/></dir><file name="Select.php" hash="b2a8fac0565fda8687340c77cd13f3f0"/><file name="Slidermanager.php" hash="d6ebb12b7c2eca2f518b7dad9eec4a67"/><file name="Status.php" hash="abc616077967ce8efa66d85db097e30f"/><file name="Target.php" hash="08a0783d33b49b0ca031ef362b48366f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannermanagerController.php" hash="3106ad354ada560f1e99a0fdaf6d2a74"/><file name="SlidermanagerController.php" hash="b230219b57ef21835a80ea6514c4c931"/></dir><file name="IndexController.php" hash="eee5977e6ec7965074b5be4736d37797"/></dir><dir name="etc"><file name="config.xml" hash="8e6454af45e0f67a0b7873c070be6d25"/><file name="system.xml" hash="07af0e7fa439d3d6a6ec1cb8bf87d4dc"/></dir><dir name="sql"><dir name="slidermanager_setup"><file name="mysql4-install-1.0.0.php" hash="cde0ab63830402bd8ae54e1924eb1053"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="slidermanager.xml" hash="e5f5b8805eb56fb67f9b6ad7d9b4ac8d"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="slidermanager.xml" hash="8826815e333cc3284667a6dd7f62b54e"/></dir><dir name="template"><dir name="slidermanager"><file name="slidermanager.phtml" hash="04934aaf5091a92951339f9c465bd5ea"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="accessshop"><dir name="images"><file name="Thumbs.db" hash="d83c43a89869adbdc91eaa62635aefec"/><file name="bg-sequence.jpg" hash="b48a2495f724c7fbd4a0e398f02259c0"/><file name="bt-next.png" hash="8081d1cfe949a3018b5e709b447026bb"/><file name="bt-prev.png" hash="e2ea2770883e3e72f8b2ccc59b5fb10b"/></dir><dir name="slidermanager"><file name="accessshop-custom.css" hash="ff5c2ef151105b74f954af6f7a7b196d"/><file name="accessshop-responsive.css" hash="830dacd79b593899a21fb8ba78d66637"/><file name="sequencejs-theme.modern-slide-in-accessshop.css" hash="5d4c648c9185ce3359cbfb45702a2199"/></dir></dir></dir><dir name="js"><file name="jquery-2.1.1.js" hash="7403060950f4a13be3b3dfde0490ee05"/><file name="sequencejs-options.modern-slide-in.js" hash="a293d57b8d26099f0d0c2c590d8ec529"/><file name="jquery.sequence.js" hash="72edd3810e406c66c62358b72ed27fe3"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="AShop_Slidermanager.xml" hash="5eded0e19a8f1f6cd2f364e987fa6d8c"/></dir></target><target name="magemedia"><dir name="slidermanager"><file name="bg-sequence.jpg" hash="b48a2495f724c7fbd4a0e398f02259c0"/></dir></target></contents>
19
+ <compatible/>
20
+ <dependencies><required><php><min>5.4.0</min><max>5.7.0</max></php></required></dependencies>
21
+ </package>
skin/frontend/base/default/css/accessshop/images/Thumbs.db ADDED
Binary file
skin/frontend/base/default/css/accessshop/images/bg-sequence.jpg ADDED
Binary file
skin/frontend/base/default/css/accessshop/images/bt-next.png ADDED
Binary file
skin/frontend/base/default/css/accessshop/images/bt-prev.png ADDED
Binary file
skin/frontend/base/default/css/accessshop/slidermanager/accessshop-custom.css ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ /* Carousel */
30
+ #after-header {
31
+ background-color: transparent;
32
+ }
33
+ #slider-home {
34
+ text-align:center;
35
+ padding-bottom: 80px;
36
+ }
37
+ #slider-home .carousel-control.right,
38
+ #slider-home .carousel-control.left {
39
+ background:none;
40
+ }
41
+ .higher #sequence .slider-wrapper {
42
+ width: 1170px;
43
+ margin-left: -585px;
44
+ left: 50%;
45
+ position: absolute;
46
+ }
47
+ .higher #sequence .slider-wrapper .title{
48
+ color: #000;
49
+ font-family: 'Roboto Condensed', sans-serif;
50
+ font-weight: 400;
51
+ }
52
+ .higher #sequence .slider-wrapper .subtitle{
53
+ color:rgba(0,0,0,0.7);
54
+ font-family: 'Roboto Condensed', sans-serif;
55
+ font-weight: 300;
56
+ }
57
+
58
+ .col2-left-layout .higher #sequence .slider-wrapper{
59
+ width: 850px !important;
60
+ margin-left: -425px !important;
61
+ }
62
+ .col2-left-layout .higher #sequence, .col2-right-layout .higher #sequence{
63
+ height: 340px !important;
64
+ }
65
+
66
+ .col2-right-layout .higher .title, .col2-left-layout .higher .title {
67
+ font-size: 46px;
68
+ margin-top: 9%;
69
+ }
70
+ .col2-right-layout .higher .subtitle , .col2-left-layout .higher .subtitle{
71
+ font-size: 25px;
72
+ }
73
+ .col2-right-layout .higher .animate-in .model, .col2-left-layout .higher .animate-in .model {
74
+ left: 56%;
75
+ width: 315px;
76
+ top: 28%;
77
+ }
78
+ .col2-right-layout .higher #sequence .slider-wrapper{
79
+ width: 850px;
80
+ margin-left: -425px;
81
+ }
82
+
83
+ .col3-layout .higher .title {
84
+ font-size: 31px;
85
+ margin-top: 14%;
86
+ }
87
+ .col3-layout .higher #sequence .title {
88
+ width: 34%;
89
+ }
90
+ .col3-layout .higher #sequence{
91
+ height:340px !important;
92
+ }
93
+ .col3-layout .higher .subtitle {
94
+ font-size: 20px;
95
+ width: 34%;
96
+ }
97
+ .col3-layout .higher .animate-in .model {
98
+ left: 48%;
99
+ width: 285px;
100
+ top: 30%;
101
+ }
102
+ .col3-layout .higher #sequence .slider-wrapper{
103
+ width: 620px;
104
+ margin-left: -310px;
105
+ }
106
+
107
+ .col3-layout .higher .animate-in .title,.col3-layout .higher .animate-in .subtitle{
108
+ left: 6%;
109
+ }
110
+
111
+
112
+
113
+ /*.slider-wrapper .link {
114
+ opacity: 1;
115
+ -webkit-transition: all 0.5s ease-in-out 2.5s;
116
+ -moz-transition: all 0.5s ease-in-out 2.5s;
117
+ -ms-transition: all 0.5s ease-in-out 2.5s;
118
+ -o-transition: all 0.5s ease-in-out 2.5s;
119
+ transition: all 0.5s ease-in-out 2.5s;
120
+ transform: rotateY(0deg);
121
+ -ms-transform: rotateY(0deg);
122
+ -webkit-transform: rotateY(0deg);
123
+ -webkit-transform-style: preserve-3d;
124
+ transform-style: preserve-3d;
125
+ }
126
+
127
+ #sequence .animate-out .slider-wrapper .link {
128
+ opacity: 0;
129
+ -webkit-transition: all 0.5s ease-in-out 2.5s;
130
+ -moz-transition: all 0.5s ease-in-out 2.5s;
131
+ -ms-transition: all 0.5s ease-in-out 2.5s;
132
+ -o-transition: all 0.5s ease-in-out 2.5s;
133
+ transition: all 0.5s ease-in-out 2.5s;
134
+ transform: rotateY(0deg);
135
+ -ms-transform: rotateY(0deg);
136
+ -webkit-transform: rotateY(0deg);
137
+ -webkit-transform-style: preserve-3d;
138
+ transform-style: preserve-3d;
139
+ }*/
140
+
141
+ #sequence .link {
142
+ opacity: 0;
143
+ transform:rotateY(-180deg);
144
+ -ms-transform:rotateY(-180deg); /* IE 9 */
145
+ -webkit-transform:rotateY(-180deg); /* Opera, Chrome, and Safari */
146
+ -webkit-transform-style: preserve-3d; /* Chrome, Safari, Opera */
147
+ transform-style: preserve-3d;
148
+ }
149
+
150
+ #sequence .animate-in .link {
151
+ opacity: 1;
152
+ -webkit-transition:all 0.5s ease-in-out 1s ;
153
+ -moz-transition:all 0.5s ease-in-out 1s ;
154
+ -ms-transition:all 0.5s ease-in-out 1s ;
155
+ -o-transition:all 0.5s ease-in-out 1s ;
156
+ transition:all 0.5s ease-in-out 1s ;
157
+ transform:rotateY(0deg);
158
+ -ms-transform:rotateY(0deg); /* IE 9 */
159
+ -webkit-transform:rotateY(0deg); /* Opera, Chrome, and Safari */
160
+ -webkit-transform-style: preserve-3d; /* Chrome, Safari, Opera */
161
+ transform-style: preserve-3d;
162
+ }
163
+
164
+ #sequence .animate-out .link {
165
+ opacity: 0;
166
+ -webkit-transition:all 0.5s ease-in-out 1s ;
167
+ -moz-transition:all 0.5s ease-in-out 1s ;
168
+ -ms-transition:all 0.5s ease-in-out 1s ;
169
+ -o-transition:all 0.5s ease-in-out 1s ;
170
+ transition:all 0.5s ease-in-out 1s ;
171
+ transform:rotateY(0deg);
172
+ -ms-transform:rotateY(0deg); /* IE 9 */
173
+ -webkit-transform:rotateY(0deg); /* Opera, Chrome, and Safari */
174
+ -webkit-transform-style: preserve-3d; /* Chrome, Safari, Opera */
175
+ transform-style: preserve-3d;
176
+ }
177
+
178
+
179
+ /*-------old version----------*/
180
+
181
+ .lower #sequence .slider-wrapper-old {
182
+ width: 880px !important;
183
+ margin-left: 20px !important;
184
+ }
185
+ .lower #sequence .slider-wrapper-old .title{
186
+ color: #000;
187
+ font-family: 'Roboto Condensed', sans-serif;
188
+ font-weight: 400;
189
+ }
190
+ .lower #sequence .slider-wrapper-old .subtitle{
191
+ font-size:26px;
192
+ color:rgba(0,0,0,0.7);
193
+ font-family: 'Roboto Condensed', sans-serif;
194
+ font-weight: 300;
195
+ width: 40%;
196
+ }
197
+
198
+ .lower #sequence .slider-wrapper-old .link{
199
+ left: 8%;
200
+ text-decoration: none;
201
+ }
202
+
203
+ .lower #sequence .slider-wrapper-old .link:hover{
204
+ text-decoration: underline;
205
+ }
206
+
207
+ .lower .animate-in .model {
208
+ left: 47%;
209
+ }
210
+
211
+ .col2-right-layout .lower #sequence .slider-wrapper-old, .col2-left-layout .lower #sequence .slider-wrapper-old{
212
+ width: 618px !important;
213
+ margin-left: 32px !important;
214
+ }
215
+ .col2-left-layout .lower #sequence, .col2-right-layout .lower #sequence{
216
+ height: 340px !important;
217
+ }
218
+
219
+
220
+ .col2-right-layout .lower .animate-in .model, .col2-left-layout .lower .animate-in .model {
221
+ left: 50%;
222
+ width: 280px;
223
+ }
224
+ .col2-right-layout .lower .title, .col2-left-layout .lower .title {
225
+ font-size: 42px;
226
+ color:#000;
227
+ ffont-family: 'Roboto Condensed', sans-serif;
228
+ }
229
+ .col2-right-layout .lower .subtitle, .col2-left-layout .lower .subtitle {
230
+ font-size: 22px !important;
231
+ color:rgba(0,0,0,0.7);
232
+ font-family: 'Roboto Condensed', sans-serif;
233
+ }
234
+ .col2-left-layout .lower .animate-in .link,.col2-right-layout .lower .animate-in .link{
235
+ left: 10% !important;
236
+ }
237
+
238
+ .col3-layout .lower #sequence .slider-wrapper-old {
239
+ width: 100% !important;
240
+ margin-left: 0 !important;
241
+ margin: 0 auto !important;
242
+ float: none !important;
243
+ left: 0 !important;
244
+ }
245
+ .col3-layout .lower #sequence {
246
+ height: 340px !important;
247
+ }
248
+ .col3-layout .lower #sequence .title {
249
+ width: 100%;
250
+ left: 0;
251
+ text-align: center;
252
+ font-family: 'Roboto Condensed', sans-serif;
253
+ color: #000;
254
+ font-size: 40px;
255
+ }
256
+
257
+ .col3-layout .lower .subtitle {
258
+ left: 0;
259
+ width: 72%;
260
+ text-align: center;
261
+ margin: 0 auto;
262
+ font-family: 'Roboto Condensed', sans-serif;
263
+ color: rgba(0,0,0,0.7);
264
+ font-size: 20px !important;
265
+ }
266
+ .col3-layout .lower .model {
267
+ display: none;
268
+ }
269
+ .col3-layout .lower .animate-in .link {
270
+ position: static;
271
+ display: block;
272
+ width: 80px;
273
+ text-align: center;
274
+ margin: 0 auto;
275
+ margin-top: 10px;
276
+ }
277
+
278
+ /*-------END old version----------*/
skin/frontend/base/default/css/accessshop/slidermanager/accessshop-responsive.css ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ /**
3
+ * AShop Slider
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the AccessshopThemes.com license that is
8
+ * available through the world-wide-web at this URL:
9
+ * http://www.accessshopThemes.com
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
14
+ * version in the future.
15
+ *
16
+ * @category AShop Slider
17
+ * @package AShop_Slidermanager
18
+ * @copyright Copyright (c) 2015 Accessshop (http://www.accessshopThemes.com)
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Accessshop Block
24
+ *
25
+ * @category AShop Slider
26
+ * @package AShop_Slidermanager
27
+ * @author AccessShop Developer
28
+ */
29
+ /* Carousel */
30
+
31
+ @media(max-width: 1024px){
32
+
33
+ #sequence .slider-wrapper{
34
+ margin-left: -460px !important;
35
+ width: 913px !important;
36
+ }
37
+
38
+ .animate-in .model{
39
+ left: 50%;
40
+ }
41
+ .col2-left-layout #sequence .slider-wrapper, .col2-right-layout #sequence .slider-wrapper{
42
+ margin-left: -337px;
43
+ width: 674px;
44
+ }
45
+ .col3-layout #sequence .slider-wrapper{
46
+ margin-left: -225px !important;
47
+ width: 438px !important;
48
+
49
+ }
50
+ .col2-left-layout .animate-in .model, .col2-right-layout .animate-in .model {
51
+ left: 51%;
52
+ width: 270px;
53
+ }
54
+
55
+ .col3-layout .animate-in .model {
56
+ left: 50% !important;
57
+ width: 215px !important;
58
+ }
59
+
60
+ .col2-left-layout .subtitle, .col2-right-layout .subtitle {
61
+ font-size: 18px;
62
+ }
63
+ .col3-layout .subtitle {
64
+ font-size: 16px !important;
65
+ }
66
+ .col2-left-layout .title,.col2-right-layout .title {
67
+ font-size: 40px;
68
+ }
69
+
70
+ }
71
+
72
+
73
+ @media(min-width: 768px) and (max-width: 980px){
74
+
75
+ #sequence .slider-wrapper {
76
+ margin-left: -322px !important;
77
+ width: 656px !important;
78
+ }
79
+ .col3-layout #sequence .slider-wrapper{
80
+ margin-left: -322px !important;
81
+ width: 656px !important;
82
+ }
83
+
84
+ .animate-in .model {
85
+ left: 32%;
86
+ }
87
+
88
+ #sequence .slider-wrapper .title {
89
+ font-size: 40px;
90
+ margin-top: 18%;
91
+ }
92
+ .subtitle {
93
+ font-size: 18px;
94
+ }
95
+ #sequence .slider-wrapper .model {
96
+ width: 42% !important;
97
+ top: 32%;
98
+ }
99
+ .animate-in .model {
100
+ left: 50% !important;
101
+ }
102
+ }
103
+
104
+ @media(max-width: 767px){
105
+ #sequence .slider-wrapper .model{
106
+ display: none;
107
+ }
108
+
109
+
110
+ #sequence .slider-wrapper {
111
+ left: 0 !important;
112
+ margin: 0 auto !important;
113
+ width: 100% !important;
114
+ }
115
+ .col2-left-layout #sequence .slider-wrapper,.col2-right-layout #sequence .slider-wrapper, .col3-layout #sequence .slider-wrapper{
116
+ left: 0 !important;
117
+ margin: 0 auto !important ;
118
+ width: 100% !important;
119
+ }
120
+ #sequence .slider-wrapper .title {
121
+ font-size: 40px;
122
+ margin-top: 18%;
123
+ left: 0;
124
+ width: 100%;
125
+ text-align: center;
126
+ }
127
+ .subtitle {
128
+ font-size: 18px;
129
+ left: 0 !important;
130
+ padding: 0 12%;
131
+ text-align: center;
132
+ width: 100%;
133
+ }
134
+
135
+ .col3-layout #sequence .slider-wrapper .subtitle {
136
+ font-size: 18px !important;
137
+ left: 0 !important;
138
+ padding: 0 12% !important;
139
+ text-align: center !important;
140
+ width: 100% !important;
141
+ }
142
+
143
+ .link {
144
+ display: block;
145
+ float: none;
146
+ left: 0 !important;
147
+ margin: 5% auto 0;
148
+ position: static;
149
+ text-align: center;
150
+ width: 19%;
151
+ }
152
+ }
153
+
154
+ @media(max-width: 480px){
155
+
156
+ .link {
157
+ width: 30%;
158
+ padding:0;
159
+ }
160
+ #sequence .slider-wrapper .title {
161
+ margin-top: 23%;
162
+
163
+ }
164
+ .subtitle {
165
+ font-size: 16px;
166
+ padding: 0 15%;
167
+ }
168
+ .col3-layout #sequence .slider-wrapper .subtitle{
169
+ font-size: 16px !important;
170
+ padding: 0 15% !important;
171
+ }
172
+ .sequence-prev{
173
+ left: 0;
174
+ }
175
+ .sequence-next{
176
+ right: 0;
177
+ }
178
+ }
179
+
180
+ @media(max-width: 320px){
181
+ #sequence .slider-wrapper .title {
182
+ font-size: 30px;
183
+ }
184
+ .subtitle {
185
+ font-size: 14px;
186
+ padding: 0 18%;
187
+ }
188
+ .link{
189
+ margin-top: 10%;
190
+ }
191
+
192
+ }
skin/frontend/base/default/css/accessshop/slidermanager/sequencejs-theme.modern-slide-in-accessshop.css ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Theme created for use with Sequence.js (http://www.sequencejs.com/)
3
+
4
+ Theme: Modern Slide In
5
+ Version: 1.3
6
+ Theme Author: Ian Lunn @IanLunn
7
+ Author URL: http://www.ianlunn.co.uk/
8
+ Theme URL: http://www.sequencejs.com/themes/modern-slide-in/
9
+
10
+ This is a FREE theme and is available under a MIT License:
11
+ http://www.opensource.org/licenses/mit-license.php
12
+
13
+ Sequence.js and its dependencies are (c) Ian Lunn Design 2012 - 2013 unless otherwise stated.
14
+ */
15
+ /* CSS RESET - http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */
16
+ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
17
+ margin: 0;
18
+ padding: 0;
19
+ border: 0;
20
+ font-size: 100%;
21
+ font: inherit;
22
+ vertical-align: baseline;
23
+ }
24
+ /* HTML5 display-role reset for older browsers */
25
+ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
26
+ display: block;
27
+ }
28
+ body {
29
+ line-height: 1;
30
+ }
31
+ ol, ul {
32
+ list-style: none;
33
+ }
34
+ blockquote, q {
35
+ quotes: none;
36
+ }
37
+ blockquote:before, blockquote:after, q:before, q:after {
38
+ content: '';
39
+ content: none;
40
+ }
41
+ table {
42
+ border-collapse: collapse;
43
+ border-spacing: 0;
44
+ }
45
+ /* !CSS RESET */
46
+ /* prefix declarations */
47
+ /* THEME STYLES */
48
+ .sequence-theme {
49
+ /* this container is just to ensure the background color stretches all the way across on bigger screens */
50
+ background: #D9D9D9;
51
+ }
52
+ #sequence {
53
+ margin: 0 auto;
54
+ position: relative;
55
+ overflow: hidden;
56
+ width: 100%;
57
+ max-width: 1920px;
58
+ background-color: #D9D9D9;
59
+ background-image: url("../images/bg-sequence.jpg");
60
+ background-repeat: no-repeat;
61
+ background-position: 50% 100%;
62
+ color: white;
63
+ font-size: 0.625em;
64
+ margin: 0 auto;
65
+ position: relative;
66
+ height: 481px;
67
+ }
68
+ #sequence > .sequence-canvas {
69
+ height: 100%;
70
+ width: 100%;
71
+ }
72
+ #sequence > .sequence-canvas > li {
73
+ position: absolute;
74
+ width: 100%;
75
+ height: 100%;
76
+ z-index: 1;
77
+ margin-left: 0;
78
+ top: 0%;
79
+ }
80
+ #sequence > .sequence-canvas > li img {
81
+ height: 96%;
82
+ }
83
+ #sequence > .sequence-canvas li > .banner-container {
84
+ height: 481px;
85
+ margin: auto;
86
+ position: relative;
87
+ width: 1230px;
88
+ }
89
+ #sequence > .sequence-canvas li > .banner-container > * {
90
+ position: absolute;
91
+ /* only cause the left and opacity properties to transition */
92
+ -webkit-transition-property: left, opacity;
93
+ -moz-transition-property: left, opacity;
94
+ -ms-transition-property: left, opacity;
95
+ -o-transition-property: left, opacity;
96
+ transition-property: left, opacity;
97
+ }
98
+ .sequence-next, .sequence-prev {
99
+ color: white;
100
+ cursor: pointer;
101
+ display: none;
102
+ font-weight: bold;
103
+ position: absolute;
104
+ /*top: 190px;*/
105
+ z-index: 1000;
106
+ }
107
+ .sequence-pause {
108
+ bottom: 0;
109
+ cursor: pointer;
110
+ position: absolute;
111
+ z-index: 1000;
112
+ }
113
+ .sequence-paused {
114
+ opacity: 0.3;
115
+ }
116
+
117
+ .sequence-prev {
118
+ left: 20px;
119
+ top: 50%;
120
+ margin-top: -35px;
121
+ }
122
+
123
+ .sequence-next {
124
+ right: 20px;
125
+ top: 50%;
126
+ margin-top: -35px;
127
+ }
128
+ .sequence-prev img, .sequence-next img {
129
+ height: 100%;
130
+ width: auto;
131
+ }
132
+ #sequence-preloader {
133
+ background: #d9d9d9;
134
+ }
135
+ .sequence-pagination {
136
+ margin: -30px auto auto;
137
+ position: relative;
138
+ text-align: center;
139
+ z-index: 999999;
140
+ -webkit-transition-duration: 0.5s;
141
+ -moz-transition-duration: 0.5s;
142
+ -ms-transition-duration: 0.5s;
143
+ -o-transition-duration: 0.5s;
144
+ transition-duration: 0.5s;
145
+ }
146
+ .sequence-pagination li {
147
+ background: none repeat scroll 0 0 #EEE;
148
+ border-radius: 50%;
149
+ cursor: pointer;
150
+ display: inline-block;
151
+ font: 0px/0 a;
152
+ height: 10px;
153
+ margin: 0 2px;
154
+ width: 10px;
155
+ }
156
+ .sequence-pagination li.current {
157
+ background: #f23f3f;
158
+ }
159
+ .sequence-pagination li img {
160
+ cursor: pointer;
161
+ opacity: 0.5;
162
+ -webkit-transition-duration: 1s;
163
+ -moz-transition-duration: 1s;
164
+ -ms-transition-duration: 1s;
165
+ -o-transition-duration: 1s;
166
+ transition-duration: 1s;
167
+ -webkit-transition-property: margin-bottom, opacity;
168
+ -moz-transition-property: margin-bottom, opacity;
169
+ -ms-transition-property: margin-bottom, opacity;
170
+ -o-transition-property: margin-bottom, opacity;
171
+ transition-property: margin-bottom, opacity;
172
+ }
173
+ .sequence-pagination li img:hover {
174
+ margin-bottom: 4px;
175
+ -webkit-transition-duration: 0.3s;
176
+ -moz-transition-duration: 0.3s;
177
+ -ms-transition-duration: 0.3s;
178
+ -o-transition-duration: 0.3s;
179
+ transition-duration: 0.3s;
180
+ }
181
+ .sequence-pagination li.current img {
182
+ opacity: 1;
183
+ }
184
+ h2 {
185
+ color: white;
186
+ font-family: 'Sirin Stencil', serif;
187
+ font-weight: bold;
188
+ text-transform: uppercase;
189
+ }
190
+ h3 {
191
+ font-family: 'Ruluko', serif;
192
+ }
193
+ .sequence-next, .sequence-prev {
194
+ position: absolute;
195
+ opacity: 0.6;
196
+ -webkit-transition-duration: 1s;
197
+ -moz-transition-duration: 1s;
198
+ -ms-transition-duration: 1s;
199
+ -o-transition-duration: 1s;
200
+ transition-duration: 1s;
201
+ }
202
+ .sequence-next:hover, .sequence-prev:hover {
203
+ opacity: 1;
204
+ -webkit-transition-duration: 1s;
205
+ -moz-transition-duration: 1s;
206
+ -ms-transition-duration: 1s;
207
+ -o-transition-duration: 1s;
208
+ transition-duration: 1s;
209
+ }
210
+ .title {
211
+ font-size: 55px;
212
+ position: relative;
213
+ margin-top: 12%;
214
+ left: 35%;
215
+ text-transform: none;
216
+ }
217
+ .animate-in .title {
218
+ left:6%;
219
+ opacity: 1;
220
+ -webkit-transition-duration: 0.5s;
221
+ -moz-transition-duration: 0.5s;
222
+ -ms-transition-duration: 0.5s;
223
+ -o-transition-duration: 0.5s;
224
+ transition-duration: 0.5s;
225
+ }
226
+ .animate-out .title {
227
+ left: 35%;
228
+ opacity: 0;
229
+ -webkit-transition-duration: 0.5s;
230
+ -moz-transition-duration: 0.5s;
231
+ -ms-transition-duration: 0.5s;
232
+ -o-transition-duration: 0.5s;
233
+ transition-duration: 0.5s;
234
+ }
235
+ .subtitle {
236
+ color: black;
237
+ font-size: 30px;
238
+ width: 46%;
239
+ position: relative;
240
+ left: 35%;
241
+ text-transform: none;
242
+ }
243
+ .animate-in .subtitle {
244
+ left: 6%;
245
+ opacity: 1;
246
+ -webkit-transition-duration: 0.5s;
247
+ -moz-transition-duration: 0.5s;
248
+ -ms-transition-duration: 0.5s;
249
+ -o-transition-duration: 0.5s;
250
+ transition-duration: 0.5s;
251
+ }
252
+ .animate-out .subtitle {
253
+ left: 35%;
254
+ opacity: 0;
255
+ -webkit-transition-duration: 0.5s;
256
+ -moz-transition-duration: 0.5s;
257
+ -ms-transition-duration: 0.5s;
258
+ -o-transition-duration: 0.5s;
259
+ transition-duration: 0.5s;
260
+ }
261
+
262
+ .animate-in .link{
263
+ left: 6%;
264
+ opacity: 1;
265
+ -webkit-transition-duration: 0.5s;
266
+ -moz-transition-duration: 0.5s;
267
+ -ms-transition-duration: 0.5s;
268
+ -o-transition-duration: 0.5s;
269
+ transition-duration: 0.5s;
270
+ }
271
+ .animate-out .link{
272
+ left: 35%;
273
+ opacity: 0;
274
+ -webkit-transition-duration: 0.5s;
275
+ -moz-transition-duration: 0.5s;
276
+ -ms-transition-duration: 0.5s;
277
+ -o-transition-duration: 0.5s;
278
+ transition-duration: 0.5s;
279
+ }
280
+ .link {
281
+ background: #f23f3f;
282
+ border-radius: 5px;
283
+ border-bottom: 3px solid #832e01;
284
+ line-height: 35px;
285
+ font-family: 'Oswald',sans-serif;
286
+ font-weight: 300;
287
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
288
+ color: #FFF !important;
289
+ padding: 0 25px;
290
+ font-size: 16px;
291
+ position: absolute;
292
+ left: 35%;
293
+ }
294
+
295
+ .model {
296
+ left: 70%;
297
+ bottom: -48%;
298
+ opacity: 0;
299
+ position:absolute; ;
300
+ height: auto !important;
301
+ /*max-height: 568px !important;*/
302
+ width: auto;/*min-width: 225px;*/
303
+ /* prevents the model from shrinking when the browser is resized */
304
+ /*max-width: 266px;*/ }
305
+ .animate-in .model {
306
+ bottom: 0px;
307
+ left: 58%;
308
+ opacity: 1;
309
+ -webkit-transition-duration: 1s;
310
+ -moz-transition-duration: 1s;
311
+ -ms-transition-duration: 1s;
312
+ -o-transition-duration: 1s;
313
+ transition-duration: 1s;
314
+ width: 400px;
315
+ top: 16%;
316
+ }
317
+ .bg3 .animate-in .model {
318
+ left: 40% !important;
319
+ }
320
+ .animate-out .model {
321
+ left: 75%;
322
+ opacity: 0;
323
+ -webkit-transition-duration: 0.5s;
324
+ -moz-transition-duration: 0.5s;
325
+ -ms-transition-duration: 0.5s;
326
+ -o-transition-duration: 0.5s;
327
+ transition-duration: 0.5s;
328
+ }
329
+
330
+
331
+ @media only screen and (min-width: 992px) {
332
+ #sequence .title {
333
+ width: 42%;
334
+ }
335
+ }
skin/frontend/base/default/js/jquery-2.1.1.js ADDED
@@ -0,0 +1,9190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery JavaScript Library v2.1.1
3
+ * http://jquery.com/
4
+ *
5
+ * Includes Sizzle.js
6
+ * http://sizzlejs.com/
7
+ *
8
+ * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
9
+ * Released under the MIT license
10
+ * http://jquery.org/license
11
+ *
12
+ * Date: 2014-05-01T17:11Z
13
+ */
14
+
15
+ (function( global, factory ) {
16
+
17
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
18
+ // For CommonJS and CommonJS-like environments where a proper window is present,
19
+ // execute the factory and get jQuery
20
+ // For environments that do not inherently posses a window with a document
21
+ // (such as Node.js), expose a jQuery-making factory as module.exports
22
+ // This accentuates the need for the creation of a real window
23
+ // e.g. var jQuery = require("jquery")(window);
24
+ // See ticket #14549 for more info
25
+ module.exports = global.document ?
26
+ factory( global, true ) :
27
+ function( w ) {
28
+ if ( !w.document ) {
29
+ throw new Error( "jQuery requires a window with a document" );
30
+ }
31
+ return factory( w );
32
+ };
33
+ } else {
34
+ factory( global );
35
+ }
36
+
37
+ // Pass this if window is not defined yet
38
+ }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
39
+
40
+ // Can't do this because several apps including ASP.NET trace
41
+ // the stack via arguments.caller.callee and Firefox dies if
42
+ // you try to trace through "use strict" call chains. (#13335)
43
+ // Support: Firefox 18+
44
+ //
45
+
46
+ var arr = [];
47
+
48
+ var slice = arr.slice;
49
+
50
+ var concat = arr.concat;
51
+
52
+ var push = arr.push;
53
+
54
+ var indexOf = arr.indexOf;
55
+
56
+ var class2type = {};
57
+
58
+ var toString = class2type.toString;
59
+
60
+ var hasOwn = class2type.hasOwnProperty;
61
+
62
+ var support = {};
63
+
64
+
65
+
66
+ var
67
+ // Use the correct document accordingly with window argument (sandbox)
68
+ document = window.document,
69
+
70
+ version = "2.1.1",
71
+
72
+ // Define a local copy of jQuery
73
+ jQuery = function( selector, context ) {
74
+ // The jQuery object is actually just the init constructor 'enhanced'
75
+ // Need init if jQuery is called (just allow error to be thrown if not included)
76
+ return new jQuery.fn.init( selector, context );
77
+ },
78
+
79
+ // Support: Android<4.1
80
+ // Make sure we trim BOM and NBSP
81
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
82
+
83
+ // Matches dashed string for camelizing
84
+ rmsPrefix = /^-ms-/,
85
+ rdashAlpha = /-([\da-z])/gi,
86
+
87
+ // Used by jQuery.camelCase as callback to replace()
88
+ fcamelCase = function( all, letter ) {
89
+ return letter.toUpperCase();
90
+ };
91
+
92
+ jQuery.fn = jQuery.prototype = {
93
+ // The current version of jQuery being used
94
+ jquery: version,
95
+
96
+ constructor: jQuery,
97
+
98
+ // Start with an empty selector
99
+ selector: "",
100
+
101
+ // The default length of a jQuery object is 0
102
+ length: 0,
103
+
104
+ toArray: function() {
105
+ return slice.call( this );
106
+ },
107
+
108
+ // Get the Nth element in the matched element set OR
109
+ // Get the whole matched element set as a clean array
110
+ get: function( num ) {
111
+ return num != null ?
112
+
113
+ // Return just the one element from the set
114
+ ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
115
+
116
+ // Return all the elements in a clean array
117
+ slice.call( this );
118
+ },
119
+
120
+ // Take an array of elements and push it onto the stack
121
+ // (returning the new matched element set)
122
+ pushStack: function( elems ) {
123
+
124
+ // Build a new jQuery matched element set
125
+ var ret = jQuery.merge( this.constructor(), elems );
126
+
127
+ // Add the old object onto the stack (as a reference)
128
+ ret.prevObject = this;
129
+ ret.context = this.context;
130
+
131
+ // Return the newly-formed element set
132
+ return ret;
133
+ },
134
+
135
+ // Execute a callback for every element in the matched set.
136
+ // (You can seed the arguments with an array of args, but this is
137
+ // only used internally.)
138
+ each: function( callback, args ) {
139
+ return jQuery.each( this, callback, args );
140
+ },
141
+
142
+ map: function( callback ) {
143
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
144
+ return callback.call( elem, i, elem );
145
+ }));
146
+ },
147
+
148
+ slice: function() {
149
+ return this.pushStack( slice.apply( this, arguments ) );
150
+ },
151
+
152
+ first: function() {
153
+ return this.eq( 0 );
154
+ },
155
+
156
+ last: function() {
157
+ return this.eq( -1 );
158
+ },
159
+
160
+ eq: function( i ) {
161
+ var len = this.length,
162
+ j = +i + ( i < 0 ? len : 0 );
163
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
164
+ },
165
+
166
+ end: function() {
167
+ return this.prevObject || this.constructor(null);
168
+ },
169
+
170
+ // For internal use only.
171
+ // Behaves like an Array's method, not like a jQuery method.
172
+ push: push,
173
+ sort: arr.sort,
174
+ splice: arr.splice
175
+ };
176
+
177
+ jQuery.extend = jQuery.fn.extend = function() {
178
+ var options, name, src, copy, copyIsArray, clone,
179
+ target = arguments[0] || {},
180
+ i = 1,
181
+ length = arguments.length,
182
+ deep = false;
183
+
184
+ // Handle a deep copy situation
185
+ if ( typeof target === "boolean" ) {
186
+ deep = target;
187
+
188
+ // skip the boolean and the target
189
+ target = arguments[ i ] || {};
190
+ i++;
191
+ }
192
+
193
+ // Handle case when target is a string or something (possible in deep copy)
194
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
195
+ target = {};
196
+ }
197
+
198
+ // extend jQuery itself if only one argument is passed
199
+ if ( i === length ) {
200
+ target = this;
201
+ i--;
202
+ }
203
+
204
+ for ( ; i < length; i++ ) {
205
+ // Only deal with non-null/undefined values
206
+ if ( (options = arguments[ i ]) != null ) {
207
+ // Extend the base object
208
+ for ( name in options ) {
209
+ src = target[ name ];
210
+ copy = options[ name ];
211
+
212
+ // Prevent never-ending loop
213
+ if ( target === copy ) {
214
+ continue;
215
+ }
216
+
217
+ // Recurse if we're merging plain objects or arrays
218
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
219
+ if ( copyIsArray ) {
220
+ copyIsArray = false;
221
+ clone = src && jQuery.isArray(src) ? src : [];
222
+
223
+ } else {
224
+ clone = src && jQuery.isPlainObject(src) ? src : {};
225
+ }
226
+
227
+ // Never move original objects, clone them
228
+ target[ name ] = jQuery.extend( deep, clone, copy );
229
+
230
+ // Don't bring in undefined values
231
+ } else if ( copy !== undefined ) {
232
+ target[ name ] = copy;
233
+ }
234
+ }
235
+ }
236
+ }
237
+
238
+ // Return the modified object
239
+ return target;
240
+ };
241
+
242
+ jQuery.extend({
243
+ // Unique for each copy of jQuery on the page
244
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
245
+
246
+ // Assume jQuery is ready without the ready module
247
+ isReady: true,
248
+
249
+ error: function( msg ) {
250
+ throw new Error( msg );
251
+ },
252
+
253
+ noop: function() {},
254
+
255
+ // See test/unit/core.js for details concerning isFunction.
256
+ // Since version 1.3, DOM methods and functions like alert
257
+ // aren't supported. They return false on IE (#2968).
258
+ isFunction: function( obj ) {
259
+ return jQuery.type(obj) === "function";
260
+ },
261
+
262
+ isArray: Array.isArray,
263
+
264
+ isWindow: function( obj ) {
265
+ return obj != null && obj === obj.window;
266
+ },
267
+
268
+ isNumeric: function( obj ) {
269
+ // parseFloat NaNs numeric-cast false positives (null|true|false|"")
270
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
271
+ // subtraction forces infinities to NaN
272
+ return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0;
273
+ },
274
+
275
+ isPlainObject: function( obj ) {
276
+ // Not plain objects:
277
+ // - Any object or value whose internal [[Class]] property is not "[object Object]"
278
+ // - DOM nodes
279
+ // - window
280
+ if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
281
+ return false;
282
+ }
283
+
284
+ if ( obj.constructor &&
285
+ !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
286
+ return false;
287
+ }
288
+
289
+ // If the function hasn't returned already, we're confident that
290
+ // |obj| is a plain object, created by {} or constructed with new Object
291
+ return true;
292
+ },
293
+
294
+ isEmptyObject: function( obj ) {
295
+ var name;
296
+ for ( name in obj ) {
297
+ return false;
298
+ }
299
+ return true;
300
+ },
301
+
302
+ type: function( obj ) {
303
+ if ( obj == null ) {
304
+ return obj + "";
305
+ }
306
+ // Support: Android < 4.0, iOS < 6 (functionish RegExp)
307
+ return typeof obj === "object" || typeof obj === "function" ?
308
+ class2type[ toString.call(obj) ] || "object" :
309
+ typeof obj;
310
+ },
311
+
312
+ // Evaluates a script in a global context
313
+ globalEval: function( code ) {
314
+ var script,
315
+ indirect = eval;
316
+
317
+ code = jQuery.trim( code );
318
+
319
+ if ( code ) {
320
+ // If the code includes a valid, prologue position
321
+ // strict mode pragma, execute code by injecting a
322
+ // script tag into the document.
323
+ if ( code.indexOf("use strict") === 1 ) {
324
+ script = document.createElement("script");
325
+ script.text = code;
326
+ document.head.appendChild( script ).parentNode.removeChild( script );
327
+ } else {
328
+ // Otherwise, avoid the DOM node creation, insertion
329
+ // and removal by using an indirect global eval
330
+ indirect( code );
331
+ }
332
+ }
333
+ },
334
+
335
+ // Convert dashed to camelCase; used by the css and data modules
336
+ // Microsoft forgot to hump their vendor prefix (#9572)
337
+ camelCase: function( string ) {
338
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
339
+ },
340
+
341
+ nodeName: function( elem, name ) {
342
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
343
+ },
344
+
345
+ // args is for internal usage only
346
+ each: function( obj, callback, args ) {
347
+ var value,
348
+ i = 0,
349
+ length = obj.length,
350
+ isArray = isArraylike( obj );
351
+
352
+ if ( args ) {
353
+ if ( isArray ) {
354
+ for ( ; i < length; i++ ) {
355
+ value = callback.apply( obj[ i ], args );
356
+
357
+ if ( value === false ) {
358
+ break;
359
+ }
360
+ }
361
+ } else {
362
+ for ( i in obj ) {
363
+ value = callback.apply( obj[ i ], args );
364
+
365
+ if ( value === false ) {
366
+ break;
367
+ }
368
+ }
369
+ }
370
+
371
+ // A special, fast, case for the most common use of each
372
+ } else {
373
+ if ( isArray ) {
374
+ for ( ; i < length; i++ ) {
375
+ value = callback.call( obj[ i ], i, obj[ i ] );
376
+
377
+ if ( value === false ) {
378
+ break;
379
+ }
380
+ }
381
+ } else {
382
+ for ( i in obj ) {
383
+ value = callback.call( obj[ i ], i, obj[ i ] );
384
+
385
+ if ( value === false ) {
386
+ break;
387
+ }
388
+ }
389
+ }
390
+ }
391
+
392
+ return obj;
393
+ },
394
+
395
+ // Support: Android<4.1
396
+ trim: function( text ) {
397
+ return text == null ?
398
+ "" :
399
+ ( text + "" ).replace( rtrim, "" );
400
+ },
401
+
402
+ // results is for internal usage only
403
+ makeArray: function( arr, results ) {
404
+ var ret = results || [];
405
+
406
+ if ( arr != null ) {
407
+ if ( isArraylike( Object(arr) ) ) {
408
+ jQuery.merge( ret,
409
+ typeof arr === "string" ?
410
+ [ arr ] : arr
411
+ );
412
+ } else {
413
+ push.call( ret, arr );
414
+ }
415
+ }
416
+
417
+ return ret;
418
+ },
419
+
420
+ inArray: function( elem, arr, i ) {
421
+ return arr == null ? -1 : indexOf.call( arr, elem, i );
422
+ },
423
+
424
+ merge: function( first, second ) {
425
+ var len = +second.length,
426
+ j = 0,
427
+ i = first.length;
428
+
429
+ for ( ; j < len; j++ ) {
430
+ first[ i++ ] = second[ j ];
431
+ }
432
+
433
+ first.length = i;
434
+
435
+ return first;
436
+ },
437
+
438
+ grep: function( elems, callback, invert ) {
439
+ var callbackInverse,
440
+ matches = [],
441
+ i = 0,
442
+ length = elems.length,
443
+ callbackExpect = !invert;
444
+
445
+ // Go through the array, only saving the items
446
+ // that pass the validator function
447
+ for ( ; i < length; i++ ) {
448
+ callbackInverse = !callback( elems[ i ], i );
449
+ if ( callbackInverse !== callbackExpect ) {
450
+ matches.push( elems[ i ] );
451
+ }
452
+ }
453
+
454
+ return matches;
455
+ },
456
+
457
+ // arg is for internal usage only
458
+ map: function( elems, callback, arg ) {
459
+ var value,
460
+ i = 0,
461
+ length = elems.length,
462
+ isArray = isArraylike( elems ),
463
+ ret = [];
464
+
465
+ // Go through the array, translating each of the items to their new values
466
+ if ( isArray ) {
467
+ for ( ; i < length; i++ ) {
468
+ value = callback( elems[ i ], i, arg );
469
+
470
+ if ( value != null ) {
471
+ ret.push( value );
472
+ }
473
+ }
474
+
475
+ // Go through every key on the object,
476
+ } else {
477
+ for ( i in elems ) {
478
+ value = callback( elems[ i ], i, arg );
479
+
480
+ if ( value != null ) {
481
+ ret.push( value );
482
+ }
483
+ }
484
+ }
485
+
486
+ // Flatten any nested arrays
487
+ return concat.apply( [], ret );
488
+ },
489
+
490
+ // A global GUID counter for objects
491
+ guid: 1,
492
+
493
+ // Bind a function to a context, optionally partially applying any
494
+ // arguments.
495
+ proxy: function( fn, context ) {
496
+ var tmp, args, proxy;
497
+
498
+ if ( typeof context === "string" ) {
499
+ tmp = fn[ context ];
500
+ context = fn;
501
+ fn = tmp;
502
+ }
503
+
504
+ // Quick check to determine if target is callable, in the spec
505
+ // this throws a TypeError, but we will just return undefined.
506
+ if ( !jQuery.isFunction( fn ) ) {
507
+ return undefined;
508
+ }
509
+
510
+ // Simulated bind
511
+ args = slice.call( arguments, 2 );
512
+ proxy = function() {
513
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
514
+ };
515
+
516
+ // Set the guid of unique handler to the same of original handler, so it can be removed
517
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
518
+
519
+ return proxy;
520
+ },
521
+
522
+ now: Date.now,
523
+
524
+ // jQuery.support is not used in Core but other projects attach their
525
+ // properties to it so it needs to exist.
526
+ support: support
527
+ });
528
+
529
+ // Populate the class2type map
530
+ jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
531
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
532
+ });
533
+
534
+ function isArraylike( obj ) {
535
+ var length = obj.length,
536
+ type = jQuery.type( obj );
537
+
538
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
539
+ return false;
540
+ }
541
+
542
+ if ( obj.nodeType === 1 && length ) {
543
+ return true;
544
+ }
545
+
546
+ return type === "array" || length === 0 ||
547
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;
548
+ }
549
+ var Sizzle =
550
+ /*!
551
+ * Sizzle CSS Selector Engine v1.10.19
552
+ * http://sizzlejs.com/
553
+ *
554
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
555
+ * Released under the MIT license
556
+ * http://jquery.org/license
557
+ *
558
+ * Date: 2014-04-18
559
+ */
560
+ (function( window ) {
561
+
562
+ var i,
563
+ support,
564
+ Expr,
565
+ getText,
566
+ isXML,
567
+ tokenize,
568
+ compile,
569
+ select,
570
+ outermostContext,
571
+ sortInput,
572
+ hasDuplicate,
573
+
574
+ // Local document vars
575
+ setDocument,
576
+ document,
577
+ docElem,
578
+ documentIsHTML,
579
+ rbuggyQSA,
580
+ rbuggyMatches,
581
+ matches,
582
+ contains,
583
+
584
+ // Instance-specific data
585
+ expando = "sizzle" + -(new Date()),
586
+ preferredDoc = window.document,
587
+ dirruns = 0,
588
+ done = 0,
589
+ classCache = createCache(),
590
+ tokenCache = createCache(),
591
+ compilerCache = createCache(),
592
+ sortOrder = function( a, b ) {
593
+ if ( a === b ) {
594
+ hasDuplicate = true;
595
+ }
596
+ return 0;
597
+ },
598
+
599
+ // General-purpose constants
600
+ strundefined = typeof undefined,
601
+ MAX_NEGATIVE = 1 << 31,
602
+
603
+ // Instance methods
604
+ hasOwn = ({}).hasOwnProperty,
605
+ arr = [],
606
+ pop = arr.pop,
607
+ push_native = arr.push,
608
+ push = arr.push,
609
+ slice = arr.slice,
610
+ // Use a stripped-down indexOf if we can't use a native one
611
+ indexOf = arr.indexOf || function( elem ) {
612
+ var i = 0,
613
+ len = this.length;
614
+ for ( ; i < len; i++ ) {
615
+ if ( this[i] === elem ) {
616
+ return i;
617
+ }
618
+ }
619
+ return -1;
620
+ },
621
+
622
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
623
+
624
+ // Regular expressions
625
+
626
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
627
+ whitespace = "[\\x20\\t\\r\\n\\f]",
628
+ // http://www.w3.org/TR/css3-syntax/#characters
629
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
630
+
631
+ // Loosely modeled on CSS identifier characters
632
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
633
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
634
+ identifier = characterEncoding.replace( "w", "w#" ),
635
+
636
+ // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
637
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
638
+ // Operator (capture 2)
639
+ "*([*^$|!~]?=)" + whitespace +
640
+ // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
641
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
642
+ "*\\]",
643
+
644
+ pseudos = ":(" + characterEncoding + ")(?:\\((" +
645
+ // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
646
+ // 1. quoted (capture 3; capture 4 or capture 5)
647
+ "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
648
+ // 2. simple (capture 6)
649
+ "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
650
+ // 3. anything else (capture 2)
651
+ ".*" +
652
+ ")\\)|)",
653
+
654
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
655
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
656
+
657
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
658
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
659
+
660
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
661
+
662
+ rpseudo = new RegExp( pseudos ),
663
+ ridentifier = new RegExp( "^" + identifier + "$" ),
664
+
665
+ matchExpr = {
666
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
667
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
668
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
669
+ "ATTR": new RegExp( "^" + attributes ),
670
+ "PSEUDO": new RegExp( "^" + pseudos ),
671
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
672
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
673
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
674
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
675
+ // For use in libraries implementing .is()
676
+ // We use this for POS matching in `select`
677
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
678
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
679
+ },
680
+
681
+ rinputs = /^(?:input|select|textarea|button)$/i,
682
+ rheader = /^h\d$/i,
683
+
684
+ rnative = /^[^{]+\{\s*\[native \w/,
685
+
686
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
687
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
688
+
689
+ rsibling = /[+~]/,
690
+ rescape = /'|\\/g,
691
+
692
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
693
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
694
+ funescape = function( _, escaped, escapedWhitespace ) {
695
+ var high = "0x" + escaped - 0x10000;
696
+ // NaN means non-codepoint
697
+ // Support: Firefox<24
698
+ // Workaround erroneous numeric interpretation of +"0x"
699
+ return high !== high || escapedWhitespace ?
700
+ escaped :
701
+ high < 0 ?
702
+ // BMP codepoint
703
+ String.fromCharCode( high + 0x10000 ) :
704
+ // Supplemental Plane codepoint (surrogate pair)
705
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
706
+ };
707
+
708
+ // Optimize for push.apply( _, NodeList )
709
+ try {
710
+ push.apply(
711
+ (arr = slice.call( preferredDoc.childNodes )),
712
+ preferredDoc.childNodes
713
+ );
714
+ // Support: Android<4.0
715
+ // Detect silently failing push.apply
716
+ arr[ preferredDoc.childNodes.length ].nodeType;
717
+ } catch ( e ) {
718
+ push = { apply: arr.length ?
719
+
720
+ // Leverage slice if possible
721
+ function( target, els ) {
722
+ push_native.apply( target, slice.call(els) );
723
+ } :
724
+
725
+ // Support: IE<9
726
+ // Otherwise append directly
727
+ function( target, els ) {
728
+ var j = target.length,
729
+ i = 0;
730
+ // Can't trust NodeList.length
731
+ while ( (target[j++] = els[i++]) ) {}
732
+ target.length = j - 1;
733
+ }
734
+ };
735
+ }
736
+
737
+ function Sizzle( selector, context, results, seed ) {
738
+ var match, elem, m, nodeType,
739
+ // QSA vars
740
+ i, groups, old, nid, newContext, newSelector;
741
+
742
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
743
+ setDocument( context );
744
+ }
745
+
746
+ context = context || document;
747
+ results = results || [];
748
+
749
+ if ( !selector || typeof selector !== "string" ) {
750
+ return results;
751
+ }
752
+
753
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
754
+ return [];
755
+ }
756
+
757
+ if ( documentIsHTML && !seed ) {
758
+
759
+ // Shortcuts
760
+ if ( (match = rquickExpr.exec( selector )) ) {
761
+ // Speed-up: Sizzle("#ID")
762
+ if ( (m = match[1]) ) {
763
+ if ( nodeType === 9 ) {
764
+ elem = context.getElementById( m );
765
+ // Check parentNode to catch when Blackberry 4.6 returns
766
+ // nodes that are no longer in the document (jQuery #6963)
767
+ if ( elem && elem.parentNode ) {
768
+ // Handle the case where IE, Opera, and Webkit return items
769
+ // by name instead of ID
770
+ if ( elem.id === m ) {
771
+ results.push( elem );
772
+ return results;
773
+ }
774
+ } else {
775
+ return results;
776
+ }
777
+ } else {
778
+ // Context is not a document
779
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
780
+ contains( context, elem ) && elem.id === m ) {
781
+ results.push( elem );
782
+ return results;
783
+ }
784
+ }
785
+
786
+ // Speed-up: Sizzle("TAG")
787
+ } else if ( match[2] ) {
788
+ push.apply( results, context.getElementsByTagName( selector ) );
789
+ return results;
790
+
791
+ // Speed-up: Sizzle(".CLASS")
792
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
793
+ push.apply( results, context.getElementsByClassName( m ) );
794
+ return results;
795
+ }
796
+ }
797
+
798
+ // QSA path
799
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
800
+ nid = old = expando;
801
+ newContext = context;
802
+ newSelector = nodeType === 9 && selector;
803
+
804
+ // qSA works strangely on Element-rooted queries
805
+ // We can work around this by specifying an extra ID on the root
806
+ // and working up from there (Thanks to Andrew Dupont for the technique)
807
+ // IE 8 doesn't work on object elements
808
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
809
+ groups = tokenize( selector );
810
+
811
+ if ( (old = context.getAttribute("id")) ) {
812
+ nid = old.replace( rescape, "\\$&" );
813
+ } else {
814
+ context.setAttribute( "id", nid );
815
+ }
816
+ nid = "[id='" + nid + "'] ";
817
+
818
+ i = groups.length;
819
+ while ( i-- ) {
820
+ groups[i] = nid + toSelector( groups[i] );
821
+ }
822
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
823
+ newSelector = groups.join(",");
824
+ }
825
+
826
+ if ( newSelector ) {
827
+ try {
828
+ push.apply( results,
829
+ newContext.querySelectorAll( newSelector )
830
+ );
831
+ return results;
832
+ } catch(qsaError) {
833
+ } finally {
834
+ if ( !old ) {
835
+ context.removeAttribute("id");
836
+ }
837
+ }
838
+ }
839
+ }
840
+ }
841
+
842
+ // All others
843
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
844
+ }
845
+
846
+ /**
847
+ * Create key-value caches of limited size
848
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
849
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
850
+ * deleting the oldest entry
851
+ */
852
+ function createCache() {
853
+ var keys = [];
854
+
855
+ function cache( key, value ) {
856
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
857
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
858
+ // Only keep the most recent entries
859
+ delete cache[ keys.shift() ];
860
+ }
861
+ return (cache[ key + " " ] = value);
862
+ }
863
+ return cache;
864
+ }
865
+
866
+ /**
867
+ * Mark a function for special use by Sizzle
868
+ * @param {Function} fn The function to mark
869
+ */
870
+ function markFunction( fn ) {
871
+ fn[ expando ] = true;
872
+ return fn;
873
+ }
874
+
875
+ /**
876
+ * Support testing using an element
877
+ * @param {Function} fn Passed the created div and expects a boolean result
878
+ */
879
+ function assert( fn ) {
880
+ var div = document.createElement("div");
881
+
882
+ try {
883
+ return !!fn( div );
884
+ } catch (e) {
885
+ return false;
886
+ } finally {
887
+ // Remove from its parent by default
888
+ if ( div.parentNode ) {
889
+ div.parentNode.removeChild( div );
890
+ }
891
+ // release memory in IE
892
+ div = null;
893
+ }
894
+ }
895
+
896
+ /**
897
+ * Adds the same handler for all of the specified attrs
898
+ * @param {String} attrs Pipe-separated list of attributes
899
+ * @param {Function} handler The method that will be applied
900
+ */
901
+ function addHandle( attrs, handler ) {
902
+ var arr = attrs.split("|"),
903
+ i = attrs.length;
904
+
905
+ while ( i-- ) {
906
+ Expr.attrHandle[ arr[i] ] = handler;
907
+ }
908
+ }
909
+
910
+ /**
911
+ * Checks document order of two siblings
912
+ * @param {Element} a
913
+ * @param {Element} b
914
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
915
+ */
916
+ function siblingCheck( a, b ) {
917
+ var cur = b && a,
918
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
919
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
920
+ ( ~a.sourceIndex || MAX_NEGATIVE );
921
+
922
+ // Use IE sourceIndex if available on both nodes
923
+ if ( diff ) {
924
+ return diff;
925
+ }
926
+
927
+ // Check if b follows a
928
+ if ( cur ) {
929
+ while ( (cur = cur.nextSibling) ) {
930
+ if ( cur === b ) {
931
+ return -1;
932
+ }
933
+ }
934
+ }
935
+
936
+ return a ? 1 : -1;
937
+ }
938
+
939
+ /**
940
+ * Returns a function to use in pseudos for input types
941
+ * @param {String} type
942
+ */
943
+ function createInputPseudo( type ) {
944
+ return function( elem ) {
945
+ var name = elem.nodeName.toLowerCase();
946
+ return name === "input" && elem.type === type;
947
+ };
948
+ }
949
+
950
+ /**
951
+ * Returns a function to use in pseudos for buttons
952
+ * @param {String} type
953
+ */
954
+ function createButtonPseudo( type ) {
955
+ return function( elem ) {
956
+ var name = elem.nodeName.toLowerCase();
957
+ return (name === "input" || name === "button") && elem.type === type;
958
+ };
959
+ }
960
+
961
+ /**
962
+ * Returns a function to use in pseudos for positionals
963
+ * @param {Function} fn
964
+ */
965
+ function createPositionalPseudo( fn ) {
966
+ return markFunction(function( argument ) {
967
+ argument = +argument;
968
+ return markFunction(function( seed, matches ) {
969
+ var j,
970
+ matchIndexes = fn( [], seed.length, argument ),
971
+ i = matchIndexes.length;
972
+
973
+ // Match elements found at the specified indexes
974
+ while ( i-- ) {
975
+ if ( seed[ (j = matchIndexes[i]) ] ) {
976
+ seed[j] = !(matches[j] = seed[j]);
977
+ }
978
+ }
979
+ });
980
+ });
981
+ }
982
+
983
+ /**
984
+ * Checks a node for validity as a Sizzle context
985
+ * @param {Element|Object=} context
986
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
987
+ */
988
+ function testContext( context ) {
989
+ return context && typeof context.getElementsByTagName !== strundefined && context;
990
+ }
991
+
992
+ // Expose support vars for convenience
993
+ support = Sizzle.support = {};
994
+
995
+ /**
996
+ * Detects XML nodes
997
+ * @param {Element|Object} elem An element or a document
998
+ * @returns {Boolean} True iff elem is a non-HTML XML node
999
+ */
1000
+ isXML = Sizzle.isXML = function( elem ) {
1001
+ // documentElement is verified for cases where it doesn't yet exist
1002
+ // (such as loading iframes in IE - #4833)
1003
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1004
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
1005
+ };
1006
+
1007
+ /**
1008
+ * Sets document-related variables once based on the current document
1009
+ * @param {Element|Object} [doc] An element or document object to use to set the document
1010
+ * @returns {Object} Returns the current document
1011
+ */
1012
+ setDocument = Sizzle.setDocument = function( node ) {
1013
+ var hasCompare,
1014
+ doc = node ? node.ownerDocument || node : preferredDoc,
1015
+ parent = doc.defaultView;
1016
+
1017
+ // If no document and documentElement is available, return
1018
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1019
+ return document;
1020
+ }
1021
+
1022
+ // Set our document
1023
+ document = doc;
1024
+ docElem = doc.documentElement;
1025
+
1026
+ // Support tests
1027
+ documentIsHTML = !isXML( doc );
1028
+
1029
+ // Support: IE>8
1030
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
1031
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
1032
+ // IE6-8 do not support the defaultView property so parent will be undefined
1033
+ if ( parent && parent !== parent.top ) {
1034
+ // IE11 does not have attachEvent, so all must suffer
1035
+ if ( parent.addEventListener ) {
1036
+ parent.addEventListener( "unload", function() {
1037
+ setDocument();
1038
+ }, false );
1039
+ } else if ( parent.attachEvent ) {
1040
+ parent.attachEvent( "onunload", function() {
1041
+ setDocument();
1042
+ });
1043
+ }
1044
+ }
1045
+
1046
+ /* Attributes
1047
+ ---------------------------------------------------------------------- */
1048
+
1049
+ // Support: IE<8
1050
+ // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
1051
+ support.attributes = assert(function( div ) {
1052
+ div.className = "i";
1053
+ return !div.getAttribute("className");
1054
+ });
1055
+
1056
+ /* getElement(s)By*
1057
+ ---------------------------------------------------------------------- */
1058
+
1059
+ // Check if getElementsByTagName("*") returns only elements
1060
+ support.getElementsByTagName = assert(function( div ) {
1061
+ div.appendChild( doc.createComment("") );
1062
+ return !div.getElementsByTagName("*").length;
1063
+ });
1064
+
1065
+ // Check if getElementsByClassName can be trusted
1066
+ support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
1067
+ div.innerHTML = "<div class='a'></div><div class='a i'></div>";
1068
+
1069
+ // Support: Safari<4
1070
+ // Catch class over-caching
1071
+ div.firstChild.className = "i";
1072
+ // Support: Opera<10
1073
+ // Catch gEBCN failure to find non-leading classes
1074
+ return div.getElementsByClassName("i").length === 2;
1075
+ });
1076
+
1077
+ // Support: IE<10
1078
+ // Check if getElementById returns elements by name
1079
+ // The broken getElementById methods don't pick up programatically-set names,
1080
+ // so use a roundabout getElementsByName test
1081
+ support.getById = assert(function( div ) {
1082
+ docElem.appendChild( div ).id = expando;
1083
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
1084
+ });
1085
+
1086
+ // ID find and filter
1087
+ if ( support.getById ) {
1088
+ Expr.find["ID"] = function( id, context ) {
1089
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
1090
+ var m = context.getElementById( id );
1091
+ // Check parentNode to catch when Blackberry 4.6 returns
1092
+ // nodes that are no longer in the document #6963
1093
+ return m && m.parentNode ? [ m ] : [];
1094
+ }
1095
+ };
1096
+ Expr.filter["ID"] = function( id ) {
1097
+ var attrId = id.replace( runescape, funescape );
1098
+ return function( elem ) {
1099
+ return elem.getAttribute("id") === attrId;
1100
+ };
1101
+ };
1102
+ } else {
1103
+ // Support: IE6/7
1104
+ // getElementById is not reliable as a find shortcut
1105
+ delete Expr.find["ID"];
1106
+
1107
+ Expr.filter["ID"] = function( id ) {
1108
+ var attrId = id.replace( runescape, funescape );
1109
+ return function( elem ) {
1110
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
1111
+ return node && node.value === attrId;
1112
+ };
1113
+ };
1114
+ }
1115
+
1116
+ // Tag
1117
+ Expr.find["TAG"] = support.getElementsByTagName ?
1118
+ function( tag, context ) {
1119
+ if ( typeof context.getElementsByTagName !== strundefined ) {
1120
+ return context.getElementsByTagName( tag );
1121
+ }
1122
+ } :
1123
+ function( tag, context ) {
1124
+ var elem,
1125
+ tmp = [],
1126
+ i = 0,
1127
+ results = context.getElementsByTagName( tag );
1128
+
1129
+ // Filter out possible comments
1130
+ if ( tag === "*" ) {
1131
+ while ( (elem = results[i++]) ) {
1132
+ if ( elem.nodeType === 1 ) {
1133
+ tmp.push( elem );
1134
+ }
1135
+ }
1136
+
1137
+ return tmp;
1138
+ }
1139
+ return results;
1140
+ };
1141
+
1142
+ // Class
1143
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1144
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
1145
+ return context.getElementsByClassName( className );
1146
+ }
1147
+ };
1148
+
1149
+ /* QSA/matchesSelector
1150
+ ---------------------------------------------------------------------- */
1151
+
1152
+ // QSA and matchesSelector support
1153
+
1154
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1155
+ rbuggyMatches = [];
1156
+
1157
+ // qSa(:focus) reports false when true (Chrome 21)
1158
+ // We allow this because of a bug in IE8/9 that throws an error
1159
+ // whenever `document.activeElement` is accessed on an iframe
1160
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
1161
+ // See http://bugs.jquery.com/ticket/13378
1162
+ rbuggyQSA = [];
1163
+
1164
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
1165
+ // Build QSA regex
1166
+ // Regex strategy adopted from Diego Perini
1167
+ assert(function( div ) {
1168
+ // Select is set to empty string on purpose
1169
+ // This is to test IE's treatment of not explicitly
1170
+ // setting a boolean content attribute,
1171
+ // since its presence should be enough
1172
+ // http://bugs.jquery.com/ticket/12359
1173
+ div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
1174
+
1175
+ // Support: IE8, Opera 11-12.16
1176
+ // Nothing should be selected when empty strings follow ^= or $= or *=
1177
+ // The test attribute must be unknown in Opera but "safe" for WinRT
1178
+ // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1179
+ if ( div.querySelectorAll("[msallowclip^='']").length ) {
1180
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1181
+ }
1182
+
1183
+ // Support: IE8
1184
+ // Boolean attributes and "value" are not treated correctly
1185
+ if ( !div.querySelectorAll("[selected]").length ) {
1186
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1187
+ }
1188
+
1189
+ // Webkit/Opera - :checked should return selected option elements
1190
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1191
+ // IE8 throws error here and will not see later tests
1192
+ if ( !div.querySelectorAll(":checked").length ) {
1193
+ rbuggyQSA.push(":checked");
1194
+ }
1195
+ });
1196
+
1197
+ assert(function( div ) {
1198
+ // Support: Windows 8 Native Apps
1199
+ // The type and name attributes are restricted during .innerHTML assignment
1200
+ var input = doc.createElement("input");
1201
+ input.setAttribute( "type", "hidden" );
1202
+ div.appendChild( input ).setAttribute( "name", "D" );
1203
+
1204
+ // Support: IE8
1205
+ // Enforce case-sensitivity of name attribute
1206
+ if ( div.querySelectorAll("[name=d]").length ) {
1207
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1208
+ }
1209
+
1210
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1211
+ // IE8 throws error here and will not see later tests
1212
+ if ( !div.querySelectorAll(":enabled").length ) {
1213
+ rbuggyQSA.push( ":enabled", ":disabled" );
1214
+ }
1215
+
1216
+ // Opera 10-11 does not throw on post-comma invalid pseudos
1217
+ div.querySelectorAll("*,:x");
1218
+ rbuggyQSA.push(",.*:");
1219
+ });
1220
+ }
1221
+
1222
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1223
+ docElem.webkitMatchesSelector ||
1224
+ docElem.mozMatchesSelector ||
1225
+ docElem.oMatchesSelector ||
1226
+ docElem.msMatchesSelector) )) ) {
1227
+
1228
+ assert(function( div ) {
1229
+ // Check to see if it's possible to do matchesSelector
1230
+ // on a disconnected node (IE 9)
1231
+ support.disconnectedMatch = matches.call( div, "div" );
1232
+
1233
+ // This should fail with an exception
1234
+ // Gecko does not error, returns false instead
1235
+ matches.call( div, "[s!='']:x" );
1236
+ rbuggyMatches.push( "!=", pseudos );
1237
+ });
1238
+ }
1239
+
1240
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1241
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1242
+
1243
+ /* Contains
1244
+ ---------------------------------------------------------------------- */
1245
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
1246
+
1247
+ // Element contains another
1248
+ // Purposefully does not implement inclusive descendent
1249
+ // As in, an element does not contain itself
1250
+ contains = hasCompare || rnative.test( docElem.contains ) ?
1251
+ function( a, b ) {
1252
+ var adown = a.nodeType === 9 ? a.documentElement : a,
1253
+ bup = b && b.parentNode;
1254
+ return a === bup || !!( bup && bup.nodeType === 1 && (
1255
+ adown.contains ?
1256
+ adown.contains( bup ) :
1257
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1258
+ ));
1259
+ } :
1260
+ function( a, b ) {
1261
+ if ( b ) {
1262
+ while ( (b = b.parentNode) ) {
1263
+ if ( b === a ) {
1264
+ return true;
1265
+ }
1266
+ }
1267
+ }
1268
+ return false;
1269
+ };
1270
+
1271
+ /* Sorting
1272
+ ---------------------------------------------------------------------- */
1273
+
1274
+ // Document order sorting
1275
+ sortOrder = hasCompare ?
1276
+ function( a, b ) {
1277
+
1278
+ // Flag for duplicate removal
1279
+ if ( a === b ) {
1280
+ hasDuplicate = true;
1281
+ return 0;
1282
+ }
1283
+
1284
+ // Sort on method existence if only one input has compareDocumentPosition
1285
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1286
+ if ( compare ) {
1287
+ return compare;
1288
+ }
1289
+
1290
+ // Calculate position if both inputs belong to the same document
1291
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1292
+ a.compareDocumentPosition( b ) :
1293
+
1294
+ // Otherwise we know they are disconnected
1295
+ 1;
1296
+
1297
+ // Disconnected nodes
1298
+ if ( compare & 1 ||
1299
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1300
+
1301
+ // Choose the first element that is related to our preferred document
1302
+ if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1303
+ return -1;
1304
+ }
1305
+ if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1306
+ return 1;
1307
+ }
1308
+
1309
+ // Maintain original order
1310
+ return sortInput ?
1311
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1312
+ 0;
1313
+ }
1314
+
1315
+ return compare & 4 ? -1 : 1;
1316
+ } :
1317
+ function( a, b ) {
1318
+ // Exit early if the nodes are identical
1319
+ if ( a === b ) {
1320
+ hasDuplicate = true;
1321
+ return 0;
1322
+ }
1323
+
1324
+ var cur,
1325
+ i = 0,
1326
+ aup = a.parentNode,
1327
+ bup = b.parentNode,
1328
+ ap = [ a ],
1329
+ bp = [ b ];
1330
+
1331
+ // Parentless nodes are either documents or disconnected
1332
+ if ( !aup || !bup ) {
1333
+ return a === doc ? -1 :
1334
+ b === doc ? 1 :
1335
+ aup ? -1 :
1336
+ bup ? 1 :
1337
+ sortInput ?
1338
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1339
+ 0;
1340
+
1341
+ // If the nodes are siblings, we can do a quick check
1342
+ } else if ( aup === bup ) {
1343
+ return siblingCheck( a, b );
1344
+ }
1345
+
1346
+ // Otherwise we need full lists of their ancestors for comparison
1347
+ cur = a;
1348
+ while ( (cur = cur.parentNode) ) {
1349
+ ap.unshift( cur );
1350
+ }
1351
+ cur = b;
1352
+ while ( (cur = cur.parentNode) ) {
1353
+ bp.unshift( cur );
1354
+ }
1355
+
1356
+ // Walk down the tree looking for a discrepancy
1357
+ while ( ap[i] === bp[i] ) {
1358
+ i++;
1359
+ }
1360
+
1361
+ return i ?
1362
+ // Do a sibling check if the nodes have a common ancestor
1363
+ siblingCheck( ap[i], bp[i] ) :
1364
+
1365
+ // Otherwise nodes in our document sort first
1366
+ ap[i] === preferredDoc ? -1 :
1367
+ bp[i] === preferredDoc ? 1 :
1368
+ 0;
1369
+ };
1370
+
1371
+ return doc;
1372
+ };
1373
+
1374
+ Sizzle.matches = function( expr, elements ) {
1375
+ return Sizzle( expr, null, null, elements );
1376
+ };
1377
+
1378
+ Sizzle.matchesSelector = function( elem, expr ) {
1379
+ // Set document vars if needed
1380
+ if ( ( elem.ownerDocument || elem ) !== document ) {
1381
+ setDocument( elem );
1382
+ }
1383
+
1384
+ // Make sure that attribute selectors are quoted
1385
+ expr = expr.replace( rattributeQuotes, "='$1']" );
1386
+
1387
+ if ( support.matchesSelector && documentIsHTML &&
1388
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1389
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1390
+
1391
+ try {
1392
+ var ret = matches.call( elem, expr );
1393
+
1394
+ // IE 9's matchesSelector returns false on disconnected nodes
1395
+ if ( ret || support.disconnectedMatch ||
1396
+ // As well, disconnected nodes are said to be in a document
1397
+ // fragment in IE 9
1398
+ elem.document && elem.document.nodeType !== 11 ) {
1399
+ return ret;
1400
+ }
1401
+ } catch(e) {}
1402
+ }
1403
+
1404
+ return Sizzle( expr, document, null, [ elem ] ).length > 0;
1405
+ };
1406
+
1407
+ Sizzle.contains = function( context, elem ) {
1408
+ // Set document vars if needed
1409
+ if ( ( context.ownerDocument || context ) !== document ) {
1410
+ setDocument( context );
1411
+ }
1412
+ return contains( context, elem );
1413
+ };
1414
+
1415
+ Sizzle.attr = function( elem, name ) {
1416
+ // Set document vars if needed
1417
+ if ( ( elem.ownerDocument || elem ) !== document ) {
1418
+ setDocument( elem );
1419
+ }
1420
+
1421
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
1422
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
1423
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1424
+ fn( elem, name, !documentIsHTML ) :
1425
+ undefined;
1426
+
1427
+ return val !== undefined ?
1428
+ val :
1429
+ support.attributes || !documentIsHTML ?
1430
+ elem.getAttribute( name ) :
1431
+ (val = elem.getAttributeNode(name)) && val.specified ?
1432
+ val.value :
1433
+ null;
1434
+ };
1435
+
1436
+ Sizzle.error = function( msg ) {
1437
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
1438
+ };
1439
+
1440
+ /**
1441
+ * Document sorting and removing duplicates
1442
+ * @param {ArrayLike} results
1443
+ */
1444
+ Sizzle.uniqueSort = function( results ) {
1445
+ var elem,
1446
+ duplicates = [],
1447
+ j = 0,
1448
+ i = 0;
1449
+
1450
+ // Unless we *know* we can detect duplicates, assume their presence
1451
+ hasDuplicate = !support.detectDuplicates;
1452
+ sortInput = !support.sortStable && results.slice( 0 );
1453
+ results.sort( sortOrder );
1454
+
1455
+ if ( hasDuplicate ) {
1456
+ while ( (elem = results[i++]) ) {
1457
+ if ( elem === results[ i ] ) {
1458
+ j = duplicates.push( i );
1459
+ }
1460
+ }
1461
+ while ( j-- ) {
1462
+ results.splice( duplicates[ j ], 1 );
1463
+ }
1464
+ }
1465
+
1466
+ // Clear input after sorting to release objects
1467
+ // See https://github.com/jquery/sizzle/pull/225
1468
+ sortInput = null;
1469
+
1470
+ return results;
1471
+ };
1472
+
1473
+ /**
1474
+ * Utility function for retrieving the text value of an array of DOM nodes
1475
+ * @param {Array|Element} elem
1476
+ */
1477
+ getText = Sizzle.getText = function( elem ) {
1478
+ var node,
1479
+ ret = "",
1480
+ i = 0,
1481
+ nodeType = elem.nodeType;
1482
+
1483
+ if ( !nodeType ) {
1484
+ // If no nodeType, this is expected to be an array
1485
+ while ( (node = elem[i++]) ) {
1486
+ // Do not traverse comment nodes
1487
+ ret += getText( node );
1488
+ }
1489
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1490
+ // Use textContent for elements
1491
+ // innerText usage removed for consistency of new lines (jQuery #11153)
1492
+ if ( typeof elem.textContent === "string" ) {
1493
+ return elem.textContent;
1494
+ } else {
1495
+ // Traverse its children
1496
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1497
+ ret += getText( elem );
1498
+ }
1499
+ }
1500
+ } else if ( nodeType === 3 || nodeType === 4 ) {
1501
+ return elem.nodeValue;
1502
+ }
1503
+ // Do not include comment or processing instruction nodes
1504
+
1505
+ return ret;
1506
+ };
1507
+
1508
+ Expr = Sizzle.selectors = {
1509
+
1510
+ // Can be adjusted by the user
1511
+ cacheLength: 50,
1512
+
1513
+ createPseudo: markFunction,
1514
+
1515
+ match: matchExpr,
1516
+
1517
+ attrHandle: {},
1518
+
1519
+ find: {},
1520
+
1521
+ relative: {
1522
+ ">": { dir: "parentNode", first: true },
1523
+ " ": { dir: "parentNode" },
1524
+ "+": { dir: "previousSibling", first: true },
1525
+ "~": { dir: "previousSibling" }
1526
+ },
1527
+
1528
+ preFilter: {
1529
+ "ATTR": function( match ) {
1530
+ match[1] = match[1].replace( runescape, funescape );
1531
+
1532
+ // Move the given value to match[3] whether quoted or unquoted
1533
+ match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1534
+
1535
+ if ( match[2] === "~=" ) {
1536
+ match[3] = " " + match[3] + " ";
1537
+ }
1538
+
1539
+ return match.slice( 0, 4 );
1540
+ },
1541
+
1542
+ "CHILD": function( match ) {
1543
+ /* matches from matchExpr["CHILD"]
1544
+ 1 type (only|nth|...)
1545
+ 2 what (child|of-type)
1546
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1547
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
1548
+ 5 sign of xn-component
1549
+ 6 x of xn-component
1550
+ 7 sign of y-component
1551
+ 8 y of y-component
1552
+ */
1553
+ match[1] = match[1].toLowerCase();
1554
+
1555
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
1556
+ // nth-* requires argument
1557
+ if ( !match[3] ) {
1558
+ Sizzle.error( match[0] );
1559
+ }
1560
+
1561
+ // numeric x and y parameters for Expr.filter.CHILD
1562
+ // remember that false/true cast respectively to 0/1
1563
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1564
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1565
+
1566
+ // other types prohibit arguments
1567
+ } else if ( match[3] ) {
1568
+ Sizzle.error( match[0] );
1569
+ }
1570
+
1571
+ return match;
1572
+ },
1573
+
1574
+ "PSEUDO": function( match ) {
1575
+ var excess,
1576
+ unquoted = !match[6] && match[2];
1577
+
1578
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
1579
+ return null;
1580
+ }
1581
+
1582
+ // Accept quoted arguments as-is
1583
+ if ( match[3] ) {
1584
+ match[2] = match[4] || match[5] || "";
1585
+
1586
+ // Strip excess characters from unquoted arguments
1587
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
1588
+ // Get excess from tokenize (recursively)
1589
+ (excess = tokenize( unquoted, true )) &&
1590
+ // advance to the next closing parenthesis
1591
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1592
+
1593
+ // excess is a negative index
1594
+ match[0] = match[0].slice( 0, excess );
1595
+ match[2] = unquoted.slice( 0, excess );
1596
+ }
1597
+
1598
+ // Return only captures needed by the pseudo filter method (type and argument)
1599
+ return match.slice( 0, 3 );
1600
+ }
1601
+ },
1602
+
1603
+ filter: {
1604
+
1605
+ "TAG": function( nodeNameSelector ) {
1606
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1607
+ return nodeNameSelector === "*" ?
1608
+ function() { return true; } :
1609
+ function( elem ) {
1610
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1611
+ };
1612
+ },
1613
+
1614
+ "CLASS": function( className ) {
1615
+ var pattern = classCache[ className + " " ];
1616
+
1617
+ return pattern ||
1618
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1619
+ classCache( className, function( elem ) {
1620
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
1621
+ });
1622
+ },
1623
+
1624
+ "ATTR": function( name, operator, check ) {
1625
+ return function( elem ) {
1626
+ var result = Sizzle.attr( elem, name );
1627
+
1628
+ if ( result == null ) {
1629
+ return operator === "!=";
1630
+ }
1631
+ if ( !operator ) {
1632
+ return true;
1633
+ }
1634
+
1635
+ result += "";
1636
+
1637
+ return operator === "=" ? result === check :
1638
+ operator === "!=" ? result !== check :
1639
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
1640
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
1641
+ operator === "$=" ? check && result.slice( -check.length ) === check :
1642
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
1643
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1644
+ false;
1645
+ };
1646
+ },
1647
+
1648
+ "CHILD": function( type, what, argument, first, last ) {
1649
+ var simple = type.slice( 0, 3 ) !== "nth",
1650
+ forward = type.slice( -4 ) !== "last",
1651
+ ofType = what === "of-type";
1652
+
1653
+ return first === 1 && last === 0 ?
1654
+
1655
+ // Shortcut for :nth-*(n)
1656
+ function( elem ) {
1657
+ return !!elem.parentNode;
1658
+ } :
1659
+
1660
+ function( elem, context, xml ) {
1661
+ var cache, outerCache, node, diff, nodeIndex, start,
1662
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
1663
+ parent = elem.parentNode,
1664
+ name = ofType && elem.nodeName.toLowerCase(),
1665
+ useCache = !xml && !ofType;
1666
+
1667
+ if ( parent ) {
1668
+
1669
+ // :(first|last|only)-(child|of-type)
1670
+ if ( simple ) {
1671
+ while ( dir ) {
1672
+ node = elem;
1673
+ while ( (node = node[ dir ]) ) {
1674
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
1675
+ return false;
1676
+ }
1677
+ }
1678
+ // Reverse direction for :only-* (if we haven't yet done so)
1679
+ start = dir = type === "only" && !start && "nextSibling";
1680
+ }
1681
+ return true;
1682
+ }
1683
+
1684
+ start = [ forward ? parent.firstChild : parent.lastChild ];
1685
+
1686
+ // non-xml :nth-child(...) stores cache data on `parent`
1687
+ if ( forward && useCache ) {
1688
+ // Seek `elem` from a previously-cached index
1689
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
1690
+ cache = outerCache[ type ] || [];
1691
+ nodeIndex = cache[0] === dirruns && cache[1];
1692
+ diff = cache[0] === dirruns && cache[2];
1693
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
1694
+
1695
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
1696
+
1697
+ // Fallback to seeking `elem` from the start
1698
+ (diff = nodeIndex = 0) || start.pop()) ) {
1699
+
1700
+ // When found, cache indexes on `parent` and break
1701
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
1702
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
1703
+ break;
1704
+ }
1705
+ }
1706
+
1707
+ // Use previously-cached element index if available
1708
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
1709
+ diff = cache[1];
1710
+
1711
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
1712
+ } else {
1713
+ // Use the same loop as above to seek `elem` from the start
1714
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
1715
+ (diff = nodeIndex = 0) || start.pop()) ) {
1716
+
1717
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
1718
+ // Cache the index of each encountered element
1719
+ if ( useCache ) {
1720
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
1721
+ }
1722
+
1723
+ if ( node === elem ) {
1724
+ break;
1725
+ }
1726
+ }
1727
+ }
1728
+ }
1729
+
1730
+ // Incorporate the offset, then check against cycle size
1731
+ diff -= last;
1732
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
1733
+ }
1734
+ };
1735
+ },
1736
+
1737
+ "PSEUDO": function( pseudo, argument ) {
1738
+ // pseudo-class names are case-insensitive
1739
+ // http://www.w3.org/TR/selectors/#pseudo-classes
1740
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1741
+ // Remember that setFilters inherits from pseudos
1742
+ var args,
1743
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1744
+ Sizzle.error( "unsupported pseudo: " + pseudo );
1745
+
1746
+ // The user may use createPseudo to indicate that
1747
+ // arguments are needed to create the filter function
1748
+ // just as Sizzle does
1749
+ if ( fn[ expando ] ) {
1750
+ return fn( argument );
1751
+ }
1752
+
1753
+ // But maintain support for old signatures
1754
+ if ( fn.length > 1 ) {
1755
+ args = [ pseudo, pseudo, "", argument ];
1756
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1757
+ markFunction(function( seed, matches ) {
1758
+ var idx,
1759
+ matched = fn( seed, argument ),
1760
+ i = matched.length;
1761
+ while ( i-- ) {
1762
+ idx = indexOf.call( seed, matched[i] );
1763
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
1764
+ }
1765
+ }) :
1766
+ function( elem ) {
1767
+ return fn( elem, 0, args );
1768
+ };
1769
+ }
1770
+
1771
+ return fn;
1772
+ }
1773
+ },
1774
+
1775
+ pseudos: {
1776
+ // Potentially complex pseudos
1777
+ "not": markFunction(function( selector ) {
1778
+ // Trim the selector passed to compile
1779
+ // to avoid treating leading and trailing
1780
+ // spaces as combinators
1781
+ var input = [],
1782
+ results = [],
1783
+ matcher = compile( selector.replace( rtrim, "$1" ) );
1784
+
1785
+ return matcher[ expando ] ?
1786
+ markFunction(function( seed, matches, context, xml ) {
1787
+ var elem,
1788
+ unmatched = matcher( seed, null, xml, [] ),
1789
+ i = seed.length;
1790
+
1791
+ // Match elements unmatched by `matcher`
1792
+ while ( i-- ) {
1793
+ if ( (elem = unmatched[i]) ) {
1794
+ seed[i] = !(matches[i] = elem);
1795
+ }
1796
+ }
1797
+ }) :
1798
+ function( elem, context, xml ) {
1799
+ input[0] = elem;
1800
+ matcher( input, null, xml, results );
1801
+ return !results.pop();
1802
+ };
1803
+ }),
1804
+
1805
+ "has": markFunction(function( selector ) {
1806
+ return function( elem ) {
1807
+ return Sizzle( selector, elem ).length > 0;
1808
+ };
1809
+ }),
1810
+
1811
+ "contains": markFunction(function( text ) {
1812
+ return function( elem ) {
1813
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1814
+ };
1815
+ }),
1816
+
1817
+ // "Whether an element is represented by a :lang() selector
1818
+ // is based solely on the element's language value
1819
+ // being equal to the identifier C,
1820
+ // or beginning with the identifier C immediately followed by "-".
1821
+ // The matching of C against the element's language value is performed case-insensitively.
1822
+ // The identifier C does not have to be a valid language name."
1823
+ // http://www.w3.org/TR/selectors/#lang-pseudo
1824
+ "lang": markFunction( function( lang ) {
1825
+ // lang value must be a valid identifier
1826
+ if ( !ridentifier.test(lang || "") ) {
1827
+ Sizzle.error( "unsupported lang: " + lang );
1828
+ }
1829
+ lang = lang.replace( runescape, funescape ).toLowerCase();
1830
+ return function( elem ) {
1831
+ var elemLang;
1832
+ do {
1833
+ if ( (elemLang = documentIsHTML ?
1834
+ elem.lang :
1835
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
1836
+
1837
+ elemLang = elemLang.toLowerCase();
1838
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
1839
+ }
1840
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1841
+ return false;
1842
+ };
1843
+ }),
1844
+
1845
+ // Miscellaneous
1846
+ "target": function( elem ) {
1847
+ var hash = window.location && window.location.hash;
1848
+ return hash && hash.slice( 1 ) === elem.id;
1849
+ },
1850
+
1851
+ "root": function( elem ) {
1852
+ return elem === docElem;
1853
+ },
1854
+
1855
+ "focus": function( elem ) {
1856
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1857
+ },
1858
+
1859
+ // Boolean properties
1860
+ "enabled": function( elem ) {
1861
+ return elem.disabled === false;
1862
+ },
1863
+
1864
+ "disabled": function( elem ) {
1865
+ return elem.disabled === true;
1866
+ },
1867
+
1868
+ "checked": function( elem ) {
1869
+ // In CSS3, :checked should return both checked and selected elements
1870
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1871
+ var nodeName = elem.nodeName.toLowerCase();
1872
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
1873
+ },
1874
+
1875
+ "selected": function( elem ) {
1876
+ // Accessing this property makes selected-by-default
1877
+ // options in Safari work properly
1878
+ if ( elem.parentNode ) {
1879
+ elem.parentNode.selectedIndex;
1880
+ }
1881
+
1882
+ return elem.selected === true;
1883
+ },
1884
+
1885
+ // Contents
1886
+ "empty": function( elem ) {
1887
+ // http://www.w3.org/TR/selectors/#empty-pseudo
1888
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
1889
+ // but not by others (comment: 8; processing instruction: 7; etc.)
1890
+ // nodeType < 6 works because attributes (2) do not appear as children
1891
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1892
+ if ( elem.nodeType < 6 ) {
1893
+ return false;
1894
+ }
1895
+ }
1896
+ return true;
1897
+ },
1898
+
1899
+ "parent": function( elem ) {
1900
+ return !Expr.pseudos["empty"]( elem );
1901
+ },
1902
+
1903
+ // Element/input types
1904
+ "header": function( elem ) {
1905
+ return rheader.test( elem.nodeName );
1906
+ },
1907
+
1908
+ "input": function( elem ) {
1909
+ return rinputs.test( elem.nodeName );
1910
+ },
1911
+
1912
+ "button": function( elem ) {
1913
+ var name = elem.nodeName.toLowerCase();
1914
+ return name === "input" && elem.type === "button" || name === "button";
1915
+ },
1916
+
1917
+ "text": function( elem ) {
1918
+ var attr;
1919
+ return elem.nodeName.toLowerCase() === "input" &&
1920
+ elem.type === "text" &&
1921
+
1922
+ // Support: IE<8
1923
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
1924
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
1925
+ },
1926
+
1927
+ // Position-in-collection
1928
+ "first": createPositionalPseudo(function() {
1929
+ return [ 0 ];
1930
+ }),
1931
+
1932
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
1933
+ return [ length - 1 ];
1934
+ }),
1935
+
1936
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
1937
+ return [ argument < 0 ? argument + length : argument ];
1938
+ }),
1939
+
1940
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
1941
+ var i = 0;
1942
+ for ( ; i < length; i += 2 ) {
1943
+ matchIndexes.push( i );
1944
+ }
1945
+ return matchIndexes;
1946
+ }),
1947
+
1948
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
1949
+ var i = 1;
1950
+ for ( ; i < length; i += 2 ) {
1951
+ matchIndexes.push( i );
1952
+ }
1953
+ return matchIndexes;
1954
+ }),
1955
+
1956
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
1957
+ var i = argument < 0 ? argument + length : argument;
1958
+ for ( ; --i >= 0; ) {
1959
+ matchIndexes.push( i );
1960
+ }
1961
+ return matchIndexes;
1962
+ }),
1963
+
1964
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
1965
+ var i = argument < 0 ? argument + length : argument;
1966
+ for ( ; ++i < length; ) {
1967
+ matchIndexes.push( i );
1968
+ }
1969
+ return matchIndexes;
1970
+ })
1971
+ }
1972
+ };
1973
+
1974
+ Expr.pseudos["nth"] = Expr.pseudos["eq"];
1975
+
1976
+ // Add button/input type pseudos
1977
+ for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
1978
+ Expr.pseudos[ i ] = createInputPseudo( i );
1979
+ }
1980
+ for ( i in { submit: true, reset: true } ) {
1981
+ Expr.pseudos[ i ] = createButtonPseudo( i );
1982
+ }
1983
+
1984
+ // Easy API for creating new setFilters
1985
+ function setFilters() {}
1986
+ setFilters.prototype = Expr.filters = Expr.pseudos;
1987
+ Expr.setFilters = new setFilters();
1988
+
1989
+ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
1990
+ var matched, match, tokens, type,
1991
+ soFar, groups, preFilters,
1992
+ cached = tokenCache[ selector + " " ];
1993
+
1994
+ if ( cached ) {
1995
+ return parseOnly ? 0 : cached.slice( 0 );
1996
+ }
1997
+
1998
+ soFar = selector;
1999
+ groups = [];
2000
+ preFilters = Expr.preFilter;
2001
+
2002
+ while ( soFar ) {
2003
+
2004
+ // Comma and first run
2005
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
2006
+ if ( match ) {
2007
+ // Don't consume trailing commas as valid
2008
+ soFar = soFar.slice( match[0].length ) || soFar;
2009
+ }
2010
+ groups.push( (tokens = []) );
2011
+ }
2012
+
2013
+ matched = false;
2014
+
2015
+ // Combinators
2016
+ if ( (match = rcombinators.exec( soFar )) ) {
2017
+ matched = match.shift();
2018
+ tokens.push({
2019
+ value: matched,
2020
+ // Cast descendant combinators to space
2021
+ type: match[0].replace( rtrim, " " )
2022
+ });
2023
+ soFar = soFar.slice( matched.length );
2024
+ }
2025
+
2026
+ // Filters
2027
+ for ( type in Expr.filter ) {
2028
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2029
+ (match = preFilters[ type ]( match ))) ) {
2030
+ matched = match.shift();
2031
+ tokens.push({
2032
+ value: matched,
2033
+ type: type,
2034
+ matches: match
2035
+ });
2036
+ soFar = soFar.slice( matched.length );
2037
+ }
2038
+ }
2039
+
2040
+ if ( !matched ) {
2041
+ break;
2042
+ }
2043
+ }
2044
+
2045
+ // Return the length of the invalid excess
2046
+ // if we're just parsing
2047
+ // Otherwise, throw an error or return tokens
2048
+ return parseOnly ?
2049
+ soFar.length :
2050
+ soFar ?
2051
+ Sizzle.error( selector ) :
2052
+ // Cache the tokens
2053
+ tokenCache( selector, groups ).slice( 0 );
2054
+ };
2055
+
2056
+ function toSelector( tokens ) {
2057
+ var i = 0,
2058
+ len = tokens.length,
2059
+ selector = "";
2060
+ for ( ; i < len; i++ ) {
2061
+ selector += tokens[i].value;
2062
+ }
2063
+ return selector;
2064
+ }
2065
+
2066
+ function addCombinator( matcher, combinator, base ) {
2067
+ var dir = combinator.dir,
2068
+ checkNonElements = base && dir === "parentNode",
2069
+ doneName = done++;
2070
+
2071
+ return combinator.first ?
2072
+ // Check against closest ancestor/preceding element
2073
+ function( elem, context, xml ) {
2074
+ while ( (elem = elem[ dir ]) ) {
2075
+ if ( elem.nodeType === 1 || checkNonElements ) {
2076
+ return matcher( elem, context, xml );
2077
+ }
2078
+ }
2079
+ } :
2080
+
2081
+ // Check against all ancestor/preceding elements
2082
+ function( elem, context, xml ) {
2083
+ var oldCache, outerCache,
2084
+ newCache = [ dirruns, doneName ];
2085
+
2086
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
2087
+ if ( xml ) {
2088
+ while ( (elem = elem[ dir ]) ) {
2089
+ if ( elem.nodeType === 1 || checkNonElements ) {
2090
+ if ( matcher( elem, context, xml ) ) {
2091
+ return true;
2092
+ }
2093
+ }
2094
+ }
2095
+ } else {
2096
+ while ( (elem = elem[ dir ]) ) {
2097
+ if ( elem.nodeType === 1 || checkNonElements ) {
2098
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
2099
+ if ( (oldCache = outerCache[ dir ]) &&
2100
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2101
+
2102
+ // Assign to newCache so results back-propagate to previous elements
2103
+ return (newCache[ 2 ] = oldCache[ 2 ]);
2104
+ } else {
2105
+ // Reuse newcache so results back-propagate to previous elements
2106
+ outerCache[ dir ] = newCache;
2107
+
2108
+ // A match means we're done; a fail means we have to keep checking
2109
+ if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2110
+ return true;
2111
+ }
2112
+ }
2113
+ }
2114
+ }
2115
+ }
2116
+ };
2117
+ }
2118
+
2119
+ function elementMatcher( matchers ) {
2120
+ return matchers.length > 1 ?
2121
+ function( elem, context, xml ) {
2122
+ var i = matchers.length;
2123
+ while ( i-- ) {
2124
+ if ( !matchers[i]( elem, context, xml ) ) {
2125
+ return false;
2126
+ }
2127
+ }
2128
+ return true;
2129
+ } :
2130
+ matchers[0];
2131
+ }
2132
+
2133
+ function multipleContexts( selector, contexts, results ) {
2134
+ var i = 0,
2135
+ len = contexts.length;
2136
+ for ( ; i < len; i++ ) {
2137
+ Sizzle( selector, contexts[i], results );
2138
+ }
2139
+ return results;
2140
+ }
2141
+
2142
+ function condense( unmatched, map, filter, context, xml ) {
2143
+ var elem,
2144
+ newUnmatched = [],
2145
+ i = 0,
2146
+ len = unmatched.length,
2147
+ mapped = map != null;
2148
+
2149
+ for ( ; i < len; i++ ) {
2150
+ if ( (elem = unmatched[i]) ) {
2151
+ if ( !filter || filter( elem, context, xml ) ) {
2152
+ newUnmatched.push( elem );
2153
+ if ( mapped ) {
2154
+ map.push( i );
2155
+ }
2156
+ }
2157
+ }
2158
+ }
2159
+
2160
+ return newUnmatched;
2161
+ }
2162
+
2163
+ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2164
+ if ( postFilter && !postFilter[ expando ] ) {
2165
+ postFilter = setMatcher( postFilter );
2166
+ }
2167
+ if ( postFinder && !postFinder[ expando ] ) {
2168
+ postFinder = setMatcher( postFinder, postSelector );
2169
+ }
2170
+ return markFunction(function( seed, results, context, xml ) {
2171
+ var temp, i, elem,
2172
+ preMap = [],
2173
+ postMap = [],
2174
+ preexisting = results.length,
2175
+
2176
+ // Get initial elements from seed or context
2177
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2178
+
2179
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
2180
+ matcherIn = preFilter && ( seed || !selector ) ?
2181
+ condense( elems, preMap, preFilter, context, xml ) :
2182
+ elems,
2183
+
2184
+ matcherOut = matcher ?
2185
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2186
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2187
+
2188
+ // ...intermediate processing is necessary
2189
+ [] :
2190
+
2191
+ // ...otherwise use results directly
2192
+ results :
2193
+ matcherIn;
2194
+
2195
+ // Find primary matches
2196
+ if ( matcher ) {
2197
+ matcher( matcherIn, matcherOut, context, xml );
2198
+ }
2199
+
2200
+ // Apply postFilter
2201
+ if ( postFilter ) {
2202
+ temp = condense( matcherOut, postMap );
2203
+ postFilter( temp, [], context, xml );
2204
+
2205
+ // Un-match failing elements by moving them back to matcherIn
2206
+ i = temp.length;
2207
+ while ( i-- ) {
2208
+ if ( (elem = temp[i]) ) {
2209
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2210
+ }
2211
+ }
2212
+ }
2213
+
2214
+ if ( seed ) {
2215
+ if ( postFinder || preFilter ) {
2216
+ if ( postFinder ) {
2217
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
2218
+ temp = [];
2219
+ i = matcherOut.length;
2220
+ while ( i-- ) {
2221
+ if ( (elem = matcherOut[i]) ) {
2222
+ // Restore matcherIn since elem is not yet a final match
2223
+ temp.push( (matcherIn[i] = elem) );
2224
+ }
2225
+ }
2226
+ postFinder( null, (matcherOut = []), temp, xml );
2227
+ }
2228
+
2229
+ // Move matched elements from seed to results to keep them synchronized
2230
+ i = matcherOut.length;
2231
+ while ( i-- ) {
2232
+ if ( (elem = matcherOut[i]) &&
2233
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
2234
+
2235
+ seed[temp] = !(results[temp] = elem);
2236
+ }
2237
+ }
2238
+ }
2239
+
2240
+ // Add elements to results, through postFinder if defined
2241
+ } else {
2242
+ matcherOut = condense(
2243
+ matcherOut === results ?
2244
+ matcherOut.splice( preexisting, matcherOut.length ) :
2245
+ matcherOut
2246
+ );
2247
+ if ( postFinder ) {
2248
+ postFinder( null, results, matcherOut, xml );
2249
+ } else {
2250
+ push.apply( results, matcherOut );
2251
+ }
2252
+ }
2253
+ });
2254
+ }
2255
+
2256
+ function matcherFromTokens( tokens ) {
2257
+ var checkContext, matcher, j,
2258
+ len = tokens.length,
2259
+ leadingRelative = Expr.relative[ tokens[0].type ],
2260
+ implicitRelative = leadingRelative || Expr.relative[" "],
2261
+ i = leadingRelative ? 1 : 0,
2262
+
2263
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
2264
+ matchContext = addCombinator( function( elem ) {
2265
+ return elem === checkContext;
2266
+ }, implicitRelative, true ),
2267
+ matchAnyContext = addCombinator( function( elem ) {
2268
+ return indexOf.call( checkContext, elem ) > -1;
2269
+ }, implicitRelative, true ),
2270
+ matchers = [ function( elem, context, xml ) {
2271
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2272
+ (checkContext = context).nodeType ?
2273
+ matchContext( elem, context, xml ) :
2274
+ matchAnyContext( elem, context, xml ) );
2275
+ } ];
2276
+
2277
+ for ( ; i < len; i++ ) {
2278
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2279
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2280
+ } else {
2281
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2282
+
2283
+ // Return special upon seeing a positional matcher
2284
+ if ( matcher[ expando ] ) {
2285
+ // Find the next relative operator (if any) for proper handling
2286
+ j = ++i;
2287
+ for ( ; j < len; j++ ) {
2288
+ if ( Expr.relative[ tokens[j].type ] ) {
2289
+ break;
2290
+ }
2291
+ }
2292
+ return setMatcher(
2293
+ i > 1 && elementMatcher( matchers ),
2294
+ i > 1 && toSelector(
2295
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2296
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2297
+ ).replace( rtrim, "$1" ),
2298
+ matcher,
2299
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
2300
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2301
+ j < len && toSelector( tokens )
2302
+ );
2303
+ }
2304
+ matchers.push( matcher );
2305
+ }
2306
+ }
2307
+
2308
+ return elementMatcher( matchers );
2309
+ }
2310
+
2311
+ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2312
+ var bySet = setMatchers.length > 0,
2313
+ byElement = elementMatchers.length > 0,
2314
+ superMatcher = function( seed, context, xml, results, outermost ) {
2315
+ var elem, j, matcher,
2316
+ matchedCount = 0,
2317
+ i = "0",
2318
+ unmatched = seed && [],
2319
+ setMatched = [],
2320
+ contextBackup = outermostContext,
2321
+ // We must always have either seed elements or outermost context
2322
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2323
+ // Use integer dirruns iff this is the outermost matcher
2324
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2325
+ len = elems.length;
2326
+
2327
+ if ( outermost ) {
2328
+ outermostContext = context !== document && context;
2329
+ }
2330
+
2331
+ // Add elements passing elementMatchers directly to results
2332
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
2333
+ // Support: IE<9, Safari
2334
+ // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2335
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2336
+ if ( byElement && elem ) {
2337
+ j = 0;
2338
+ while ( (matcher = elementMatchers[j++]) ) {
2339
+ if ( matcher( elem, context, xml ) ) {
2340
+ results.push( elem );
2341
+ break;
2342
+ }
2343
+ }
2344
+ if ( outermost ) {
2345
+ dirruns = dirrunsUnique;
2346
+ }
2347
+ }
2348
+
2349
+ // Track unmatched elements for set filters
2350
+ if ( bySet ) {
2351
+ // They will have gone through all possible matchers
2352
+ if ( (elem = !matcher && elem) ) {
2353
+ matchedCount--;
2354
+ }
2355
+
2356
+ // Lengthen the array for every element, matched or not
2357
+ if ( seed ) {
2358
+ unmatched.push( elem );
2359
+ }
2360
+ }
2361
+ }
2362
+
2363
+ // Apply set filters to unmatched elements
2364
+ matchedCount += i;
2365
+ if ( bySet && i !== matchedCount ) {
2366
+ j = 0;
2367
+ while ( (matcher = setMatchers[j++]) ) {
2368
+ matcher( unmatched, setMatched, context, xml );
2369
+ }
2370
+
2371
+ if ( seed ) {
2372
+ // Reintegrate element matches to eliminate the need for sorting
2373
+ if ( matchedCount > 0 ) {
2374
+ while ( i-- ) {
2375
+ if ( !(unmatched[i] || setMatched[i]) ) {
2376
+ setMatched[i] = pop.call( results );
2377
+ }
2378
+ }
2379
+ }
2380
+
2381
+ // Discard index placeholder values to get only actual matches
2382
+ setMatched = condense( setMatched );
2383
+ }
2384
+
2385
+ // Add matches to results
2386
+ push.apply( results, setMatched );
2387
+
2388
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
2389
+ if ( outermost && !seed && setMatched.length > 0 &&
2390
+ ( matchedCount + setMatchers.length ) > 1 ) {
2391
+
2392
+ Sizzle.uniqueSort( results );
2393
+ }
2394
+ }
2395
+
2396
+ // Override manipulation of globals by nested matchers
2397
+ if ( outermost ) {
2398
+ dirruns = dirrunsUnique;
2399
+ outermostContext = contextBackup;
2400
+ }
2401
+
2402
+ return unmatched;
2403
+ };
2404
+
2405
+ return bySet ?
2406
+ markFunction( superMatcher ) :
2407
+ superMatcher;
2408
+ }
2409
+
2410
+ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2411
+ var i,
2412
+ setMatchers = [],
2413
+ elementMatchers = [],
2414
+ cached = compilerCache[ selector + " " ];
2415
+
2416
+ if ( !cached ) {
2417
+ // Generate a function of recursive functions that can be used to check each element
2418
+ if ( !match ) {
2419
+ match = tokenize( selector );
2420
+ }
2421
+ i = match.length;
2422
+ while ( i-- ) {
2423
+ cached = matcherFromTokens( match[i] );
2424
+ if ( cached[ expando ] ) {
2425
+ setMatchers.push( cached );
2426
+ } else {
2427
+ elementMatchers.push( cached );
2428
+ }
2429
+ }
2430
+
2431
+ // Cache the compiled function
2432
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2433
+
2434
+ // Save selector and tokenization
2435
+ cached.selector = selector;
2436
+ }
2437
+ return cached;
2438
+ };
2439
+
2440
+ /**
2441
+ * A low-level selection function that works with Sizzle's compiled
2442
+ * selector functions
2443
+ * @param {String|Function} selector A selector or a pre-compiled
2444
+ * selector function built with Sizzle.compile
2445
+ * @param {Element} context
2446
+ * @param {Array} [results]
2447
+ * @param {Array} [seed] A set of elements to match against
2448
+ */
2449
+ select = Sizzle.select = function( selector, context, results, seed ) {
2450
+ var i, tokens, token, type, find,
2451
+ compiled = typeof selector === "function" && selector,
2452
+ match = !seed && tokenize( (selector = compiled.selector || selector) );
2453
+
2454
+ results = results || [];
2455
+
2456
+ // Try to minimize operations if there is no seed and only one group
2457
+ if ( match.length === 1 ) {
2458
+
2459
+ // Take a shortcut and set the context if the root selector is an ID
2460
+ tokens = match[0] = match[0].slice( 0 );
2461
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2462
+ support.getById && context.nodeType === 9 && documentIsHTML &&
2463
+ Expr.relative[ tokens[1].type ] ) {
2464
+
2465
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2466
+ if ( !context ) {
2467
+ return results;
2468
+
2469
+ // Precompiled matchers will still verify ancestry, so step up a level
2470
+ } else if ( compiled ) {
2471
+ context = context.parentNode;
2472
+ }
2473
+
2474
+ selector = selector.slice( tokens.shift().value.length );
2475
+ }
2476
+
2477
+ // Fetch a seed set for right-to-left matching
2478
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2479
+ while ( i-- ) {
2480
+ token = tokens[i];
2481
+
2482
+ // Abort if we hit a combinator
2483
+ if ( Expr.relative[ (type = token.type) ] ) {
2484
+ break;
2485
+ }
2486
+ if ( (find = Expr.find[ type ]) ) {
2487
+ // Search, expanding context for leading sibling combinators
2488
+ if ( (seed = find(
2489
+ token.matches[0].replace( runescape, funescape ),
2490
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2491
+ )) ) {
2492
+
2493
+ // If seed is empty or no tokens remain, we can return early
2494
+ tokens.splice( i, 1 );
2495
+ selector = seed.length && toSelector( tokens );
2496
+ if ( !selector ) {
2497
+ push.apply( results, seed );
2498
+ return results;
2499
+ }
2500
+
2501
+ break;
2502
+ }
2503
+ }
2504
+ }
2505
+ }
2506
+
2507
+ // Compile and execute a filtering function if one is not provided
2508
+ // Provide `match` to avoid retokenization if we modified the selector above
2509
+ ( compiled || compile( selector, match ) )(
2510
+ seed,
2511
+ context,
2512
+ !documentIsHTML,
2513
+ results,
2514
+ rsibling.test( selector ) && testContext( context.parentNode ) || context
2515
+ );
2516
+ return results;
2517
+ };
2518
+
2519
+ // One-time assignments
2520
+
2521
+ // Sort stability
2522
+ support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2523
+
2524
+ // Support: Chrome<14
2525
+ // Always assume duplicates if they aren't passed to the comparison function
2526
+ support.detectDuplicates = !!hasDuplicate;
2527
+
2528
+ // Initialize against the default document
2529
+ setDocument();
2530
+
2531
+ // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2532
+ // Detached nodes confoundingly follow *each other*
2533
+ support.sortDetached = assert(function( div1 ) {
2534
+ // Should return 1, but returns 4 (following)
2535
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
2536
+ });
2537
+
2538
+ // Support: IE<8
2539
+ // Prevent attribute/property "interpolation"
2540
+ // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2541
+ if ( !assert(function( div ) {
2542
+ div.innerHTML = "<a href='#'></a>";
2543
+ return div.firstChild.getAttribute("href") === "#" ;
2544
+ }) ) {
2545
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
2546
+ if ( !isXML ) {
2547
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2548
+ }
2549
+ });
2550
+ }
2551
+
2552
+ // Support: IE<9
2553
+ // Use defaultValue in place of getAttribute("value")
2554
+ if ( !support.attributes || !assert(function( div ) {
2555
+ div.innerHTML = "<input/>";
2556
+ div.firstChild.setAttribute( "value", "" );
2557
+ return div.firstChild.getAttribute( "value" ) === "";
2558
+ }) ) {
2559
+ addHandle( "value", function( elem, name, isXML ) {
2560
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2561
+ return elem.defaultValue;
2562
+ }
2563
+ });
2564
+ }
2565
+
2566
+ // Support: IE<9
2567
+ // Use getAttributeNode to fetch booleans when getAttribute lies
2568
+ if ( !assert(function( div ) {
2569
+ return div.getAttribute("disabled") == null;
2570
+ }) ) {
2571
+ addHandle( booleans, function( elem, name, isXML ) {
2572
+ var val;
2573
+ if ( !isXML ) {
2574
+ return elem[ name ] === true ? name.toLowerCase() :
2575
+ (val = elem.getAttributeNode( name )) && val.specified ?
2576
+ val.value :
2577
+ null;
2578
+ }
2579
+ });
2580
+ }
2581
+
2582
+ return Sizzle;
2583
+
2584
+ })( window );
2585
+
2586
+
2587
+
2588
+ jQuery.find = Sizzle;
2589
+ jQuery.expr = Sizzle.selectors;
2590
+ jQuery.expr[":"] = jQuery.expr.pseudos;
2591
+ jQuery.unique = Sizzle.uniqueSort;
2592
+ jQuery.text = Sizzle.getText;
2593
+ jQuery.isXMLDoc = Sizzle.isXML;
2594
+ jQuery.contains = Sizzle.contains;
2595
+
2596
+
2597
+
2598
+ var rneedsContext = jQuery.expr.match.needsContext;
2599
+
2600
+ var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
2601
+
2602
+
2603
+
2604
+ var risSimple = /^.[^:#\[\.,]*$/;
2605
+
2606
+ // Implement the identical functionality for filter and not
2607
+ function winnow( elements, qualifier, not ) {
2608
+ if ( jQuery.isFunction( qualifier ) ) {
2609
+ return jQuery.grep( elements, function( elem, i ) {
2610
+ /* jshint -W018 */
2611
+ return !!qualifier.call( elem, i, elem ) !== not;
2612
+ });
2613
+
2614
+ }
2615
+
2616
+ if ( qualifier.nodeType ) {
2617
+ return jQuery.grep( elements, function( elem ) {
2618
+ return ( elem === qualifier ) !== not;
2619
+ });
2620
+
2621
+ }
2622
+
2623
+ if ( typeof qualifier === "string" ) {
2624
+ if ( risSimple.test( qualifier ) ) {
2625
+ return jQuery.filter( qualifier, elements, not );
2626
+ }
2627
+
2628
+ qualifier = jQuery.filter( qualifier, elements );
2629
+ }
2630
+
2631
+ return jQuery.grep( elements, function( elem ) {
2632
+ return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
2633
+ });
2634
+ }
2635
+
2636
+ jQuery.filter = function( expr, elems, not ) {
2637
+ var elem = elems[ 0 ];
2638
+
2639
+ if ( not ) {
2640
+ expr = ":not(" + expr + ")";
2641
+ }
2642
+
2643
+ return elems.length === 1 && elem.nodeType === 1 ?
2644
+ jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
2645
+ jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2646
+ return elem.nodeType === 1;
2647
+ }));
2648
+ };
2649
+
2650
+ jQuery.fn.extend({
2651
+ find: function( selector ) {
2652
+ var i,
2653
+ len = this.length,
2654
+ ret = [],
2655
+ self = this;
2656
+
2657
+ if ( typeof selector !== "string" ) {
2658
+ return this.pushStack( jQuery( selector ).filter(function() {
2659
+ for ( i = 0; i < len; i++ ) {
2660
+ if ( jQuery.contains( self[ i ], this ) ) {
2661
+ return true;
2662
+ }
2663
+ }
2664
+ }) );
2665
+ }
2666
+
2667
+ for ( i = 0; i < len; i++ ) {
2668
+ jQuery.find( selector, self[ i ], ret );
2669
+ }
2670
+
2671
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
2672
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
2673
+ ret.selector = this.selector ? this.selector + " " + selector : selector;
2674
+ return ret;
2675
+ },
2676
+ filter: function( selector ) {
2677
+ return this.pushStack( winnow(this, selector || [], false) );
2678
+ },
2679
+ not: function( selector ) {
2680
+ return this.pushStack( winnow(this, selector || [], true) );
2681
+ },
2682
+ is: function( selector ) {
2683
+ return !!winnow(
2684
+ this,
2685
+
2686
+ // If this is a positional/relative selector, check membership in the returned set
2687
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
2688
+ typeof selector === "string" && rneedsContext.test( selector ) ?
2689
+ jQuery( selector ) :
2690
+ selector || [],
2691
+ false
2692
+ ).length;
2693
+ }
2694
+ });
2695
+
2696
+
2697
+ // Initialize a jQuery object
2698
+
2699
+
2700
+ // A central reference to the root jQuery(document)
2701
+ var rootjQuery,
2702
+
2703
+ // A simple way to check for HTML strings
2704
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
2705
+ // Strict HTML recognition (#11290: must start with <)
2706
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
2707
+
2708
+ init = jQuery.fn.init = function( selector, context ) {
2709
+ var match, elem;
2710
+
2711
+ // HANDLE: $(""), $(null), $(undefined), $(false)
2712
+ if ( !selector ) {
2713
+ return this;
2714
+ }
2715
+
2716
+ // Handle HTML strings
2717
+ if ( typeof selector === "string" ) {
2718
+ if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
2719
+ // Assume that strings that start and end with <> are HTML and skip the regex check
2720
+ match = [ null, selector, null ];
2721
+
2722
+ } else {
2723
+ match = rquickExpr.exec( selector );
2724
+ }
2725
+
2726
+ // Match html or make sure no context is specified for #id
2727
+ if ( match && (match[1] || !context) ) {
2728
+
2729
+ // HANDLE: $(html) -> $(array)
2730
+ if ( match[1] ) {
2731
+ context = context instanceof jQuery ? context[0] : context;
2732
+
2733
+ // scripts is true for back-compat
2734
+ // Intentionally let the error be thrown if parseHTML is not present
2735
+ jQuery.merge( this, jQuery.parseHTML(
2736
+ match[1],
2737
+ context && context.nodeType ? context.ownerDocument || context : document,
2738
+ true
2739
+ ) );
2740
+
2741
+ // HANDLE: $(html, props)
2742
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
2743
+ for ( match in context ) {
2744
+ // Properties of context are called as methods if possible
2745
+ if ( jQuery.isFunction( this[ match ] ) ) {
2746
+ this[ match ]( context[ match ] );
2747
+
2748
+ // ...and otherwise set as attributes
2749
+ } else {
2750
+ this.attr( match, context[ match ] );
2751
+ }
2752
+ }
2753
+ }
2754
+
2755
+ return this;
2756
+
2757
+ // HANDLE: $(#id)
2758
+ } else {
2759
+ elem = document.getElementById( match[2] );
2760
+
2761
+ // Check parentNode to catch when Blackberry 4.6 returns
2762
+ // nodes that are no longer in the document #6963
2763
+ if ( elem && elem.parentNode ) {
2764
+ // Inject the element directly into the jQuery object
2765
+ this.length = 1;
2766
+ this[0] = elem;
2767
+ }
2768
+
2769
+ this.context = document;
2770
+ this.selector = selector;
2771
+ return this;
2772
+ }
2773
+
2774
+ // HANDLE: $(expr, $(...))
2775
+ } else if ( !context || context.jquery ) {
2776
+ return ( context || rootjQuery ).find( selector );
2777
+
2778
+ // HANDLE: $(expr, context)
2779
+ // (which is just equivalent to: $(context).find(expr)
2780
+ } else {
2781
+ return this.constructor( context ).find( selector );
2782
+ }
2783
+
2784
+ // HANDLE: $(DOMElement)
2785
+ } else if ( selector.nodeType ) {
2786
+ this.context = this[0] = selector;
2787
+ this.length = 1;
2788
+ return this;
2789
+
2790
+ // HANDLE: $(function)
2791
+ // Shortcut for document ready
2792
+ } else if ( jQuery.isFunction( selector ) ) {
2793
+ return typeof rootjQuery.ready !== "undefined" ?
2794
+ rootjQuery.ready( selector ) :
2795
+ // Execute immediately if ready is not present
2796
+ selector( jQuery );
2797
+ }
2798
+
2799
+ if ( selector.selector !== undefined ) {
2800
+ this.selector = selector.selector;
2801
+ this.context = selector.context;
2802
+ }
2803
+
2804
+ return jQuery.makeArray( selector, this );
2805
+ };
2806
+
2807
+ // Give the init function the jQuery prototype for later instantiation
2808
+ init.prototype = jQuery.fn;
2809
+
2810
+ // Initialize central reference
2811
+ rootjQuery = jQuery( document );
2812
+
2813
+
2814
+ var rparentsprev = /^(?:parents|prev(?:Until|All))/,
2815
+ // methods guaranteed to produce a unique set when starting from a unique set
2816
+ guaranteedUnique = {
2817
+ children: true,
2818
+ contents: true,
2819
+ next: true,
2820
+ prev: true
2821
+ };
2822
+
2823
+ jQuery.extend({
2824
+ dir: function( elem, dir, until ) {
2825
+ var matched = [],
2826
+ truncate = until !== undefined;
2827
+
2828
+ while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
2829
+ if ( elem.nodeType === 1 ) {
2830
+ if ( truncate && jQuery( elem ).is( until ) ) {
2831
+ break;
2832
+ }
2833
+ matched.push( elem );
2834
+ }
2835
+ }
2836
+ return matched;
2837
+ },
2838
+
2839
+ sibling: function( n, elem ) {
2840
+ var matched = [];
2841
+
2842
+ for ( ; n; n = n.nextSibling ) {
2843
+ if ( n.nodeType === 1 && n !== elem ) {
2844
+ matched.push( n );
2845
+ }
2846
+ }
2847
+
2848
+ return matched;
2849
+ }
2850
+ });
2851
+
2852
+ jQuery.fn.extend({
2853
+ has: function( target ) {
2854
+ var targets = jQuery( target, this ),
2855
+ l = targets.length;
2856
+
2857
+ return this.filter(function() {
2858
+ var i = 0;
2859
+ for ( ; i < l; i++ ) {
2860
+ if ( jQuery.contains( this, targets[i] ) ) {
2861
+ return true;
2862
+ }
2863
+ }
2864
+ });
2865
+ },
2866
+
2867
+ closest: function( selectors, context ) {
2868
+ var cur,
2869
+ i = 0,
2870
+ l = this.length,
2871
+ matched = [],
2872
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
2873
+ jQuery( selectors, context || this.context ) :
2874
+ 0;
2875
+
2876
+ for ( ; i < l; i++ ) {
2877
+ for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
2878
+ // Always skip document fragments
2879
+ if ( cur.nodeType < 11 && (pos ?
2880
+ pos.index(cur) > -1 :
2881
+
2882
+ // Don't pass non-elements to Sizzle
2883
+ cur.nodeType === 1 &&
2884
+ jQuery.find.matchesSelector(cur, selectors)) ) {
2885
+
2886
+ matched.push( cur );
2887
+ break;
2888
+ }
2889
+ }
2890
+ }
2891
+
2892
+ return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
2893
+ },
2894
+
2895
+ // Determine the position of an element within
2896
+ // the matched set of elements
2897
+ index: function( elem ) {
2898
+
2899
+ // No argument, return index in parent
2900
+ if ( !elem ) {
2901
+ return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
2902
+ }
2903
+
2904
+ // index in selector
2905
+ if ( typeof elem === "string" ) {
2906
+ return indexOf.call( jQuery( elem ), this[ 0 ] );
2907
+ }
2908
+
2909
+ // Locate the position of the desired element
2910
+ return indexOf.call( this,
2911
+
2912
+ // If it receives a jQuery object, the first element is used
2913
+ elem.jquery ? elem[ 0 ] : elem
2914
+ );
2915
+ },
2916
+
2917
+ add: function( selector, context ) {
2918
+ return this.pushStack(
2919
+ jQuery.unique(
2920
+ jQuery.merge( this.get(), jQuery( selector, context ) )
2921
+ )
2922
+ );
2923
+ },
2924
+
2925
+ addBack: function( selector ) {
2926
+ return this.add( selector == null ?
2927
+ this.prevObject : this.prevObject.filter(selector)
2928
+ );
2929
+ }
2930
+ });
2931
+
2932
+ function sibling( cur, dir ) {
2933
+ while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
2934
+ return cur;
2935
+ }
2936
+
2937
+ jQuery.each({
2938
+ parent: function( elem ) {
2939
+ var parent = elem.parentNode;
2940
+ return parent && parent.nodeType !== 11 ? parent : null;
2941
+ },
2942
+ parents: function( elem ) {
2943
+ return jQuery.dir( elem, "parentNode" );
2944
+ },
2945
+ parentsUntil: function( elem, i, until ) {
2946
+ return jQuery.dir( elem, "parentNode", until );
2947
+ },
2948
+ next: function( elem ) {
2949
+ return sibling( elem, "nextSibling" );
2950
+ },
2951
+ prev: function( elem ) {
2952
+ return sibling( elem, "previousSibling" );
2953
+ },
2954
+ nextAll: function( elem ) {
2955
+ return jQuery.dir( elem, "nextSibling" );
2956
+ },
2957
+ prevAll: function( elem ) {
2958
+ return jQuery.dir( elem, "previousSibling" );
2959
+ },
2960
+ nextUntil: function( elem, i, until ) {
2961
+ return jQuery.dir( elem, "nextSibling", until );
2962
+ },
2963
+ prevUntil: function( elem, i, until ) {
2964
+ return jQuery.dir( elem, "previousSibling", until );
2965
+ },
2966
+ siblings: function( elem ) {
2967
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
2968
+ },
2969
+ children: function( elem ) {
2970
+ return jQuery.sibling( elem.firstChild );
2971
+ },
2972
+ contents: function( elem ) {
2973
+ return elem.contentDocument || jQuery.merge( [], elem.childNodes );
2974
+ }
2975
+ }, function( name, fn ) {
2976
+ jQuery.fn[ name ] = function( until, selector ) {
2977
+ var matched = jQuery.map( this, fn, until );
2978
+
2979
+ if ( name.slice( -5 ) !== "Until" ) {
2980
+ selector = until;
2981
+ }
2982
+
2983
+ if ( selector && typeof selector === "string" ) {
2984
+ matched = jQuery.filter( selector, matched );
2985
+ }
2986
+
2987
+ if ( this.length > 1 ) {
2988
+ // Remove duplicates
2989
+ if ( !guaranteedUnique[ name ] ) {
2990
+ jQuery.unique( matched );
2991
+ }
2992
+
2993
+ // Reverse order for parents* and prev-derivatives
2994
+ if ( rparentsprev.test( name ) ) {
2995
+ matched.reverse();
2996
+ }
2997
+ }
2998
+
2999
+ return this.pushStack( matched );
3000
+ };
3001
+ });
3002
+ var rnotwhite = (/\S+/g);
3003
+
3004
+
3005
+
3006
+ // String to Object options format cache
3007
+ var optionsCache = {};
3008
+
3009
+ // Convert String-formatted options into Object-formatted ones and store in cache
3010
+ function createOptions( options ) {
3011
+ var object = optionsCache[ options ] = {};
3012
+ jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
3013
+ object[ flag ] = true;
3014
+ });
3015
+ return object;
3016
+ }
3017
+
3018
+ /*
3019
+ * Create a callback list using the following parameters:
3020
+ *
3021
+ * options: an optional list of space-separated options that will change how
3022
+ * the callback list behaves or a more traditional option object
3023
+ *
3024
+ * By default a callback list will act like an event callback list and can be
3025
+ * "fired" multiple times.
3026
+ *
3027
+ * Possible options:
3028
+ *
3029
+ * once: will ensure the callback list can only be fired once (like a Deferred)
3030
+ *
3031
+ * memory: will keep track of previous values and will call any callback added
3032
+ * after the list has been fired right away with the latest "memorized"
3033
+ * values (like a Deferred)
3034
+ *
3035
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
3036
+ *
3037
+ * stopOnFalse: interrupt callings when a callback returns false
3038
+ *
3039
+ */
3040
+ jQuery.Callbacks = function( options ) {
3041
+
3042
+ // Convert options from String-formatted to Object-formatted if needed
3043
+ // (we check in cache first)
3044
+ options = typeof options === "string" ?
3045
+ ( optionsCache[ options ] || createOptions( options ) ) :
3046
+ jQuery.extend( {}, options );
3047
+
3048
+ var // Last fire value (for non-forgettable lists)
3049
+ memory,
3050
+ // Flag to know if list was already fired
3051
+ fired,
3052
+ // Flag to know if list is currently firing
3053
+ firing,
3054
+ // First callback to fire (used internally by add and fireWith)
3055
+ firingStart,
3056
+ // End of the loop when firing
3057
+ firingLength,
3058
+ // Index of currently firing callback (modified by remove if needed)
3059
+ firingIndex,
3060
+ // Actual callback list
3061
+ list = [],
3062
+ // Stack of fire calls for repeatable lists
3063
+ stack = !options.once && [],
3064
+ // Fire callbacks
3065
+ fire = function( data ) {
3066
+ memory = options.memory && data;
3067
+ fired = true;
3068
+ firingIndex = firingStart || 0;
3069
+ firingStart = 0;
3070
+ firingLength = list.length;
3071
+ firing = true;
3072
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
3073
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
3074
+ memory = false; // To prevent further calls using add
3075
+ break;
3076
+ }
3077
+ }
3078
+ firing = false;
3079
+ if ( list ) {
3080
+ if ( stack ) {
3081
+ if ( stack.length ) {
3082
+ fire( stack.shift() );
3083
+ }
3084
+ } else if ( memory ) {
3085
+ list = [];
3086
+ } else {
3087
+ self.disable();
3088
+ }
3089
+ }
3090
+ },
3091
+ // Actual Callbacks object
3092
+ self = {
3093
+ // Add a callback or a collection of callbacks to the list
3094
+ add: function() {
3095
+ if ( list ) {
3096
+ // First, we save the current length
3097
+ var start = list.length;
3098
+ (function add( args ) {
3099
+ jQuery.each( args, function( _, arg ) {
3100
+ var type = jQuery.type( arg );
3101
+ if ( type === "function" ) {
3102
+ if ( !options.unique || !self.has( arg ) ) {
3103
+ list.push( arg );
3104
+ }
3105
+ } else if ( arg && arg.length && type !== "string" ) {
3106
+ // Inspect recursively
3107
+ add( arg );
3108
+ }
3109
+ });
3110
+ })( arguments );
3111
+ // Do we need to add the callbacks to the
3112
+ // current firing batch?
3113
+ if ( firing ) {
3114
+ firingLength = list.length;
3115
+ // With memory, if we're not firing then
3116
+ // we should call right away
3117
+ } else if ( memory ) {
3118
+ firingStart = start;
3119
+ fire( memory );
3120
+ }
3121
+ }
3122
+ return this;
3123
+ },
3124
+ // Remove a callback from the list
3125
+ remove: function() {
3126
+ if ( list ) {
3127
+ jQuery.each( arguments, function( _, arg ) {
3128
+ var index;
3129
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3130
+ list.splice( index, 1 );
3131
+ // Handle firing indexes
3132
+ if ( firing ) {
3133
+ if ( index <= firingLength ) {
3134
+ firingLength--;
3135
+ }
3136
+ if ( index <= firingIndex ) {
3137
+ firingIndex--;
3138
+ }
3139
+ }
3140
+ }
3141
+ });
3142
+ }
3143
+ return this;
3144
+ },
3145
+ // Check if a given callback is in the list.
3146
+ // If no argument is given, return whether or not list has callbacks attached.
3147
+ has: function( fn ) {
3148
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
3149
+ },
3150
+ // Remove all callbacks from the list
3151
+ empty: function() {
3152
+ list = [];
3153
+ firingLength = 0;
3154
+ return this;
3155
+ },
3156
+ // Have the list do nothing anymore
3157
+ disable: function() {
3158
+ list = stack = memory = undefined;
3159
+ return this;
3160
+ },
3161
+ // Is it disabled?
3162
+ disabled: function() {
3163
+ return !list;
3164
+ },
3165
+ // Lock the list in its current state
3166
+ lock: function() {
3167
+ stack = undefined;
3168
+ if ( !memory ) {
3169
+ self.disable();
3170
+ }
3171
+ return this;
3172
+ },
3173
+ // Is it locked?
3174
+ locked: function() {
3175
+ return !stack;
3176
+ },
3177
+ // Call all callbacks with the given context and arguments
3178
+ fireWith: function( context, args ) {
3179
+ if ( list && ( !fired || stack ) ) {
3180
+ args = args || [];
3181
+ args = [ context, args.slice ? args.slice() : args ];
3182
+ if ( firing ) {
3183
+ stack.push( args );
3184
+ } else {
3185
+ fire( args );
3186
+ }
3187
+ }
3188
+ return this;
3189
+ },
3190
+ // Call all the callbacks with the given arguments
3191
+ fire: function() {
3192
+ self.fireWith( this, arguments );
3193
+ return this;
3194
+ },
3195
+ // To know if the callbacks have already been called at least once
3196
+ fired: function() {
3197
+ return !!fired;
3198
+ }
3199
+ };
3200
+
3201
+ return self;
3202
+ };
3203
+
3204
+
3205
+ jQuery.extend({
3206
+
3207
+ Deferred: function( func ) {
3208
+ var tuples = [
3209
+ // action, add listener, listener list, final state
3210
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
3211
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
3212
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
3213
+ ],
3214
+ state = "pending",
3215
+ promise = {
3216
+ state: function() {
3217
+ return state;
3218
+ },
3219
+ always: function() {
3220
+ deferred.done( arguments ).fail( arguments );
3221
+ return this;
3222
+ },
3223
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
3224
+ var fns = arguments;
3225
+ return jQuery.Deferred(function( newDefer ) {
3226
+ jQuery.each( tuples, function( i, tuple ) {
3227
+ var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
3228
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
3229
+ deferred[ tuple[1] ](function() {
3230
+ var returned = fn && fn.apply( this, arguments );
3231
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
3232
+ returned.promise()
3233
+ .done( newDefer.resolve )
3234
+ .fail( newDefer.reject )
3235
+ .progress( newDefer.notify );
3236
+ } else {
3237
+ newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
3238
+ }
3239
+ });
3240
+ });
3241
+ fns = null;
3242
+ }).promise();
3243
+ },
3244
+ // Get a promise for this deferred
3245
+ // If obj is provided, the promise aspect is added to the object
3246
+ promise: function( obj ) {
3247
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
3248
+ }
3249
+ },
3250
+ deferred = {};
3251
+
3252
+ // Keep pipe for back-compat
3253
+ promise.pipe = promise.then;
3254
+
3255
+ // Add list-specific methods
3256
+ jQuery.each( tuples, function( i, tuple ) {
3257
+ var list = tuple[ 2 ],
3258
+ stateString = tuple[ 3 ];
3259
+
3260
+ // promise[ done | fail | progress ] = list.add
3261
+ promise[ tuple[1] ] = list.add;
3262
+
3263
+ // Handle state
3264
+ if ( stateString ) {
3265
+ list.add(function() {
3266
+ // state = [ resolved | rejected ]
3267
+ state = stateString;
3268
+
3269
+ // [ reject_list | resolve_list ].disable; progress_list.lock
3270
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
3271
+ }
3272
+
3273
+ // deferred[ resolve | reject | notify ]
3274
+ deferred[ tuple[0] ] = function() {
3275
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
3276
+ return this;
3277
+ };
3278
+ deferred[ tuple[0] + "With" ] = list.fireWith;
3279
+ });
3280
+
3281
+ // Make the deferred a promise
3282
+ promise.promise( deferred );
3283
+
3284
+ // Call given func if any
3285
+ if ( func ) {
3286
+ func.call( deferred, deferred );
3287
+ }
3288
+
3289
+ // All done!
3290
+ return deferred;
3291
+ },
3292
+
3293
+ // Deferred helper
3294
+ when: function( subordinate /* , ..., subordinateN */ ) {
3295
+ var i = 0,
3296
+ resolveValues = slice.call( arguments ),
3297
+ length = resolveValues.length,
3298
+
3299
+ // the count of uncompleted subordinates
3300
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
3301
+
3302
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
3303
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
3304
+
3305
+ // Update function for both resolve and progress values
3306
+ updateFunc = function( i, contexts, values ) {
3307
+ return function( value ) {
3308
+ contexts[ i ] = this;
3309
+ values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3310
+ if ( values === progressValues ) {
3311
+ deferred.notifyWith( contexts, values );
3312
+ } else if ( !( --remaining ) ) {
3313
+ deferred.resolveWith( contexts, values );
3314
+ }
3315
+ };
3316
+ },
3317
+
3318
+ progressValues, progressContexts, resolveContexts;
3319
+
3320
+ // add listeners to Deferred subordinates; treat others as resolved
3321
+ if ( length > 1 ) {
3322
+ progressValues = new Array( length );
3323
+ progressContexts = new Array( length );
3324
+ resolveContexts = new Array( length );
3325
+ for ( ; i < length; i++ ) {
3326
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
3327
+ resolveValues[ i ].promise()
3328
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
3329
+ .fail( deferred.reject )
3330
+ .progress( updateFunc( i, progressContexts, progressValues ) );
3331
+ } else {
3332
+ --remaining;
3333
+ }
3334
+ }
3335
+ }
3336
+
3337
+ // if we're not waiting on anything, resolve the master
3338
+ if ( !remaining ) {
3339
+ deferred.resolveWith( resolveContexts, resolveValues );
3340
+ }
3341
+
3342
+ return deferred.promise();
3343
+ }
3344
+ });
3345
+
3346
+
3347
+ // The deferred used on DOM ready
3348
+ var readyList;
3349
+
3350
+ jQuery.fn.ready = function( fn ) {
3351
+ // Add the callback
3352
+ jQuery.ready.promise().done( fn );
3353
+
3354
+ return this;
3355
+ };
3356
+
3357
+ jQuery.extend({
3358
+ // Is the DOM ready to be used? Set to true once it occurs.
3359
+ isReady: false,
3360
+
3361
+ // A counter to track how many items to wait for before
3362
+ // the ready event fires. See #6781
3363
+ readyWait: 1,
3364
+
3365
+ // Hold (or release) the ready event
3366
+ holdReady: function( hold ) {
3367
+ if ( hold ) {
3368
+ jQuery.readyWait++;
3369
+ } else {
3370
+ jQuery.ready( true );
3371
+ }
3372
+ },
3373
+
3374
+ // Handle when the DOM is ready
3375
+ ready: function( wait ) {
3376
+
3377
+ // Abort if there are pending holds or we're already ready
3378
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3379
+ return;
3380
+ }
3381
+
3382
+ // Remember that the DOM is ready
3383
+ jQuery.isReady = true;
3384
+
3385
+ // If a normal DOM Ready event fired, decrement, and wait if need be
3386
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
3387
+ return;
3388
+ }
3389
+
3390
+ // If there are functions bound, to execute
3391
+ readyList.resolveWith( document, [ jQuery ] );
3392
+
3393
+ // Trigger any bound ready events
3394
+ if ( jQuery.fn.triggerHandler ) {
3395
+ jQuery( document ).triggerHandler( "ready" );
3396
+ jQuery( document ).off( "ready" );
3397
+ }
3398
+ }
3399
+ });
3400
+
3401
+ /**
3402
+ * The ready event handler and self cleanup method
3403
+ */
3404
+ function completed() {
3405
+ document.removeEventListener( "DOMContentLoaded", completed, false );
3406
+ window.removeEventListener( "load", completed, false );
3407
+ jQuery.ready();
3408
+ }
3409
+
3410
+ jQuery.ready.promise = function( obj ) {
3411
+ if ( !readyList ) {
3412
+
3413
+ readyList = jQuery.Deferred();
3414
+
3415
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
3416
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
3417
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
3418
+ if ( document.readyState === "complete" ) {
3419
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
3420
+ setTimeout( jQuery.ready );
3421
+
3422
+ } else {
3423
+
3424
+ // Use the handy event callback
3425
+ document.addEventListener( "DOMContentLoaded", completed, false );
3426
+
3427
+ // A fallback to window.onload, that will always work
3428
+ window.addEventListener( "load", completed, false );
3429
+ }
3430
+ }
3431
+ return readyList.promise( obj );
3432
+ };
3433
+
3434
+ // Kick off the DOM ready check even if the user does not
3435
+ jQuery.ready.promise();
3436
+
3437
+
3438
+
3439
+
3440
+ // Multifunctional method to get and set values of a collection
3441
+ // The value/s can optionally be executed if it's a function
3442
+ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
3443
+ var i = 0,
3444
+ len = elems.length,
3445
+ bulk = key == null;
3446
+
3447
+ // Sets many values
3448
+ if ( jQuery.type( key ) === "object" ) {
3449
+ chainable = true;
3450
+ for ( i in key ) {
3451
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
3452
+ }
3453
+
3454
+ // Sets one value
3455
+ } else if ( value !== undefined ) {
3456
+ chainable = true;
3457
+
3458
+ if ( !jQuery.isFunction( value ) ) {
3459
+ raw = true;
3460
+ }
3461
+
3462
+ if ( bulk ) {
3463
+ // Bulk operations run against the entire set
3464
+ if ( raw ) {
3465
+ fn.call( elems, value );
3466
+ fn = null;
3467
+
3468
+ // ...except when executing function values
3469
+ } else {
3470
+ bulk = fn;
3471
+ fn = function( elem, key, value ) {
3472
+ return bulk.call( jQuery( elem ), value );
3473
+ };
3474
+ }
3475
+ }
3476
+
3477
+ if ( fn ) {
3478
+ for ( ; i < len; i++ ) {
3479
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
3480
+ }
3481
+ }
3482
+ }
3483
+
3484
+ return chainable ?
3485
+ elems :
3486
+
3487
+ // Gets
3488
+ bulk ?
3489
+ fn.call( elems ) :
3490
+ len ? fn( elems[0], key ) : emptyGet;
3491
+ };
3492
+
3493
+
3494
+ /**
3495
+ * Determines whether an object can have data
3496
+ */
3497
+ jQuery.acceptData = function( owner ) {
3498
+ // Accepts only:
3499
+ // - Node
3500
+ // - Node.ELEMENT_NODE
3501
+ // - Node.DOCUMENT_NODE
3502
+ // - Object
3503
+ // - Any
3504
+ /* jshint -W018 */
3505
+ return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
3506
+ };
3507
+
3508
+
3509
+ function Data() {
3510
+ // Support: Android < 4,
3511
+ // Old WebKit does not have Object.preventExtensions/freeze method,
3512
+ // return new empty object instead with no [[set]] accessor
3513
+ Object.defineProperty( this.cache = {}, 0, {
3514
+ get: function() {
3515
+ return {};
3516
+ }
3517
+ });
3518
+
3519
+ this.expando = jQuery.expando + Math.random();
3520
+ }
3521
+
3522
+ Data.uid = 1;
3523
+ Data.accepts = jQuery.acceptData;
3524
+
3525
+ Data.prototype = {
3526
+ key: function( owner ) {
3527
+ // We can accept data for non-element nodes in modern browsers,
3528
+ // but we should not, see #8335.
3529
+ // Always return the key for a frozen object.
3530
+ if ( !Data.accepts( owner ) ) {
3531
+ return 0;
3532
+ }
3533
+
3534
+ var descriptor = {},
3535
+ // Check if the owner object already has a cache key
3536
+ unlock = owner[ this.expando ];
3537
+
3538
+ // If not, create one
3539
+ if ( !unlock ) {
3540
+ unlock = Data.uid++;
3541
+
3542
+ // Secure it in a non-enumerable, non-writable property
3543
+ try {
3544
+ descriptor[ this.expando ] = { value: unlock };
3545
+ Object.defineProperties( owner, descriptor );
3546
+
3547
+ // Support: Android < 4
3548
+ // Fallback to a less secure definition
3549
+ } catch ( e ) {
3550
+ descriptor[ this.expando ] = unlock;
3551
+ jQuery.extend( owner, descriptor );
3552
+ }
3553
+ }
3554
+
3555
+ // Ensure the cache object
3556
+ if ( !this.cache[ unlock ] ) {
3557
+ this.cache[ unlock ] = {};
3558
+ }
3559
+
3560
+ return unlock;
3561
+ },
3562
+ set: function( owner, data, value ) {
3563
+ var prop,
3564
+ // There may be an unlock assigned to this node,
3565
+ // if there is no entry for this "owner", create one inline
3566
+ // and set the unlock as though an owner entry had always existed
3567
+ unlock = this.key( owner ),
3568
+ cache = this.cache[ unlock ];
3569
+
3570
+ // Handle: [ owner, key, value ] args
3571
+ if ( typeof data === "string" ) {
3572
+ cache[ data ] = value;
3573
+
3574
+ // Handle: [ owner, { properties } ] args
3575
+ } else {
3576
+ // Fresh assignments by object are shallow copied
3577
+ if ( jQuery.isEmptyObject( cache ) ) {
3578
+ jQuery.extend( this.cache[ unlock ], data );
3579
+ // Otherwise, copy the properties one-by-one to the cache object
3580
+ } else {
3581
+ for ( prop in data ) {
3582
+ cache[ prop ] = data[ prop ];
3583
+ }
3584
+ }
3585
+ }
3586
+ return cache;
3587
+ },
3588
+ get: function( owner, key ) {
3589
+ // Either a valid cache is found, or will be created.
3590
+ // New caches will be created and the unlock returned,
3591
+ // allowing direct access to the newly created
3592
+ // empty data object. A valid owner object must be provided.
3593
+ var cache = this.cache[ this.key( owner ) ];
3594
+
3595
+ return key === undefined ?
3596
+ cache : cache[ key ];
3597
+ },
3598
+ access: function( owner, key, value ) {
3599
+ var stored;
3600
+ // In cases where either:
3601
+ //
3602
+ // 1. No key was specified
3603
+ // 2. A string key was specified, but no value provided
3604
+ //
3605
+ // Take the "read" path and allow the get method to determine
3606
+ // which value to return, respectively either:
3607
+ //
3608
+ // 1. The entire cache object
3609
+ // 2. The data stored at the key
3610
+ //
3611
+ if ( key === undefined ||
3612
+ ((key && typeof key === "string") && value === undefined) ) {
3613
+
3614
+ stored = this.get( owner, key );
3615
+
3616
+ return stored !== undefined ?
3617
+ stored : this.get( owner, jQuery.camelCase(key) );
3618
+ }
3619
+
3620
+ // [*]When the key is not a string, or both a key and value
3621
+ // are specified, set or extend (existing objects) with either:
3622
+ //
3623
+ // 1. An object of properties
3624
+ // 2. A key and value
3625
+ //
3626
+ this.set( owner, key, value );
3627
+
3628
+ // Since the "set" path can have two possible entry points
3629
+ // return the expected data based on which path was taken[*]
3630
+ return value !== undefined ? value : key;
3631
+ },
3632
+ remove: function( owner, key ) {
3633
+ var i, name, camel,
3634
+ unlock = this.key( owner ),
3635
+ cache = this.cache[ unlock ];
3636
+
3637
+ if ( key === undefined ) {
3638
+ this.cache[ unlock ] = {};
3639
+
3640
+ } else {
3641
+ // Support array or space separated string of keys
3642
+ if ( jQuery.isArray( key ) ) {
3643
+ // If "name" is an array of keys...
3644
+ // When data is initially created, via ("key", "val") signature,
3645
+ // keys will be converted to camelCase.
3646
+ // Since there is no way to tell _how_ a key was added, remove
3647
+ // both plain key and camelCase key. #12786
3648
+ // This will only penalize the array argument path.
3649
+ name = key.concat( key.map( jQuery.camelCase ) );
3650
+ } else {
3651
+ camel = jQuery.camelCase( key );
3652
+ // Try the string as a key before any manipulation
3653
+ if ( key in cache ) {
3654
+ name = [ key, camel ];
3655
+ } else {
3656
+ // If a key with the spaces exists, use it.
3657
+ // Otherwise, create an array by matching non-whitespace
3658
+ name = camel;
3659
+ name = name in cache ?
3660
+ [ name ] : ( name.match( rnotwhite ) || [] );
3661
+ }
3662
+ }
3663
+
3664
+ i = name.length;
3665
+ while ( i-- ) {
3666
+ delete cache[ name[ i ] ];
3667
+ }
3668
+ }
3669
+ },
3670
+ hasData: function( owner ) {
3671
+ return !jQuery.isEmptyObject(
3672
+ this.cache[ owner[ this.expando ] ] || {}
3673
+ );
3674
+ },
3675
+ discard: function( owner ) {
3676
+ if ( owner[ this.expando ] ) {
3677
+ delete this.cache[ owner[ this.expando ] ];
3678
+ }
3679
+ }
3680
+ };
3681
+ var data_priv = new Data();
3682
+
3683
+ var data_user = new Data();
3684
+
3685
+
3686
+
3687
+ /*
3688
+ Implementation Summary
3689
+
3690
+ 1. Enforce API surface and semantic compatibility with 1.9.x branch
3691
+ 2. Improve the module's maintainability by reducing the storage
3692
+ paths to a single mechanism.
3693
+ 3. Use the same single mechanism to support "private" and "user" data.
3694
+ 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
3695
+ 5. Avoid exposing implementation details on user objects (eg. expando properties)
3696
+ 6. Provide a clear path for implementation upgrade to WeakMap in 2014
3697
+ */
3698
+ var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
3699
+ rmultiDash = /([A-Z])/g;
3700
+
3701
+ function dataAttr( elem, key, data ) {
3702
+ var name;
3703
+
3704
+ // If nothing was found internally, try to fetch any
3705
+ // data from the HTML5 data-* attribute
3706
+ if ( data === undefined && elem.nodeType === 1 ) {
3707
+ name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
3708
+ data = elem.getAttribute( name );
3709
+
3710
+ if ( typeof data === "string" ) {
3711
+ try {
3712
+ data = data === "true" ? true :
3713
+ data === "false" ? false :
3714
+ data === "null" ? null :
3715
+ // Only convert to a number if it doesn't change the string
3716
+ +data + "" === data ? +data :
3717
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
3718
+ data;
3719
+ } catch( e ) {}
3720
+
3721
+ // Make sure we set the data so it isn't changed later
3722
+ data_user.set( elem, key, data );
3723
+ } else {
3724
+ data = undefined;
3725
+ }
3726
+ }
3727
+ return data;
3728
+ }
3729
+
3730
+ jQuery.extend({
3731
+ hasData: function( elem ) {
3732
+ return data_user.hasData( elem ) || data_priv.hasData( elem );
3733
+ },
3734
+
3735
+ data: function( elem, name, data ) {
3736
+ return data_user.access( elem, name, data );
3737
+ },
3738
+
3739
+ removeData: function( elem, name ) {
3740
+ data_user.remove( elem, name );
3741
+ },
3742
+
3743
+ // TODO: Now that all calls to _data and _removeData have been replaced
3744
+ // with direct calls to data_priv methods, these can be deprecated.
3745
+ _data: function( elem, name, data ) {
3746
+ return data_priv.access( elem, name, data );
3747
+ },
3748
+
3749
+ _removeData: function( elem, name ) {
3750
+ data_priv.remove( elem, name );
3751
+ }
3752
+ });
3753
+
3754
+ jQuery.fn.extend({
3755
+ data: function( key, value ) {
3756
+ var i, name, data,
3757
+ elem = this[ 0 ],
3758
+ attrs = elem && elem.attributes;
3759
+
3760
+ // Gets all values
3761
+ if ( key === undefined ) {
3762
+ if ( this.length ) {
3763
+ data = data_user.get( elem );
3764
+
3765
+ if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
3766
+ i = attrs.length;
3767
+ while ( i-- ) {
3768
+
3769
+ // Support: IE11+
3770
+ // The attrs elements can be null (#14894)
3771
+ if ( attrs[ i ] ) {
3772
+ name = attrs[ i ].name;
3773
+ if ( name.indexOf( "data-" ) === 0 ) {
3774
+ name = jQuery.camelCase( name.slice(5) );
3775
+ dataAttr( elem, name, data[ name ] );
3776
+ }
3777
+ }
3778
+ }
3779
+ data_priv.set( elem, "hasDataAttrs", true );
3780
+ }
3781
+ }
3782
+
3783
+ return data;
3784
+ }
3785
+
3786
+ // Sets multiple values
3787
+ if ( typeof key === "object" ) {
3788
+ return this.each(function() {
3789
+ data_user.set( this, key );
3790
+ });
3791
+ }
3792
+
3793
+ return access( this, function( value ) {
3794
+ var data,
3795
+ camelKey = jQuery.camelCase( key );
3796
+
3797
+ // The calling jQuery object (element matches) is not empty
3798
+ // (and therefore has an element appears at this[ 0 ]) and the
3799
+ // `value` parameter was not undefined. An empty jQuery object
3800
+ // will result in `undefined` for elem = this[ 0 ] which will
3801
+ // throw an exception if an attempt to read a data cache is made.
3802
+ if ( elem && value === undefined ) {
3803
+ // Attempt to get data from the cache
3804
+ // with the key as-is
3805
+ data = data_user.get( elem, key );
3806
+ if ( data !== undefined ) {
3807
+ return data;
3808
+ }
3809
+
3810
+ // Attempt to get data from the cache
3811
+ // with the key camelized
3812
+ data = data_user.get( elem, camelKey );
3813
+ if ( data !== undefined ) {
3814
+ return data;
3815
+ }
3816
+
3817
+ // Attempt to "discover" the data in
3818
+ // HTML5 custom data-* attrs
3819
+ data = dataAttr( elem, camelKey, undefined );
3820
+ if ( data !== undefined ) {
3821
+ return data;
3822
+ }
3823
+
3824
+ // We tried really hard, but the data doesn't exist.
3825
+ return;
3826
+ }
3827
+
3828
+ // Set the data...
3829
+ this.each(function() {
3830
+ // First, attempt to store a copy or reference of any
3831
+ // data that might've been store with a camelCased key.
3832
+ var data = data_user.get( this, camelKey );
3833
+
3834
+ // For HTML5 data-* attribute interop, we have to
3835
+ // store property names with dashes in a camelCase form.
3836
+ // This might not apply to all properties...*
3837
+ data_user.set( this, camelKey, value );
3838
+
3839
+ // *... In the case of properties that might _actually_
3840
+ // have dashes, we need to also store a copy of that
3841
+ // unchanged property.
3842
+ if ( key.indexOf("-") !== -1 && data !== undefined ) {
3843
+ data_user.set( this, key, value );
3844
+ }
3845
+ });
3846
+ }, null, value, arguments.length > 1, null, true );
3847
+ },
3848
+
3849
+ removeData: function( key ) {
3850
+ return this.each(function() {
3851
+ data_user.remove( this, key );
3852
+ });
3853
+ }
3854
+ });
3855
+
3856
+
3857
+ jQuery.extend({
3858
+ queue: function( elem, type, data ) {
3859
+ var queue;
3860
+
3861
+ if ( elem ) {
3862
+ type = ( type || "fx" ) + "queue";
3863
+ queue = data_priv.get( elem, type );
3864
+
3865
+ // Speed up dequeue by getting out quickly if this is just a lookup
3866
+ if ( data ) {
3867
+ if ( !queue || jQuery.isArray( data ) ) {
3868
+ queue = data_priv.access( elem, type, jQuery.makeArray(data) );
3869
+ } else {
3870
+ queue.push( data );
3871
+ }
3872
+ }
3873
+ return queue || [];
3874
+ }
3875
+ },
3876
+
3877
+ dequeue: function( elem, type ) {
3878
+ type = type || "fx";
3879
+
3880
+ var queue = jQuery.queue( elem, type ),
3881
+ startLength = queue.length,
3882
+ fn = queue.shift(),
3883
+ hooks = jQuery._queueHooks( elem, type ),
3884
+ next = function() {
3885
+ jQuery.dequeue( elem, type );
3886
+ };
3887
+
3888
+ // If the fx queue is dequeued, always remove the progress sentinel
3889
+ if ( fn === "inprogress" ) {
3890
+ fn = queue.shift();
3891
+ startLength--;
3892
+ }
3893
+
3894
+ if ( fn ) {
3895
+
3896
+ // Add a progress sentinel to prevent the fx queue from being
3897
+ // automatically dequeued
3898
+ if ( type === "fx" ) {
3899
+ queue.unshift( "inprogress" );
3900
+ }
3901
+
3902
+ // clear up the last queue stop function
3903
+ delete hooks.stop;
3904
+ fn.call( elem, next, hooks );
3905
+ }
3906
+
3907
+ if ( !startLength && hooks ) {
3908
+ hooks.empty.fire();
3909
+ }
3910
+ },
3911
+
3912
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
3913
+ _queueHooks: function( elem, type ) {
3914
+ var key = type + "queueHooks";
3915
+ return data_priv.get( elem, key ) || data_priv.access( elem, key, {
3916
+ empty: jQuery.Callbacks("once memory").add(function() {
3917
+ data_priv.remove( elem, [ type + "queue", key ] );
3918
+ })
3919
+ });
3920
+ }
3921
+ });
3922
+
3923
+ jQuery.fn.extend({
3924
+ queue: function( type, data ) {
3925
+ var setter = 2;
3926
+
3927
+ if ( typeof type !== "string" ) {
3928
+ data = type;
3929
+ type = "fx";
3930
+ setter--;
3931
+ }
3932
+
3933
+ if ( arguments.length < setter ) {
3934
+ return jQuery.queue( this[0], type );
3935
+ }
3936
+
3937
+ return data === undefined ?
3938
+ this :
3939
+ this.each(function() {
3940
+ var queue = jQuery.queue( this, type, data );
3941
+
3942
+ // ensure a hooks for this queue
3943
+ jQuery._queueHooks( this, type );
3944
+
3945
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
3946
+ jQuery.dequeue( this, type );
3947
+ }
3948
+ });
3949
+ },
3950
+ dequeue: function( type ) {
3951
+ return this.each(function() {
3952
+ jQuery.dequeue( this, type );
3953
+ });
3954
+ },
3955
+ clearQueue: function( type ) {
3956
+ return this.queue( type || "fx", [] );
3957
+ },
3958
+ // Get a promise resolved when queues of a certain type
3959
+ // are emptied (fx is the type by default)
3960
+ promise: function( type, obj ) {
3961
+ var tmp,
3962
+ count = 1,
3963
+ defer = jQuery.Deferred(),
3964
+ elements = this,
3965
+ i = this.length,
3966
+ resolve = function() {
3967
+ if ( !( --count ) ) {
3968
+ defer.resolveWith( elements, [ elements ] );
3969
+ }
3970
+ };
3971
+
3972
+ if ( typeof type !== "string" ) {
3973
+ obj = type;
3974
+ type = undefined;
3975
+ }
3976
+ type = type || "fx";
3977
+
3978
+ while ( i-- ) {
3979
+ tmp = data_priv.get( elements[ i ], type + "queueHooks" );
3980
+ if ( tmp && tmp.empty ) {
3981
+ count++;
3982
+ tmp.empty.add( resolve );
3983
+ }
3984
+ }
3985
+ resolve();
3986
+ return defer.promise( obj );
3987
+ }
3988
+ });
3989
+ var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
3990
+
3991
+ var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
3992
+
3993
+ var isHidden = function( elem, el ) {
3994
+ // isHidden might be called from jQuery#filter function;
3995
+ // in that case, element will be second argument
3996
+ elem = el || elem;
3997
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
3998
+ };
3999
+
4000
+ var rcheckableType = (/^(?:checkbox|radio)$/i);
4001
+
4002
+
4003
+
4004
+ (function() {
4005
+ var fragment = document.createDocumentFragment(),
4006
+ div = fragment.appendChild( document.createElement( "div" ) ),
4007
+ input = document.createElement( "input" );
4008
+
4009
+ // #11217 - WebKit loses check when the name is after the checked attribute
4010
+ // Support: Windows Web Apps (WWA)
4011
+ // `name` and `type` need .setAttribute for WWA
4012
+ input.setAttribute( "type", "radio" );
4013
+ input.setAttribute( "checked", "checked" );
4014
+ input.setAttribute( "name", "t" );
4015
+
4016
+ div.appendChild( input );
4017
+
4018
+ // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
4019
+ // old WebKit doesn't clone checked state correctly in fragments
4020
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4021
+
4022
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
4023
+ // Support: IE9-IE11+
4024
+ div.innerHTML = "<textarea>x</textarea>";
4025
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4026
+ })();
4027
+ var strundefined = typeof undefined;
4028
+
4029
+
4030
+
4031
+ support.focusinBubbles = "onfocusin" in window;
4032
+
4033
+
4034
+ var
4035
+ rkeyEvent = /^key/,
4036
+ rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
4037
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
4038
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
4039
+
4040
+ function returnTrue() {
4041
+ return true;
4042
+ }
4043
+
4044
+ function returnFalse() {
4045
+ return false;
4046
+ }
4047
+
4048
+ function safeActiveElement() {
4049
+ try {
4050
+ return document.activeElement;
4051
+ } catch ( err ) { }
4052
+ }
4053
+
4054
+ /*
4055
+ * Helper functions for managing events -- not part of the public interface.
4056
+ * Props to Dean Edwards' addEvent library for many of the ideas.
4057
+ */
4058
+ jQuery.event = {
4059
+
4060
+ global: {},
4061
+
4062
+ add: function( elem, types, handler, data, selector ) {
4063
+
4064
+ var handleObjIn, eventHandle, tmp,
4065
+ events, t, handleObj,
4066
+ special, handlers, type, namespaces, origType,
4067
+ elemData = data_priv.get( elem );
4068
+
4069
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
4070
+ if ( !elemData ) {
4071
+ return;
4072
+ }
4073
+
4074
+ // Caller can pass in an object of custom data in lieu of the handler
4075
+ if ( handler.handler ) {
4076
+ handleObjIn = handler;
4077
+ handler = handleObjIn.handler;
4078
+ selector = handleObjIn.selector;
4079
+ }
4080
+
4081
+ // Make sure that the handler has a unique ID, used to find/remove it later
4082
+ if ( !handler.guid ) {
4083
+ handler.guid = jQuery.guid++;
4084
+ }
4085
+
4086
+ // Init the element's event structure and main handler, if this is the first
4087
+ if ( !(events = elemData.events) ) {
4088
+ events = elemData.events = {};
4089
+ }
4090
+ if ( !(eventHandle = elemData.handle) ) {
4091
+ eventHandle = elemData.handle = function( e ) {
4092
+ // Discard the second event of a jQuery.event.trigger() and
4093
+ // when an event is called after a page has unloaded
4094
+ return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
4095
+ jQuery.event.dispatch.apply( elem, arguments ) : undefined;
4096
+ };
4097
+ }
4098
+
4099
+ // Handle multiple events separated by a space
4100
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
4101
+ t = types.length;
4102
+ while ( t-- ) {
4103
+ tmp = rtypenamespace.exec( types[t] ) || [];
4104
+ type = origType = tmp[1];
4105
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
4106
+
4107
+ // There *must* be a type, no attaching namespace-only handlers
4108
+ if ( !type ) {
4109
+ continue;
4110
+ }
4111
+
4112
+ // If event changes its type, use the special event handlers for the changed type
4113
+ special = jQuery.event.special[ type ] || {};
4114
+
4115
+ // If selector defined, determine special event api type, otherwise given type
4116
+ type = ( selector ? special.delegateType : special.bindType ) || type;
4117
+
4118
+ // Update special based on newly reset type
4119
+ special = jQuery.event.special[ type ] || {};
4120
+
4121
+ // handleObj is passed to all event handlers
4122
+ handleObj = jQuery.extend({
4123
+ type: type,
4124
+ origType: origType,
4125
+ data: data,
4126
+ handler: handler,
4127
+ guid: handler.guid,
4128
+ selector: selector,
4129
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4130
+ namespace: namespaces.join(".")
4131
+ }, handleObjIn );
4132
+
4133
+ // Init the event handler queue if we're the first
4134
+ if ( !(handlers = events[ type ]) ) {
4135
+ handlers = events[ type ] = [];
4136
+ handlers.delegateCount = 0;
4137
+
4138
+ // Only use addEventListener if the special events handler returns false
4139
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4140
+ if ( elem.addEventListener ) {
4141
+ elem.addEventListener( type, eventHandle, false );
4142
+ }
4143
+ }
4144
+ }
4145
+
4146
+ if ( special.add ) {
4147
+ special.add.call( elem, handleObj );
4148
+
4149
+ if ( !handleObj.handler.guid ) {
4150
+ handleObj.handler.guid = handler.guid;
4151
+ }
4152
+ }
4153
+
4154
+ // Add to the element's handler list, delegates in front
4155
+ if ( selector ) {
4156
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
4157
+ } else {
4158
+ handlers.push( handleObj );
4159
+ }
4160
+
4161
+ // Keep track of which events have ever been used, for event optimization
4162
+ jQuery.event.global[ type ] = true;
4163
+ }
4164
+
4165
+ },
4166
+
4167
+ // Detach an event or set of events from an element
4168
+ remove: function( elem, types, handler, selector, mappedTypes ) {
4169
+
4170
+ var j, origCount, tmp,
4171
+ events, t, handleObj,
4172
+ special, handlers, type, namespaces, origType,
4173
+ elemData = data_priv.hasData( elem ) && data_priv.get( elem );
4174
+
4175
+ if ( !elemData || !(events = elemData.events) ) {
4176
+ return;
4177
+ }
4178
+
4179
+ // Once for each type.namespace in types; type may be omitted
4180
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
4181
+ t = types.length;
4182
+ while ( t-- ) {
4183
+ tmp = rtypenamespace.exec( types[t] ) || [];
4184
+ type = origType = tmp[1];
4185
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
4186
+
4187
+ // Unbind all events (on this namespace, if provided) for the element
4188
+ if ( !type ) {
4189
+ for ( type in events ) {
4190
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
4191
+ }
4192
+ continue;
4193
+ }
4194
+
4195
+ special = jQuery.event.special[ type ] || {};
4196
+ type = ( selector ? special.delegateType : special.bindType ) || type;
4197
+ handlers = events[ type ] || [];
4198
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
4199
+
4200
+ // Remove matching events
4201
+ origCount = j = handlers.length;
4202
+ while ( j-- ) {
4203
+ handleObj = handlers[ j ];
4204
+
4205
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
4206
+ ( !handler || handler.guid === handleObj.guid ) &&
4207
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
4208
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
4209
+ handlers.splice( j, 1 );
4210
+
4211
+ if ( handleObj.selector ) {
4212
+ handlers.delegateCount--;
4213
+ }
4214
+ if ( special.remove ) {
4215
+ special.remove.call( elem, handleObj );
4216
+ }
4217
+ }
4218
+ }
4219
+
4220
+ // Remove generic event handler if we removed something and no more handlers exist
4221
+ // (avoids potential for endless recursion during removal of special event handlers)
4222
+ if ( origCount && !handlers.length ) {
4223
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
4224
+ jQuery.removeEvent( elem, type, elemData.handle );
4225
+ }
4226
+
4227
+ delete events[ type ];
4228
+ }
4229
+ }
4230
+
4231
+ // Remove the expando if it's no longer used
4232
+ if ( jQuery.isEmptyObject( events ) ) {
4233
+ delete elemData.handle;
4234
+ data_priv.remove( elem, "events" );
4235
+ }
4236
+ },
4237
+
4238
+ trigger: function( event, data, elem, onlyHandlers ) {
4239
+
4240
+ var i, cur, tmp, bubbleType, ontype, handle, special,
4241
+ eventPath = [ elem || document ],
4242
+ type = hasOwn.call( event, "type" ) ? event.type : event,
4243
+ namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
4244
+
4245
+ cur = tmp = elem = elem || document;
4246
+
4247
+ // Don't do events on text and comment nodes
4248
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
4249
+ return;
4250
+ }
4251
+
4252
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
4253
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
4254
+ return;
4255
+ }
4256
+
4257
+ if ( type.indexOf(".") >= 0 ) {
4258
+ // Namespaced trigger; create a regexp to match event type in handle()
4259
+ namespaces = type.split(".");
4260
+ type = namespaces.shift();
4261
+ namespaces.sort();
4262
+ }
4263
+ ontype = type.indexOf(":") < 0 && "on" + type;
4264
+
4265
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
4266
+ event = event[ jQuery.expando ] ?
4267
+ event :
4268
+ new jQuery.Event( type, typeof event === "object" && event );
4269
+
4270
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
4271
+ event.isTrigger = onlyHandlers ? 2 : 3;
4272
+ event.namespace = namespaces.join(".");
4273
+ event.namespace_re = event.namespace ?
4274
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
4275
+ null;
4276
+
4277
+ // Clean up the event in case it is being reused
4278
+ event.result = undefined;
4279
+ if ( !event.target ) {
4280
+ event.target = elem;
4281
+ }
4282
+
4283
+ // Clone any incoming data and prepend the event, creating the handler arg list
4284
+ data = data == null ?
4285
+ [ event ] :
4286
+ jQuery.makeArray( data, [ event ] );
4287
+
4288
+ // Allow special events to draw outside the lines
4289
+ special = jQuery.event.special[ type ] || {};
4290
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
4291
+ return;
4292
+ }
4293
+
4294
+ // Determine event propagation path in advance, per W3C events spec (#9951)
4295
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
4296
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
4297
+
4298
+ bubbleType = special.delegateType || type;
4299
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
4300
+ cur = cur.parentNode;
4301
+ }
4302
+ for ( ; cur; cur = cur.parentNode ) {
4303
+ eventPath.push( cur );
4304
+ tmp = cur;
4305
+ }
4306
+
4307
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
4308
+ if ( tmp === (elem.ownerDocument || document) ) {
4309
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
4310
+ }
4311
+ }
4312
+
4313
+ // Fire handlers on the event path
4314
+ i = 0;
4315
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
4316
+
4317
+ event.type = i > 1 ?
4318
+ bubbleType :
4319
+ special.bindType || type;
4320
+
4321
+ // jQuery handler
4322
+ handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
4323
+ if ( handle ) {
4324
+ handle.apply( cur, data );
4325
+ }
4326
+
4327
+ // Native handler
4328
+ handle = ontype && cur[ ontype ];
4329
+ if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
4330
+ event.result = handle.apply( cur, data );
4331
+ if ( event.result === false ) {
4332
+ event.preventDefault();
4333
+ }
4334
+ }
4335
+ }
4336
+ event.type = type;
4337
+
4338
+ // If nobody prevented the default action, do it now
4339
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
4340
+
4341
+ if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
4342
+ jQuery.acceptData( elem ) ) {
4343
+
4344
+ // Call a native DOM method on the target with the same name name as the event.
4345
+ // Don't do default actions on window, that's where global variables be (#6170)
4346
+ if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
4347
+
4348
+ // Don't re-trigger an onFOO event when we call its FOO() method
4349
+ tmp = elem[ ontype ];
4350
+
4351
+ if ( tmp ) {
4352
+ elem[ ontype ] = null;
4353
+ }
4354
+
4355
+ // Prevent re-triggering of the same event, since we already bubbled it above
4356
+ jQuery.event.triggered = type;
4357
+ elem[ type ]();
4358
+ jQuery.event.triggered = undefined;
4359
+
4360
+ if ( tmp ) {
4361
+ elem[ ontype ] = tmp;
4362
+ }
4363
+ }
4364
+ }
4365
+ }
4366
+
4367
+ return event.result;
4368
+ },
4369
+
4370
+ dispatch: function( event ) {
4371
+
4372
+ // Make a writable jQuery.Event from the native event object
4373
+ event = jQuery.event.fix( event );
4374
+
4375
+ var i, j, ret, matched, handleObj,
4376
+ handlerQueue = [],
4377
+ args = slice.call( arguments ),
4378
+ handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
4379
+ special = jQuery.event.special[ event.type ] || {};
4380
+
4381
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
4382
+ args[0] = event;
4383
+ event.delegateTarget = this;
4384
+
4385
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
4386
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
4387
+ return;
4388
+ }
4389
+
4390
+ // Determine handlers
4391
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
4392
+
4393
+ // Run delegates first; they may want to stop propagation beneath us
4394
+ i = 0;
4395
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
4396
+ event.currentTarget = matched.elem;
4397
+
4398
+ j = 0;
4399
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
4400
+
4401
+ // Triggered event must either 1) have no namespace, or
4402
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
4403
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
4404
+
4405
+ event.handleObj = handleObj;
4406
+ event.data = handleObj.data;
4407
+
4408
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
4409
+ .apply( matched.elem, args );
4410
+
4411
+ if ( ret !== undefined ) {
4412
+ if ( (event.result = ret) === false ) {
4413
+ event.preventDefault();
4414
+ event.stopPropagation();
4415
+ }
4416
+ }
4417
+ }
4418
+ }
4419
+ }
4420
+
4421
+ // Call the postDispatch hook for the mapped type
4422
+ if ( special.postDispatch ) {
4423
+ special.postDispatch.call( this, event );
4424
+ }
4425
+
4426
+ return event.result;
4427
+ },
4428
+
4429
+ handlers: function( event, handlers ) {
4430
+ var i, matches, sel, handleObj,
4431
+ handlerQueue = [],
4432
+ delegateCount = handlers.delegateCount,
4433
+ cur = event.target;
4434
+
4435
+ // Find delegate handlers
4436
+ // Black-hole SVG <use> instance trees (#13180)
4437
+ // Avoid non-left-click bubbling in Firefox (#3861)
4438
+ if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
4439
+
4440
+ for ( ; cur !== this; cur = cur.parentNode || this ) {
4441
+
4442
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
4443
+ if ( cur.disabled !== true || event.type !== "click" ) {
4444
+ matches = [];
4445
+ for ( i = 0; i < delegateCount; i++ ) {
4446
+ handleObj = handlers[ i ];
4447
+
4448
+ // Don't conflict with Object.prototype properties (#13203)
4449
+ sel = handleObj.selector + " ";
4450
+
4451
+ if ( matches[ sel ] === undefined ) {
4452
+ matches[ sel ] = handleObj.needsContext ?
4453
+ jQuery( sel, this ).index( cur ) >= 0 :
4454
+ jQuery.find( sel, this, null, [ cur ] ).length;
4455
+ }
4456
+ if ( matches[ sel ] ) {
4457
+ matches.push( handleObj );
4458
+ }
4459
+ }
4460
+ if ( matches.length ) {
4461
+ handlerQueue.push({ elem: cur, handlers: matches });
4462
+ }
4463
+ }
4464
+ }
4465
+ }
4466
+
4467
+ // Add the remaining (directly-bound) handlers
4468
+ if ( delegateCount < handlers.length ) {
4469
+ handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
4470
+ }
4471
+
4472
+ return handlerQueue;
4473
+ },
4474
+
4475
+ // Includes some event props shared by KeyEvent and MouseEvent
4476
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
4477
+
4478
+ fixHooks: {},
4479
+
4480
+ keyHooks: {
4481
+ props: "char charCode key keyCode".split(" "),
4482
+ filter: function( event, original ) {
4483
+
4484
+ // Add which for key events
4485
+ if ( event.which == null ) {
4486
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
4487
+ }
4488
+
4489
+ return event;
4490
+ }
4491
+ },
4492
+
4493
+ mouseHooks: {
4494
+ props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
4495
+ filter: function( event, original ) {
4496
+ var eventDoc, doc, body,
4497
+ button = original.button;
4498
+
4499
+ // Calculate pageX/Y if missing and clientX/Y available
4500
+ if ( event.pageX == null && original.clientX != null ) {
4501
+ eventDoc = event.target.ownerDocument || document;
4502
+ doc = eventDoc.documentElement;
4503
+ body = eventDoc.body;
4504
+
4505
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
4506
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
4507
+ }
4508
+
4509
+ // Add which for click: 1 === left; 2 === middle; 3 === right
4510
+ // Note: button is not normalized, so don't use it
4511
+ if ( !event.which && button !== undefined ) {
4512
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
4513
+ }
4514
+
4515
+ return event;
4516
+ }
4517
+ },
4518
+
4519
+ fix: function( event ) {
4520
+ if ( event[ jQuery.expando ] ) {
4521
+ return event;
4522
+ }
4523
+
4524
+ // Create a writable copy of the event object and normalize some properties
4525
+ var i, prop, copy,
4526
+ type = event.type,
4527
+ originalEvent = event,
4528
+ fixHook = this.fixHooks[ type ];
4529
+
4530
+ if ( !fixHook ) {
4531
+ this.fixHooks[ type ] = fixHook =
4532
+ rmouseEvent.test( type ) ? this.mouseHooks :
4533
+ rkeyEvent.test( type ) ? this.keyHooks :
4534
+ {};
4535
+ }
4536
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
4537
+
4538
+ event = new jQuery.Event( originalEvent );
4539
+
4540
+ i = copy.length;
4541
+ while ( i-- ) {
4542
+ prop = copy[ i ];
4543
+ event[ prop ] = originalEvent[ prop ];
4544
+ }
4545
+
4546
+ // Support: Cordova 2.5 (WebKit) (#13255)
4547
+ // All events should have a target; Cordova deviceready doesn't
4548
+ if ( !event.target ) {
4549
+ event.target = document;
4550
+ }
4551
+
4552
+ // Support: Safari 6.0+, Chrome < 28
4553
+ // Target should not be a text node (#504, #13143)
4554
+ if ( event.target.nodeType === 3 ) {
4555
+ event.target = event.target.parentNode;
4556
+ }
4557
+
4558
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
4559
+ },
4560
+
4561
+ special: {
4562
+ load: {
4563
+ // Prevent triggered image.load events from bubbling to window.load
4564
+ noBubble: true
4565
+ },
4566
+ focus: {
4567
+ // Fire native event if possible so blur/focus sequence is correct
4568
+ trigger: function() {
4569
+ if ( this !== safeActiveElement() && this.focus ) {
4570
+ this.focus();
4571
+ return false;
4572
+ }
4573
+ },
4574
+ delegateType: "focusin"
4575
+ },
4576
+ blur: {
4577
+ trigger: function() {
4578
+ if ( this === safeActiveElement() && this.blur ) {
4579
+ this.blur();
4580
+ return false;
4581
+ }
4582
+ },
4583
+ delegateType: "focusout"
4584
+ },
4585
+ click: {
4586
+ // For checkbox, fire native event so checked state will be right
4587
+ trigger: function() {
4588
+ if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
4589
+ this.click();
4590
+ return false;
4591
+ }
4592
+ },
4593
+
4594
+ // For cross-browser consistency, don't fire native .click() on links
4595
+ _default: function( event ) {
4596
+ return jQuery.nodeName( event.target, "a" );
4597
+ }
4598
+ },
4599
+
4600
+ beforeunload: {
4601
+ postDispatch: function( event ) {
4602
+
4603
+ // Support: Firefox 20+
4604
+ // Firefox doesn't alert if the returnValue field is not set.
4605
+ if ( event.result !== undefined && event.originalEvent ) {
4606
+ event.originalEvent.returnValue = event.result;
4607
+ }
4608
+ }
4609
+ }
4610
+ },
4611
+
4612
+ simulate: function( type, elem, event, bubble ) {
4613
+ // Piggyback on a donor event to simulate a different one.
4614
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
4615
+ // simulated event prevents default then we do the same on the donor.
4616
+ var e = jQuery.extend(
4617
+ new jQuery.Event(),
4618
+ event,
4619
+ {
4620
+ type: type,
4621
+ isSimulated: true,
4622
+ originalEvent: {}
4623
+ }
4624
+ );
4625
+ if ( bubble ) {
4626
+ jQuery.event.trigger( e, null, elem );
4627
+ } else {
4628
+ jQuery.event.dispatch.call( elem, e );
4629
+ }
4630
+ if ( e.isDefaultPrevented() ) {
4631
+ event.preventDefault();
4632
+ }
4633
+ }
4634
+ };
4635
+
4636
+ jQuery.removeEvent = function( elem, type, handle ) {
4637
+ if ( elem.removeEventListener ) {
4638
+ elem.removeEventListener( type, handle, false );
4639
+ }
4640
+ };
4641
+
4642
+ jQuery.Event = function( src, props ) {
4643
+ // Allow instantiation without the 'new' keyword
4644
+ if ( !(this instanceof jQuery.Event) ) {
4645
+ return new jQuery.Event( src, props );
4646
+ }
4647
+
4648
+ // Event object
4649
+ if ( src && src.type ) {
4650
+ this.originalEvent = src;
4651
+ this.type = src.type;
4652
+
4653
+ // Events bubbling up the document may have been marked as prevented
4654
+ // by a handler lower down the tree; reflect the correct value.
4655
+ this.isDefaultPrevented = src.defaultPrevented ||
4656
+ src.defaultPrevented === undefined &&
4657
+ // Support: Android < 4.0
4658
+ src.returnValue === false ?
4659
+ returnTrue :
4660
+ returnFalse;
4661
+
4662
+ // Event type
4663
+ } else {
4664
+ this.type = src;
4665
+ }
4666
+
4667
+ // Put explicitly provided properties onto the event object
4668
+ if ( props ) {
4669
+ jQuery.extend( this, props );
4670
+ }
4671
+
4672
+ // Create a timestamp if incoming event doesn't have one
4673
+ this.timeStamp = src && src.timeStamp || jQuery.now();
4674
+
4675
+ // Mark it as fixed
4676
+ this[ jQuery.expando ] = true;
4677
+ };
4678
+
4679
+ // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
4680
+ // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
4681
+ jQuery.Event.prototype = {
4682
+ isDefaultPrevented: returnFalse,
4683
+ isPropagationStopped: returnFalse,
4684
+ isImmediatePropagationStopped: returnFalse,
4685
+
4686
+ preventDefault: function() {
4687
+ var e = this.originalEvent;
4688
+
4689
+ this.isDefaultPrevented = returnTrue;
4690
+
4691
+ if ( e && e.preventDefault ) {
4692
+ e.preventDefault();
4693
+ }
4694
+ },
4695
+ stopPropagation: function() {
4696
+ var e = this.originalEvent;
4697
+
4698
+ this.isPropagationStopped = returnTrue;
4699
+
4700
+ if ( e && e.stopPropagation ) {
4701
+ e.stopPropagation();
4702
+ }
4703
+ },
4704
+ stopImmediatePropagation: function() {
4705
+ var e = this.originalEvent;
4706
+
4707
+ this.isImmediatePropagationStopped = returnTrue;
4708
+
4709
+ if ( e && e.stopImmediatePropagation ) {
4710
+ e.stopImmediatePropagation();
4711
+ }
4712
+
4713
+ this.stopPropagation();
4714
+ }
4715
+ };
4716
+
4717
+ // Create mouseenter/leave events using mouseover/out and event-time checks
4718
+ // Support: Chrome 15+
4719
+ jQuery.each({
4720
+ mouseenter: "mouseover",
4721
+ mouseleave: "mouseout",
4722
+ pointerenter: "pointerover",
4723
+ pointerleave: "pointerout"
4724
+ }, function( orig, fix ) {
4725
+ jQuery.event.special[ orig ] = {
4726
+ delegateType: fix,
4727
+ bindType: fix,
4728
+
4729
+ handle: function( event ) {
4730
+ var ret,
4731
+ target = this,
4732
+ related = event.relatedTarget,
4733
+ handleObj = event.handleObj;
4734
+
4735
+ // For mousenter/leave call the handler if related is outside the target.
4736
+ // NB: No relatedTarget if the mouse left/entered the browser window
4737
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
4738
+ event.type = handleObj.origType;
4739
+ ret = handleObj.handler.apply( this, arguments );
4740
+ event.type = fix;
4741
+ }
4742
+ return ret;
4743
+ }
4744
+ };
4745
+ });
4746
+
4747
+ // Create "bubbling" focus and blur events
4748
+ // Support: Firefox, Chrome, Safari
4749
+ if ( !support.focusinBubbles ) {
4750
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
4751
+
4752
+ // Attach a single capturing handler on the document while someone wants focusin/focusout
4753
+ var handler = function( event ) {
4754
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
4755
+ };
4756
+
4757
+ jQuery.event.special[ fix ] = {
4758
+ setup: function() {
4759
+ var doc = this.ownerDocument || this,
4760
+ attaches = data_priv.access( doc, fix );
4761
+
4762
+ if ( !attaches ) {
4763
+ doc.addEventListener( orig, handler, true );
4764
+ }
4765
+ data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
4766
+ },
4767
+ teardown: function() {
4768
+ var doc = this.ownerDocument || this,
4769
+ attaches = data_priv.access( doc, fix ) - 1;
4770
+
4771
+ if ( !attaches ) {
4772
+ doc.removeEventListener( orig, handler, true );
4773
+ data_priv.remove( doc, fix );
4774
+
4775
+ } else {
4776
+ data_priv.access( doc, fix, attaches );
4777
+ }
4778
+ }
4779
+ };
4780
+ });
4781
+ }
4782
+
4783
+ jQuery.fn.extend({
4784
+
4785
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
4786
+ var origFn, type;
4787
+
4788
+ // Types can be a map of types/handlers
4789
+ if ( typeof types === "object" ) {
4790
+ // ( types-Object, selector, data )
4791
+ if ( typeof selector !== "string" ) {
4792
+ // ( types-Object, data )
4793
+ data = data || selector;
4794
+ selector = undefined;
4795
+ }
4796
+ for ( type in types ) {
4797
+ this.on( type, selector, data, types[ type ], one );
4798
+ }
4799
+ return this;
4800
+ }
4801
+
4802
+ if ( data == null && fn == null ) {
4803
+ // ( types, fn )
4804
+ fn = selector;
4805
+ data = selector = undefined;
4806
+ } else if ( fn == null ) {
4807
+ if ( typeof selector === "string" ) {
4808
+ // ( types, selector, fn )
4809
+ fn = data;
4810
+ data = undefined;
4811
+ } else {
4812
+ // ( types, data, fn )
4813
+ fn = data;
4814
+ data = selector;
4815
+ selector = undefined;
4816
+ }
4817
+ }
4818
+ if ( fn === false ) {
4819
+ fn = returnFalse;
4820
+ } else if ( !fn ) {
4821
+ return this;
4822
+ }
4823
+
4824
+ if ( one === 1 ) {
4825
+ origFn = fn;
4826
+ fn = function( event ) {
4827
+ // Can use an empty set, since event contains the info
4828
+ jQuery().off( event );
4829
+ return origFn.apply( this, arguments );
4830
+ };
4831
+ // Use same guid so caller can remove using origFn
4832
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
4833
+ }
4834
+ return this.each( function() {
4835
+ jQuery.event.add( this, types, fn, data, selector );
4836
+ });
4837
+ },
4838
+ one: function( types, selector, data, fn ) {
4839
+ return this.on( types, selector, data, fn, 1 );
4840
+ },
4841
+ off: function( types, selector, fn ) {
4842
+ var handleObj, type;
4843
+ if ( types && types.preventDefault && types.handleObj ) {
4844
+ // ( event ) dispatched jQuery.Event
4845
+ handleObj = types.handleObj;
4846
+ jQuery( types.delegateTarget ).off(
4847
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
4848
+ handleObj.selector,
4849
+ handleObj.handler
4850
+ );
4851
+ return this;
4852
+ }
4853
+ if ( typeof types === "object" ) {
4854
+ // ( types-object [, selector] )
4855
+ for ( type in types ) {
4856
+ this.off( type, selector, types[ type ] );
4857
+ }
4858
+ return this;
4859
+ }
4860
+ if ( selector === false || typeof selector === "function" ) {
4861
+ // ( types [, fn] )
4862
+ fn = selector;
4863
+ selector = undefined;
4864
+ }
4865
+ if ( fn === false ) {
4866
+ fn = returnFalse;
4867
+ }
4868
+ return this.each(function() {
4869
+ jQuery.event.remove( this, types, fn, selector );
4870
+ });
4871
+ },
4872
+
4873
+ trigger: function( type, data ) {
4874
+ return this.each(function() {
4875
+ jQuery.event.trigger( type, data, this );
4876
+ });
4877
+ },
4878
+ triggerHandler: function( type, data ) {
4879
+ var elem = this[0];
4880
+ if ( elem ) {
4881
+ return jQuery.event.trigger( type, data, elem, true );
4882
+ }
4883
+ }
4884
+ });
4885
+
4886
+
4887
+ var
4888
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
4889
+ rtagName = /<([\w:]+)/,
4890
+ rhtml = /<|&#?\w+;/,
4891
+ rnoInnerhtml = /<(?:script|style|link)/i,
4892
+ // checked="checked" or checked
4893
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
4894
+ rscriptType = /^$|\/(?:java|ecma)script/i,
4895
+ rscriptTypeMasked = /^true\/(.*)/,
4896
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
4897
+
4898
+ // We have to close these tags to support XHTML (#13200)
4899
+ wrapMap = {
4900
+
4901
+ // Support: IE 9
4902
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
4903
+
4904
+ thead: [ 1, "<table>", "</table>" ],
4905
+ col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
4906
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
4907
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
4908
+
4909
+ _default: [ 0, "", "" ]
4910
+ };
4911
+
4912
+ // Support: IE 9
4913
+ wrapMap.optgroup = wrapMap.option;
4914
+
4915
+ wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4916
+ wrapMap.th = wrapMap.td;
4917
+
4918
+ // Support: 1.x compatibility
4919
+ // Manipulating tables requires a tbody
4920
+ function manipulationTarget( elem, content ) {
4921
+ return jQuery.nodeName( elem, "table" ) &&
4922
+ jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
4923
+
4924
+ elem.getElementsByTagName("tbody")[0] ||
4925
+ elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
4926
+ elem;
4927
+ }
4928
+
4929
+ // Replace/restore the type attribute of script elements for safe DOM manipulation
4930
+ function disableScript( elem ) {
4931
+ elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
4932
+ return elem;
4933
+ }
4934
+ function restoreScript( elem ) {
4935
+ var match = rscriptTypeMasked.exec( elem.type );
4936
+
4937
+ if ( match ) {
4938
+ elem.type = match[ 1 ];
4939
+ } else {
4940
+ elem.removeAttribute("type");
4941
+ }
4942
+
4943
+ return elem;
4944
+ }
4945
+
4946
+ // Mark scripts as having already been evaluated
4947
+ function setGlobalEval( elems, refElements ) {
4948
+ var i = 0,
4949
+ l = elems.length;
4950
+
4951
+ for ( ; i < l; i++ ) {
4952
+ data_priv.set(
4953
+ elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
4954
+ );
4955
+ }
4956
+ }
4957
+
4958
+ function cloneCopyEvent( src, dest ) {
4959
+ var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
4960
+
4961
+ if ( dest.nodeType !== 1 ) {
4962
+ return;
4963
+ }
4964
+
4965
+ // 1. Copy private data: events, handlers, etc.
4966
+ if ( data_priv.hasData( src ) ) {
4967
+ pdataOld = data_priv.access( src );
4968
+ pdataCur = data_priv.set( dest, pdataOld );
4969
+ events = pdataOld.events;
4970
+
4971
+ if ( events ) {
4972
+ delete pdataCur.handle;
4973
+ pdataCur.events = {};
4974
+
4975
+ for ( type in events ) {
4976
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
4977
+ jQuery.event.add( dest, type, events[ type ][ i ] );
4978
+ }
4979
+ }
4980
+ }
4981
+ }
4982
+
4983
+ // 2. Copy user data
4984
+ if ( data_user.hasData( src ) ) {
4985
+ udataOld = data_user.access( src );
4986
+ udataCur = jQuery.extend( {}, udataOld );
4987
+
4988
+ data_user.set( dest, udataCur );
4989
+ }
4990
+ }
4991
+
4992
+ function getAll( context, tag ) {
4993
+ var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
4994
+ context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
4995
+ [];
4996
+
4997
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
4998
+ jQuery.merge( [ context ], ret ) :
4999
+ ret;
5000
+ }
5001
+
5002
+ // Support: IE >= 9
5003
+ function fixInput( src, dest ) {
5004
+ var nodeName = dest.nodeName.toLowerCase();
5005
+
5006
+ // Fails to persist the checked state of a cloned checkbox or radio button.
5007
+ if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5008
+ dest.checked = src.checked;
5009
+
5010
+ // Fails to return the selected option to the default selected state when cloning options
5011
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
5012
+ dest.defaultValue = src.defaultValue;
5013
+ }
5014
+ }
5015
+
5016
+ jQuery.extend({
5017
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
5018
+ var i, l, srcElements, destElements,
5019
+ clone = elem.cloneNode( true ),
5020
+ inPage = jQuery.contains( elem.ownerDocument, elem );
5021
+
5022
+ // Support: IE >= 9
5023
+ // Fix Cloning issues
5024
+ if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
5025
+ !jQuery.isXMLDoc( elem ) ) {
5026
+
5027
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
5028
+ destElements = getAll( clone );
5029
+ srcElements = getAll( elem );
5030
+
5031
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {
5032
+ fixInput( srcElements[ i ], destElements[ i ] );
5033
+ }
5034
+ }
5035
+
5036
+ // Copy the events from the original to the clone
5037
+ if ( dataAndEvents ) {
5038
+ if ( deepDataAndEvents ) {
5039
+ srcElements = srcElements || getAll( elem );
5040
+ destElements = destElements || getAll( clone );
5041
+
5042
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {
5043
+ cloneCopyEvent( srcElements[ i ], destElements[ i ] );
5044
+ }
5045
+ } else {
5046
+ cloneCopyEvent( elem, clone );
5047
+ }
5048
+ }
5049
+
5050
+ // Preserve script evaluation history
5051
+ destElements = getAll( clone, "script" );
5052
+ if ( destElements.length > 0 ) {
5053
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
5054
+ }
5055
+
5056
+ // Return the cloned set
5057
+ return clone;
5058
+ },
5059
+
5060
+ buildFragment: function( elems, context, scripts, selection ) {
5061
+ var elem, tmp, tag, wrap, contains, j,
5062
+ fragment = context.createDocumentFragment(),
5063
+ nodes = [],
5064
+ i = 0,
5065
+ l = elems.length;
5066
+
5067
+ for ( ; i < l; i++ ) {
5068
+ elem = elems[ i ];
5069
+
5070
+ if ( elem || elem === 0 ) {
5071
+
5072
+ // Add nodes directly
5073
+ if ( jQuery.type( elem ) === "object" ) {
5074
+ // Support: QtWebKit
5075
+ // jQuery.merge because push.apply(_, arraylike) throws
5076
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
5077
+
5078
+ // Convert non-html into a text node
5079
+ } else if ( !rhtml.test( elem ) ) {
5080
+ nodes.push( context.createTextNode( elem ) );
5081
+
5082
+ // Convert html into DOM nodes
5083
+ } else {
5084
+ tmp = tmp || fragment.appendChild( context.createElement("div") );
5085
+
5086
+ // Deserialize a standard representation
5087
+ tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
5088
+ wrap = wrapMap[ tag ] || wrapMap._default;
5089
+ tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
5090
+
5091
+ // Descend through wrappers to the right content
5092
+ j = wrap[ 0 ];
5093
+ while ( j-- ) {
5094
+ tmp = tmp.lastChild;
5095
+ }
5096
+
5097
+ // Support: QtWebKit
5098
+ // jQuery.merge because push.apply(_, arraylike) throws
5099
+ jQuery.merge( nodes, tmp.childNodes );
5100
+
5101
+ // Remember the top-level container
5102
+ tmp = fragment.firstChild;
5103
+
5104
+ // Fixes #12346
5105
+ // Support: Webkit, IE
5106
+ tmp.textContent = "";
5107
+ }
5108
+ }
5109
+ }
5110
+
5111
+ // Remove wrapper from fragment
5112
+ fragment.textContent = "";
5113
+
5114
+ i = 0;
5115
+ while ( (elem = nodes[ i++ ]) ) {
5116
+
5117
+ // #4087 - If origin and destination elements are the same, and this is
5118
+ // that element, do not do anything
5119
+ if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
5120
+ continue;
5121
+ }
5122
+
5123
+ contains = jQuery.contains( elem.ownerDocument, elem );
5124
+
5125
+ // Append to fragment
5126
+ tmp = getAll( fragment.appendChild( elem ), "script" );
5127
+
5128
+ // Preserve script evaluation history
5129
+ if ( contains ) {
5130
+ setGlobalEval( tmp );
5131
+ }
5132
+
5133
+ // Capture executables
5134
+ if ( scripts ) {
5135
+ j = 0;
5136
+ while ( (elem = tmp[ j++ ]) ) {
5137
+ if ( rscriptType.test( elem.type || "" ) ) {
5138
+ scripts.push( elem );
5139
+ }
5140
+ }
5141
+ }
5142
+ }
5143
+
5144
+ return fragment;
5145
+ },
5146
+
5147
+ cleanData: function( elems ) {
5148
+ var data, elem, type, key,
5149
+ special = jQuery.event.special,
5150
+ i = 0;
5151
+
5152
+ for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
5153
+ if ( jQuery.acceptData( elem ) ) {
5154
+ key = elem[ data_priv.expando ];
5155
+
5156
+ if ( key && (data = data_priv.cache[ key ]) ) {
5157
+ if ( data.events ) {
5158
+ for ( type in data.events ) {
5159
+ if ( special[ type ] ) {
5160
+ jQuery.event.remove( elem, type );
5161
+
5162
+ // This is a shortcut to avoid jQuery.event.remove's overhead
5163
+ } else {
5164
+ jQuery.removeEvent( elem, type, data.handle );
5165
+ }
5166
+ }
5167
+ }
5168
+ if ( data_priv.cache[ key ] ) {
5169
+ // Discard any remaining `private` data
5170
+ delete data_priv.cache[ key ];
5171
+ }
5172
+ }
5173
+ }
5174
+ // Discard any remaining `user` data
5175
+ delete data_user.cache[ elem[ data_user.expando ] ];
5176
+ }
5177
+ }
5178
+ });
5179
+
5180
+ jQuery.fn.extend({
5181
+ text: function( value ) {
5182
+ return access( this, function( value ) {
5183
+ return value === undefined ?
5184
+ jQuery.text( this ) :
5185
+ this.empty().each(function() {
5186
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5187
+ this.textContent = value;
5188
+ }
5189
+ });
5190
+ }, null, value, arguments.length );
5191
+ },
5192
+
5193
+ append: function() {
5194
+ return this.domManip( arguments, function( elem ) {
5195
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5196
+ var target = manipulationTarget( this, elem );
5197
+ target.appendChild( elem );
5198
+ }
5199
+ });
5200
+ },
5201
+
5202
+ prepend: function() {
5203
+ return this.domManip( arguments, function( elem ) {
5204
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5205
+ var target = manipulationTarget( this, elem );
5206
+ target.insertBefore( elem, target.firstChild );
5207
+ }
5208
+ });
5209
+ },
5210
+
5211
+ before: function() {
5212
+ return this.domManip( arguments, function( elem ) {
5213
+ if ( this.parentNode ) {
5214
+ this.parentNode.insertBefore( elem, this );
5215
+ }
5216
+ });
5217
+ },
5218
+
5219
+ after: function() {
5220
+ return this.domManip( arguments, function( elem ) {
5221
+ if ( this.parentNode ) {
5222
+ this.parentNode.insertBefore( elem, this.nextSibling );
5223
+ }
5224
+ });
5225
+ },
5226
+
5227
+ remove: function( selector, keepData /* Internal Use Only */ ) {
5228
+ var elem,
5229
+ elems = selector ? jQuery.filter( selector, this ) : this,
5230
+ i = 0;
5231
+
5232
+ for ( ; (elem = elems[i]) != null; i++ ) {
5233
+ if ( !keepData && elem.nodeType === 1 ) {
5234
+ jQuery.cleanData( getAll( elem ) );
5235
+ }
5236
+
5237
+ if ( elem.parentNode ) {
5238
+ if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
5239
+ setGlobalEval( getAll( elem, "script" ) );
5240
+ }
5241
+ elem.parentNode.removeChild( elem );
5242
+ }
5243
+ }
5244
+
5245
+ return this;
5246
+ },
5247
+
5248
+ empty: function() {
5249
+ var elem,
5250
+ i = 0;
5251
+
5252
+ for ( ; (elem = this[i]) != null; i++ ) {
5253
+ if ( elem.nodeType === 1 ) {
5254
+
5255
+ // Prevent memory leaks
5256
+ jQuery.cleanData( getAll( elem, false ) );
5257
+
5258
+ // Remove any remaining nodes
5259
+ elem.textContent = "";
5260
+ }
5261
+ }
5262
+
5263
+ return this;
5264
+ },
5265
+
5266
+ clone: function( dataAndEvents, deepDataAndEvents ) {
5267
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5268
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5269
+
5270
+ return this.map(function() {
5271
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5272
+ });
5273
+ },
5274
+
5275
+ html: function( value ) {
5276
+ return access( this, function( value ) {
5277
+ var elem = this[ 0 ] || {},
5278
+ i = 0,
5279
+ l = this.length;
5280
+
5281
+ if ( value === undefined && elem.nodeType === 1 ) {
5282
+ return elem.innerHTML;
5283
+ }
5284
+
5285
+ // See if we can take a shortcut and just use innerHTML
5286
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5287
+ !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
5288
+
5289
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
5290
+
5291
+ try {
5292
+ for ( ; i < l; i++ ) {
5293
+ elem = this[ i ] || {};
5294
+
5295
+ // Remove element nodes and prevent memory leaks
5296
+ if ( elem.nodeType === 1 ) {
5297
+ jQuery.cleanData( getAll( elem, false ) );
5298
+ elem.innerHTML = value;
5299
+ }
5300
+ }
5301
+
5302
+ elem = 0;
5303
+
5304
+ // If using innerHTML throws an exception, use the fallback method
5305
+ } catch( e ) {}
5306
+ }
5307
+
5308
+ if ( elem ) {
5309
+ this.empty().append( value );
5310
+ }
5311
+ }, null, value, arguments.length );
5312
+ },
5313
+
5314
+ replaceWith: function() {
5315
+ var arg = arguments[ 0 ];
5316
+
5317
+ // Make the changes, replacing each context element with the new content
5318
+ this.domManip( arguments, function( elem ) {
5319
+ arg = this.parentNode;
5320
+
5321
+ jQuery.cleanData( getAll( this ) );
5322
+
5323
+ if ( arg ) {
5324
+ arg.replaceChild( elem, this );
5325
+ }
5326
+ });
5327
+
5328
+ // Force removal if there was no new content (e.g., from empty arguments)
5329
+ return arg && (arg.length || arg.nodeType) ? this : this.remove();
5330
+ },
5331
+
5332
+ detach: function( selector ) {
5333
+ return this.remove( selector, true );
5334
+ },
5335
+
5336
+ domManip: function( args, callback ) {
5337
+
5338
+ // Flatten any nested arrays
5339
+ args = concat.apply( [], args );
5340
+
5341
+ var fragment, first, scripts, hasScripts, node, doc,
5342
+ i = 0,
5343
+ l = this.length,
5344
+ set = this,
5345
+ iNoClone = l - 1,
5346
+ value = args[ 0 ],
5347
+ isFunction = jQuery.isFunction( value );
5348
+
5349
+ // We can't cloneNode fragments that contain checked, in WebKit
5350
+ if ( isFunction ||
5351
+ ( l > 1 && typeof value === "string" &&
5352
+ !support.checkClone && rchecked.test( value ) ) ) {
5353
+ return this.each(function( index ) {
5354
+ var self = set.eq( index );
5355
+ if ( isFunction ) {
5356
+ args[ 0 ] = value.call( this, index, self.html() );
5357
+ }
5358
+ self.domManip( args, callback );
5359
+ });
5360
+ }
5361
+
5362
+ if ( l ) {
5363
+ fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
5364
+ first = fragment.firstChild;
5365
+
5366
+ if ( fragment.childNodes.length === 1 ) {
5367
+ fragment = first;
5368
+ }
5369
+
5370
+ if ( first ) {
5371
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5372
+ hasScripts = scripts.length;
5373
+
5374
+ // Use the original fragment for the last item instead of the first because it can end up
5375
+ // being emptied incorrectly in certain situations (#8070).
5376
+ for ( ; i < l; i++ ) {
5377
+ node = fragment;
5378
+
5379
+ if ( i !== iNoClone ) {
5380
+ node = jQuery.clone( node, true, true );
5381
+
5382
+ // Keep references to cloned scripts for later restoration
5383
+ if ( hasScripts ) {
5384
+ // Support: QtWebKit
5385
+ // jQuery.merge because push.apply(_, arraylike) throws
5386
+ jQuery.merge( scripts, getAll( node, "script" ) );
5387
+ }
5388
+ }
5389
+
5390
+ callback.call( this[ i ], node, i );
5391
+ }
5392
+
5393
+ if ( hasScripts ) {
5394
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
5395
+
5396
+ // Reenable scripts
5397
+ jQuery.map( scripts, restoreScript );
5398
+
5399
+ // Evaluate executable scripts on first document insertion
5400
+ for ( i = 0; i < hasScripts; i++ ) {
5401
+ node = scripts[ i ];
5402
+ if ( rscriptType.test( node.type || "" ) &&
5403
+ !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
5404
+
5405
+ if ( node.src ) {
5406
+ // Optional AJAX dependency, but won't run scripts if not present
5407
+ if ( jQuery._evalUrl ) {
5408
+ jQuery._evalUrl( node.src );
5409
+ }
5410
+ } else {
5411
+ jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
5412
+ }
5413
+ }
5414
+ }
5415
+ }
5416
+ }
5417
+ }
5418
+
5419
+ return this;
5420
+ }
5421
+ });
5422
+
5423
+ jQuery.each({
5424
+ appendTo: "append",
5425
+ prependTo: "prepend",
5426
+ insertBefore: "before",
5427
+ insertAfter: "after",
5428
+ replaceAll: "replaceWith"
5429
+ }, function( name, original ) {
5430
+ jQuery.fn[ name ] = function( selector ) {
5431
+ var elems,
5432
+ ret = [],
5433
+ insert = jQuery( selector ),
5434
+ last = insert.length - 1,
5435
+ i = 0;
5436
+
5437
+ for ( ; i <= last; i++ ) {
5438
+ elems = i === last ? this : this.clone( true );
5439
+ jQuery( insert[ i ] )[ original ]( elems );
5440
+
5441
+ // Support: QtWebKit
5442
+ // .get() because push.apply(_, arraylike) throws
5443
+ push.apply( ret, elems.get() );
5444
+ }
5445
+
5446
+ return this.pushStack( ret );
5447
+ };
5448
+ });
5449
+
5450
+
5451
+ var iframe,
5452
+ elemdisplay = {};
5453
+
5454
+ /**
5455
+ * Retrieve the actual display of a element
5456
+ * @param {String} name nodeName of the element
5457
+ * @param {Object} doc Document object
5458
+ */
5459
+ // Called only from within defaultDisplay
5460
+ function actualDisplay( name, doc ) {
5461
+ var style,
5462
+ elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
5463
+
5464
+ // getDefaultComputedStyle might be reliably used only on attached element
5465
+ display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
5466
+
5467
+ // Use of this method is a temporary fix (more like optmization) until something better comes along,
5468
+ // since it was removed from specification and supported only in FF
5469
+ style.display : jQuery.css( elem[ 0 ], "display" );
5470
+
5471
+ // We don't have any data stored on the element,
5472
+ // so use "detach" method as fast way to get rid of the element
5473
+ elem.detach();
5474
+
5475
+ return display;
5476
+ }
5477
+
5478
+ /**
5479
+ * Try to determine the default display value of an element
5480
+ * @param {String} nodeName
5481
+ */
5482
+ function defaultDisplay( nodeName ) {
5483
+ var doc = document,
5484
+ display = elemdisplay[ nodeName ];
5485
+
5486
+ if ( !display ) {
5487
+ display = actualDisplay( nodeName, doc );
5488
+
5489
+ // If the simple way fails, read from inside an iframe
5490
+ if ( display === "none" || !display ) {
5491
+
5492
+ // Use the already-created iframe if possible
5493
+ iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
5494
+
5495
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
5496
+ doc = iframe[ 0 ].contentDocument;
5497
+
5498
+ // Support: IE
5499
+ doc.write();
5500
+ doc.close();
5501
+
5502
+ display = actualDisplay( nodeName, doc );
5503
+ iframe.detach();
5504
+ }
5505
+
5506
+ // Store the correct default display
5507
+ elemdisplay[ nodeName ] = display;
5508
+ }
5509
+
5510
+ return display;
5511
+ }
5512
+ var rmargin = (/^margin/);
5513
+
5514
+ var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
5515
+
5516
+ var getStyles = function( elem ) {
5517
+ return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
5518
+ };
5519
+
5520
+
5521
+
5522
+ function curCSS( elem, name, computed ) {
5523
+ var width, minWidth, maxWidth, ret,
5524
+ style = elem.style;
5525
+
5526
+ computed = computed || getStyles( elem );
5527
+
5528
+ // Support: IE9
5529
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
5530
+ if ( computed ) {
5531
+ ret = computed.getPropertyValue( name ) || computed[ name ];
5532
+ }
5533
+
5534
+ if ( computed ) {
5535
+
5536
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
5537
+ ret = jQuery.style( elem, name );
5538
+ }
5539
+
5540
+ // Support: iOS < 6
5541
+ // A tribute to the "awesome hack by Dean Edwards"
5542
+ // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
5543
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
5544
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
5545
+
5546
+ // Remember the original values
5547
+ width = style.width;
5548
+ minWidth = style.minWidth;
5549
+ maxWidth = style.maxWidth;
5550
+
5551
+ // Put in the new values to get a computed value out
5552
+ style.minWidth = style.maxWidth = style.width = ret;
5553
+ ret = computed.width;
5554
+
5555
+ // Revert the changed values
5556
+ style.width = width;
5557
+ style.minWidth = minWidth;
5558
+ style.maxWidth = maxWidth;
5559
+ }
5560
+ }
5561
+
5562
+ return ret !== undefined ?
5563
+ // Support: IE
5564
+ // IE returns zIndex value as an integer.
5565
+ ret + "" :
5566
+ ret;
5567
+ }
5568
+
5569
+
5570
+ function addGetHookIf( conditionFn, hookFn ) {
5571
+ // Define the hook, we'll check on the first run if it's really needed.
5572
+ return {
5573
+ get: function() {
5574
+ if ( conditionFn() ) {
5575
+ // Hook not needed (or it's not possible to use it due to missing dependency),
5576
+ // remove it.
5577
+ // Since there are no other hooks for marginRight, remove the whole object.
5578
+ delete this.get;
5579
+ return;
5580
+ }
5581
+
5582
+ // Hook needed; redefine it so that the support test is not executed again.
5583
+
5584
+ return (this.get = hookFn).apply( this, arguments );
5585
+ }
5586
+ };
5587
+ }
5588
+
5589
+
5590
+ (function() {
5591
+ var pixelPositionVal, boxSizingReliableVal,
5592
+ docElem = document.documentElement,
5593
+ container = document.createElement( "div" ),
5594
+ div = document.createElement( "div" );
5595
+
5596
+ if ( !div.style ) {
5597
+ return;
5598
+ }
5599
+
5600
+ div.style.backgroundClip = "content-box";
5601
+ div.cloneNode( true ).style.backgroundClip = "";
5602
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
5603
+
5604
+ container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
5605
+ "position:absolute";
5606
+ container.appendChild( div );
5607
+
5608
+ // Executing both pixelPosition & boxSizingReliable tests require only one layout
5609
+ // so they're executed at the same time to save the second computation.
5610
+ function computePixelPositionAndBoxSizingReliable() {
5611
+ div.style.cssText =
5612
+ // Support: Firefox<29, Android 2.3
5613
+ // Vendor-prefix box-sizing
5614
+ "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
5615
+ "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
5616
+ "border:1px;padding:1px;width:4px;position:absolute";
5617
+ div.innerHTML = "";
5618
+ docElem.appendChild( container );
5619
+
5620
+ var divStyle = window.getComputedStyle( div, null );
5621
+ pixelPositionVal = divStyle.top !== "1%";
5622
+ boxSizingReliableVal = divStyle.width === "4px";
5623
+
5624
+ docElem.removeChild( container );
5625
+ }
5626
+
5627
+ // Support: node.js jsdom
5628
+ // Don't assume that getComputedStyle is a property of the global object
5629
+ if ( window.getComputedStyle ) {
5630
+ jQuery.extend( support, {
5631
+ pixelPosition: function() {
5632
+ // This test is executed only once but we still do memoizing
5633
+ // since we can use the boxSizingReliable pre-computing.
5634
+ // No need to check if the test was already performed, though.
5635
+ computePixelPositionAndBoxSizingReliable();
5636
+ return pixelPositionVal;
5637
+ },
5638
+ boxSizingReliable: function() {
5639
+ if ( boxSizingReliableVal == null ) {
5640
+ computePixelPositionAndBoxSizingReliable();
5641
+ }
5642
+ return boxSizingReliableVal;
5643
+ },
5644
+ reliableMarginRight: function() {
5645
+ // Support: Android 2.3
5646
+ // Check if div with explicit width and no margin-right incorrectly
5647
+ // gets computed margin-right based on width of container. (#3333)
5648
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
5649
+ // This support function is only executed once so no memoizing is needed.
5650
+ var ret,
5651
+ marginDiv = div.appendChild( document.createElement( "div" ) );
5652
+
5653
+ // Reset CSS: box-sizing; display; margin; border; padding
5654
+ marginDiv.style.cssText = div.style.cssText =
5655
+ // Support: Firefox<29, Android 2.3
5656
+ // Vendor-prefix box-sizing
5657
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
5658
+ "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
5659
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
5660
+ div.style.width = "1px";
5661
+ docElem.appendChild( container );
5662
+
5663
+ ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
5664
+
5665
+ docElem.removeChild( container );
5666
+
5667
+ return ret;
5668
+ }
5669
+ });
5670
+ }
5671
+ })();
5672
+
5673
+
5674
+ // A method for quickly swapping in/out CSS properties to get correct calculations.
5675
+ jQuery.swap = function( elem, options, callback, args ) {
5676
+ var ret, name,
5677
+ old = {};
5678
+
5679
+ // Remember the old values, and insert the new ones
5680
+ for ( name in options ) {
5681
+ old[ name ] = elem.style[ name ];
5682
+ elem.style[ name ] = options[ name ];
5683
+ }
5684
+
5685
+ ret = callback.apply( elem, args || [] );
5686
+
5687
+ // Revert the old values
5688
+ for ( name in options ) {
5689
+ elem.style[ name ] = old[ name ];
5690
+ }
5691
+
5692
+ return ret;
5693
+ };
5694
+
5695
+
5696
+ var
5697
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
5698
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
5699
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
5700
+ rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
5701
+ rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
5702
+
5703
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
5704
+ cssNormalTransform = {
5705
+ letterSpacing: "0",
5706
+ fontWeight: "400"
5707
+ },
5708
+
5709
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
5710
+
5711
+ // return a css property mapped to a potentially vendor prefixed property
5712
+ function vendorPropName( style, name ) {
5713
+
5714
+ // shortcut for names that are not vendor prefixed
5715
+ if ( name in style ) {
5716
+ return name;
5717
+ }
5718
+
5719
+ // check for vendor prefixed names
5720
+ var capName = name[0].toUpperCase() + name.slice(1),
5721
+ origName = name,
5722
+ i = cssPrefixes.length;
5723
+
5724
+ while ( i-- ) {
5725
+ name = cssPrefixes[ i ] + capName;
5726
+ if ( name in style ) {
5727
+ return name;
5728
+ }
5729
+ }
5730
+
5731
+ return origName;
5732
+ }
5733
+
5734
+ function setPositiveNumber( elem, value, subtract ) {
5735
+ var matches = rnumsplit.exec( value );
5736
+ return matches ?
5737
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
5738
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
5739
+ value;
5740
+ }
5741
+
5742
+ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
5743
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
5744
+ // If we already have the right measurement, avoid augmentation
5745
+ 4 :
5746
+ // Otherwise initialize for horizontal or vertical properties
5747
+ name === "width" ? 1 : 0,
5748
+
5749
+ val = 0;
5750
+
5751
+ for ( ; i < 4; i += 2 ) {
5752
+ // both box models exclude margin, so add it if we want it
5753
+ if ( extra === "margin" ) {
5754
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
5755
+ }
5756
+
5757
+ if ( isBorderBox ) {
5758
+ // border-box includes padding, so remove it if we want content
5759
+ if ( extra === "content" ) {
5760
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
5761
+ }
5762
+
5763
+ // at this point, extra isn't border nor margin, so remove border
5764
+ if ( extra !== "margin" ) {
5765
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
5766
+ }
5767
+ } else {
5768
+ // at this point, extra isn't content, so add padding
5769
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
5770
+
5771
+ // at this point, extra isn't content nor padding, so add border
5772
+ if ( extra !== "padding" ) {
5773
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
5774
+ }
5775
+ }
5776
+ }
5777
+
5778
+ return val;
5779
+ }
5780
+
5781
+ function getWidthOrHeight( elem, name, extra ) {
5782
+
5783
+ // Start with offset property, which is equivalent to the border-box value
5784
+ var valueIsBorderBox = true,
5785
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
5786
+ styles = getStyles( elem ),
5787
+ isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
5788
+
5789
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
5790
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
5791
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
5792
+ if ( val <= 0 || val == null ) {
5793
+ // Fall back to computed then uncomputed css if necessary
5794
+ val = curCSS( elem, name, styles );
5795
+ if ( val < 0 || val == null ) {
5796
+ val = elem.style[ name ];
5797
+ }
5798
+
5799
+ // Computed unit is not pixels. Stop here and return.
5800
+ if ( rnumnonpx.test(val) ) {
5801
+ return val;
5802
+ }
5803
+
5804
+ // we need the check for style in case a browser which returns unreliable values
5805
+ // for getComputedStyle silently falls back to the reliable elem.style
5806
+ valueIsBorderBox = isBorderBox &&
5807
+ ( support.boxSizingReliable() || val === elem.style[ name ] );
5808
+
5809
+ // Normalize "", auto, and prepare for extra
5810
+ val = parseFloat( val ) || 0;
5811
+ }
5812
+
5813
+ // use the active box-sizing model to add/subtract irrelevant styles
5814
+ return ( val +
5815
+ augmentWidthOrHeight(
5816
+ elem,
5817
+ name,
5818
+ extra || ( isBorderBox ? "border" : "content" ),
5819
+ valueIsBorderBox,
5820
+ styles
5821
+ )
5822
+ ) + "px";
5823
+ }
5824
+
5825
+ function showHide( elements, show ) {
5826
+ var display, elem, hidden,
5827
+ values = [],
5828
+ index = 0,
5829
+ length = elements.length;
5830
+
5831
+ for ( ; index < length; index++ ) {
5832
+ elem = elements[ index ];
5833
+ if ( !elem.style ) {
5834
+ continue;
5835
+ }
5836
+
5837
+ values[ index ] = data_priv.get( elem, "olddisplay" );
5838
+ display = elem.style.display;
5839
+ if ( show ) {
5840
+ // Reset the inline display of this element to learn if it is
5841
+ // being hidden by cascaded rules or not
5842
+ if ( !values[ index ] && display === "none" ) {
5843
+ elem.style.display = "";
5844
+ }
5845
+
5846
+ // Set elements which have been overridden with display: none
5847
+ // in a stylesheet to whatever the default browser style is
5848
+ // for such an element
5849
+ if ( elem.style.display === "" && isHidden( elem ) ) {
5850
+ values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
5851
+ }
5852
+ } else {
5853
+ hidden = isHidden( elem );
5854
+
5855
+ if ( display !== "none" || !hidden ) {
5856
+ data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
5857
+ }
5858
+ }
5859
+ }
5860
+
5861
+ // Set the display of most of the elements in a second loop
5862
+ // to avoid the constant reflow
5863
+ for ( index = 0; index < length; index++ ) {
5864
+ elem = elements[ index ];
5865
+ if ( !elem.style ) {
5866
+ continue;
5867
+ }
5868
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
5869
+ elem.style.display = show ? values[ index ] || "" : "none";
5870
+ }
5871
+ }
5872
+
5873
+ return elements;
5874
+ }
5875
+
5876
+ jQuery.extend({
5877
+ // Add in style property hooks for overriding the default
5878
+ // behavior of getting and setting a style property
5879
+ cssHooks: {
5880
+ opacity: {
5881
+ get: function( elem, computed ) {
5882
+ if ( computed ) {
5883
+ // We should always get a number back from opacity
5884
+ var ret = curCSS( elem, "opacity" );
5885
+ return ret === "" ? "1" : ret;
5886
+ }
5887
+ }
5888
+ }
5889
+ },
5890
+
5891
+ // Don't automatically add "px" to these possibly-unitless properties
5892
+ cssNumber: {
5893
+ "columnCount": true,
5894
+ "fillOpacity": true,
5895
+ "flexGrow": true,
5896
+ "flexShrink": true,
5897
+ "fontWeight": true,
5898
+ "lineHeight": true,
5899
+ "opacity": true,
5900
+ "order": true,
5901
+ "orphans": true,
5902
+ "widows": true,
5903
+ "zIndex": true,
5904
+ "zoom": true
5905
+ },
5906
+
5907
+ // Add in properties whose names you wish to fix before
5908
+ // setting or getting the value
5909
+ cssProps: {
5910
+ // normalize float css property
5911
+ "float": "cssFloat"
5912
+ },
5913
+
5914
+ // Get and set the style property on a DOM Node
5915
+ style: function( elem, name, value, extra ) {
5916
+ // Don't set styles on text and comment nodes
5917
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
5918
+ return;
5919
+ }
5920
+
5921
+ // Make sure that we're working with the right name
5922
+ var ret, type, hooks,
5923
+ origName = jQuery.camelCase( name ),
5924
+ style = elem.style;
5925
+
5926
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
5927
+
5928
+ // gets hook for the prefixed version
5929
+ // followed by the unprefixed version
5930
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
5931
+
5932
+ // Check if we're setting a value
5933
+ if ( value !== undefined ) {
5934
+ type = typeof value;
5935
+
5936
+ // convert relative number strings (+= or -=) to relative numbers. #7345
5937
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
5938
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
5939
+ // Fixes bug #9237
5940
+ type = "number";
5941
+ }
5942
+
5943
+ // Make sure that null and NaN values aren't set. See: #7116
5944
+ if ( value == null || value !== value ) {
5945
+ return;
5946
+ }
5947
+
5948
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
5949
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
5950
+ value += "px";
5951
+ }
5952
+
5953
+ // Fixes #8908, it can be done more correctly by specifying setters in cssHooks,
5954
+ // but it would mean to define eight (for every problematic property) identical functions
5955
+ if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
5956
+ style[ name ] = "inherit";
5957
+ }
5958
+
5959
+ // If a hook was provided, use that value, otherwise just set the specified value
5960
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
5961
+ style[ name ] = value;
5962
+ }
5963
+
5964
+ } else {
5965
+ // If a hook was provided get the non-computed value from there
5966
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
5967
+ return ret;
5968
+ }
5969
+
5970
+ // Otherwise just get the value from the style object
5971
+ return style[ name ];
5972
+ }
5973
+ },
5974
+
5975
+ css: function( elem, name, extra, styles ) {
5976
+ var val, num, hooks,
5977
+ origName = jQuery.camelCase( name );
5978
+
5979
+ // Make sure that we're working with the right name
5980
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
5981
+
5982
+ // gets hook for the prefixed version
5983
+ // followed by the unprefixed version
5984
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
5985
+
5986
+ // If a hook was provided get the computed value from there
5987
+ if ( hooks && "get" in hooks ) {
5988
+ val = hooks.get( elem, true, extra );
5989
+ }
5990
+
5991
+ // Otherwise, if a way to get the computed value exists, use that
5992
+ if ( val === undefined ) {
5993
+ val = curCSS( elem, name, styles );
5994
+ }
5995
+
5996
+ //convert "normal" to computed value
5997
+ if ( val === "normal" && name in cssNormalTransform ) {
5998
+ val = cssNormalTransform[ name ];
5999
+ }
6000
+
6001
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
6002
+ if ( extra === "" || extra ) {
6003
+ num = parseFloat( val );
6004
+ return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
6005
+ }
6006
+ return val;
6007
+ }
6008
+ });
6009
+
6010
+ jQuery.each([ "height", "width" ], function( i, name ) {
6011
+ jQuery.cssHooks[ name ] = {
6012
+ get: function( elem, computed, extra ) {
6013
+ if ( computed ) {
6014
+ // certain elements can have dimension info if we invisibly show them
6015
+ // however, it must have a current display style that would benefit from this
6016
+ return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
6017
+ jQuery.swap( elem, cssShow, function() {
6018
+ return getWidthOrHeight( elem, name, extra );
6019
+ }) :
6020
+ getWidthOrHeight( elem, name, extra );
6021
+ }
6022
+ },
6023
+
6024
+ set: function( elem, value, extra ) {
6025
+ var styles = extra && getStyles( elem );
6026
+ return setPositiveNumber( elem, value, extra ?
6027
+ augmentWidthOrHeight(
6028
+ elem,
6029
+ name,
6030
+ extra,
6031
+ jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6032
+ styles
6033
+ ) : 0
6034
+ );
6035
+ }
6036
+ };
6037
+ });
6038
+
6039
+ // Support: Android 2.3
6040
+ jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
6041
+ function( elem, computed ) {
6042
+ if ( computed ) {
6043
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6044
+ // Work around by temporarily setting element display to inline-block
6045
+ return jQuery.swap( elem, { "display": "inline-block" },
6046
+ curCSS, [ elem, "marginRight" ] );
6047
+ }
6048
+ }
6049
+ );
6050
+
6051
+ // These hooks are used by animate to expand properties
6052
+ jQuery.each({
6053
+ margin: "",
6054
+ padding: "",
6055
+ border: "Width"
6056
+ }, function( prefix, suffix ) {
6057
+ jQuery.cssHooks[ prefix + suffix ] = {
6058
+ expand: function( value ) {
6059
+ var i = 0,
6060
+ expanded = {},
6061
+
6062
+ // assumes a single number if not a string
6063
+ parts = typeof value === "string" ? value.split(" ") : [ value ];
6064
+
6065
+ for ( ; i < 4; i++ ) {
6066
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
6067
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6068
+ }
6069
+
6070
+ return expanded;
6071
+ }
6072
+ };
6073
+
6074
+ if ( !rmargin.test( prefix ) ) {
6075
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6076
+ }
6077
+ });
6078
+
6079
+ jQuery.fn.extend({
6080
+ css: function( name, value ) {
6081
+ return access( this, function( elem, name, value ) {
6082
+ var styles, len,
6083
+ map = {},
6084
+ i = 0;
6085
+
6086
+ if ( jQuery.isArray( name ) ) {
6087
+ styles = getStyles( elem );
6088
+ len = name.length;
6089
+
6090
+ for ( ; i < len; i++ ) {
6091
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6092
+ }
6093
+
6094
+ return map;
6095
+ }
6096
+
6097
+ return value !== undefined ?
6098
+ jQuery.style( elem, name, value ) :
6099
+ jQuery.css( elem, name );
6100
+ }, name, value, arguments.length > 1 );
6101
+ },
6102
+ show: function() {
6103
+ return showHide( this, true );
6104
+ },
6105
+ hide: function() {
6106
+ return showHide( this );
6107
+ },
6108
+ toggle: function( state ) {
6109
+ if ( typeof state === "boolean" ) {
6110
+ return state ? this.show() : this.hide();
6111
+ }
6112
+
6113
+ return this.each(function() {
6114
+ if ( isHidden( this ) ) {
6115
+ jQuery( this ).show();
6116
+ } else {
6117
+ jQuery( this ).hide();
6118
+ }
6119
+ });
6120
+ }
6121
+ });
6122
+
6123
+
6124
+ function Tween( elem, options, prop, end, easing ) {
6125
+ return new Tween.prototype.init( elem, options, prop, end, easing );
6126
+ }
6127
+ jQuery.Tween = Tween;
6128
+
6129
+ Tween.prototype = {
6130
+ constructor: Tween,
6131
+ init: function( elem, options, prop, end, easing, unit ) {
6132
+ this.elem = elem;
6133
+ this.prop = prop;
6134
+ this.easing = easing || "swing";
6135
+ this.options = options;
6136
+ this.start = this.now = this.cur();
6137
+ this.end = end;
6138
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
6139
+ },
6140
+ cur: function() {
6141
+ var hooks = Tween.propHooks[ this.prop ];
6142
+
6143
+ return hooks && hooks.get ?
6144
+ hooks.get( this ) :
6145
+ Tween.propHooks._default.get( this );
6146
+ },
6147
+ run: function( percent ) {
6148
+ var eased,
6149
+ hooks = Tween.propHooks[ this.prop ];
6150
+
6151
+ if ( this.options.duration ) {
6152
+ this.pos = eased = jQuery.easing[ this.easing ](
6153
+ percent, this.options.duration * percent, 0, 1, this.options.duration
6154
+ );
6155
+ } else {
6156
+ this.pos = eased = percent;
6157
+ }
6158
+ this.now = ( this.end - this.start ) * eased + this.start;
6159
+
6160
+ if ( this.options.step ) {
6161
+ this.options.step.call( this.elem, this.now, this );
6162
+ }
6163
+
6164
+ if ( hooks && hooks.set ) {
6165
+ hooks.set( this );
6166
+ } else {
6167
+ Tween.propHooks._default.set( this );
6168
+ }
6169
+ return this;
6170
+ }
6171
+ };
6172
+
6173
+ Tween.prototype.init.prototype = Tween.prototype;
6174
+
6175
+ Tween.propHooks = {
6176
+ _default: {
6177
+ get: function( tween ) {
6178
+ var result;
6179
+
6180
+ if ( tween.elem[ tween.prop ] != null &&
6181
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
6182
+ return tween.elem[ tween.prop ];
6183
+ }
6184
+
6185
+ // passing an empty string as a 3rd parameter to .css will automatically
6186
+ // attempt a parseFloat and fallback to a string if the parse fails
6187
+ // so, simple values such as "10px" are parsed to Float.
6188
+ // complex values such as "rotate(1rad)" are returned as is.
6189
+ result = jQuery.css( tween.elem, tween.prop, "" );
6190
+ // Empty strings, null, undefined and "auto" are converted to 0.
6191
+ return !result || result === "auto" ? 0 : result;
6192
+ },
6193
+ set: function( tween ) {
6194
+ // use step hook for back compat - use cssHook if its there - use .style if its
6195
+ // available and use plain properties where available
6196
+ if ( jQuery.fx.step[ tween.prop ] ) {
6197
+ jQuery.fx.step[ tween.prop ]( tween );
6198
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
6199
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
6200
+ } else {
6201
+ tween.elem[ tween.prop ] = tween.now;
6202
+ }
6203
+ }
6204
+ }
6205
+ };
6206
+
6207
+ // Support: IE9
6208
+ // Panic based approach to setting things on disconnected nodes
6209
+
6210
+ Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
6211
+ set: function( tween ) {
6212
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
6213
+ tween.elem[ tween.prop ] = tween.now;
6214
+ }
6215
+ }
6216
+ };
6217
+
6218
+ jQuery.easing = {
6219
+ linear: function( p ) {
6220
+ return p;
6221
+ },
6222
+ swing: function( p ) {
6223
+ return 0.5 - Math.cos( p * Math.PI ) / 2;
6224
+ }
6225
+ };
6226
+
6227
+ jQuery.fx = Tween.prototype.init;
6228
+
6229
+ // Back Compat <1.8 extension point
6230
+ jQuery.fx.step = {};
6231
+
6232
+
6233
+
6234
+
6235
+ var
6236
+ fxNow, timerId,
6237
+ rfxtypes = /^(?:toggle|show|hide)$/,
6238
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
6239
+ rrun = /queueHooks$/,
6240
+ animationPrefilters = [ defaultPrefilter ],
6241
+ tweeners = {
6242
+ "*": [ function( prop, value ) {
6243
+ var tween = this.createTween( prop, value ),
6244
+ target = tween.cur(),
6245
+ parts = rfxnum.exec( value ),
6246
+ unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
6247
+
6248
+ // Starting value computation is required for potential unit mismatches
6249
+ start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
6250
+ rfxnum.exec( jQuery.css( tween.elem, prop ) ),
6251
+ scale = 1,
6252
+ maxIterations = 20;
6253
+
6254
+ if ( start && start[ 3 ] !== unit ) {
6255
+ // Trust units reported by jQuery.css
6256
+ unit = unit || start[ 3 ];
6257
+
6258
+ // Make sure we update the tween properties later on
6259
+ parts = parts || [];
6260
+
6261
+ // Iteratively approximate from a nonzero starting point
6262
+ start = +target || 1;
6263
+
6264
+ do {
6265
+ // If previous iteration zeroed out, double until we get *something*
6266
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
6267
+ scale = scale || ".5";
6268
+
6269
+ // Adjust and apply
6270
+ start = start / scale;
6271
+ jQuery.style( tween.elem, prop, start + unit );
6272
+
6273
+ // Update scale, tolerating zero or NaN from tween.cur()
6274
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
6275
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
6276
+ }
6277
+
6278
+ // Update tween properties
6279
+ if ( parts ) {
6280
+ start = tween.start = +start || +target || 0;
6281
+ tween.unit = unit;
6282
+ // If a +=/-= token was provided, we're doing a relative animation
6283
+ tween.end = parts[ 1 ] ?
6284
+ start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
6285
+ +parts[ 2 ];
6286
+ }
6287
+
6288
+ return tween;
6289
+ } ]
6290
+ };
6291
+
6292
+ // Animations created synchronously will run synchronously
6293
+ function createFxNow() {
6294
+ setTimeout(function() {
6295
+ fxNow = undefined;
6296
+ });
6297
+ return ( fxNow = jQuery.now() );
6298
+ }
6299
+
6300
+ // Generate parameters to create a standard animation
6301
+ function genFx( type, includeWidth ) {
6302
+ var which,
6303
+ i = 0,
6304
+ attrs = { height: type };
6305
+
6306
+ // if we include width, step value is 1 to do all cssExpand values,
6307
+ // if we don't include width, step value is 2 to skip over Left and Right
6308
+ includeWidth = includeWidth ? 1 : 0;
6309
+ for ( ; i < 4 ; i += 2 - includeWidth ) {
6310
+ which = cssExpand[ i ];
6311
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
6312
+ }
6313
+
6314
+ if ( includeWidth ) {
6315
+ attrs.opacity = attrs.width = type;
6316
+ }
6317
+
6318
+ return attrs;
6319
+ }
6320
+
6321
+ function createTween( value, prop, animation ) {
6322
+ var tween,
6323
+ collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
6324
+ index = 0,
6325
+ length = collection.length;
6326
+ for ( ; index < length; index++ ) {
6327
+ if ( (tween = collection[ index ].call( animation, prop, value )) ) {
6328
+
6329
+ // we're done with this property
6330
+ return tween;
6331
+ }
6332
+ }
6333
+ }
6334
+
6335
+ function defaultPrefilter( elem, props, opts ) {
6336
+ /* jshint validthis: true */
6337
+ var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
6338
+ anim = this,
6339
+ orig = {},
6340
+ style = elem.style,
6341
+ hidden = elem.nodeType && isHidden( elem ),
6342
+ dataShow = data_priv.get( elem, "fxshow" );
6343
+
6344
+ // handle queue: false promises
6345
+ if ( !opts.queue ) {
6346
+ hooks = jQuery._queueHooks( elem, "fx" );
6347
+ if ( hooks.unqueued == null ) {
6348
+ hooks.unqueued = 0;
6349
+ oldfire = hooks.empty.fire;
6350
+ hooks.empty.fire = function() {
6351
+ if ( !hooks.unqueued ) {
6352
+ oldfire();
6353
+ }
6354
+ };
6355
+ }
6356
+ hooks.unqueued++;
6357
+
6358
+ anim.always(function() {
6359
+ // doing this makes sure that the complete handler will be called
6360
+ // before this completes
6361
+ anim.always(function() {
6362
+ hooks.unqueued--;
6363
+ if ( !jQuery.queue( elem, "fx" ).length ) {
6364
+ hooks.empty.fire();
6365
+ }
6366
+ });
6367
+ });
6368
+ }
6369
+
6370
+ // height/width overflow pass
6371
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
6372
+ // Make sure that nothing sneaks out
6373
+ // Record all 3 overflow attributes because IE9-10 do not
6374
+ // change the overflow attribute when overflowX and
6375
+ // overflowY are set to the same value
6376
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
6377
+
6378
+ // Set display property to inline-block for height/width
6379
+ // animations on inline elements that are having width/height animated
6380
+ display = jQuery.css( elem, "display" );
6381
+
6382
+ // Test default display if display is currently "none"
6383
+ checkDisplay = display === "none" ?
6384
+ data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
6385
+
6386
+ if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
6387
+ style.display = "inline-block";
6388
+ }
6389
+ }
6390
+
6391
+ if ( opts.overflow ) {
6392
+ style.overflow = "hidden";
6393
+ anim.always(function() {
6394
+ style.overflow = opts.overflow[ 0 ];
6395
+ style.overflowX = opts.overflow[ 1 ];
6396
+ style.overflowY = opts.overflow[ 2 ];
6397
+ });
6398
+ }
6399
+
6400
+ // show/hide pass
6401
+ for ( prop in props ) {
6402
+ value = props[ prop ];
6403
+ if ( rfxtypes.exec( value ) ) {
6404
+ delete props[ prop ];
6405
+ toggle = toggle || value === "toggle";
6406
+ if ( value === ( hidden ? "hide" : "show" ) ) {
6407
+
6408
+ // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
6409
+ if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
6410
+ hidden = true;
6411
+ } else {
6412
+ continue;
6413
+ }
6414
+ }
6415
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
6416
+
6417
+ // Any non-fx value stops us from restoring the original display value
6418
+ } else {
6419
+ display = undefined;
6420
+ }
6421
+ }
6422
+
6423
+ if ( !jQuery.isEmptyObject( orig ) ) {
6424
+ if ( dataShow ) {
6425
+ if ( "hidden" in dataShow ) {
6426
+ hidden = dataShow.hidden;
6427
+ }
6428
+ } else {
6429
+ dataShow = data_priv.access( elem, "fxshow", {} );
6430
+ }
6431
+
6432
+ // store state if its toggle - enables .stop().toggle() to "reverse"
6433
+ if ( toggle ) {
6434
+ dataShow.hidden = !hidden;
6435
+ }
6436
+ if ( hidden ) {
6437
+ jQuery( elem ).show();
6438
+ } else {
6439
+ anim.done(function() {
6440
+ jQuery( elem ).hide();
6441
+ });
6442
+ }
6443
+ anim.done(function() {
6444
+ var prop;
6445
+
6446
+ data_priv.remove( elem, "fxshow" );
6447
+ for ( prop in orig ) {
6448
+ jQuery.style( elem, prop, orig[ prop ] );
6449
+ }
6450
+ });
6451
+ for ( prop in orig ) {
6452
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
6453
+
6454
+ if ( !( prop in dataShow ) ) {
6455
+ dataShow[ prop ] = tween.start;
6456
+ if ( hidden ) {
6457
+ tween.end = tween.start;
6458
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
6459
+ }
6460
+ }
6461
+ }
6462
+
6463
+ // If this is a noop like .hide().hide(), restore an overwritten display value
6464
+ } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
6465
+ style.display = display;
6466
+ }
6467
+ }
6468
+
6469
+ function propFilter( props, specialEasing ) {
6470
+ var index, name, easing, value, hooks;
6471
+
6472
+ // camelCase, specialEasing and expand cssHook pass
6473
+ for ( index in props ) {
6474
+ name = jQuery.camelCase( index );
6475
+ easing = specialEasing[ name ];
6476
+ value = props[ index ];
6477
+ if ( jQuery.isArray( value ) ) {
6478
+ easing = value[ 1 ];
6479
+ value = props[ index ] = value[ 0 ];
6480
+ }
6481
+
6482
+ if ( index !== name ) {
6483
+ props[ name ] = value;
6484
+ delete props[ index ];
6485
+ }
6486
+
6487
+ hooks = jQuery.cssHooks[ name ];
6488
+ if ( hooks && "expand" in hooks ) {
6489
+ value = hooks.expand( value );
6490
+ delete props[ name ];
6491
+
6492
+ // not quite $.extend, this wont overwrite keys already present.
6493
+ // also - reusing 'index' from above because we have the correct "name"
6494
+ for ( index in value ) {
6495
+ if ( !( index in props ) ) {
6496
+ props[ index ] = value[ index ];
6497
+ specialEasing[ index ] = easing;
6498
+ }
6499
+ }
6500
+ } else {
6501
+ specialEasing[ name ] = easing;
6502
+ }
6503
+ }
6504
+ }
6505
+
6506
+ function Animation( elem, properties, options ) {
6507
+ var result,
6508
+ stopped,
6509
+ index = 0,
6510
+ length = animationPrefilters.length,
6511
+ deferred = jQuery.Deferred().always( function() {
6512
+ // don't match elem in the :animated selector
6513
+ delete tick.elem;
6514
+ }),
6515
+ tick = function() {
6516
+ if ( stopped ) {
6517
+ return false;
6518
+ }
6519
+ var currentTime = fxNow || createFxNow(),
6520
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
6521
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
6522
+ temp = remaining / animation.duration || 0,
6523
+ percent = 1 - temp,
6524
+ index = 0,
6525
+ length = animation.tweens.length;
6526
+
6527
+ for ( ; index < length ; index++ ) {
6528
+ animation.tweens[ index ].run( percent );
6529
+ }
6530
+
6531
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
6532
+
6533
+ if ( percent < 1 && length ) {
6534
+ return remaining;
6535
+ } else {
6536
+ deferred.resolveWith( elem, [ animation ] );
6537
+ return false;
6538
+ }
6539
+ },
6540
+ animation = deferred.promise({
6541
+ elem: elem,
6542
+ props: jQuery.extend( {}, properties ),
6543
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
6544
+ originalProperties: properties,
6545
+ originalOptions: options,
6546
+ startTime: fxNow || createFxNow(),
6547
+ duration: options.duration,
6548
+ tweens: [],
6549
+ createTween: function( prop, end ) {
6550
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
6551
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
6552
+ animation.tweens.push( tween );
6553
+ return tween;
6554
+ },
6555
+ stop: function( gotoEnd ) {
6556
+ var index = 0,
6557
+ // if we are going to the end, we want to run all the tweens
6558
+ // otherwise we skip this part
6559
+ length = gotoEnd ? animation.tweens.length : 0;
6560
+ if ( stopped ) {
6561
+ return this;
6562
+ }
6563
+ stopped = true;
6564
+ for ( ; index < length ; index++ ) {
6565
+ animation.tweens[ index ].run( 1 );
6566
+ }
6567
+
6568
+ // resolve when we played the last frame
6569
+ // otherwise, reject
6570
+ if ( gotoEnd ) {
6571
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
6572
+ } else {
6573
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
6574
+ }
6575
+ return this;
6576
+ }
6577
+ }),
6578
+ props = animation.props;
6579
+
6580
+ propFilter( props, animation.opts.specialEasing );
6581
+
6582
+ for ( ; index < length ; index++ ) {
6583
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
6584
+ if ( result ) {
6585
+ return result;
6586
+ }
6587
+ }
6588
+
6589
+ jQuery.map( props, createTween, animation );
6590
+
6591
+ if ( jQuery.isFunction( animation.opts.start ) ) {
6592
+ animation.opts.start.call( elem, animation );
6593
+ }
6594
+
6595
+ jQuery.fx.timer(
6596
+ jQuery.extend( tick, {
6597
+ elem: elem,
6598
+ anim: animation,
6599
+ queue: animation.opts.queue
6600
+ })
6601
+ );
6602
+
6603
+ // attach callbacks from options
6604
+ return animation.progress( animation.opts.progress )
6605
+ .done( animation.opts.done, animation.opts.complete )
6606
+ .fail( animation.opts.fail )
6607
+ .always( animation.opts.always );
6608
+ }
6609
+
6610
+ jQuery.Animation = jQuery.extend( Animation, {
6611
+
6612
+ tweener: function( props, callback ) {
6613
+ if ( jQuery.isFunction( props ) ) {
6614
+ callback = props;
6615
+ props = [ "*" ];
6616
+ } else {
6617
+ props = props.split(" ");
6618
+ }
6619
+
6620
+ var prop,
6621
+ index = 0,
6622
+ length = props.length;
6623
+
6624
+ for ( ; index < length ; index++ ) {
6625
+ prop = props[ index ];
6626
+ tweeners[ prop ] = tweeners[ prop ] || [];
6627
+ tweeners[ prop ].unshift( callback );
6628
+ }
6629
+ },
6630
+
6631
+ prefilter: function( callback, prepend ) {
6632
+ if ( prepend ) {
6633
+ animationPrefilters.unshift( callback );
6634
+ } else {
6635
+ animationPrefilters.push( callback );
6636
+ }
6637
+ }
6638
+ });
6639
+
6640
+ jQuery.speed = function( speed, easing, fn ) {
6641
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
6642
+ complete: fn || !fn && easing ||
6643
+ jQuery.isFunction( speed ) && speed,
6644
+ duration: speed,
6645
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
6646
+ };
6647
+
6648
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
6649
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
6650
+
6651
+ // normalize opt.queue - true/undefined/null -> "fx"
6652
+ if ( opt.queue == null || opt.queue === true ) {
6653
+ opt.queue = "fx";
6654
+ }
6655
+
6656
+ // Queueing
6657
+ opt.old = opt.complete;
6658
+
6659
+ opt.complete = function() {
6660
+ if ( jQuery.isFunction( opt.old ) ) {
6661
+ opt.old.call( this );
6662
+ }
6663
+
6664
+ if ( opt.queue ) {
6665
+ jQuery.dequeue( this, opt.queue );
6666
+ }
6667
+ };
6668
+
6669
+ return opt;
6670
+ };
6671
+
6672
+ jQuery.fn.extend({
6673
+ fadeTo: function( speed, to, easing, callback ) {
6674
+
6675
+ // show any hidden elements after setting opacity to 0
6676
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
6677
+
6678
+ // animate to the value specified
6679
+ .end().animate({ opacity: to }, speed, easing, callback );
6680
+ },
6681
+ animate: function( prop, speed, easing, callback ) {
6682
+ var empty = jQuery.isEmptyObject( prop ),
6683
+ optall = jQuery.speed( speed, easing, callback ),
6684
+ doAnimation = function() {
6685
+ // Operate on a copy of prop so per-property easing won't be lost
6686
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
6687
+
6688
+ // Empty animations, or finishing resolves immediately
6689
+ if ( empty || data_priv.get( this, "finish" ) ) {
6690
+ anim.stop( true );
6691
+ }
6692
+ };
6693
+ doAnimation.finish = doAnimation;
6694
+
6695
+ return empty || optall.queue === false ?
6696
+ this.each( doAnimation ) :
6697
+ this.queue( optall.queue, doAnimation );
6698
+ },
6699
+ stop: function( type, clearQueue, gotoEnd ) {
6700
+ var stopQueue = function( hooks ) {
6701
+ var stop = hooks.stop;
6702
+ delete hooks.stop;
6703
+ stop( gotoEnd );
6704
+ };
6705
+
6706
+ if ( typeof type !== "string" ) {
6707
+ gotoEnd = clearQueue;
6708
+ clearQueue = type;
6709
+ type = undefined;
6710
+ }
6711
+ if ( clearQueue && type !== false ) {
6712
+ this.queue( type || "fx", [] );
6713
+ }
6714
+
6715
+ return this.each(function() {
6716
+ var dequeue = true,
6717
+ index = type != null && type + "queueHooks",
6718
+ timers = jQuery.timers,
6719
+ data = data_priv.get( this );
6720
+
6721
+ if ( index ) {
6722
+ if ( data[ index ] && data[ index ].stop ) {
6723
+ stopQueue( data[ index ] );
6724
+ }
6725
+ } else {
6726
+ for ( index in data ) {
6727
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
6728
+ stopQueue( data[ index ] );
6729
+ }
6730
+ }
6731
+ }
6732
+
6733
+ for ( index = timers.length; index--; ) {
6734
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
6735
+ timers[ index ].anim.stop( gotoEnd );
6736
+ dequeue = false;
6737
+ timers.splice( index, 1 );
6738
+ }
6739
+ }
6740
+
6741
+ // start the next in the queue if the last step wasn't forced
6742
+ // timers currently will call their complete callbacks, which will dequeue
6743
+ // but only if they were gotoEnd
6744
+ if ( dequeue || !gotoEnd ) {
6745
+ jQuery.dequeue( this, type );
6746
+ }
6747
+ });
6748
+ },
6749
+ finish: function( type ) {
6750
+ if ( type !== false ) {
6751
+ type = type || "fx";
6752
+ }
6753
+ return this.each(function() {
6754
+ var index,
6755
+ data = data_priv.get( this ),
6756
+ queue = data[ type + "queue" ],
6757
+ hooks = data[ type + "queueHooks" ],
6758
+ timers = jQuery.timers,
6759
+ length = queue ? queue.length : 0;
6760
+
6761
+ // enable finishing flag on private data
6762
+ data.finish = true;
6763
+
6764
+ // empty the queue first
6765
+ jQuery.queue( this, type, [] );
6766
+
6767
+ if ( hooks && hooks.stop ) {
6768
+ hooks.stop.call( this, true );
6769
+ }
6770
+
6771
+ // look for any active animations, and finish them
6772
+ for ( index = timers.length; index--; ) {
6773
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
6774
+ timers[ index ].anim.stop( true );
6775
+ timers.splice( index, 1 );
6776
+ }
6777
+ }
6778
+
6779
+ // look for any animations in the old queue and finish them
6780
+ for ( index = 0; index < length; index++ ) {
6781
+ if ( queue[ index ] && queue[ index ].finish ) {
6782
+ queue[ index ].finish.call( this );
6783
+ }
6784
+ }
6785
+
6786
+ // turn off finishing flag
6787
+ delete data.finish;
6788
+ });
6789
+ }
6790
+ });
6791
+
6792
+ jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
6793
+ var cssFn = jQuery.fn[ name ];
6794
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
6795
+ return speed == null || typeof speed === "boolean" ?
6796
+ cssFn.apply( this, arguments ) :
6797
+ this.animate( genFx( name, true ), speed, easing, callback );
6798
+ };
6799
+ });
6800
+
6801
+ // Generate shortcuts for custom animations
6802
+ jQuery.each({
6803
+ slideDown: genFx("show"),
6804
+ slideUp: genFx("hide"),
6805
+ slideToggle: genFx("toggle"),
6806
+ fadeIn: { opacity: "show" },
6807
+ fadeOut: { opacity: "hide" },
6808
+ fadeToggle: { opacity: "toggle" }
6809
+ }, function( name, props ) {
6810
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
6811
+ return this.animate( props, speed, easing, callback );
6812
+ };
6813
+ });
6814
+
6815
+ jQuery.timers = [];
6816
+ jQuery.fx.tick = function() {
6817
+ var timer,
6818
+ i = 0,
6819
+ timers = jQuery.timers;
6820
+
6821
+ fxNow = jQuery.now();
6822
+
6823
+ for ( ; i < timers.length; i++ ) {
6824
+ timer = timers[ i ];
6825
+ // Checks the timer has not already been removed
6826
+ if ( !timer() && timers[ i ] === timer ) {
6827
+ timers.splice( i--, 1 );
6828
+ }
6829
+ }
6830
+
6831
+ if ( !timers.length ) {
6832
+ jQuery.fx.stop();
6833
+ }
6834
+ fxNow = undefined;
6835
+ };
6836
+
6837
+ jQuery.fx.timer = function( timer ) {
6838
+ jQuery.timers.push( timer );
6839
+ if ( timer() ) {
6840
+ jQuery.fx.start();
6841
+ } else {
6842
+ jQuery.timers.pop();
6843
+ }
6844
+ };
6845
+
6846
+ jQuery.fx.interval = 13;
6847
+
6848
+ jQuery.fx.start = function() {
6849
+ if ( !timerId ) {
6850
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
6851
+ }
6852
+ };
6853
+
6854
+ jQuery.fx.stop = function() {
6855
+ clearInterval( timerId );
6856
+ timerId = null;
6857
+ };
6858
+
6859
+ jQuery.fx.speeds = {
6860
+ slow: 600,
6861
+ fast: 200,
6862
+ // Default speed
6863
+ _default: 400
6864
+ };
6865
+
6866
+
6867
+ // Based off of the plugin by Clint Helfers, with permission.
6868
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
6869
+ jQuery.fn.delay = function( time, type ) {
6870
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
6871
+ type = type || "fx";
6872
+
6873
+ return this.queue( type, function( next, hooks ) {
6874
+ var timeout = setTimeout( next, time );
6875
+ hooks.stop = function() {
6876
+ clearTimeout( timeout );
6877
+ };
6878
+ });
6879
+ };
6880
+
6881
+
6882
+ (function() {
6883
+ var input = document.createElement( "input" ),
6884
+ select = document.createElement( "select" ),
6885
+ opt = select.appendChild( document.createElement( "option" ) );
6886
+
6887
+ input.type = "checkbox";
6888
+
6889
+ // Support: iOS 5.1, Android 4.x, Android 2.3
6890
+ // Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)
6891
+ support.checkOn = input.value !== "";
6892
+
6893
+ // Must access the parent to make an option select properly
6894
+ // Support: IE9, IE10
6895
+ support.optSelected = opt.selected;
6896
+
6897
+ // Make sure that the options inside disabled selects aren't marked as disabled
6898
+ // (WebKit marks them as disabled)
6899
+ select.disabled = true;
6900
+ support.optDisabled = !opt.disabled;
6901
+
6902
+ // Check if an input maintains its value after becoming a radio
6903
+ // Support: IE9, IE10
6904
+ input = document.createElement( "input" );
6905
+ input.value = "t";
6906
+ input.type = "radio";
6907
+ support.radioValue = input.value === "t";
6908
+ })();
6909
+
6910
+
6911
+ var nodeHook, boolHook,
6912
+ attrHandle = jQuery.expr.attrHandle;
6913
+
6914
+ jQuery.fn.extend({
6915
+ attr: function( name, value ) {
6916
+ return access( this, jQuery.attr, name, value, arguments.length > 1 );
6917
+ },
6918
+
6919
+ removeAttr: function( name ) {
6920
+ return this.each(function() {
6921
+ jQuery.removeAttr( this, name );
6922
+ });
6923
+ }
6924
+ });
6925
+
6926
+ jQuery.extend({
6927
+ attr: function( elem, name, value ) {
6928
+ var hooks, ret,
6929
+ nType = elem.nodeType;
6930
+
6931
+ // don't get/set attributes on text, comment and attribute nodes
6932
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
6933
+ return;
6934
+ }
6935
+
6936
+ // Fallback to prop when attributes are not supported
6937
+ if ( typeof elem.getAttribute === strundefined ) {
6938
+ return jQuery.prop( elem, name, value );
6939
+ }
6940
+
6941
+ // All attributes are lowercase
6942
+ // Grab necessary hook if one is defined
6943
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
6944
+ name = name.toLowerCase();
6945
+ hooks = jQuery.attrHooks[ name ] ||
6946
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
6947
+ }
6948
+
6949
+ if ( value !== undefined ) {
6950
+
6951
+ if ( value === null ) {
6952
+ jQuery.removeAttr( elem, name );
6953
+
6954
+ } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
6955
+ return ret;
6956
+
6957
+ } else {
6958
+ elem.setAttribute( name, value + "" );
6959
+ return value;
6960
+ }
6961
+
6962
+ } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
6963
+ return ret;
6964
+
6965
+ } else {
6966
+ ret = jQuery.find.attr( elem, name );
6967
+
6968
+ // Non-existent attributes return null, we normalize to undefined
6969
+ return ret == null ?
6970
+ undefined :
6971
+ ret;
6972
+ }
6973
+ },
6974
+
6975
+ removeAttr: function( elem, value ) {
6976
+ var name, propName,
6977
+ i = 0,
6978
+ attrNames = value && value.match( rnotwhite );
6979
+
6980
+ if ( attrNames && elem.nodeType === 1 ) {
6981
+ while ( (name = attrNames[i++]) ) {
6982
+ propName = jQuery.propFix[ name ] || name;
6983
+
6984
+ // Boolean attributes get special treatment (#10870)
6985
+ if ( jQuery.expr.match.bool.test( name ) ) {
6986
+ // Set corresponding property to false
6987
+ elem[ propName ] = false;
6988
+ }
6989
+
6990
+ elem.removeAttribute( name );
6991
+ }
6992
+ }
6993
+ },
6994
+
6995
+ attrHooks: {
6996
+ type: {
6997
+ set: function( elem, value ) {
6998
+ if ( !support.radioValue && value === "radio" &&
6999
+ jQuery.nodeName( elem, "input" ) ) {
7000
+ // Setting the type on a radio button after the value resets the value in IE6-9
7001
+ // Reset value to default in case type is set after value during creation
7002
+ var val = elem.value;
7003
+ elem.setAttribute( "type", value );
7004
+ if ( val ) {
7005
+ elem.value = val;
7006
+ }
7007
+ return value;
7008
+ }
7009
+ }
7010
+ }
7011
+ }
7012
+ });
7013
+
7014
+ // Hooks for boolean attributes
7015
+ boolHook = {
7016
+ set: function( elem, value, name ) {
7017
+ if ( value === false ) {
7018
+ // Remove boolean attributes when set to false
7019
+ jQuery.removeAttr( elem, name );
7020
+ } else {
7021
+ elem.setAttribute( name, name );
7022
+ }
7023
+ return name;
7024
+ }
7025
+ };
7026
+ jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
7027
+ var getter = attrHandle[ name ] || jQuery.find.attr;
7028
+
7029
+ attrHandle[ name ] = function( elem, name, isXML ) {
7030
+ var ret, handle;
7031
+ if ( !isXML ) {
7032
+ // Avoid an infinite loop by temporarily removing this function from the getter
7033
+ handle = attrHandle[ name ];
7034
+ attrHandle[ name ] = ret;
7035
+ ret = getter( elem, name, isXML ) != null ?
7036
+ name.toLowerCase() :
7037
+ null;
7038
+ attrHandle[ name ] = handle;
7039
+ }
7040
+ return ret;
7041
+ };
7042
+ });
7043
+
7044
+
7045
+
7046
+
7047
+ var rfocusable = /^(?:input|select|textarea|button)$/i;
7048
+
7049
+ jQuery.fn.extend({
7050
+ prop: function( name, value ) {
7051
+ return access( this, jQuery.prop, name, value, arguments.length > 1 );
7052
+ },
7053
+
7054
+ removeProp: function( name ) {
7055
+ return this.each(function() {
7056
+ delete this[ jQuery.propFix[ name ] || name ];
7057
+ });
7058
+ }
7059
+ });
7060
+
7061
+ jQuery.extend({
7062
+ propFix: {
7063
+ "for": "htmlFor",
7064
+ "class": "className"
7065
+ },
7066
+
7067
+ prop: function( elem, name, value ) {
7068
+ var ret, hooks, notxml,
7069
+ nType = elem.nodeType;
7070
+
7071
+ // don't get/set properties on text, comment and attribute nodes
7072
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
7073
+ return;
7074
+ }
7075
+
7076
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
7077
+
7078
+ if ( notxml ) {
7079
+ // Fix name and attach hooks
7080
+ name = jQuery.propFix[ name ] || name;
7081
+ hooks = jQuery.propHooks[ name ];
7082
+ }
7083
+
7084
+ if ( value !== undefined ) {
7085
+ return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
7086
+ ret :
7087
+ ( elem[ name ] = value );
7088
+
7089
+ } else {
7090
+ return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
7091
+ ret :
7092
+ elem[ name ];
7093
+ }
7094
+ },
7095
+
7096
+ propHooks: {
7097
+ tabIndex: {
7098
+ get: function( elem ) {
7099
+ return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
7100
+ elem.tabIndex :
7101
+ -1;
7102
+ }
7103
+ }
7104
+ }
7105
+ });
7106
+
7107
+ // Support: IE9+
7108
+ // Selectedness for an option in an optgroup can be inaccurate
7109
+ if ( !support.optSelected ) {
7110
+ jQuery.propHooks.selected = {
7111
+ get: function( elem ) {
7112
+ var parent = elem.parentNode;
7113
+ if ( parent && parent.parentNode ) {
7114
+ parent.parentNode.selectedIndex;
7115
+ }
7116
+ return null;
7117
+ }
7118
+ };
7119
+ }
7120
+
7121
+ jQuery.each([
7122
+ "tabIndex",
7123
+ "readOnly",
7124
+ "maxLength",
7125
+ "cellSpacing",
7126
+ "cellPadding",
7127
+ "rowSpan",
7128
+ "colSpan",
7129
+ "useMap",
7130
+ "frameBorder",
7131
+ "contentEditable"
7132
+ ], function() {
7133
+ jQuery.propFix[ this.toLowerCase() ] = this;
7134
+ });
7135
+
7136
+
7137
+
7138
+
7139
+ var rclass = /[\t\r\n\f]/g;
7140
+
7141
+ jQuery.fn.extend({
7142
+ addClass: function( value ) {
7143
+ var classes, elem, cur, clazz, j, finalValue,
7144
+ proceed = typeof value === "string" && value,
7145
+ i = 0,
7146
+ len = this.length;
7147
+
7148
+ if ( jQuery.isFunction( value ) ) {
7149
+ return this.each(function( j ) {
7150
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
7151
+ });
7152
+ }
7153
+
7154
+ if ( proceed ) {
7155
+ // The disjunction here is for better compressibility (see removeClass)
7156
+ classes = ( value || "" ).match( rnotwhite ) || [];
7157
+
7158
+ for ( ; i < len; i++ ) {
7159
+ elem = this[ i ];
7160
+ cur = elem.nodeType === 1 && ( elem.className ?
7161
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
7162
+ " "
7163
+ );
7164
+
7165
+ if ( cur ) {
7166
+ j = 0;
7167
+ while ( (clazz = classes[j++]) ) {
7168
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
7169
+ cur += clazz + " ";
7170
+ }
7171
+ }
7172
+
7173
+ // only assign if different to avoid unneeded rendering.
7174
+ finalValue = jQuery.trim( cur );
7175
+ if ( elem.className !== finalValue ) {
7176
+ elem.className = finalValue;
7177
+ }
7178
+ }
7179
+ }
7180
+ }
7181
+
7182
+ return this;
7183
+ },
7184
+
7185
+ removeClass: function( value ) {
7186
+ var classes, elem, cur, clazz, j, finalValue,
7187
+ proceed = arguments.length === 0 || typeof value === "string" && value,
7188
+ i = 0,
7189
+ len = this.length;
7190
+
7191
+ if ( jQuery.isFunction( value ) ) {
7192
+ return this.each(function( j ) {
7193
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
7194
+ });
7195
+ }
7196
+ if ( proceed ) {
7197
+ classes = ( value || "" ).match( rnotwhite ) || [];
7198
+
7199
+ for ( ; i < len; i++ ) {
7200
+ elem = this[ i ];
7201
+ // This expression is here for better compressibility (see addClass)
7202
+ cur = elem.nodeType === 1 && ( elem.className ?
7203
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
7204
+ ""
7205
+ );
7206
+
7207
+ if ( cur ) {
7208
+ j = 0;
7209
+ while ( (clazz = classes[j++]) ) {
7210
+ // Remove *all* instances
7211
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
7212
+ cur = cur.replace( " " + clazz + " ", " " );
7213
+ }
7214
+ }
7215
+
7216
+ // only assign if different to avoid unneeded rendering.
7217
+ finalValue = value ? jQuery.trim( cur ) : "";
7218
+ if ( elem.className !== finalValue ) {
7219
+ elem.className = finalValue;
7220
+ }
7221
+ }
7222
+ }
7223
+ }
7224
+
7225
+ return this;
7226
+ },
7227
+
7228
+ toggleClass: function( value, stateVal ) {
7229
+ var type = typeof value;
7230
+
7231
+ if ( typeof stateVal === "boolean" && type === "string" ) {
7232
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
7233
+ }
7234
+
7235
+ if ( jQuery.isFunction( value ) ) {
7236
+ return this.each(function( i ) {
7237
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
7238
+ });
7239
+ }
7240
+
7241
+ return this.each(function() {
7242
+ if ( type === "string" ) {
7243
+ // toggle individual class names
7244
+ var className,
7245
+ i = 0,
7246
+ self = jQuery( this ),
7247
+ classNames = value.match( rnotwhite ) || [];
7248
+
7249
+ while ( (className = classNames[ i++ ]) ) {
7250
+ // check each className given, space separated list
7251
+ if ( self.hasClass( className ) ) {
7252
+ self.removeClass( className );
7253
+ } else {
7254
+ self.addClass( className );
7255
+ }
7256
+ }
7257
+
7258
+ // Toggle whole class name
7259
+ } else if ( type === strundefined || type === "boolean" ) {
7260
+ if ( this.className ) {
7261
+ // store className if set
7262
+ data_priv.set( this, "__className__", this.className );
7263
+ }
7264
+
7265
+ // If the element has a class name or if we're passed "false",
7266
+ // then remove the whole classname (if there was one, the above saved it).
7267
+ // Otherwise bring back whatever was previously saved (if anything),
7268
+ // falling back to the empty string if nothing was stored.
7269
+ this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
7270
+ }
7271
+ });
7272
+ },
7273
+
7274
+ hasClass: function( selector ) {
7275
+ var className = " " + selector + " ",
7276
+ i = 0,
7277
+ l = this.length;
7278
+ for ( ; i < l; i++ ) {
7279
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
7280
+ return true;
7281
+ }
7282
+ }
7283
+
7284
+ return false;
7285
+ }
7286
+ });
7287
+
7288
+
7289
+
7290
+
7291
+ var rreturn = /\r/g;
7292
+
7293
+ jQuery.fn.extend({
7294
+ val: function( value ) {
7295
+ var hooks, ret, isFunction,
7296
+ elem = this[0];
7297
+
7298
+ if ( !arguments.length ) {
7299
+ if ( elem ) {
7300
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
7301
+
7302
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
7303
+ return ret;
7304
+ }
7305
+
7306
+ ret = elem.value;
7307
+
7308
+ return typeof ret === "string" ?
7309
+ // handle most common string cases
7310
+ ret.replace(rreturn, "") :
7311
+ // handle cases where value is null/undef or number
7312
+ ret == null ? "" : ret;
7313
+ }
7314
+
7315
+ return;
7316
+ }
7317
+
7318
+ isFunction = jQuery.isFunction( value );
7319
+
7320
+ return this.each(function( i ) {
7321
+ var val;
7322
+
7323
+ if ( this.nodeType !== 1 ) {
7324
+ return;
7325
+ }
7326
+
7327
+ if ( isFunction ) {
7328
+ val = value.call( this, i, jQuery( this ).val() );
7329
+ } else {
7330
+ val = value;
7331
+ }
7332
+
7333
+ // Treat null/undefined as ""; convert numbers to string
7334
+ if ( val == null ) {
7335
+ val = "";
7336
+
7337
+ } else if ( typeof val === "number" ) {
7338
+ val += "";
7339
+
7340
+ } else if ( jQuery.isArray( val ) ) {
7341
+ val = jQuery.map( val, function( value ) {
7342
+ return value == null ? "" : value + "";
7343
+ });
7344
+ }
7345
+
7346
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
7347
+
7348
+ // If set returns undefined, fall back to normal setting
7349
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
7350
+ this.value = val;
7351
+ }
7352
+ });
7353
+ }
7354
+ });
7355
+
7356
+ jQuery.extend({
7357
+ valHooks: {
7358
+ option: {
7359
+ get: function( elem ) {
7360
+ var val = jQuery.find.attr( elem, "value" );
7361
+ return val != null ?
7362
+ val :
7363
+ // Support: IE10-11+
7364
+ // option.text throws exceptions (#14686, #14858)
7365
+ jQuery.trim( jQuery.text( elem ) );
7366
+ }
7367
+ },
7368
+ select: {
7369
+ get: function( elem ) {
7370
+ var value, option,
7371
+ options = elem.options,
7372
+ index = elem.selectedIndex,
7373
+ one = elem.type === "select-one" || index < 0,
7374
+ values = one ? null : [],
7375
+ max = one ? index + 1 : options.length,
7376
+ i = index < 0 ?
7377
+ max :
7378
+ one ? index : 0;
7379
+
7380
+ // Loop through all the selected options
7381
+ for ( ; i < max; i++ ) {
7382
+ option = options[ i ];
7383
+
7384
+ // IE6-9 doesn't update selected after form reset (#2551)
7385
+ if ( ( option.selected || i === index ) &&
7386
+ // Don't return options that are disabled or in a disabled optgroup
7387
+ ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
7388
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
7389
+
7390
+ // Get the specific value for the option
7391
+ value = jQuery( option ).val();
7392
+
7393
+ // We don't need an array for one selects
7394
+ if ( one ) {
7395
+ return value;
7396
+ }
7397
+
7398
+ // Multi-Selects return an array
7399
+ values.push( value );
7400
+ }
7401
+ }
7402
+
7403
+ return values;
7404
+ },
7405
+
7406
+ set: function( elem, value ) {
7407
+ var optionSet, option,
7408
+ options = elem.options,
7409
+ values = jQuery.makeArray( value ),
7410
+ i = options.length;
7411
+
7412
+ while ( i-- ) {
7413
+ option = options[ i ];
7414
+ if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
7415
+ optionSet = true;
7416
+ }
7417
+ }
7418
+
7419
+ // force browsers to behave consistently when non-matching value is set
7420
+ if ( !optionSet ) {
7421
+ elem.selectedIndex = -1;
7422
+ }
7423
+ return values;
7424
+ }
7425
+ }
7426
+ }
7427
+ });
7428
+
7429
+ // Radios and checkboxes getter/setter
7430
+ jQuery.each([ "radio", "checkbox" ], function() {
7431
+ jQuery.valHooks[ this ] = {
7432
+ set: function( elem, value ) {
7433
+ if ( jQuery.isArray( value ) ) {
7434
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
7435
+ }
7436
+ }
7437
+ };
7438
+ if ( !support.checkOn ) {
7439
+ jQuery.valHooks[ this ].get = function( elem ) {
7440
+ // Support: Webkit
7441
+ // "" is returned instead of "on" if a value isn't specified
7442
+ return elem.getAttribute("value") === null ? "on" : elem.value;
7443
+ };
7444
+ }
7445
+ });
7446
+
7447
+
7448
+
7449
+
7450
+ // Return jQuery for attributes-only inclusion
7451
+
7452
+
7453
+ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
7454
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
7455
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
7456
+
7457
+ // Handle event binding
7458
+ jQuery.fn[ name ] = function( data, fn ) {
7459
+ return arguments.length > 0 ?
7460
+ this.on( name, null, data, fn ) :
7461
+ this.trigger( name );
7462
+ };
7463
+ });
7464
+
7465
+ jQuery.fn.extend({
7466
+ hover: function( fnOver, fnOut ) {
7467
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
7468
+ },
7469
+
7470
+ bind: function( types, data, fn ) {
7471
+ return this.on( types, null, data, fn );
7472
+ },
7473
+ unbind: function( types, fn ) {
7474
+ return this.off( types, null, fn );
7475
+ },
7476
+
7477
+ delegate: function( selector, types, data, fn ) {
7478
+ return this.on( types, selector, data, fn );
7479
+ },
7480
+ undelegate: function( selector, types, fn ) {
7481
+ // ( namespace ) or ( selector, types [, fn] )
7482
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
7483
+ }
7484
+ });
7485
+
7486
+
7487
+ var nonce = jQuery.now();
7488
+
7489
+ var rquery = (/\?/);
7490
+
7491
+
7492
+
7493
+ // Support: Android 2.3
7494
+ // Workaround failure to string-cast null input
7495
+ jQuery.parseJSON = function( data ) {
7496
+ return JSON.parse( data + "" );
7497
+ };
7498
+
7499
+
7500
+ // Cross-browser xml parsing
7501
+ jQuery.parseXML = function( data ) {
7502
+ var xml, tmp;
7503
+ if ( !data || typeof data !== "string" ) {
7504
+ return null;
7505
+ }
7506
+
7507
+ // Support: IE9
7508
+ try {
7509
+ tmp = new DOMParser();
7510
+ xml = tmp.parseFromString( data, "text/xml" );
7511
+ } catch ( e ) {
7512
+ xml = undefined;
7513
+ }
7514
+
7515
+ if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
7516
+ jQuery.error( "Invalid XML: " + data );
7517
+ }
7518
+ return xml;
7519
+ };
7520
+
7521
+
7522
+ var
7523
+ // Document location
7524
+ ajaxLocParts,
7525
+ ajaxLocation,
7526
+
7527
+ rhash = /#.*$/,
7528
+ rts = /([?&])_=[^&]*/,
7529
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
7530
+ // #7653, #8125, #8152: local protocol detection
7531
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
7532
+ rnoContent = /^(?:GET|HEAD)$/,
7533
+ rprotocol = /^\/\//,
7534
+ rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
7535
+
7536
+ /* Prefilters
7537
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
7538
+ * 2) These are called:
7539
+ * - BEFORE asking for a transport
7540
+ * - AFTER param serialization (s.data is a string if s.processData is true)
7541
+ * 3) key is the dataType
7542
+ * 4) the catchall symbol "*" can be used
7543
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
7544
+ */
7545
+ prefilters = {},
7546
+
7547
+ /* Transports bindings
7548
+ * 1) key is the dataType
7549
+ * 2) the catchall symbol "*" can be used
7550
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
7551
+ */
7552
+ transports = {},
7553
+
7554
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
7555
+ allTypes = "*/".concat("*");
7556
+
7557
+ // #8138, IE may throw an exception when accessing
7558
+ // a field from window.location if document.domain has been set
7559
+ try {
7560
+ ajaxLocation = location.href;
7561
+ } catch( e ) {
7562
+ // Use the href attribute of an A element
7563
+ // since IE will modify it given document.location
7564
+ ajaxLocation = document.createElement( "a" );
7565
+ ajaxLocation.href = "";
7566
+ ajaxLocation = ajaxLocation.href;
7567
+ }
7568
+
7569
+ // Segment location into parts
7570
+ ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
7571
+
7572
+ // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
7573
+ function addToPrefiltersOrTransports( structure ) {
7574
+
7575
+ // dataTypeExpression is optional and defaults to "*"
7576
+ return function( dataTypeExpression, func ) {
7577
+
7578
+ if ( typeof dataTypeExpression !== "string" ) {
7579
+ func = dataTypeExpression;
7580
+ dataTypeExpression = "*";
7581
+ }
7582
+
7583
+ var dataType,
7584
+ i = 0,
7585
+ dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
7586
+
7587
+ if ( jQuery.isFunction( func ) ) {
7588
+ // For each dataType in the dataTypeExpression
7589
+ while ( (dataType = dataTypes[i++]) ) {
7590
+ // Prepend if requested
7591
+ if ( dataType[0] === "+" ) {
7592
+ dataType = dataType.slice( 1 ) || "*";
7593
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
7594
+
7595
+ // Otherwise append
7596
+ } else {
7597
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
7598
+ }
7599
+ }
7600
+ }
7601
+ };
7602
+ }
7603
+
7604
+ // Base inspection function for prefilters and transports
7605
+ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
7606
+
7607
+ var inspected = {},
7608
+ seekingTransport = ( structure === transports );
7609
+
7610
+ function inspect( dataType ) {
7611
+ var selected;
7612
+ inspected[ dataType ] = true;
7613
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
7614
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
7615
+ if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
7616
+ options.dataTypes.unshift( dataTypeOrTransport );
7617
+ inspect( dataTypeOrTransport );
7618
+ return false;
7619
+ } else if ( seekingTransport ) {
7620
+ return !( selected = dataTypeOrTransport );
7621
+ }
7622
+ });
7623
+ return selected;
7624
+ }
7625
+
7626
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
7627
+ }
7628
+
7629
+ // A special extend for ajax options
7630
+ // that takes "flat" options (not to be deep extended)
7631
+ // Fixes #9887
7632
+ function ajaxExtend( target, src ) {
7633
+ var key, deep,
7634
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
7635
+
7636
+ for ( key in src ) {
7637
+ if ( src[ key ] !== undefined ) {
7638
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
7639
+ }
7640
+ }
7641
+ if ( deep ) {
7642
+ jQuery.extend( true, target, deep );
7643
+ }
7644
+
7645
+ return target;
7646
+ }
7647
+
7648
+ /* Handles responses to an ajax request:
7649
+ * - finds the right dataType (mediates between content-type and expected dataType)
7650
+ * - returns the corresponding response
7651
+ */
7652
+ function ajaxHandleResponses( s, jqXHR, responses ) {
7653
+
7654
+ var ct, type, finalDataType, firstDataType,
7655
+ contents = s.contents,
7656
+ dataTypes = s.dataTypes;
7657
+
7658
+ // Remove auto dataType and get content-type in the process
7659
+ while ( dataTypes[ 0 ] === "*" ) {
7660
+ dataTypes.shift();
7661
+ if ( ct === undefined ) {
7662
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
7663
+ }
7664
+ }
7665
+
7666
+ // Check if we're dealing with a known content-type
7667
+ if ( ct ) {
7668
+ for ( type in contents ) {
7669
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
7670
+ dataTypes.unshift( type );
7671
+ break;
7672
+ }
7673
+ }
7674
+ }
7675
+
7676
+ // Check to see if we have a response for the expected dataType
7677
+ if ( dataTypes[ 0 ] in responses ) {
7678
+ finalDataType = dataTypes[ 0 ];
7679
+ } else {
7680
+ // Try convertible dataTypes
7681
+ for ( type in responses ) {
7682
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
7683
+ finalDataType = type;
7684
+ break;
7685
+ }
7686
+ if ( !firstDataType ) {
7687
+ firstDataType = type;
7688
+ }
7689
+ }
7690
+ // Or just use first one
7691
+ finalDataType = finalDataType || firstDataType;
7692
+ }
7693
+
7694
+ // If we found a dataType
7695
+ // We add the dataType to the list if needed
7696
+ // and return the corresponding response
7697
+ if ( finalDataType ) {
7698
+ if ( finalDataType !== dataTypes[ 0 ] ) {
7699
+ dataTypes.unshift( finalDataType );
7700
+ }
7701
+ return responses[ finalDataType ];
7702
+ }
7703
+ }
7704
+
7705
+ /* Chain conversions given the request and the original response
7706
+ * Also sets the responseXXX fields on the jqXHR instance
7707
+ */
7708
+ function ajaxConvert( s, response, jqXHR, isSuccess ) {
7709
+ var conv2, current, conv, tmp, prev,
7710
+ converters = {},
7711
+ // Work with a copy of dataTypes in case we need to modify it for conversion
7712
+ dataTypes = s.dataTypes.slice();
7713
+
7714
+ // Create converters map with lowercased keys
7715
+ if ( dataTypes[ 1 ] ) {
7716
+ for ( conv in s.converters ) {
7717
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
7718
+ }
7719
+ }
7720
+
7721
+ current = dataTypes.shift();
7722
+
7723
+ // Convert to each sequential dataType
7724
+ while ( current ) {
7725
+
7726
+ if ( s.responseFields[ current ] ) {
7727
+ jqXHR[ s.responseFields[ current ] ] = response;
7728
+ }
7729
+
7730
+ // Apply the dataFilter if provided
7731
+ if ( !prev && isSuccess && s.dataFilter ) {
7732
+ response = s.dataFilter( response, s.dataType );
7733
+ }
7734
+
7735
+ prev = current;
7736
+ current = dataTypes.shift();
7737
+
7738
+ if ( current ) {
7739
+
7740
+ // There's only work to do if current dataType is non-auto
7741
+ if ( current === "*" ) {
7742
+
7743
+ current = prev;
7744
+
7745
+ // Convert response if prev dataType is non-auto and differs from current
7746
+ } else if ( prev !== "*" && prev !== current ) {
7747
+
7748
+ // Seek a direct converter
7749
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
7750
+
7751
+ // If none found, seek a pair
7752
+ if ( !conv ) {
7753
+ for ( conv2 in converters ) {
7754
+
7755
+ // If conv2 outputs current
7756
+ tmp = conv2.split( " " );
7757
+ if ( tmp[ 1 ] === current ) {
7758
+
7759
+ // If prev can be converted to accepted input
7760
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
7761
+ converters[ "* " + tmp[ 0 ] ];
7762
+ if ( conv ) {
7763
+ // Condense equivalence converters
7764
+ if ( conv === true ) {
7765
+ conv = converters[ conv2 ];
7766
+
7767
+ // Otherwise, insert the intermediate dataType
7768
+ } else if ( converters[ conv2 ] !== true ) {
7769
+ current = tmp[ 0 ];
7770
+ dataTypes.unshift( tmp[ 1 ] );
7771
+ }
7772
+ break;
7773
+ }
7774
+ }
7775
+ }
7776
+ }
7777
+
7778
+ // Apply converter (if not an equivalence)
7779
+ if ( conv !== true ) {
7780
+
7781
+ // Unless errors are allowed to bubble, catch and return them
7782
+ if ( conv && s[ "throws" ] ) {
7783
+ response = conv( response );
7784
+ } else {
7785
+ try {
7786
+ response = conv( response );
7787
+ } catch ( e ) {
7788
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
7789
+ }
7790
+ }
7791
+ }
7792
+ }
7793
+ }
7794
+ }
7795
+
7796
+ return { state: "success", data: response };
7797
+ }
7798
+
7799
+ jQuery.extend({
7800
+
7801
+ // Counter for holding the number of active queries
7802
+ active: 0,
7803
+
7804
+ // Last-Modified header cache for next request
7805
+ lastModified: {},
7806
+ etag: {},
7807
+
7808
+ ajaxSettings: {
7809
+ url: ajaxLocation,
7810
+ type: "GET",
7811
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
7812
+ global: true,
7813
+ processData: true,
7814
+ async: true,
7815
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
7816
+ /*
7817
+ timeout: 0,
7818
+ data: null,
7819
+ dataType: null,
7820
+ username: null,
7821
+ password: null,
7822
+ cache: null,
7823
+ throws: false,
7824
+ traditional: false,
7825
+ headers: {},
7826
+ */
7827
+
7828
+ accepts: {
7829
+ "*": allTypes,
7830
+ text: "text/plain",
7831
+ html: "text/html",
7832
+ xml: "application/xml, text/xml",
7833
+ json: "application/json, text/javascript"
7834
+ },
7835
+
7836
+ contents: {
7837
+ xml: /xml/,
7838
+ html: /html/,
7839
+ json: /json/
7840
+ },
7841
+
7842
+ responseFields: {
7843
+ xml: "responseXML",
7844
+ text: "responseText",
7845
+ json: "responseJSON"
7846
+ },
7847
+
7848
+ // Data converters
7849
+ // Keys separate source (or catchall "*") and destination types with a single space
7850
+ converters: {
7851
+
7852
+ // Convert anything to text
7853
+ "* text": String,
7854
+
7855
+ // Text to html (true = no transformation)
7856
+ "text html": true,
7857
+
7858
+ // Evaluate text as a json expression
7859
+ "text json": jQuery.parseJSON,
7860
+
7861
+ // Parse text as xml
7862
+ "text xml": jQuery.parseXML
7863
+ },
7864
+
7865
+ // For options that shouldn't be deep extended:
7866
+ // you can add your own custom options here if
7867
+ // and when you create one that shouldn't be
7868
+ // deep extended (see ajaxExtend)
7869
+ flatOptions: {
7870
+ url: true,
7871
+ context: true
7872
+ }
7873
+ },
7874
+
7875
+ // Creates a full fledged settings object into target
7876
+ // with both ajaxSettings and settings fields.
7877
+ // If target is omitted, writes into ajaxSettings.
7878
+ ajaxSetup: function( target, settings ) {
7879
+ return settings ?
7880
+
7881
+ // Building a settings object
7882
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
7883
+
7884
+ // Extending ajaxSettings
7885
+ ajaxExtend( jQuery.ajaxSettings, target );
7886
+ },
7887
+
7888
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
7889
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
7890
+
7891
+ // Main method
7892
+ ajax: function( url, options ) {
7893
+
7894
+ // If url is an object, simulate pre-1.5 signature
7895
+ if ( typeof url === "object" ) {
7896
+ options = url;
7897
+ url = undefined;
7898
+ }
7899
+
7900
+ // Force options to be an object
7901
+ options = options || {};
7902
+
7903
+ var transport,
7904
+ // URL without anti-cache param
7905
+ cacheURL,
7906
+ // Response headers
7907
+ responseHeadersString,
7908
+ responseHeaders,
7909
+ // timeout handle
7910
+ timeoutTimer,
7911
+ // Cross-domain detection vars
7912
+ parts,
7913
+ // To know if global events are to be dispatched
7914
+ fireGlobals,
7915
+ // Loop variable
7916
+ i,
7917
+ // Create the final options object
7918
+ s = jQuery.ajaxSetup( {}, options ),
7919
+ // Callbacks context
7920
+ callbackContext = s.context || s,
7921
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
7922
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
7923
+ jQuery( callbackContext ) :
7924
+ jQuery.event,
7925
+ // Deferreds
7926
+ deferred = jQuery.Deferred(),
7927
+ completeDeferred = jQuery.Callbacks("once memory"),
7928
+ // Status-dependent callbacks
7929
+ statusCode = s.statusCode || {},
7930
+ // Headers (they are sent all at once)
7931
+ requestHeaders = {},
7932
+ requestHeadersNames = {},
7933
+ // The jqXHR state
7934
+ state = 0,
7935
+ // Default abort message
7936
+ strAbort = "canceled",
7937
+ // Fake xhr
7938
+ jqXHR = {
7939
+ readyState: 0,
7940
+
7941
+ // Builds headers hashtable if needed
7942
+ getResponseHeader: function( key ) {
7943
+ var match;
7944
+ if ( state === 2 ) {
7945
+ if ( !responseHeaders ) {
7946
+ responseHeaders = {};
7947
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
7948
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
7949
+ }
7950
+ }
7951
+ match = responseHeaders[ key.toLowerCase() ];
7952
+ }
7953
+ return match == null ? null : match;
7954
+ },
7955
+
7956
+ // Raw string
7957
+ getAllResponseHeaders: function() {
7958
+ return state === 2 ? responseHeadersString : null;
7959
+ },
7960
+
7961
+ // Caches the header
7962
+ setRequestHeader: function( name, value ) {
7963
+ var lname = name.toLowerCase();
7964
+ if ( !state ) {
7965
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
7966
+ requestHeaders[ name ] = value;
7967
+ }
7968
+ return this;
7969
+ },
7970
+
7971
+ // Overrides response content-type header
7972
+ overrideMimeType: function( type ) {
7973
+ if ( !state ) {
7974
+ s.mimeType = type;
7975
+ }
7976
+ return this;
7977
+ },
7978
+
7979
+ // Status-dependent callbacks
7980
+ statusCode: function( map ) {
7981
+ var code;
7982
+ if ( map ) {
7983
+ if ( state < 2 ) {
7984
+ for ( code in map ) {
7985
+ // Lazy-add the new callback in a way that preserves old ones
7986
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
7987
+ }
7988
+ } else {
7989
+ // Execute the appropriate callbacks
7990
+ jqXHR.always( map[ jqXHR.status ] );
7991
+ }
7992
+ }
7993
+ return this;
7994
+ },
7995
+
7996
+ // Cancel the request
7997
+ abort: function( statusText ) {
7998
+ var finalText = statusText || strAbort;
7999
+ if ( transport ) {
8000
+ transport.abort( finalText );
8001
+ }
8002
+ done( 0, finalText );
8003
+ return this;
8004
+ }
8005
+ };
8006
+
8007
+ // Attach deferreds
8008
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
8009
+ jqXHR.success = jqXHR.done;
8010
+ jqXHR.error = jqXHR.fail;
8011
+
8012
+ // Remove hash character (#7531: and string promotion)
8013
+ // Add protocol if not provided (prefilters might expect it)
8014
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
8015
+ // We also use the url parameter if available
8016
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
8017
+ .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
8018
+
8019
+ // Alias method option to type as per ticket #12004
8020
+ s.type = options.method || options.type || s.method || s.type;
8021
+
8022
+ // Extract dataTypes list
8023
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
8024
+
8025
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
8026
+ if ( s.crossDomain == null ) {
8027
+ parts = rurl.exec( s.url.toLowerCase() );
8028
+ s.crossDomain = !!( parts &&
8029
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
8030
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
8031
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
8032
+ );
8033
+ }
8034
+
8035
+ // Convert data if not already a string
8036
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
8037
+ s.data = jQuery.param( s.data, s.traditional );
8038
+ }
8039
+
8040
+ // Apply prefilters
8041
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
8042
+
8043
+ // If request was aborted inside a prefilter, stop there
8044
+ if ( state === 2 ) {
8045
+ return jqXHR;
8046
+ }
8047
+
8048
+ // We can fire global events as of now if asked to
8049
+ fireGlobals = s.global;
8050
+
8051
+ // Watch for a new set of requests
8052
+ if ( fireGlobals && jQuery.active++ === 0 ) {
8053
+ jQuery.event.trigger("ajaxStart");
8054
+ }
8055
+
8056
+ // Uppercase the type
8057
+ s.type = s.type.toUpperCase();
8058
+
8059
+ // Determine if request has content
8060
+ s.hasContent = !rnoContent.test( s.type );
8061
+
8062
+ // Save the URL in case we're toying with the If-Modified-Since
8063
+ // and/or If-None-Match header later on
8064
+ cacheURL = s.url;
8065
+
8066
+ // More options handling for requests with no content
8067
+ if ( !s.hasContent ) {
8068
+
8069
+ // If data is available, append data to url
8070
+ if ( s.data ) {
8071
+ cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
8072
+ // #9682: remove data so that it's not used in an eventual retry
8073
+ delete s.data;
8074
+ }
8075
+
8076
+ // Add anti-cache in url if needed
8077
+ if ( s.cache === false ) {
8078
+ s.url = rts.test( cacheURL ) ?
8079
+
8080
+ // If there is already a '_' parameter, set its value
8081
+ cacheURL.replace( rts, "$1_=" + nonce++ ) :
8082
+
8083
+ // Otherwise add one to the end
8084
+ cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
8085
+ }
8086
+ }
8087
+
8088
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8089
+ if ( s.ifModified ) {
8090
+ if ( jQuery.lastModified[ cacheURL ] ) {
8091
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
8092
+ }
8093
+ if ( jQuery.etag[ cacheURL ] ) {
8094
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
8095
+ }
8096
+ }
8097
+
8098
+ // Set the correct header, if data is being sent
8099
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
8100
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
8101
+ }
8102
+
8103
+ // Set the Accepts header for the server, depending on the dataType
8104
+ jqXHR.setRequestHeader(
8105
+ "Accept",
8106
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
8107
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
8108
+ s.accepts[ "*" ]
8109
+ );
8110
+
8111
+ // Check for headers option
8112
+ for ( i in s.headers ) {
8113
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
8114
+ }
8115
+
8116
+ // Allow custom headers/mimetypes and early abort
8117
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
8118
+ // Abort if not done already and return
8119
+ return jqXHR.abort();
8120
+ }
8121
+
8122
+ // aborting is no longer a cancellation
8123
+ strAbort = "abort";
8124
+
8125
+ // Install callbacks on deferreds
8126
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
8127
+ jqXHR[ i ]( s[ i ] );
8128
+ }
8129
+
8130
+ // Get transport
8131
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
8132
+
8133
+ // If no transport, we auto-abort
8134
+ if ( !transport ) {
8135
+ done( -1, "No Transport" );
8136
+ } else {
8137
+ jqXHR.readyState = 1;
8138
+
8139
+ // Send global event
8140
+ if ( fireGlobals ) {
8141
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
8142
+ }
8143
+ // Timeout
8144
+ if ( s.async && s.timeout > 0 ) {
8145
+ timeoutTimer = setTimeout(function() {
8146
+ jqXHR.abort("timeout");
8147
+ }, s.timeout );
8148
+ }
8149
+
8150
+ try {
8151
+ state = 1;
8152
+ transport.send( requestHeaders, done );
8153
+ } catch ( e ) {
8154
+ // Propagate exception as error if not done
8155
+ if ( state < 2 ) {
8156
+ done( -1, e );
8157
+ // Simply rethrow otherwise
8158
+ } else {
8159
+ throw e;
8160
+ }
8161
+ }
8162
+ }
8163
+
8164
+ // Callback for when everything is done
8165
+ function done( status, nativeStatusText, responses, headers ) {
8166
+ var isSuccess, success, error, response, modified,
8167
+ statusText = nativeStatusText;
8168
+
8169
+ // Called once
8170
+ if ( state === 2 ) {
8171
+ return;
8172
+ }
8173
+
8174
+ // State is "done" now
8175
+ state = 2;
8176
+
8177
+ // Clear timeout if it exists
8178
+ if ( timeoutTimer ) {
8179
+ clearTimeout( timeoutTimer );
8180
+ }
8181
+
8182
+ // Dereference transport for early garbage collection
8183
+ // (no matter how long the jqXHR object will be used)
8184
+ transport = undefined;
8185
+
8186
+ // Cache response headers
8187
+ responseHeadersString = headers || "";
8188
+
8189
+ // Set readyState
8190
+ jqXHR.readyState = status > 0 ? 4 : 0;
8191
+
8192
+ // Determine if successful
8193
+ isSuccess = status >= 200 && status < 300 || status === 304;
8194
+
8195
+ // Get response data
8196
+ if ( responses ) {
8197
+ response = ajaxHandleResponses( s, jqXHR, responses );
8198
+ }
8199
+
8200
+ // Convert no matter what (that way responseXXX fields are always set)
8201
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
8202
+
8203
+ // If successful, handle type chaining
8204
+ if ( isSuccess ) {
8205
+
8206
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8207
+ if ( s.ifModified ) {
8208
+ modified = jqXHR.getResponseHeader("Last-Modified");
8209
+ if ( modified ) {
8210
+ jQuery.lastModified[ cacheURL ] = modified;
8211
+ }
8212
+ modified = jqXHR.getResponseHeader("etag");
8213
+ if ( modified ) {
8214
+ jQuery.etag[ cacheURL ] = modified;
8215
+ }
8216
+ }
8217
+
8218
+ // if no content
8219
+ if ( status === 204 || s.type === "HEAD" ) {
8220
+ statusText = "nocontent";
8221
+
8222
+ // if not modified
8223
+ } else if ( status === 304 ) {
8224
+ statusText = "notmodified";
8225
+
8226
+ // If we have data, let's convert it
8227
+ } else {
8228
+ statusText = response.state;
8229
+ success = response.data;
8230
+ error = response.error;
8231
+ isSuccess = !error;
8232
+ }
8233
+ } else {
8234
+ // We extract error from statusText
8235
+ // then normalize statusText and status for non-aborts
8236
+ error = statusText;
8237
+ if ( status || !statusText ) {
8238
+ statusText = "error";
8239
+ if ( status < 0 ) {
8240
+ status = 0;
8241
+ }
8242
+ }
8243
+ }
8244
+
8245
+ // Set data for the fake xhr object
8246
+ jqXHR.status = status;
8247
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
8248
+
8249
+ // Success/Error
8250
+ if ( isSuccess ) {
8251
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
8252
+ } else {
8253
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
8254
+ }
8255
+
8256
+ // Status-dependent callbacks
8257
+ jqXHR.statusCode( statusCode );
8258
+ statusCode = undefined;
8259
+
8260
+ if ( fireGlobals ) {
8261
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
8262
+ [ jqXHR, s, isSuccess ? success : error ] );
8263
+ }
8264
+
8265
+ // Complete
8266
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
8267
+
8268
+ if ( fireGlobals ) {
8269
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
8270
+ // Handle the global AJAX counter
8271
+ if ( !( --jQuery.active ) ) {
8272
+ jQuery.event.trigger("ajaxStop");
8273
+ }
8274
+ }
8275
+ }
8276
+
8277
+ return jqXHR;
8278
+ },
8279
+
8280
+ getJSON: function( url, data, callback ) {
8281
+ return jQuery.get( url, data, callback, "json" );
8282
+ },
8283
+
8284
+ getScript: function( url, callback ) {
8285
+ return jQuery.get( url, undefined, callback, "script" );
8286
+ }
8287
+ });
8288
+
8289
+ jQuery.each( [ "get", "post" ], function( i, method ) {
8290
+ jQuery[ method ] = function( url, data, callback, type ) {
8291
+ // shift arguments if data argument was omitted
8292
+ if ( jQuery.isFunction( data ) ) {
8293
+ type = type || callback;
8294
+ callback = data;
8295
+ data = undefined;
8296
+ }
8297
+
8298
+ return jQuery.ajax({
8299
+ url: url,
8300
+ type: method,
8301
+ dataType: type,
8302
+ data: data,
8303
+ success: callback
8304
+ });
8305
+ };
8306
+ });
8307
+
8308
+ // Attach a bunch of functions for handling common AJAX events
8309
+ jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
8310
+ jQuery.fn[ type ] = function( fn ) {
8311
+ return this.on( type, fn );
8312
+ };
8313
+ });
8314
+
8315
+
8316
+ jQuery._evalUrl = function( url ) {
8317
+ return jQuery.ajax({
8318
+ url: url,
8319
+ type: "GET",
8320
+ dataType: "script",
8321
+ async: false,
8322
+ global: false,
8323
+ "throws": true
8324
+ });
8325
+ };
8326
+
8327
+
8328
+ jQuery.fn.extend({
8329
+ wrapAll: function( html ) {
8330
+ var wrap;
8331
+
8332
+ if ( jQuery.isFunction( html ) ) {
8333
+ return this.each(function( i ) {
8334
+ jQuery( this ).wrapAll( html.call(this, i) );
8335
+ });
8336
+ }
8337
+
8338
+ if ( this[ 0 ] ) {
8339
+
8340
+ // The elements to wrap the target around
8341
+ wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
8342
+
8343
+ if ( this[ 0 ].parentNode ) {
8344
+ wrap.insertBefore( this[ 0 ] );
8345
+ }
8346
+
8347
+ wrap.map(function() {
8348
+ var elem = this;
8349
+
8350
+ while ( elem.firstElementChild ) {
8351
+ elem = elem.firstElementChild;
8352
+ }
8353
+
8354
+ return elem;
8355
+ }).append( this );
8356
+ }
8357
+
8358
+ return this;
8359
+ },
8360
+
8361
+ wrapInner: function( html ) {
8362
+ if ( jQuery.isFunction( html ) ) {
8363
+ return this.each(function( i ) {
8364
+ jQuery( this ).wrapInner( html.call(this, i) );
8365
+ });
8366
+ }
8367
+
8368
+ return this.each(function() {
8369
+ var self = jQuery( this ),
8370
+ contents = self.contents();
8371
+
8372
+ if ( contents.length ) {
8373
+ contents.wrapAll( html );
8374
+
8375
+ } else {
8376
+ self.append( html );
8377
+ }
8378
+ });
8379
+ },
8380
+
8381
+ wrap: function( html ) {
8382
+ var isFunction = jQuery.isFunction( html );
8383
+
8384
+ return this.each(function( i ) {
8385
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
8386
+ });
8387
+ },
8388
+
8389
+ unwrap: function() {
8390
+ return this.parent().each(function() {
8391
+ if ( !jQuery.nodeName( this, "body" ) ) {
8392
+ jQuery( this ).replaceWith( this.childNodes );
8393
+ }
8394
+ }).end();
8395
+ }
8396
+ });
8397
+
8398
+
8399
+ jQuery.expr.filters.hidden = function( elem ) {
8400
+ // Support: Opera <= 12.12
8401
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
8402
+ return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
8403
+ };
8404
+ jQuery.expr.filters.visible = function( elem ) {
8405
+ return !jQuery.expr.filters.hidden( elem );
8406
+ };
8407
+
8408
+
8409
+
8410
+
8411
+ var r20 = /%20/g,
8412
+ rbracket = /\[\]$/,
8413
+ rCRLF = /\r?\n/g,
8414
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
8415
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
8416
+
8417
+ function buildParams( prefix, obj, traditional, add ) {
8418
+ var name;
8419
+
8420
+ if ( jQuery.isArray( obj ) ) {
8421
+ // Serialize array item.
8422
+ jQuery.each( obj, function( i, v ) {
8423
+ if ( traditional || rbracket.test( prefix ) ) {
8424
+ // Treat each array item as a scalar.
8425
+ add( prefix, v );
8426
+
8427
+ } else {
8428
+ // Item is non-scalar (array or object), encode its numeric index.
8429
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
8430
+ }
8431
+ });
8432
+
8433
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
8434
+ // Serialize object item.
8435
+ for ( name in obj ) {
8436
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
8437
+ }
8438
+
8439
+ } else {
8440
+ // Serialize scalar item.
8441
+ add( prefix, obj );
8442
+ }
8443
+ }
8444
+
8445
+ // Serialize an array of form elements or a set of
8446
+ // key/values into a query string
8447
+ jQuery.param = function( a, traditional ) {
8448
+ var prefix,
8449
+ s = [],
8450
+ add = function( key, value ) {
8451
+ // If value is a function, invoke it and return its value
8452
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
8453
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
8454
+ };
8455
+
8456
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
8457
+ if ( traditional === undefined ) {
8458
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
8459
+ }
8460
+
8461
+ // If an array was passed in, assume that it is an array of form elements.
8462
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
8463
+ // Serialize the form elements
8464
+ jQuery.each( a, function() {
8465
+ add( this.name, this.value );
8466
+ });
8467
+
8468
+ } else {
8469
+ // If traditional, encode the "old" way (the way 1.3.2 or older
8470
+ // did it), otherwise encode params recursively.
8471
+ for ( prefix in a ) {
8472
+ buildParams( prefix, a[ prefix ], traditional, add );
8473
+ }
8474
+ }
8475
+
8476
+ // Return the resulting serialization
8477
+ return s.join( "&" ).replace( r20, "+" );
8478
+ };
8479
+
8480
+ jQuery.fn.extend({
8481
+ serialize: function() {
8482
+ return jQuery.param( this.serializeArray() );
8483
+ },
8484
+ serializeArray: function() {
8485
+ return this.map(function() {
8486
+ // Can add propHook for "elements" to filter or add form elements
8487
+ var elements = jQuery.prop( this, "elements" );
8488
+ return elements ? jQuery.makeArray( elements ) : this;
8489
+ })
8490
+ .filter(function() {
8491
+ var type = this.type;
8492
+
8493
+ // Use .is( ":disabled" ) so that fieldset[disabled] works
8494
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
8495
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
8496
+ ( this.checked || !rcheckableType.test( type ) );
8497
+ })
8498
+ .map(function( i, elem ) {
8499
+ var val = jQuery( this ).val();
8500
+
8501
+ return val == null ?
8502
+ null :
8503
+ jQuery.isArray( val ) ?
8504
+ jQuery.map( val, function( val ) {
8505
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8506
+ }) :
8507
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8508
+ }).get();
8509
+ }
8510
+ });
8511
+
8512
+
8513
+ jQuery.ajaxSettings.xhr = function() {
8514
+ try {
8515
+ return new XMLHttpRequest();
8516
+ } catch( e ) {}
8517
+ };
8518
+
8519
+ var xhrId = 0,
8520
+ xhrCallbacks = {},
8521
+ xhrSuccessStatus = {
8522
+ // file protocol always yields status code 0, assume 200
8523
+ 0: 200,
8524
+ // Support: IE9
8525
+ // #1450: sometimes IE returns 1223 when it should be 204
8526
+ 1223: 204
8527
+ },
8528
+ xhrSupported = jQuery.ajaxSettings.xhr();
8529
+
8530
+ // Support: IE9
8531
+ // Open requests must be manually aborted on unload (#5280)
8532
+ if ( window.ActiveXObject ) {
8533
+ jQuery( window ).on( "unload", function() {
8534
+ for ( var key in xhrCallbacks ) {
8535
+ xhrCallbacks[ key ]();
8536
+ }
8537
+ });
8538
+ }
8539
+
8540
+ support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
8541
+ support.ajax = xhrSupported = !!xhrSupported;
8542
+
8543
+ jQuery.ajaxTransport(function( options ) {
8544
+ var callback;
8545
+
8546
+ // Cross domain only allowed if supported through XMLHttpRequest
8547
+ if ( support.cors || xhrSupported && !options.crossDomain ) {
8548
+ return {
8549
+ send: function( headers, complete ) {
8550
+ var i,
8551
+ xhr = options.xhr(),
8552
+ id = ++xhrId;
8553
+
8554
+ xhr.open( options.type, options.url, options.async, options.username, options.password );
8555
+
8556
+ // Apply custom fields if provided
8557
+ if ( options.xhrFields ) {
8558
+ for ( i in options.xhrFields ) {
8559
+ xhr[ i ] = options.xhrFields[ i ];
8560
+ }
8561
+ }
8562
+
8563
+ // Override mime type if needed
8564
+ if ( options.mimeType && xhr.overrideMimeType ) {
8565
+ xhr.overrideMimeType( options.mimeType );
8566
+ }
8567
+
8568
+ // X-Requested-With header
8569
+ // For cross-domain requests, seeing as conditions for a preflight are
8570
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
8571
+ // (it can always be set on a per-request basis or even using ajaxSetup)
8572
+ // For same-domain requests, won't change header if already provided.
8573
+ if ( !options.crossDomain && !headers["X-Requested-With"] ) {
8574
+ headers["X-Requested-With"] = "XMLHttpRequest";
8575
+ }
8576
+
8577
+ // Set headers
8578
+ for ( i in headers ) {
8579
+ xhr.setRequestHeader( i, headers[ i ] );
8580
+ }
8581
+
8582
+ // Callback
8583
+ callback = function( type ) {
8584
+ return function() {
8585
+ if ( callback ) {
8586
+ delete xhrCallbacks[ id ];
8587
+ callback = xhr.onload = xhr.onerror = null;
8588
+
8589
+ if ( type === "abort" ) {
8590
+ xhr.abort();
8591
+ } else if ( type === "error" ) {
8592
+ complete(
8593
+ // file: protocol always yields status 0; see #8605, #14207
8594
+ xhr.status,
8595
+ xhr.statusText
8596
+ );
8597
+ } else {
8598
+ complete(
8599
+ xhrSuccessStatus[ xhr.status ] || xhr.status,
8600
+ xhr.statusText,
8601
+ // Support: IE9
8602
+ // Accessing binary-data responseText throws an exception
8603
+ // (#11426)
8604
+ typeof xhr.responseText === "string" ? {
8605
+ text: xhr.responseText
8606
+ } : undefined,
8607
+ xhr.getAllResponseHeaders()
8608
+ );
8609
+ }
8610
+ }
8611
+ };
8612
+ };
8613
+
8614
+ // Listen to events
8615
+ xhr.onload = callback();
8616
+ xhr.onerror = callback("error");
8617
+
8618
+ // Create the abort callback
8619
+ callback = xhrCallbacks[ id ] = callback("abort");
8620
+
8621
+ try {
8622
+ // Do send the request (this may raise an exception)
8623
+ xhr.send( options.hasContent && options.data || null );
8624
+ } catch ( e ) {
8625
+ // #14683: Only rethrow if this hasn't been notified as an error yet
8626
+ if ( callback ) {
8627
+ throw e;
8628
+ }
8629
+ }
8630
+ },
8631
+
8632
+ abort: function() {
8633
+ if ( callback ) {
8634
+ callback();
8635
+ }
8636
+ }
8637
+ };
8638
+ }
8639
+ });
8640
+
8641
+
8642
+
8643
+
8644
+ // Install script dataType
8645
+ jQuery.ajaxSetup({
8646
+ accepts: {
8647
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
8648
+ },
8649
+ contents: {
8650
+ script: /(?:java|ecma)script/
8651
+ },
8652
+ converters: {
8653
+ "text script": function( text ) {
8654
+ jQuery.globalEval( text );
8655
+ return text;
8656
+ }
8657
+ }
8658
+ });
8659
+
8660
+ // Handle cache's special case and crossDomain
8661
+ jQuery.ajaxPrefilter( "script", function( s ) {
8662
+ if ( s.cache === undefined ) {
8663
+ s.cache = false;
8664
+ }
8665
+ if ( s.crossDomain ) {
8666
+ s.type = "GET";
8667
+ }
8668
+ });
8669
+
8670
+ // Bind script tag hack transport
8671
+ jQuery.ajaxTransport( "script", function( s ) {
8672
+ // This transport only deals with cross domain requests
8673
+ if ( s.crossDomain ) {
8674
+ var script, callback;
8675
+ return {
8676
+ send: function( _, complete ) {
8677
+ script = jQuery("<script>").prop({
8678
+ async: true,
8679
+ charset: s.scriptCharset,
8680
+ src: s.url
8681
+ }).on(
8682
+ "load error",
8683
+ callback = function( evt ) {
8684
+ script.remove();
8685
+ callback = null;
8686
+ if ( evt ) {
8687
+ complete( evt.type === "error" ? 404 : 200, evt.type );
8688
+ }
8689
+ }
8690
+ );
8691
+ document.head.appendChild( script[ 0 ] );
8692
+ },
8693
+ abort: function() {
8694
+ if ( callback ) {
8695
+ callback();
8696
+ }
8697
+ }
8698
+ };
8699
+ }
8700
+ });
8701
+
8702
+
8703
+
8704
+
8705
+ var oldCallbacks = [],
8706
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
8707
+
8708
+ // Default jsonp settings
8709
+ jQuery.ajaxSetup({
8710
+ jsonp: "callback",
8711
+ jsonpCallback: function() {
8712
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
8713
+ this[ callback ] = true;
8714
+ return callback;
8715
+ }
8716
+ });
8717
+
8718
+ // Detect, normalize options and install callbacks for jsonp requests
8719
+ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
8720
+
8721
+ var callbackName, overwritten, responseContainer,
8722
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
8723
+ "url" :
8724
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
8725
+ );
8726
+
8727
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
8728
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
8729
+
8730
+ // Get callback name, remembering preexisting value associated with it
8731
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
8732
+ s.jsonpCallback() :
8733
+ s.jsonpCallback;
8734
+
8735
+ // Insert callback into url or form data
8736
+ if ( jsonProp ) {
8737
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
8738
+ } else if ( s.jsonp !== false ) {
8739
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
8740
+ }
8741
+
8742
+ // Use data converter to retrieve json after script execution
8743
+ s.converters["script json"] = function() {
8744
+ if ( !responseContainer ) {
8745
+ jQuery.error( callbackName + " was not called" );
8746
+ }
8747
+ return responseContainer[ 0 ];
8748
+ };
8749
+
8750
+ // force json dataType
8751
+ s.dataTypes[ 0 ] = "json";
8752
+
8753
+ // Install callback
8754
+ overwritten = window[ callbackName ];
8755
+ window[ callbackName ] = function() {
8756
+ responseContainer = arguments;
8757
+ };
8758
+
8759
+ // Clean-up function (fires after converters)
8760
+ jqXHR.always(function() {
8761
+ // Restore preexisting value
8762
+ window[ callbackName ] = overwritten;
8763
+
8764
+ // Save back as free
8765
+ if ( s[ callbackName ] ) {
8766
+ // make sure that re-using the options doesn't screw things around
8767
+ s.jsonpCallback = originalSettings.jsonpCallback;
8768
+
8769
+ // save the callback name for future use
8770
+ oldCallbacks.push( callbackName );
8771
+ }
8772
+
8773
+ // Call if it was a function and we have a response
8774
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
8775
+ overwritten( responseContainer[ 0 ] );
8776
+ }
8777
+
8778
+ responseContainer = overwritten = undefined;
8779
+ });
8780
+
8781
+ // Delegate to script
8782
+ return "script";
8783
+ }
8784
+ });
8785
+
8786
+
8787
+
8788
+
8789
+ // data: string of html
8790
+ // context (optional): If specified, the fragment will be created in this context, defaults to document
8791
+ // keepScripts (optional): If true, will include scripts passed in the html string
8792
+ jQuery.parseHTML = function( data, context, keepScripts ) {
8793
+ if ( !data || typeof data !== "string" ) {
8794
+ return null;
8795
+ }
8796
+ if ( typeof context === "boolean" ) {
8797
+ keepScripts = context;
8798
+ context = false;
8799
+ }
8800
+ context = context || document;
8801
+
8802
+ var parsed = rsingleTag.exec( data ),
8803
+ scripts = !keepScripts && [];
8804
+
8805
+ // Single tag
8806
+ if ( parsed ) {
8807
+ return [ context.createElement( parsed[1] ) ];
8808
+ }
8809
+
8810
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
8811
+
8812
+ if ( scripts && scripts.length ) {
8813
+ jQuery( scripts ).remove();
8814
+ }
8815
+
8816
+ return jQuery.merge( [], parsed.childNodes );
8817
+ };
8818
+
8819
+
8820
+ // Keep a copy of the old load method
8821
+ var _load = jQuery.fn.load;
8822
+
8823
+ /**
8824
+ * Load a url into a page
8825
+ */
8826
+ jQuery.fn.load = function( url, params, callback ) {
8827
+ if ( typeof url !== "string" && _load ) {
8828
+ return _load.apply( this, arguments );
8829
+ }
8830
+
8831
+ var selector, type, response,
8832
+ self = this,
8833
+ off = url.indexOf(" ");
8834
+
8835
+ if ( off >= 0 ) {
8836
+ selector = jQuery.trim( url.slice( off ) );
8837
+ url = url.slice( 0, off );
8838
+ }
8839
+
8840
+ // If it's a function
8841
+ if ( jQuery.isFunction( params ) ) {
8842
+
8843
+ // We assume that it's the callback
8844
+ callback = params;
8845
+ params = undefined;
8846
+
8847
+ // Otherwise, build a param string
8848
+ } else if ( params && typeof params === "object" ) {
8849
+ type = "POST";
8850
+ }
8851
+
8852
+ // If we have elements to modify, make the request
8853
+ if ( self.length > 0 ) {
8854
+ jQuery.ajax({
8855
+ url: url,
8856
+
8857
+ // if "type" variable is undefined, then "GET" method will be used
8858
+ type: type,
8859
+ dataType: "html",
8860
+ data: params
8861
+ }).done(function( responseText ) {
8862
+
8863
+ // Save response for use in complete callback
8864
+ response = arguments;
8865
+
8866
+ self.html( selector ?
8867
+
8868
+ // If a selector was specified, locate the right elements in a dummy div
8869
+ // Exclude scripts to avoid IE 'Permission Denied' errors
8870
+ jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
8871
+
8872
+ // Otherwise use the full result
8873
+ responseText );
8874
+
8875
+ }).complete( callback && function( jqXHR, status ) {
8876
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
8877
+ });
8878
+ }
8879
+
8880
+ return this;
8881
+ };
8882
+
8883
+
8884
+
8885
+
8886
+ jQuery.expr.filters.animated = function( elem ) {
8887
+ return jQuery.grep(jQuery.timers, function( fn ) {
8888
+ return elem === fn.elem;
8889
+ }).length;
8890
+ };
8891
+
8892
+
8893
+
8894
+
8895
+ var docElem = window.document.documentElement;
8896
+
8897
+ /**
8898
+ * Gets a window from an element
8899
+ */
8900
+ function getWindow( elem ) {
8901
+ return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
8902
+ }
8903
+
8904
+ jQuery.offset = {
8905
+ setOffset: function( elem, options, i ) {
8906
+ var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
8907
+ position = jQuery.css( elem, "position" ),
8908
+ curElem = jQuery( elem ),
8909
+ props = {};
8910
+
8911
+ // Set position first, in-case top/left are set even on static elem
8912
+ if ( position === "static" ) {
8913
+ elem.style.position = "relative";
8914
+ }
8915
+
8916
+ curOffset = curElem.offset();
8917
+ curCSSTop = jQuery.css( elem, "top" );
8918
+ curCSSLeft = jQuery.css( elem, "left" );
8919
+ calculatePosition = ( position === "absolute" || position === "fixed" ) &&
8920
+ ( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
8921
+
8922
+ // Need to be able to calculate position if either top or left is auto and position is either absolute or fixed
8923
+ if ( calculatePosition ) {
8924
+ curPosition = curElem.position();
8925
+ curTop = curPosition.top;
8926
+ curLeft = curPosition.left;
8927
+
8928
+ } else {
8929
+ curTop = parseFloat( curCSSTop ) || 0;
8930
+ curLeft = parseFloat( curCSSLeft ) || 0;
8931
+ }
8932
+
8933
+ if ( jQuery.isFunction( options ) ) {
8934
+ options = options.call( elem, i, curOffset );
8935
+ }
8936
+
8937
+ if ( options.top != null ) {
8938
+ props.top = ( options.top - curOffset.top ) + curTop;
8939
+ }
8940
+ if ( options.left != null ) {
8941
+ props.left = ( options.left - curOffset.left ) + curLeft;
8942
+ }
8943
+
8944
+ if ( "using" in options ) {
8945
+ options.using.call( elem, props );
8946
+
8947
+ } else {
8948
+ curElem.css( props );
8949
+ }
8950
+ }
8951
+ };
8952
+
8953
+ jQuery.fn.extend({
8954
+ offset: function( options ) {
8955
+ if ( arguments.length ) {
8956
+ return options === undefined ?
8957
+ this :
8958
+ this.each(function( i ) {
8959
+ jQuery.offset.setOffset( this, options, i );
8960
+ });
8961
+ }
8962
+
8963
+ var docElem, win,
8964
+ elem = this[ 0 ],
8965
+ box = { top: 0, left: 0 },
8966
+ doc = elem && elem.ownerDocument;
8967
+
8968
+ if ( !doc ) {
8969
+ return;
8970
+ }
8971
+
8972
+ docElem = doc.documentElement;
8973
+
8974
+ // Make sure it's not a disconnected DOM node
8975
+ if ( !jQuery.contains( docElem, elem ) ) {
8976
+ return box;
8977
+ }
8978
+
8979
+ // If we don't have gBCR, just use 0,0 rather than error
8980
+ // BlackBerry 5, iOS 3 (original iPhone)
8981
+ if ( typeof elem.getBoundingClientRect !== strundefined ) {
8982
+ box = elem.getBoundingClientRect();
8983
+ }
8984
+ win = getWindow( doc );
8985
+ return {
8986
+ top: box.top + win.pageYOffset - docElem.clientTop,
8987
+ left: box.left + win.pageXOffset - docElem.clientLeft
8988
+ };
8989
+ },
8990
+
8991
+ position: function() {
8992
+ if ( !this[ 0 ] ) {
8993
+ return;
8994
+ }
8995
+
8996
+ var offsetParent, offset,
8997
+ elem = this[ 0 ],
8998
+ parentOffset = { top: 0, left: 0 };
8999
+
9000
+ // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
9001
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
9002
+ // We assume that getBoundingClientRect is available when computed position is fixed
9003
+ offset = elem.getBoundingClientRect();
9004
+
9005
+ } else {
9006
+ // Get *real* offsetParent
9007
+ offsetParent = this.offsetParent();
9008
+
9009
+ // Get correct offsets
9010
+ offset = this.offset();
9011
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
9012
+ parentOffset = offsetParent.offset();
9013
+ }
9014
+
9015
+ // Add offsetParent borders
9016
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
9017
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
9018
+ }
9019
+
9020
+ // Subtract parent offsets and element margins
9021
+ return {
9022
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
9023
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
9024
+ };
9025
+ },
9026
+
9027
+ offsetParent: function() {
9028
+ return this.map(function() {
9029
+ var offsetParent = this.offsetParent || docElem;
9030
+
9031
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
9032
+ offsetParent = offsetParent.offsetParent;
9033
+ }
9034
+
9035
+ return offsetParent || docElem;
9036
+ });
9037
+ }
9038
+ });
9039
+
9040
+ // Create scrollLeft and scrollTop methods
9041
+ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
9042
+ var top = "pageYOffset" === prop;
9043
+
9044
+ jQuery.fn[ method ] = function( val ) {
9045
+ return access( this, function( elem, method, val ) {
9046
+ var win = getWindow( elem );
9047
+
9048
+ if ( val === undefined ) {
9049
+ return win ? win[ prop ] : elem[ method ];
9050
+ }
9051
+
9052
+ if ( win ) {
9053
+ win.scrollTo(
9054
+ !top ? val : window.pageXOffset,
9055
+ top ? val : window.pageYOffset
9056
+ );
9057
+
9058
+ } else {
9059
+ elem[ method ] = val;
9060
+ }
9061
+ }, method, val, arguments.length, null );
9062
+ };
9063
+ });
9064
+
9065
+ // Add the top/left cssHooks using jQuery.fn.position
9066
+ // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
9067
+ // getComputedStyle returns percent when specified for top/left/bottom/right
9068
+ // rather than make the css module depend on the offset module, we just check for it here
9069
+ jQuery.each( [ "top", "left" ], function( i, prop ) {
9070
+ jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
9071
+ function( elem, computed ) {
9072
+ if ( computed ) {
9073
+ computed = curCSS( elem, prop );
9074
+ // if curCSS returns percentage, fallback to offset
9075
+ return rnumnonpx.test( computed ) ?
9076
+ jQuery( elem ).position()[ prop ] + "px" :
9077
+ computed;
9078
+ }
9079
+ }
9080
+ );
9081
+ });
9082
+
9083
+
9084
+ // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
9085
+ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
9086
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
9087
+ // margin is only for outerHeight, outerWidth
9088
+ jQuery.fn[ funcName ] = function( margin, value ) {
9089
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
9090
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
9091
+
9092
+ return access( this, function( elem, type, value ) {
9093
+ var doc;
9094
+
9095
+ if ( jQuery.isWindow( elem ) ) {
9096
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
9097
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
9098
+ // https://github.com/jquery/jquery/pull/764
9099
+ return elem.document.documentElement[ "client" + name ];
9100
+ }
9101
+
9102
+ // Get document width or height
9103
+ if ( elem.nodeType === 9 ) {
9104
+ doc = elem.documentElement;
9105
+
9106
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
9107
+ // whichever is greatest
9108
+ return Math.max(
9109
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
9110
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
9111
+ doc[ "client" + name ]
9112
+ );
9113
+ }
9114
+
9115
+ return value === undefined ?
9116
+ // Get width or height on the element, requesting but not forcing parseFloat
9117
+ jQuery.css( elem, type, extra ) :
9118
+
9119
+ // Set width or height on the element
9120
+ jQuery.style( elem, type, value, extra );
9121
+ }, type, chainable ? margin : undefined, chainable, null );
9122
+ };
9123
+ });
9124
+ });
9125
+
9126
+
9127
+ // The number of elements contained in the matched element set
9128
+ jQuery.fn.size = function() {
9129
+ return this.length;
9130
+ };
9131
+
9132
+ jQuery.fn.andSelf = jQuery.fn.addBack;
9133
+
9134
+
9135
+
9136
+
9137
+ // Register as a named AMD module, since jQuery can be concatenated with other
9138
+ // files that may use define, but not via a proper concatenation script that
9139
+ // understands anonymous AMD modules. A named AMD is safest and most robust
9140
+ // way to register. Lowercase jquery is used because AMD module names are
9141
+ // derived from file names, and jQuery is normally delivered in a lowercase
9142
+ // file name. Do this after creating the global so that if an AMD module wants
9143
+ // to call noConflict to hide this version of jQuery, it will work.
9144
+
9145
+ // Note that for maximum portability, libraries that are not jQuery should
9146
+ // declare themselves as anonymous modules, and avoid setting a global if an
9147
+ // AMD loader is present. jQuery is a special case. For more information, see
9148
+ // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
9149
+
9150
+ if ( typeof define === "function" && define.amd ) {
9151
+ define( "jquery", [], function() {
9152
+ return jQuery;
9153
+ });
9154
+ }
9155
+
9156
+
9157
+
9158
+
9159
+ var
9160
+ // Map over jQuery in case of overwrite
9161
+ _jQuery = window.jQuery,
9162
+
9163
+ // Map over the $ in case of overwrite
9164
+ _$ = window.$;
9165
+
9166
+ jQuery.noConflict = function( deep ) {
9167
+ if ( window.$ === jQuery ) {
9168
+ window.$ = _$;
9169
+ }
9170
+
9171
+ if ( deep && window.jQuery === jQuery ) {
9172
+ window.jQuery = _jQuery;
9173
+ }
9174
+
9175
+ return jQuery;
9176
+ };
9177
+
9178
+ // Expose jQuery and $ identifiers, even in
9179
+ // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
9180
+ // and CommonJS for browser emulators (#13566)
9181
+ if ( typeof noGlobal === strundefined ) {
9182
+ window.jQuery = window.$ = jQuery;
9183
+ }
9184
+
9185
+
9186
+
9187
+
9188
+ return jQuery;
9189
+
9190
+ }));
skin/frontend/base/default/js/jquery.sequence.js ADDED
@@ -0,0 +1,1308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Sequence.js (http://www.sequencejs.com)
3
+ Version: 1.0.1.2
4
+ Author: Ian Lunn @IanLunn
5
+ Author URL: http://www.ianlunn.co.uk/
6
+ Github: https://github.com/IanLunn/Sequence
7
+
8
+ This is a FREE script and is available under a MIT License:
9
+ http://www.opensource.org/licenses/mit-license.php
10
+
11
+ Sequence.js and its dependencies are (c) Ian Lunn Design 2012 unless otherwise stated.
12
+
13
+ Sequence also relies on the following open source scripts:
14
+
15
+ - jQuery imagesLoaded 2.1.0 (http://github.com/desandro/imagesloaded)
16
+ Paul Irish et al
17
+ Available under a MIT License: http://www.opensource.org/licenses/mit-license.php
18
+
19
+ - jQuery TouchWipe 1.1.1 (http://www.netcu.de/jquery-touchwipe-iphone-ipad-library)
20
+ Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
21
+ Available under a MIT License: http://www.opensource.org/licenses/mit-license.php
22
+
23
+ - Modernizr 2.6.1 Custom Build (http://modernizr.com/) (Named Modernizr for Sequence to prevent conflicts)
24
+ Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
25
+ Available under the BSD and MIT licenses: www.modernizr.com/license/
26
+ */
27
+
28
+ ;(function($) {
29
+ var windowLoaded = false;
30
+ $(window).bind("load", function() {
31
+ windowLoaded = true;
32
+ });
33
+
34
+ function Sequence(element, options, defaults, get) {
35
+ var self = this;
36
+ self.container = $(element); //the Sequence containing element
37
+ self.canvas = self.container.children('.sequence-canvas'); //the Sequence canvas which holds Sequence's frames (<li> elements)
38
+ self.frames = self.canvas.children('li'); //the Sequence frames (top level <li> elements within the Sequence canvas)
39
+
40
+ self._modernizrForSequence(); //get the custom build necessary for Sequence
41
+
42
+ var prefixes = { //convert JS transition/animation names to CSS names
43
+ 'WebkitTransition' : '-webkit-',
44
+ 'WebkitAnimation' : '-webkit-',
45
+ 'MozTransition' : '-moz-',
46
+ 'MozAnimation ' : '-moz-',
47
+ 'OTransition' : '-o-',
48
+ 'OAnimation' : '-o-',
49
+ 'msTransition' : '-ms-',
50
+ 'msAnimation' : '-ms-',
51
+ 'transition' : '',
52
+ 'animation' : ''
53
+ };
54
+
55
+ var transitionsAndAnimations = { //convert JS transition names to JS transition end and animation end event names (also apply a classname of .sequence to the event)
56
+ 'WebkitTransition' : 'webkitTransitionEnd.sequence',
57
+ 'WebkitAnimation' : 'webkitAnimationEnd.sequence',
58
+ 'MozTransition' : 'transitionend.sequence',
59
+ 'MozAnimation' : 'animationend.sequence',
60
+ 'OTransition' : 'otransitionend.sequence',
61
+ 'OAnimation' : 'oanimationend.sequence',
62
+ 'msTransition' : 'MSTransitionEnd.sequence',
63
+ 'msAnimation' : 'MSAnimationEnd.sequence',
64
+ 'transition' : 'transitionend.sequence',
65
+ 'animation' : 'animationend.sequence'
66
+ };
67
+
68
+ self.transitionPrefix = prefixes[ModernizrForSequence.prefixed('transition')], //work out the CSS transition prefix for the browser being used (-webkit- for example)
69
+ self.animationPrefix = prefixes[ModernizrForSequence.prefixed('animation')], //work out the CSS animation prefix for the browser being used
70
+
71
+ self.transitionProperties = {},
72
+ self.transitionEnd = transitionsAndAnimations[ModernizrForSequence.prefixed('transition')] + ' ' + transitionsAndAnimations[ModernizrForSequence.prefixed('animation')], //work out the JS transitionEnd name for the browser being used (webkitTransitionEnd webkitAnimationEnd for example)
73
+ self.numberOfFrames = self.frames.length, //number of frames (<li>) Sequence consists of
74
+
75
+ self.transitionsSupported = (self.transitionPrefix !== undefined) ? true : false, //determine if transitions are supported
76
+ self.hasTouch = ("ontouchstart" in window) ? true : false, //determine if this is a touch enabled device
77
+ self.isPaused = false, //whether Sequence is paused
78
+ self.isBeingHoveredOver = false, //whether the Sequence canvas is currently being hovered over
79
+
80
+ self.container.removeClass('sequence-destroyed'); //if Sequence is destroyed using .destroy(), it is given a clas of "destroy", remove that now if present
81
+
82
+ //CALLBACKS
83
+ self.paused = function() {}, //executes when Sequence is paused
84
+ self.unpaused = function() {}, //executes when Sequence is unpaused
85
+
86
+ self.beforeNextFrameAnimatesIn = function() {}, //executes before the next frame animates in
87
+ self.afterNextFrameAnimatesIn = function() {}, //executes after the next frame animates in
88
+ self.beforeCurrentFrameAnimatesOut = function() {}, //executes before the current frame animates out
89
+ self.afterCurrentFrameAnimatesOut = function() {}, //executes after the current frame animates out
90
+
91
+ self.afterLoaded = function() {}; //executes after Sequence is initiated
92
+ self.destroyed = function() {}; //executes when Sequence is destroyed via the destory() function
93
+
94
+ //INIT
95
+ self.settings = $.extend({}, defaults, options); //combine default options with developer defined ones
96
+ self.settings.preloader = self._renderUiElements(self.settings.preloader, '.sequence-preloader'); //set up the preloader and save it
97
+ self.isStartingFrame = (self.settings.animateStartingFrameIn) ? true : false; //determine if the first frame should animate in
98
+ self.settings.unpauseDelay = (self.settings.unpauseDelay === null) ? self.settings.autoPlayDelay : self.settings.unpauseDelay; //if the unpauseDelay is not specified, make it the same as the autoPlayDelay speed
99
+ self.getHashTagFrom = (self.settings.hashDataAttribute) ? "data-sequence-hashtag": "id"; //get the hashtag from the ID or data attribute?
100
+ self.frameHashID = []; //array that matches frames with has IDs
101
+ self.direction = self.settings.autoPlayDirection;
102
+
103
+ if(self.settings.hideFramesUntilPreloaded && self.settings.preloader !== undefined && self.settings.preloader !== false) { //if using a preloader and hiding frames until preloading has completed...
104
+ self.frames.hide(); //hide Sequence's frames
105
+ }
106
+
107
+ if(self.transitionPrefix === "-o-") { //if Opera prefixes are required...
108
+ self.transitionsSupported = self._operaTest(); //run a test to see if Opera correctly supports transitions (Opera 11 has bugs relating to transitions)
109
+ }
110
+
111
+ self.frames.removeClass("animate-in"); //remove any instance of "animate-in", which should be used incase JS is disabled
112
+
113
+ //functionality to run once Sequence has preloaded
114
+ function oncePreloaded() {
115
+ self.afterLoaded(); //callback
116
+ if(self.settings.hideFramesUntilPreloaded && self.settings.preloader !== undefined && self.settings.preloader !== false) {
117
+ self.frames.show();
118
+ }
119
+ if(self.settings.preloader !== undefined && self.settings.preloader !== false){
120
+ if(self.settings.hidePreloaderUsingCSS && self.transitionsSupported) {
121
+ self.prependPreloadingCompleteTo = (self.settings.prependPreloadingComplete === true) ? self.settings.preloader : $(self.settings.prependPreloadingComplete);
122
+ self.prependPreloadingCompleteTo.addClass("preloading-complete");
123
+ setTimeout(init, self.settings.hidePreloaderDelay);
124
+ }else{
125
+ self.settings.preloader.fadeOut(self.settings.hidePreloaderDelay, function() {
126
+ clearInterval(self.defaultPreloader);
127
+ init();
128
+ });
129
+ }
130
+ }else{
131
+ init();
132
+ }
133
+ }
134
+
135
+ var preloadTheseFramesLength = self.settings.preloadTheseFrames.length; //how many frames to preload?
136
+ var preloadTheseImagesLength = self.settings.preloadTheseImages.length; //how many single images to load?
137
+
138
+ // Useful for integration with js module loaders (e.g. requireJS) where window.load may have fired prior to this script executing.
139
+ // Should be used with care. Modernizr normally likes to execute in the <head> tags.
140
+ if (self.settings.windowLoaded === true) {
141
+ windowLoaded = self.settings.windowLoaded;
142
+ }
143
+
144
+ function saveImagesToArray(length, srcOnly) {
145
+ var imagesToPreload = []; //saves the images that are to be preloaded
146
+ if(!srcOnly){
147
+ for(var i = length; i > 0; i--){ //for each frame to be preloaded...
148
+ self.frames.eq(self.settings.preloadTheseFrames[i-1]-1).find("img").each(function() { //find <img>'s in specific frames, and for each found...
149
+ imagesToPreload.push($(this)[0]); //add it to the array of images to be preloaded
150
+ });
151
+ }
152
+ }else{
153
+ for(var j = length; j > 0; j--) { //for each frame to be preloaded...
154
+ imagesToPreload.push($("body").find('img[src="'+self.settings.preloadTheseImages[j-1]+'"]')); //find any <img> with the given source and add it to the array of images to be preloaded
155
+ }
156
+ }
157
+ return imagesToPreload;
158
+ }
159
+
160
+ //jQuery imagesLoaded plugin v2.1.0 (http://github.com/desandro/imagesloaded)
161
+ function imagesLoaded(imagesToPreload, callback) {
162
+ var BLANK = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
163
+ var $this = imagesToPreload,
164
+ deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
165
+ hasNotify = $.isFunction(deferred.notify),
166
+ $images = $this.find('img').add( $this.filter('img') ),
167
+ loaded = [],
168
+ proper = [],
169
+ broken = [];
170
+
171
+ //Register deferred callbacks
172
+ if($.isPlainObject(callback)) {
173
+ $.each(callback, function(key, value) {
174
+ if(key === 'callback') {
175
+ callback = value;
176
+ }else if(deferred) {
177
+ deferred[key](value);
178
+ }
179
+ });
180
+ }
181
+
182
+ function doneLoading() {
183
+ var $proper = $(proper),
184
+ $broken = $(broken);
185
+
186
+ if(deferred) {
187
+ if(broken.length) {
188
+ deferred.reject($images, $proper, $broken);
189
+ }else{
190
+ deferred.resolve($images);
191
+ }
192
+ }
193
+
194
+ if($.isFunction(callback)) {
195
+ callback.call($this, $images, $proper, $broken);
196
+ }
197
+ }
198
+
199
+ function imgLoaded( img, isBroken ) {
200
+ if(img.src === BLANK || $.inArray(img, loaded) !== -1) { // don't proceed if BLANK image, or image is already loaded
201
+ return;
202
+ }
203
+
204
+ loaded.push(img); // store element in loaded images array
205
+
206
+ if(isBroken) { // keep track of broken and properly loaded images
207
+ broken.push(img);
208
+ }else{
209
+ proper.push(img);
210
+ }
211
+
212
+ $.data(img, 'imagesLoaded', {isBroken: isBroken, src: img.src }); // cache image and its state for future calls
213
+
214
+ if(hasNotify) { // trigger deferred progress method if present
215
+ deferred.notifyWith($(img), [isBroken, $images, $(proper), $(broken)]);
216
+ }
217
+
218
+ if($images.length === loaded.length) { // call doneLoading and clean listeners if all images are loaded
219
+ setTimeout(doneLoading);
220
+ $images.unbind('.imagesLoaded');
221
+ }
222
+ }
223
+
224
+ if(!$images.length) { // if no images, trigger immediately
225
+ doneLoading();
226
+ }else{
227
+ $images.bind('load.imagesLoaded error.imagesLoaded', function(event) {
228
+ imgLoaded(event.target, event.type === 'error'); // trigger imgLoaded
229
+ }).each(function(i, el) {
230
+ var src = el.src;
231
+ var cached = $.data(el, 'imagesLoaded'); // find out if this image has been already checked for status if it was, and src has not changed, call imgLoaded on it
232
+ if(cached && cached.src === src) {
233
+ imgLoaded(el, cached.isBroken);
234
+ return;
235
+ }
236
+
237
+ if(el.complete && el.naturalWidth !== undefined) { // if complete is true and browser supports natural sizes, try to check for image status manually
238
+ imgLoaded(el, el.naturalWidth === 0 || el.naturalHeight === 0);
239
+ return;
240
+ }
241
+
242
+ // cached images don't fire load sometimes, so we reset src, but only when dealing with IE, or image is complete (loaded) and failed manual check webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
243
+ if(el.readyState || el.complete) {
244
+ el.src = BLANK;
245
+ el.src = src;
246
+ }
247
+ });
248
+ }
249
+ }
250
+
251
+ if(self.settings.preloader !== undefined && self.settings.preloader !== false && (preloadTheseFramesLength !== 0 || preloadTheseImagesLength !== 0)) { //if using the preloader and the dev has specified some images should preload...
252
+ var frameImagesToPreload = saveImagesToArray(preloadTheseFramesLength); //get images from particular Sequence frames to be preloaded
253
+ var individualImagesToPreload = saveImagesToArray(preloadTheseImagesLength, true); //get images with specific source values to be preloaded
254
+ var imagesToPreload = $(frameImagesToPreload.concat(individualImagesToPreload)); //combine frame images and individual images
255
+
256
+ imagesLoaded(imagesToPreload, oncePreloaded);
257
+ }else{ //if not using the preloader...
258
+ if(windowLoaded === true) { //if the window has already loaded...
259
+ oncePreloaded(); //run the init functionality when the preloader has finished
260
+ $(this).unbind("load.sequence"); //unbind the load event as it's no longer needed
261
+ }else{ //if the window hasn't already loaded...
262
+ $(window).bind("load.sequence", function() { //when the window loads...
263
+ oncePreloaded(); //run the init functionality when the preloader has finished
264
+ $(this).unbind("load.sequence"); //unbind the load event as it's no longer needed
265
+ });
266
+ }
267
+ }
268
+
269
+ function init() {
270
+ $(self.settings.preloader).remove(); //remove the preloader element
271
+
272
+ self.nextButton = self._renderUiElements(self.settings.nextButton, ".sequence-next"); //set up the next button
273
+ self.prevButton = self._renderUiElements(self.settings.prevButton, ".sequence-prev"); //set up the previous button
274
+ self.pauseButton = self._renderUiElements(self.settings.pauseButton, ".sequence-pause"); //set up the pause button
275
+ self.pagination = self._renderUiElements(self.settings.pagination, ".sequence-pagination"); //set up the pagination
276
+
277
+ if((self.nextButton !== undefined && self.nextButton !== false) && self.settings.showNextButtonOnInit === true){self.nextButton.show();} //if using a next button, show it
278
+ if((self.prevButton !== undefined && self.prevButton !== false) && self.settings.showPrevButtonOnInit === true){self.prevButton.show();} //if using a previous button, show it
279
+ if((self.pauseButton !== undefined && self.pauseButton !== false) && self.settings.showPauseButtonOnInit === true){self.pauseButton.show();} //if using a pause button, show it
280
+
281
+ if(self.settings.pauseIcon !== false) {
282
+ self.pauseIcon = self._renderUiElements(self.settings.pauseIcon, ".sequence-pause-icon");
283
+ if(self.pauseIcon !== undefined) {
284
+ self.pauseIcon.hide();
285
+ }
286
+ }else{
287
+ self.pauseIcon = undefined;
288
+ }
289
+
290
+ if(self.pagination !== undefined && self.pagination !== false) {
291
+ self.paginationLinks = self.pagination.children(); //get each pagination link
292
+
293
+ self.paginationLinks.on('click.sequence', function() { //when a pagination link is clicked...
294
+ var associatedFrameNumber = $(this).index() + 1; //get the number of the frame this link is associated with
295
+ self.goTo(associatedFrameNumber); //go to the associate frame
296
+ });
297
+
298
+ if(self.settings.showPaginationOnInit === true) {
299
+ self.pagination.show();
300
+ }
301
+ }
302
+
303
+ self.nextFrameID = self.settings.startingFrameID;
304
+
305
+ if(self.settings.hashTags === true) { //if using hashtags...
306
+ self.frames.each(function() { //for each frame...
307
+ self.frameHashID.push($(this).prop(self.getHashTagFrom)); //add the hashtag to an array
308
+ });
309
+
310
+ self.currentHashTag = location.hash.replace("#", ""); //get the current hashtag
311
+ if(self.currentHashTag === undefined || self.currentHashTag === "") { //if there is no hashtag...
312
+ self.nextFrameID = self.settings.startingFrameID; //use the startingFrameID
313
+ }else{
314
+ self.frameHashIndex = $.inArray(self.currentHashTag, self.frameHashID); //get the index of the frame that matches the hashtag
315
+ if(self.frameHashIndex !== -1){ //if the hashtag matches a Sequence frame ID...
316
+ self.nextFrameID = self.frameHashIndex + 1; //use the frame associated to the hashtag
317
+ }else{
318
+ self.nextFrameID = self.settings.startingFrameID; //use the startingFrameID
319
+ }
320
+ }
321
+ }
322
+
323
+ self.nextFrame = self.frames.eq(self.nextFrameID-1); //get the next frame
324
+ self.nextFrameChildren = self.nextFrame.children(); //get the elements within the next frame to be animated
325
+
326
+ if(self.pagination !== undefined) { //if using pagination, make the starting frame the current one in pagination
327
+ $(self.paginationLinks[self.settings.startingFrameID-1]).addClass('current'); //add the 'current' class to the current frame
328
+ }
329
+
330
+ if(self.transitionsSupported) { //initiate the full featured Sequence if transitions are supported...
331
+ if(!self.settings.animateStartingFrameIn) { //start first frame in animated in position
332
+ self.currentFrameID = self.nextFrameID;
333
+
334
+ if(self.settings.moveActiveFrameToTop) {
335
+ self.nextFrame.css('z-index', self.numberOfFrames);
336
+ }
337
+
338
+ self._resetElements(self.transitionPrefix, self.nextFrameChildren, "0s");
339
+ self.nextFrame.addClass("animate-in");
340
+ if(self.settings.hashTags && self.settings.hashChangesOnFirstFrame) {
341
+ self.currentHashTag = self.nextFrame.prop(self.getHashTagFrom);
342
+ document.location.hash = "#"+self.currentHashTag;
343
+ }
344
+
345
+ setTimeout(function() {
346
+ self._resetElements(self.transitionPrefix, self.nextFrameChildren, "");
347
+ }, 100);
348
+
349
+ self._resetAutoPlay(true, self.settings.autoPlayDelay);
350
+ }else if(self.settings.reverseAnimationsWhenNavigatingBackwards && self.settings.autoPlayDirection -1 && self.settings.animateStartingFrameIn) { //animate in backwards
351
+ self._resetElements(self.transitionPrefix, self.nextFrameChildren, "0s");
352
+ self.nextFrame.addClass("animate-out");
353
+ self.goTo(self.nextFrameID, -1, true);
354
+ }else{ //animate in forwards
355
+ self.goTo(self.nextFrameID, 1, true);
356
+ }
357
+ }else{ //initiate a basic slider for browsers that don't support CSS3 transitions
358
+ self.container.addClass("sequence-fallback");
359
+ self.currentFrameID = self.nextFrameID;
360
+ if(self.settings.hashTags && self.settings.hashChangesOnFirstFrame){
361
+ self.currentHashTag = self.nextFrame.prop(self.getHashTagFrom);
362
+ document.location.hash = "#"+self.currentHashTag;
363
+ }
364
+
365
+ self.frames.addClass("animate-in"); //move each frame into its animate-in position
366
+ self.frames.not(':eq('+(self.nextFrameID-1)+')').css({"display": "none", "opacity": 0}); //set all frames (except the next one) to display: none, opacity: 0
367
+ self._resetAutoPlay(true, self.settings.autoPlayDelay);
368
+ }
369
+ //END INIT
370
+ //EVENTS
371
+ if(self.nextButton !== undefined) { //if a next button is defined...
372
+ self.nextButton.bind('click.sequence', function() { //when the next button is clicked...
373
+ self.next(); //go to the next frame
374
+ });
375
+ }
376
+
377
+ if(self.prevButton !== undefined) { //if a previous button is defined...
378
+ self.prevButton.bind('click.sequence', function() { //when the previous button is clicked...
379
+ self.prev(); //go to the previous frame
380
+ });
381
+ }
382
+
383
+ if(self.pauseButton !== undefined) { //if a pause button is defined...
384
+ self.pauseButton.bind('click.sequence', function() { //when the pause button is clicked...
385
+ self.pause(true); //pause Sequence and set hardPause to true
386
+ });
387
+ }
388
+
389
+ function keyEvents(keyPressed, keyDirections) {
390
+ var keyCode;
391
+ var keyCodes;
392
+
393
+ for(keyCodes in keyDirections) {
394
+ if(keyCodes === "left" || keyCodes === "right") {
395
+ keyCode = defaultKeys[keyCodes];
396
+ }else{
397
+ keyCode = keyCodes;
398
+ }
399
+
400
+ if(keyPressed === parseFloat(keyCode)) { //if the key pressed is associated with a function...
401
+ self._initCustomKeyEvent(keyDirections[keyCodes]); //initiate the function
402
+ }
403
+ }
404
+ }
405
+
406
+ if(self.settings.keyNavigation) {
407
+ var defaultKeys = {
408
+ 'left' : 37,
409
+ 'right' : 39
410
+ };
411
+
412
+ $(document).bind('keydown.sequence', function(e) { //when a key is pressed...
413
+ var keyCodeChar = String.fromCharCode(e.keyCode);
414
+ if((keyCodeChar > 0 && keyCodeChar <= self.numberOfFrames) && (self.settings.numericKeysGoToFrames)) {
415
+ self.nextFrameID = keyCodeChar;
416
+ self.goTo(self.nextFrameID); //go to specified frame
417
+ }
418
+
419
+ keyEvents(e.keyCode, self.settings.keyEvents); //run default keyevents
420
+ keyEvents(e.keyCode, self.settings.customKeyEvents); //run custom keyevents
421
+ });
422
+ }
423
+
424
+ self.canvas.on({
425
+ 'mouseenter.sequence': function() { //when the mouse enter the Sequence element...
426
+ if(self.settings.pauseOnHover && self.settings.autoPlay && !self.hasTouch) { //if using pauseOnHover and autoPlay on non touch devices
427
+ self.isBeingHoveredOver = true;
428
+ if(!self.isHardPaused) { //if Sequence is hard paused (via a pause button)...
429
+ self.pause(); //pause autoPlay
430
+ }
431
+ }
432
+ },
433
+ 'mouseleave.sequence': function() { //when the mouse leaves the Sequence element...
434
+ if(self.settings.pauseOnHover && self.settings.autoPlay && !self.hasTouch) { //if using pauseOnHover and autoPlay on non touch devices
435
+ self.isBeingHoveredOver = false;
436
+ if(!self.isHardPaused) { //if Sequence is not hard paused (via a pause button)...
437
+ self.unpause(); //unpause autoPlay
438
+ }
439
+ }
440
+ }
441
+ });
442
+
443
+ if(self.settings.hashTags) { //if hashchange is enabled in the settings...
444
+ $(window).bind('hashchange.sequence', function() { //when the hashtag changes...
445
+ var newTag = location.hash.replace("#", ""); //grab the new hashtag
446
+
447
+ if(self.currentHashTag !== newTag) { //if the last hashtag is not the same as the current one...
448
+ self.currentHashTag = newTag; //save the new tag
449
+ self.frameHashIndex = $.inArray(self.currentHashTag, self.frameHashID); //get the index of the frame that matches the hashtag
450
+ if(self.frameHashIndex !== -1) { //if the hashtag matches a Sequence frame ID...
451
+ self.nextFrameID = self.frameHashIndex + 1; //set that frame as the next one
452
+ self.goTo(self.nextFrameID); //go to the next frame
453
+ }
454
+ }
455
+ });
456
+ }
457
+
458
+ function cancelTouch() {
459
+ self.canvas.on("touchmove.sequence", onTouchMove);
460
+ startX = null;
461
+ isMoving = false;
462
+ }
463
+
464
+ function onTouchMove(e) {
465
+ if(self.settings.swipePreventsDefault) {
466
+ e.preventDefault();
467
+ }
468
+ if(isMoving) {
469
+ var x = e.originalEvent.touches[0].pageX;
470
+ var y = e.originalEvent.touches[0].pageY;
471
+ var dx = startX - x;
472
+ var dy = startY - y;
473
+ if(Math.abs(dx) >= self.settings.swipeThreshold) {
474
+ cancelTouch();
475
+ if(dx > 0) {
476
+ self._initCustomKeyEvent(self.settings.swipeEvents.left);
477
+ }else{
478
+ self._initCustomKeyEvent(self.settings.swipeEvents.right);
479
+ }
480
+ }else if(Math.abs(dy) >= self.settings.swipeThreshold) {
481
+ cancelTouch();
482
+ if(dy > 0) {
483
+ self._initCustomKeyEvent(self.settings.swipeEvents.down);
484
+ }else{
485
+ self._initCustomKeyEvent(self.settings.swipeEvents.up);
486
+ }
487
+ }
488
+ }
489
+ }
490
+
491
+ function onTouchStart(e) {
492
+ if(e.originalEvent.touches.length === 1) {
493
+ startX = e.originalEvent.touches[0].pageX;
494
+ startY = e.originalEvent.touches[0].pageY;
495
+ isMoving = true;
496
+ self.canvas.on("touchmove.sequence", onTouchMove);
497
+ }
498
+ }
499
+
500
+ if(self.settings.swipeNavigation && self.hasTouch) { //if using swipeNavigation and the device has touch capabilities...
501
+ //jQuery TouchWipe v1.1.1 (http://www.netcu.de/jquery-touchwipe-iphone-ipad-library)
502
+ var startX;
503
+ var startY;
504
+ var isMoving = false;
505
+
506
+ self.canvas.on("touchstart.sequence", onTouchStart);
507
+ }
508
+ //END EVENTS
509
+ }
510
+ } //END CONSTRUCTOR
511
+
512
+ Sequence.prototype = {
513
+
514
+ //PUBLIC METHODS
515
+ /*
516
+ start autoPlay -- causing Sequence to automatically change frame every x amount of milliseconds
517
+
518
+ delay: a time in ms before starting the autoPlay feature (if unspecified, the default will be used)
519
+ */
520
+ startAutoPlay: function(delay) {
521
+ var self = this;
522
+ delay = (delay === undefined) ? self.settings.autoPlayDelay : delay; //if a delay isn't specified, use the default
523
+ self.unpause();
524
+
525
+ self._resetAutoPlay(); //stop autoPlay before starting it again
526
+ self.autoPlayTimer = setTimeout(function() { //start a new autoPlay timer and...
527
+ if(self.settings.autoPlayDirection === 1) { //go to either the next or previous frame
528
+ self.next();
529
+ }else{
530
+ self.prev();
531
+ }
532
+ }, delay); //after a specified delay
533
+ },
534
+
535
+ //stop causing Sequence to automatically change frame every x amount of seconds
536
+ stopAutoPlay: function() {
537
+ var self = this;
538
+ self.pause(true);
539
+ clearTimeout(self.autoPlayTimer); //stop the autoPlay timer
540
+ },
541
+
542
+ /*
543
+ Toggle startAutoPlay (unpausing autoPlay) and stopAutoPlay (pausing autoPlay)
544
+
545
+ hardPause: if true, Sequence's pauseOnHover will not execute. Useful for pause buttons.
546
+
547
+ Note: Sequence 0.7.3 and below didn't have an .unpause() function -- .pause() would pause/unpause
548
+ based on the current state. .unpause() is now included for clarity but the .pause() function will
549
+ still toggle between paused and unpaused states.
550
+ */
551
+ pause: function(hardPause) {
552
+ var self = this;
553
+ if(!self.isSoftPaused) { //if pausing Sequence...
554
+ if(self.pauseButton !== undefined) { //if a pause button is defined...
555
+ self.pauseButton.addClass("paused"); //add the class of "paused" to the pause button
556
+ if(self.pauseIcon !== undefined) { //if a pause icon is defined...
557
+ self.pauseIcon.show(); //show the pause icon
558
+ }
559
+ }
560
+ self.paused(); //callback when Sequence is paused
561
+ self.isSoftPaused = true;
562
+ self.isHardPaused = (hardPause) ? true : false; //if hardPausing, set hardPause to true
563
+ self.isPaused = true;
564
+ self._resetAutoPlay(); //stop autoPlay
565
+ }else{ //if unpausing Sequence...
566
+ self.unpause();
567
+ }
568
+ },
569
+
570
+ /*
571
+ Start the autoPlay feature, as well as deal with any changes to pauseButtons, pauseIcons and public variables etc
572
+
573
+ callback: if false, the unpause callback will not be initiated (this is because unpause is used internally during the stop and start of each frame)
574
+ */
575
+ unpause: function(callback) {
576
+ var self = this;
577
+ if(self.pauseButton !== undefined) { //if a pause button is defined...
578
+ self.pauseButton.removeClass("paused"); //remove the class of "paused" from the pause button
579
+ if(self.pauseIcon !== undefined) { //if a pause icon is defined...
580
+ self.pauseIcon.hide(); //hide the pause icon
581
+ }
582
+ }
583
+
584
+ self.isSoftPaused = false;
585
+ self.isHardPaused = false;
586
+ self.isPaused = false;
587
+
588
+ if(!self.active) {
589
+ if(callback !== false) {
590
+ self.unpaused(); //callback when Sequence is unpaused
591
+ }
592
+ self._resetAutoPlay(true, self.settings.unpauseDelay); //start autoPlay after a delay specified via the unpauseDelay setting
593
+ }else{
594
+ self.delayUnpause = true; //Sequence is animating so delay the unpause event until the animation completes
595
+ }
596
+ },
597
+
598
+ //Go to the frame ahead of the current one
599
+ next: function() {
600
+ var self = this;
601
+ id = (self.currentFrameID !== self.numberOfFrames) ? self.currentFrameID + 1 : 1; //work out the next frame ID
602
+ if(self.active === false || self.active === undefined) { //if Sequence isn't currently animating...
603
+ self.goTo(id, 1); //go to the next frame
604
+ }else{ //if Sequence is currently animating...
605
+ self.goTo(id, 1, true); //go immediately to the next frame (ignoring the transition threshold)
606
+ }
607
+ },
608
+
609
+ //Go to the frame prior to the current one
610
+ prev: function() {
611
+ var self = this;
612
+ id = (self.currentFrameID === 1) ? self.numberOfFrames : self.currentFrameID - 1; //work out the prev frame ID
613
+ if(self.active === false || self.active === undefined) { //if Sequence isn't currently animating...
614
+ self.goTo(id, -1); //go to the prev frame
615
+ }else{ //if Sequence is currently animating...
616
+ self.goTo(id, -1, true); //go immediately to the prev frame (ignoring the transition threshold)
617
+ }
618
+ },
619
+
620
+ /*
621
+ Go to a specific frame
622
+
623
+ id: number of the frame to go to
624
+ direction: direction to get to that frame (1 = forward, -1 = reverse)
625
+ ignoreTransitionThreshold: if true, ignore the transitionThreshold setting and immediately go to the specified frame
626
+ */
627
+ goTo: function(id, direction, ignoreTransitionThreshold) {
628
+ var self = this;
629
+ self.nextFrameID = parseFloat(id);
630
+ var transitionThreshold = (ignoreTransitionThreshold === true) ? 0 : self.settings.transitionThreshold; //if transitionThreshold is to be ignored, set it to zero
631
+
632
+ if((self.nextFrameID === self.currentFrameID) //if the next frame the user is trying to go to is the same as the currently active one...
633
+ || (self.settings.navigationSkip && self.navigationSkipThresholdActive) //or navigationSkip is enabled and the navigationSkipThreshold is active (which prevents frame from being navigated too fast)...
634
+ || (!self.settings.navigationSkip && self.active) //or navigationSkip is disbaled but Sequence is animating...
635
+ || (!self.transitionsSupported && self.active) //or Sequence is in fallback mode and Sequence is animating...
636
+ || (!self.settings.cycle && direction === 1 && self.currentFrameID === self.numberOfFrames) //or cycling is disabled, the user is navigating forward and this is the last frame...
637
+ || (!self.settings.cycle && direction === -1 && self.currentFrameID === 1) //or cycling is disabled, the user is navigating backwards and this is the first frame...
638
+ || (self.settings.preventReverseSkipping && self.direction !== direction && self.active)) { //or Sequence is animating and the user is trying to change the direction of navigation...
639
+ return false; //don't go to another frame
640
+ }else if(self.settings.navigationSkip && self.active) { //if navigationSkip is enabled and Sequence is animating (a frame is being skipped before it has finished animating)...
641
+ self.navigationSkipThresholdActive = true; //the navigationSkipThreshold is now active
642
+ if(self.settings.fadeFrameWhenSkipped) { //if a frame should fade when skipped...
643
+ self.nextFrame.stop().animate({"opacity": 0}, self.settings.fadeFrameTime); //fade
644
+ }
645
+
646
+ clearTimeout(self.transitionThresholdTimer);
647
+
648
+ setTimeout(function() { //start the navigationSkipThreshold timer to prevent being able to navigate too quickly
649
+ self.navigationSkipThresholdActive = false; //once the timer is complete, navigationSkip can occur again
650
+ }, self.settings.navigationSkipThreshold);
651
+ }
652
+
653
+ if(!self.active || self.settings.navigationSkip) { //if there are no animations running or navigationSkip is enabled...
654
+ self.active = true; //Sequence is now animating
655
+ self._resetAutoPlay(); //stop any autoPlay timer that may be running
656
+
657
+ if(direction === undefined) { //if no direction to navigate was defined...
658
+ self.direction = (self.nextFrameID > self.currentFrameID) ? 1 : -1; //work out which way to go based on what frame is currently active
659
+ }else{
660
+ self.direction = direction; //go to the developer defined frame
661
+ }
662
+
663
+ self.currentFrame = self.canvas.children(".animate-in"); //find which frame is active -- the frame currently being viewed (and about to be animated out)
664
+ self.nextFrame = self.frames.eq(self.nextFrameID-1); //grab the next frame
665
+ self.currentFrameChildren = self.currentFrame.children(); //save the child elements of the current frame
666
+ self.nextFrameChildren = self.nextFrame.children(); //save the child elements of the next frame
667
+
668
+ if(self.pagination !== undefined) { //if using pagination...
669
+ self.paginationLinks.removeClass('current'); //remove the 'current' class from all pagination links
670
+ $(self.paginationLinks[self.nextFrameID-1]).addClass('current'); //add the 'current' class to the current frame
671
+ }
672
+
673
+ if(self.transitionsSupported) { //if the browser supports CSS3 transitions...
674
+ if(self.currentFrame.length !== undefined) { //if there is a current frame (one that is in it's animate-in position)...
675
+ self.beforeCurrentFrameAnimatesOut(); //callback
676
+ if(self.settings.moveActiveFrameToTop) { //if the active frame should move to the top...
677
+ self.currentFrame.css("z-index", 1); //move this frame to the bottom as it is now inactive
678
+ }
679
+ self._resetElements(self.transitionPrefix, self.nextFrameChildren, "0s"); //give the next frame elements a transition-duration and transition-delay of 0s so they don't transition to their reset position
680
+ if(!self.settings.reverseAnimationsWhenNavigatingBackwards || self.direction === 1) { //if user hit next button...
681
+ self.nextFrame.removeClass("animate-out"); //reset the next frame back to its starting position
682
+ self._resetElements(self.transitionPrefix, self.currentFrameChildren, ""); //remove any inline styles from the elements to be animated so styles via the "animate-out" class can take full effect
683
+ }else if(self.settings.reverseAnimationsWhenNavigatingBackwards && self.direction === -1) { //if the user hit prev button
684
+ self.nextFrame.addClass("animate-out"); //reset the next frame back to its animate-out position
685
+ self._reverseTransitionProperties(); //reverse the transition-duration, transition-delay and transition-timing-function
686
+ }
687
+ }else{
688
+ self.isStartingFrame = false; //no longer the first frame
689
+ }
690
+
691
+ self.active = true; //Sequence is now animating
692
+ self.currentFrame.unbind(self.transitionEnd); //remove the animation end event
693
+ self.nextFrame.unbind(self.transitionEnd); //remove the animation end event
694
+
695
+ if(self.settings.fadeFrameWhenSkipped && self.settings.navigationSkip) { //if a frame may have faded out when it was previously skipped...
696
+ self.nextFrame.css("opacity", 1); //show it again
697
+ }
698
+
699
+ self.beforeNextFrameAnimatesIn(); //callback
700
+ if(self.settings.moveActiveFrameToTop) { //if an active frame should be moved to the top...
701
+ self.nextFrame.css('z-index', self.numberOfFrames);
702
+ }
703
+
704
+ //modifications to the current and next frame's elements to get them ready to animate
705
+ if(!self.settings.reverseAnimationsWhenNavigatingBackwards || self.direction === 1) { //if user hit next button...
706
+ setTimeout(function() { //50ms timeout to give the browser a chance to modify the DOM sequentially
707
+ self._resetElements(self.transitionPrefix, self.nextFrameChildren, ""); //remove any inline styles from the elements to be animated so styles via the "animate-in" class can take full effect
708
+ self._waitForAnimationsToComplete(self.nextFrame, self.nextFrameChildren, "in"); //wait for the next frame to animate in
709
+ if(self.afterCurrentFrameAnimatesOut !== "function () {}" || (self.settings.transitionThreshold === true && ignoreTransitionThreshold !== true)) { //if the afterCurrentFrameAnimatesOut is being used...
710
+ self._waitForAnimationsToComplete(self.currentFrame, self.currentFrameChildren, "out", true, 1); //wait for the current frame to animate out as well
711
+ }
712
+ }, 50);
713
+
714
+ //final class changes to make animations happen
715
+ setTimeout(function() { //50ms timeout to give the browser a chance to modify the DOM sequentially
716
+ if(self.settings.transitionThreshold === false || self.settings.transitionThreshold === 0 || ignoreTransitionThreshold === true) { //if not using a transitionThreshold...
717
+ self.currentFrame.toggleClass("animate-out animate-in"); //remove the "animate-in" class and add the "animate-out" class to the current frame
718
+ self.nextFrame.addClass("animate-in"); //add the "animate-in" class
719
+ }else { //if using a transitionThreshold...
720
+ self.currentFrame.toggleClass("animate-out animate-in"); //remove the "animate-in" class and add the "animate-out" class to the current frame
721
+ if(self.settings.transitionThreshold !== true) { //if there's no transitionThreshold or the dev specified a transitionThreshold in milliseconds
722
+ self.transitionThresholdTimer = setTimeout(function() { //cause the next frame to animate in after a certain period
723
+ self.nextFrame.addClass("animate-in"); //add the "animate-in" class
724
+ }, transitionThreshold);
725
+ }
726
+ }
727
+ }, 50);
728
+ }else if(self.settings.reverseAnimationsWhenNavigatingBackwards && self.direction === -1) { //if the user hit prev button
729
+ setTimeout(function() { //50ms timeout to give the browser a chance to modify the DOM sequentially
730
+ //remove any inline styles from the elements so styles via the "animate-in" and "animate-out" class can take full effect
731
+ self._resetElements(self.transitionPrefix, self.currentFrameChildren, "");
732
+ self._resetElements(self.transitionPrefix, self.nextFrameChildren, "");
733
+ self._reverseTransitionProperties(); //reverse the transition-duration, transition-delay and transition-timing-function
734
+
735
+ self._waitForAnimationsToComplete(self.nextFrame, self.nextFrameChildren, "in"); //wait for the next frame to animate in
736
+ if(self.afterCurrentFrameAnimatesOut !== "function () {}" || (self.settings.transitionThreshold === true && ignoreTransitionThreshold !== true)) { //if the afterCurrentFrameAnimatesOut is being used...
737
+ self._waitForAnimationsToComplete(self.currentFrame, self.currentFrameChildren, "out", true, -1); //wait for the current frame to animate out as well
738
+ }
739
+ }, 50);
740
+
741
+ //final class changes to make animations happen
742
+ setTimeout(function() { //50ms timeout to give the browser a chance to modify the DOM sequentially
743
+ if(self.settings.transitionThreshold === false || self.settings.transitionThreshold === 0 || ignoreTransitionThreshold === true) { //if not using a transitionThreshold...
744
+ self.currentFrame.removeClass("animate-in"); //remove the "animate-in" class from the current frame
745
+ self.nextFrame.toggleClass("animate-out animate-in"); //add the "animate-out" class and remove the "animate-in" class from the next frame
746
+ }else{ //if using a transitionThreshold...
747
+ self.currentFrame.removeClass("animate-in");
748
+ if(self.settings.transitionThreshold !== true) { //if there's no transitionThreshold or the dev specified a transitionThreshold in milliseconds
749
+ self.transitionThresholdTimer = setTimeout(function() { //cause the next frame to animate in after a certain period
750
+ self.nextFrame.toggleClass("animate-out animate-in"); //add the "animate-in" class and remove the "animate-out" class
751
+ }, transitionThreshold);
752
+ }
753
+ }
754
+ }, 50);
755
+ }
756
+ }else{ //if the browser doesn't support CSS3 transitions...
757
+ function animationComplete() {
758
+ self._setHashTag();
759
+ self.active = false;
760
+ self._resetAutoPlay(true, self.settings.autoPlayDelay);
761
+ }
762
+
763
+ switch(self.settings.fallback.theme) {
764
+ case "fade": //if using the fade fallback theme...
765
+ self.frames.css({"position": "relative"}); //this allows for fadein/out in IE
766
+ self.beforeCurrentFrameAnimatesOut();
767
+ self.currentFrame = self.frames.eq(self.currentFrameID-1);
768
+ self.currentFrame.animate({"opacity": 0}, self.settings.fallback.speed, function() { //hide the current frame
769
+ self.currentFrame.css({"display": "none", "z-index": "1"});
770
+ self.afterCurrentFrameAnimatesOut();
771
+ self.beforeNextFrameAnimatesIn();
772
+ self.nextFrame.css({"display": "block", "z-index": self.numberOfFrames}).animate({"opacity": 1}, 500, function() {
773
+ self.afterNextFrameAnimatesIn();
774
+ }); //make the next frame the current one and show it
775
+ animationComplete();
776
+ });
777
+
778
+ self.frames.css({"position": "relative"}); //this allows for fadein/out in IE
779
+ break;
780
+
781
+ case "slide": //if using the slide fallback theme...
782
+ default:
783
+ //create objects which will save the .css() and .animation() objects
784
+ var animateOut = {};
785
+ var animateIn = {};
786
+ var moveIn = {};
787
+
788
+ //construct the .css() and .animation() objects
789
+ if(self.direction === 1) {
790
+ animateOut.left = "-100%";
791
+ animateIn.left = "100%";
792
+ }else{
793
+ animateOut.left = "100%";
794
+ animateIn.left = "-100%";
795
+ }
796
+
797
+ moveIn.left = "0";
798
+ moveIn.opacity = 1;
799
+
800
+ self.currentFrame = self.frames.eq(self.currentFrameID-1);
801
+ self.beforeCurrentFrameAnimatesOut();
802
+ self.currentFrame.animate(animateOut, self.settings.fallback.speed, function() {
803
+ self.currentFrame.css({"display": "none", "z-index": "1"});
804
+ self.afterCurrentFrameAnimatesOut();
805
+ }); //cause the current frame to animate out
806
+ self.beforeNextFrameAnimatesIn(); //callback
807
+ self.nextFrame.show().css(animateIn);
808
+ self.nextFrame.css({"display": "block", "z-index": self.numberOfFrames}).animate(moveIn, self.settings.fallback.speed, function() { //cause the next frame to animate in
809
+ animationComplete();
810
+ self.afterNextFrameAnimatesIn(); //callback
811
+ });
812
+ break;
813
+ }
814
+ }
815
+ self.currentFrameID = self.nextFrameID; //make the currentFrameID the same as the one that is to animate in
816
+ }
817
+ },
818
+
819
+ /*
820
+ removes Sequence from the element it's attached to
821
+
822
+ callback: a callback to run once .destroy() has finished (or see the sequence.destroyed() callback)
823
+ */
824
+ destroy: function(callback) {
825
+ var self = this;
826
+
827
+ self.container.addClass('sequence-destroyed'); //add a class of "destroyed" in case the developer wants to animate opacity etc
828
+
829
+ //REMOVE EVENTS
830
+ if(self.nextButton !== undefined) { //remove the next button click event if a next button is defined
831
+ self.nextButton.unbind('click.sequence');
832
+ }
833
+ if(self.prevButton !== undefined) { //remove the previous button click event if a previous button is defined
834
+ self.prevButton.unbind('click.sequence');
835
+ }
836
+ if(self.pauseButton !== undefined) { //remove the pause button click event if a pause button is defined
837
+ self.pauseButton.unbind('click.sequence');
838
+ }
839
+
840
+ if(self.pagination !== undefined) {
841
+ self.paginationLinks.unbind('click.sequence');
842
+ }
843
+
844
+ $(document).unbind('keydown.sequence'); //unbind key events
845
+ self.canvas.unbind('mouseenter.sequence, mouseleave.sequence, touchstart.sequence, touchmove.sequence'); //unbind mouse and touch events
846
+ $(window).unbind('hashchange.sequence'); //unbind hashchange
847
+
848
+ //CLEAR TIMERS
849
+ self.stopAutoPlay();
850
+ clearTimeout(self.transitionThresholdTimer);
851
+
852
+ //TIDY UP THE DOM
853
+ self.canvas.children('li').remove(); //because Sequence rearranges frames so the active one is always on top, remove them all...
854
+ self.canvas.prepend(self.frames); //then add them back in, in their original order
855
+ self.frames.removeClass('animate-in animate-out').removeAttr('style'); //remove classes and inline styles from all frames
856
+ self.frames.eq(self.currentFrameID-1).addClass('animate-in'); //keep the current frame in it's animate-in position
857
+
858
+ //HIDE UI ELEMENTS
859
+ if(self.nextButton !== undefined && self.nextButton !== false) { //if a next button is defined and was shown on initiation, hide it
860
+ self.nextButton.hide();
861
+ }
862
+ if(self.prevButton !== undefined && self.prevButton !== false) { //if a prev button is defined and was shown on initiation, hide it
863
+ self.prevButton.hide();
864
+ }
865
+ if(self.pauseButton !== undefined && self.pauseButton !== false) { //if a pause button is defined and was shown on initiation, hide it
866
+ self.pauseButton.hide();
867
+ }
868
+ if(self.pauseIcon !== undefined && self.pauseIcon !== false) { //if a pause icon is defined, hide it
869
+ self.pauseIcon.hide();
870
+ }
871
+ if(self.pagination !== undefined && self.pagination !== false) { //if pagination is defined and was shown on initiation, hide it
872
+ self.pagination.hide();
873
+ }
874
+
875
+ //CALLBACKS - a callback can either be passed into the destroy() function or by using the sequence.destroyed() publc method
876
+ if(callback !== undefined) {
877
+ callback(); //callback past into the function
878
+ }
879
+
880
+ self.destroyed(); //callback
881
+ self.container.removeData(); //remove data
882
+ },
883
+ //END PUBLIC METHODS
884
+
885
+ //PRIVATE METHODS
886
+
887
+ //trigger keyEvents, customKeyEvents and swipeEvents
888
+ _initCustomKeyEvent: function(event) {
889
+ var self = this;
890
+
891
+ switch(event) {
892
+ case "next":
893
+ self.next();
894
+ break;
895
+ case "prev":
896
+ self.prev();
897
+ break;
898
+ case "pause":
899
+ self.pause(true);
900
+ break;
901
+ }
902
+ },
903
+
904
+ /*
905
+ reset the transition-duration and transition-delay properties of an element
906
+
907
+ elementToReset = the element that is to have it's properties reset
908
+ cssValue = the value to be given to the transition-duration and transition-delay properties
909
+ */
910
+ _resetElements: function(prefix, elementToReset, cssValue) {
911
+ var self = this;
912
+
913
+ elementToReset.css(
914
+ self._prefixCSS(prefix, {
915
+ "transition-duration": cssValue,
916
+ "transition-delay": cssValue,
917
+ "transition-timing-function": ""
918
+ })
919
+ );
920
+ },
921
+
922
+ /*
923
+ when navigating backwards and reverseAnimationsWhenNavigatingBackwards is true, take the transition properties for forward animation and manipulate the animated elements to create a perfect reversal
924
+ */
925
+ _reverseTransitionProperties: function() {
926
+ var self = this;
927
+
928
+ var currentFrameChildrenDurations = []; //saves the duration for each of the current frame's element
929
+ var nextFrameChildrenDurations = []; //saves the duration for each of the next frame's element
930
+
931
+ self.currentFrameChildren.each(function() { //get the overall duration (including delay) for each animated element in the current frame
932
+ currentFrameChildrenDurations.push(parseFloat($(this).css(self.transitionPrefix+'transition-duration').replace('s', '')) + parseFloat($(this).css(self.transitionPrefix+'transition-delay').replace('s', '')));
933
+ });
934
+
935
+ self.nextFrameChildren.each(function() { //get the overall duration (including delay) for each animated element in the current frame
936
+ nextFrameChildrenDurations.push(parseFloat($(this).css(self.transitionPrefix+'transition-duration').replace('s', '')) + parseFloat($(this).css(self.transitionPrefix+'transition-delay').replace('s', '')));
937
+ });
938
+
939
+ var maximumCurrentFrameDuration = Math.max.apply(Math, currentFrameChildrenDurations); //find which transition duration is the longest
940
+ var maximumNextFrameDuration = Math.max.apply(Math, nextFrameChildrenDurations); //find which transition duration is the longest
941
+ var transitionDifference = maximumCurrentFrameDuration - maximumNextFrameDuration; //get the overal transition difference between the current and next frame
942
+ var currentDelay = 0;
943
+ var nextDelay = 0;
944
+
945
+ if(transitionDifference < 0 && !self.settings.preventDelayWhenReversingAnimations) { //if the current frame has a greater duration than the next frame...
946
+ /* note: because the current frame will take longer to animate out than the next to animate in, when this animation is reversed, the current frame will have a delay applied before it animates out. By default, Sequence will aim to avoid this (via the preventDelayWhenReversingAnimations option) because a delay on the current frame may confuse the user. The delay is removed, which means the reversal of animation is slightly out of sync */
947
+ currentDelay = Math.abs(transitionDifference);
948
+ }else if(transitionDifference > 0) { //if the next frame has a greater duration than the current frame, add the difference on as a delay
949
+ nextDelay = Math.abs(transitionDifference);
950
+ }
951
+
952
+ var reverseEachProperty = function(transitionProperties, currentFrameChildren, maximumFrameDuration, frameDelay) {
953
+
954
+ function convertTimingFunctionToCubicBezier(timingFunction) {
955
+
956
+ timingFunction = timingFunction.split(',')[0]; //only use one timing function
957
+
958
+ var timingFunctionToCubicBezier = {
959
+ "linear" : "cubic-bezier(0.0,0.0,1.0,1.0)",
960
+ "ease" : "cubic-bezier(0.25, 0.1, 0.25, 1.0)",
961
+ "ease-in": "cubic-bezier(0.42, 0.0, 1.0, 1.0)",
962
+ "ease-in-out": "cubic-bezier(0.42, 0.0, 0.58, 1.0)",
963
+ "ease-out": "cubic-bezier(0.0, 0.0, 0.58, 1.0)"
964
+ };
965
+
966
+ if(timingFunction.indexOf("cubic-bezier") < 0) { //if the timing-function returned isn't a cubic-bezier()
967
+ timingFunction = timingFunctionToCubicBezier[timingFunction]; //convert it to one
968
+ }
969
+
970
+ return timingFunction; //return a cubic-bezier()
971
+ }
972
+
973
+ currentFrameChildren.each(function() {
974
+
975
+ var duration = parseFloat($(this).css(self.transitionPrefix+'transition-duration').replace('s', '')); //get the elements transition-duration
976
+ var delay = parseFloat($(this).css(self.transitionPrefix+'transition-delay').replace('s', '')); //get the elements transition-delay
977
+ var transitionFunction = $(this).css(self.transitionPrefix+'transition-timing-function'); //get the elements transiion-timing-function
978
+
979
+ if(transitionFunction.indexOf('cubic') === -1) { //if the function isn't a cubic-bezier (the Blink engine returns keywords instead)...
980
+ var transitionFunction = convertTimingFunctionToCubicBezier(transitionFunction); //convert the keyword to cubic-bezier()
981
+ }
982
+
983
+ if (self.settings.reverseEaseWhenNavigatingBackwards) {
984
+ var cubicBezier = transitionFunction.replace('cubic-bezier(', '').replace(')', '').split(','); //remove the CSS function and just get the array
985
+ $.each(cubicBezier, function(index, value) { //for each point that makes up the cubic bezier...
986
+ cubicBezier[index] = parseFloat(value); //turn the point into a number (rather than text)
987
+ });
988
+
989
+ //reverse the cubic bezier
990
+ var reversedCubicBezier = [
991
+ 1 - cubicBezier[2],
992
+ 1 - cubicBezier[3],
993
+ 1 - cubicBezier[0],
994
+ 1 - cubicBezier[1]
995
+ ];
996
+ transitionFunction = 'cubic-bezier('+reversedCubicBezier+')'; //add the reversed cubic bezier back into a CSS function
997
+ }
998
+
999
+ var frameDuration = duration + delay; //get the overall duration of the element
1000
+
1001
+ transitionProperties["transition-duration"] = duration + 's'; //reapply the element's transition-duration (to override any inline styles)
1002
+ transitionProperties["transition-delay"] = (maximumFrameDuration - frameDuration + frameDelay) + 's'; //add a delay if required
1003
+ transitionProperties["transition-timing-function"] = transitionFunction; //reapply the reversed transition function
1004
+ $(this).css(
1005
+ self._prefixCSS(self.transitionPrefix, transitionProperties) //set the new transition properties
1006
+ );
1007
+ });
1008
+ };
1009
+
1010
+ reverseEachProperty(self.transitionProperties, self.currentFrameChildren, maximumCurrentFrameDuration, currentDelay); //reverse properties for each of the current frame's elements
1011
+ reverseEachProperty(self.transitionProperties, self.nextFrameChildren, maximumNextFrameDuration, nextDelay); //reverse properties for each of the next frame's elements
1012
+ },
1013
+
1014
+ /*
1015
+ adds the browser vendors prefix onto multiple CSS properties
1016
+
1017
+ prefix = the prefix for the browser Sequence is being viewed in (-webkit- for example)
1018
+ properties = the properties to be prefixed (transition-duration for example)
1019
+ */
1020
+ _prefixCSS: function(prefix, properties) {
1021
+ var self = this;
1022
+
1023
+ var css = {};
1024
+ for(var property in properties) { //for each property to be modified...
1025
+ css[prefix + property] = properties[property]; //add the prefix to the property name
1026
+ }
1027
+ return css; //return the prefixed CSS
1028
+ },
1029
+
1030
+ /*
1031
+ internal function used to start and stop autoPlay
1032
+ start: if true, autoPlay will be started, else it'll be stopped
1033
+ delay: a time in ms before starting the autoPlay feature (if unspecified, the default will be used)
1034
+ */
1035
+ _resetAutoPlay: function(start, delay) {
1036
+ var self = this;
1037
+
1038
+ if(start === true) { //if starting autoPlay
1039
+ if(self.settings.autoPlay && !self.isSoftPaused) { //if using autoPlay and Sequence isn't paused...
1040
+ clearTimeout(self.autoPlayTimer); //stop the autoPlay timer
1041
+ self.autoPlayTimer = setTimeout(function() { //start a new autoPlay timer and...
1042
+ if(self.settings.autoPlayDirection === 1) { //go to either the next or previous frame
1043
+ self.next();
1044
+ }else{
1045
+ self.prev();
1046
+ }
1047
+ }, delay); //after a specified delay
1048
+ }
1049
+ }else{ //if stopping autoPlay
1050
+ clearTimeout(self.autoPlayTimer); //stop the autoPlay timer
1051
+ }
1052
+ },
1053
+
1054
+ /*functionality to initiate the preloader, next/previous buttons and so on
1055
+
1056
+ devOption: true = the developer wants to use the default selector. false = don't use a uiElement. string = the developer defined selector to use for the UI element
1057
+ defaultOption: the default selector to use for the UI element, when the developer specifies false for devOption
1058
+ */
1059
+ _renderUiElements: function(devOption, defaultOption) {
1060
+ var self = this;
1061
+
1062
+ switch(devOption) {
1063
+ case false: //don't set up a uiElement
1064
+ return undefined;
1065
+
1066
+ case true: //use the default uiElement
1067
+ if(defaultOption === ".sequence-preloader") { //if setting up the preloader...
1068
+ self._defaultPreloader(self.container, self.transitionsSupported, self.animationPrefix); //get the default preloader
1069
+ }
1070
+ return $(defaultOption, self.container); //return the default element
1071
+
1072
+ default: //if using a developer defined selector...
1073
+ return $(devOption, self.container); //return the developer defined element
1074
+ }
1075
+ },
1076
+
1077
+ /*
1078
+ prevents the next frame from animating until the current frame has finished animating
1079
+
1080
+ frame: the frame <li> which is animating
1081
+ self.currentFrameChildren: the animated direct child elements of the frame
1082
+ transitionPhase: whether the elements are animating "in" to an active position or "out" of an active position
1083
+ inAfterwards: whether the next frame should animate in afterwards
1084
+ direction: the direction of animation
1085
+ */
1086
+ _waitForAnimationsToComplete: function(frame, currentFrameChildren, transitionPhase, inAfterwards, direction) {
1087
+ var self = this;
1088
+
1089
+ if(transitionPhase === "out") { //if waiting on a frame's element to animate out...
1090
+ var onceComplete = function() {
1091
+ self.afterCurrentFrameAnimatesOut(); //callback
1092
+
1093
+ if(self.settings.transitionThreshold === true) {
1094
+ if(direction === 1) {
1095
+ self.nextFrame.addClass("animate-in"); //add the "animate-in" class
1096
+ }else if(direction === -1) {
1097
+ self.nextFrame.toggleClass("animate-out animate-in");
1098
+ }
1099
+ }
1100
+ };
1101
+ }else if(transitionPhase === "in") { //if waiting on a frame's element to animate in...
1102
+ var onceComplete = function() {
1103
+ self.afterNextFrameAnimatesIn(); //callback
1104
+ self._setHashTag(); //set the hashtag to represent the newly active frame
1105
+
1106
+ self.active = false; //Sequence is not animating
1107
+
1108
+ if(!self.isHardPaused && !self.isBeingHoveredOver) { //if Sequence isn't hard paused (via a pause button for example) or being hovered over...
1109
+ if(!self.delayUnpause) { //if unpausing isn't delayed (Sequence wasn't animating when unpause was invoked)...
1110
+ self.unpause(false); //unpause Sequence but don't run the unpause callback
1111
+ }else{ //if unpausing was delay because Sequence was animating when unpause was invoked...
1112
+ self.delayUnpause = false;
1113
+ self.unpause(); //unpause Sequence
1114
+ }
1115
+ }
1116
+ };
1117
+ }
1118
+
1119
+ currentFrameChildren.data('animationEnded', false); // set the data attribute of each animated element to indicate that the animation has not yet ended
1120
+ frame.bind(self.transitionEnd, function(e) { //when an element finishes animating...
1121
+ $(e.target).data('animationEnded', true); // set the data attrbiute to indicate that the element has finished it's animation
1122
+
1123
+ // now check if all elements have finished animating
1124
+ var allAnimationsEnded = true;
1125
+ currentFrameChildren.each(function() { //for each element being animated within a frame...
1126
+ if($(this).data('animationEnded') === false) { //if the animation hasn't ended...
1127
+ allAnimationsEnded = false; //not all animations have ended yet
1128
+ return false; //break out of the animationEnded check early
1129
+ }
1130
+ });
1131
+
1132
+ if(allAnimationsEnded) { //if all animations have ended...
1133
+ frame.unbind(self.transitionEnd); //stop waiting for animations to end
1134
+ onceComplete();
1135
+ }
1136
+ });
1137
+ },
1138
+
1139
+ _setHashTag: function() {
1140
+ var self = this;
1141
+
1142
+ if(self.settings.hashTags) { //if hashTags is enabled...
1143
+ self.currentHashTag = self.nextFrame.prop(self.getHashTagFrom); //get the hashtag name
1144
+ self.frameHashIndex = $.inArray(self.currentHashTag, self.frameHashID); //get the index of the frame that matches the hashtag
1145
+ if(self.frameHashIndex !== -1 && (self.settings.hashChangesOnFirstFrame || (!self.isStartingFrame || !self.transitionsSupported))) { //if the hashtag matches a Sequence frame ID...
1146
+ self.nextFrameID = self.frameHashIndex + 1;
1147
+ document.location.hash = "#"+self.currentHashTag;
1148
+ }else{
1149
+ self.nextFrameID = self.settings.startingFrameID;
1150
+ self.isStartingFrame = false;
1151
+ }
1152
+ }
1153
+ },
1154
+
1155
+ /* Modernizr 2.6.1 (Custom Build) | MIT & BSD
1156
+ * Build: http://modernizr.com/download/#-svg-prefixed-testprop-testallprops-domprefixes
1157
+ */
1158
+ _modernizrForSequence: function() {
1159
+ ;window.ModernizrForSequence=function(a,b,c){function x(a){i.cssText=a}function y(a,b){return x(prefixes.join(a+";")+(b||""))}function z(a,b){return typeof a===b}function A(a,b){return!!~(""+a).indexOf(b)}function B(a,b){for(var d in a){var e=a[d];if(!A(e,"-")&&i[e]!==c)return b=="pfx"?e:!0}return!1}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:z(f,"function")?f.bind(d||b):f}return!1}function D(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+m.join(d+" ")+d).split(" ");return z(b,"string")||z(b,"undefined")?B(e,b):(e=(a+" "+n.join(d+" ")+d).split(" "),C(e,b,c))}var d="2.6.1",e={},f=b.documentElement,g="modernizrForSequence",h=b.createElement(g),i=h.style,j,k={}.toString,l="Webkit Moz O ms",m=l.split(" "),n=l.toLowerCase().split(" "),o={svg:"http://www.w3.org/2000/svg"},p={},q={},r={},s=[],t=s.slice,u,v={}.hasOwnProperty,w;!z(v,"undefined")&&!z(v.call,"undefined")?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=self;if(typeof c!="function")throw new TypeError;var d=t.call(arguments,1),e=function(){if(self instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(t.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(t.call(arguments)))};return e}),p.svg=function(){return!!b.createElementNS&&!!b.createElementNS(o.svg,"svg").createSVGRect};for(var E in p)w(p,E)&&(u=E.toLowerCase(),e[u]=p[E](),s.push((e[u]?"":"no-")+u));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)w(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,enableClasses&&(f.className+=" "+(b?"":"no-")+a),e[a]=b}return e},x(""),h=j=null,e._version=d,e._domPrefixes=n,e._cssomPrefixes=m,e.testProp=function(a){return B([a])},e.testAllProps=D,e.prefixed=function(a,b,c){return b?D(a,b,c):D(a,"pfx")},e}(self,self.document);
1160
+ },
1161
+
1162
+ /* Set up Sequence's default preloader
1163
+ * prependTo = which element to prepend the preloader to
1164
+ * transitions = whether CSS3 transitions are supported
1165
+ * prefix = the prefix for the browser Sequence is being viewed in
1166
+ */
1167
+ _defaultPreloader: function(prependTo, transitions, prefix) {
1168
+ var icon = '<div class="sequence-preloader"><svg class="preloading" xmlns="http://www.w3.org/2000/svg"><circle class="circle" cx="6" cy="6" r="6" /><circle class="circle" cx="22" cy="6" r="6" /><circle class="circle" cx="38" cy="6" r="6" /></svg></div>';
1169
+
1170
+ $("head").append("<style>.sequence-preloader{height: 100%;position: absolute;width: 100%;z-index: 999999;}@"+prefix+"keyframes preload{0%{opacity: 1;}50%{opacity: 0;}100%{opacity: 1;}}.sequence-preloader .preloading .circle{fill: #ff9442;display: inline-block;height: 12px;position: relative;top: -50%;width: 12px;"+prefix+"animation: preload 1s infinite; animation: preload 1s infinite;}.preloading{display:block;height: 12px;margin: 0 auto;top: 50%;margin-top:-6px;position: relative;width: 48px;}.sequence-preloader .preloading .circle:nth-child(2){"+prefix+"animation-delay: .15s; animation-delay: .15s;}.sequence-preloader .preloading .circle:nth-child(3){"+prefix+"animation-delay: .3s; animation-delay: .3s;}.preloading-complete{opacity: 0;visibility: hidden;"+prefix+"transition-duration: 1s; transition-duration: 1s;}div.inline{background-color: #ff9442; margin-right: 4px; float: left;}</style>");
1171
+ prependTo.prepend(icon);
1172
+ if(!ModernizrForSequence.svg && !transitions) { //if SVG isn't supported, remain calm and add this fallback instead...
1173
+ $(".sequence-preloader").prepend('<div class="preloading"><div class="circle inline"></div><div class="circle inline"></div><div class="circle inline"></div></div>');
1174
+ setInterval(function() {
1175
+ $(".sequence-preloader .circle").fadeToggle(500);
1176
+ }, 500);
1177
+ }else if(!transitions) { //if transitions aren't supported, toggle the opacity instead
1178
+ setInterval(function() {
1179
+ $(".sequence-preloader").fadeToggle(500);
1180
+ }, 500);
1181
+ }
1182
+ },
1183
+
1184
+ //a quick test to work out if Opera supports transitions properly (to work around the fact that Opera 11 supports transitions but doesn't return a transition value properly)
1185
+ _operaTest: function() {
1186
+ $("body").append('<span id="sequence-opera-test"></span>');
1187
+ var $operaTest = $("#sequence-opera-test");
1188
+ $operaTest.css("-o-transition", "1s"); //add a transition value to the Opera test
1189
+ if($operaTest.css("-o-transition") !== "1s") { //if the expected value isn't returned...
1190
+ $operaTest.remove();
1191
+ return false; //cause Opera to go into the fallback theme
1192
+ }else{
1193
+ $operaTest.remove();
1194
+ return true;
1195
+ }
1196
+ }
1197
+ //END PRIVATE METHODS
1198
+
1199
+ }; //END PROTOTYPE
1200
+
1201
+ var defaults = {
1202
+ //General Settings
1203
+ startingFrameID: 1, //The frame (the list item `<li>`) that should first be displayed when Sequence loads
1204
+ cycle: true, //Whether Sequence should navigate to the first frame after the last frame and vice versa
1205
+ animateStartingFrameIn: false, //Whether the first frame should animate in to its active position
1206
+ transitionThreshold: false, //The delay between a frame animating out and the next animating in (false = no delay, true = the next frame will animate in only once the current frame has animated out)
1207
+ reverseAnimationsWhenNavigatingBackwards: true, //Whether animations should be reversed when a user navigates backwards by clicking a previous button/swiping/pressing the left key
1208
+ reverseEaseWhenNavigatingBackwards: true, //Whether the ease function should be reversed when a user navigates backwards
1209
+ preventDelayWhenReversingAnimations: false, //Whether a delay should be removed when animations are reversed. This delay is removed by default to prevent user confusion
1210
+ moveActiveFrameToTop: true, //Whether a frame should be given a higher `z-index` than other frames whilst it is active, to bring it above the others
1211
+ windowLoaded: false, //Set to true if it is known that the window.onload event has already fired. Useful with javascript module loaders (such as RequireJS).
1212
+
1213
+ //Autoplay Settings
1214
+ autoPlay: false, //Cause Sequence to automatically change between frames over a period of time, as defined in autoPlayDelay
1215
+ autoPlayDirection: 1, //The direction in which Sequence should auto play
1216
+ autoPlayDelay: 5000, //The duration in milliseconds at which frames should remain on screen before animating to the next
1217
+
1218
+ //Frame Skipping Settings
1219
+ navigationSkip: true, //Whether the user can navigate through frames before each frame has finished animating
1220
+ navigationSkipThreshold: 250, //Amount of time that must pass before the next frame can be navigated to
1221
+ fadeFrameWhenSkipped: true, //If a frame is skipped before it finishes animating, it will quickly fade out
1222
+ fadeFrameTime: 150, //If fadeFrameWhenSkipped is true, how quickly a frame should fade out when skipped (in milliseconds)
1223
+ preventReverseSkipping: false, //Whether the user can change the direction of navigation during frames animating (if navigating forward, the user can only skip forwards when other frames are animating).
1224
+
1225
+ //Next/Prev Button Settings
1226
+ nextButton: false, //if true, Sequence will use an element with class ".sequence-next" as the next button, else specify your own selector. false = don't use an in-built next button
1227
+ showNextButtonOnInit: true, //if true, Sequence will make the next button display: block; once Sequence has loaded (give the next button selector display: none; in the CSS to hide it until its usable)
1228
+ prevButton: false, //if true, Sequence will use an element with class ".sequence-prev" as the previous button, else specify your own selector. false = don't use an in-built previous button
1229
+ showPrevButtonOnInit: true, //if true, Sequence will make the previous button display: block; once Sequence has loaded (give the previous button selector display: none; in the CSS to hide it until its usable)
1230
+
1231
+ //Pause Settings
1232
+ pauseButton: false, //if true, Sequence will use an element with class ".sequence-pause" as the pause button, else specify your own selector. false = don't use an in-built pause button
1233
+ unpauseDelay: null, //the time to wait before navigating to the next frame when Sequence is unpaused. Note that if an unpauseDelay is not specified, the default is the same as the autoPlayDelay setting
1234
+ pauseOnHover: true, //pause Sequence when the Sequence container is hovered over
1235
+ pauseIcon: false, //if true, Sequence will use an element with class ".sequence-pause-icon" as the pause icon, else specify your own selector. false = don't use an in-built pause icon (the pause icon will display when Sequence is paused)
1236
+ showPauseButtonOnInit: true, //if true, Sequence will make the pause button display: block; once Sequence has loaded (give the pause button selector display: none; in the CSS to hide it until its usable)
1237
+
1238
+ //Pagination Settings
1239
+ pagination: false, //if true, Sequence will use an element with class ".sequence-pagination" as the paginated navigation, else specify your own selector. false = don't use in-built pagination
1240
+ showPaginationOnInit: true, //if true, Sequence will make the pagination display: block; once Sequence has loaded (give the pagination selector display: none; in the CSS to hide it until its usable)
1241
+
1242
+ //Preloader Settings
1243
+ preloader: false,
1244
+ preloadTheseFrames: [1], //all images in these frames will load before Sequence initiates
1245
+ preloadTheseImages: [ //specify particular images to load before Sequence initiates
1246
+ /* Example usage
1247
+ "images/catEatingSalad.jpg",
1248
+ "images/meDressedAsBatman.png"
1249
+ */
1250
+ ],
1251
+ /*Note: You can use preloadTheseFrames and preloadTheseImages together. You might want to load all images in frame 1 and just one big image from frame 2 for example*/
1252
+ hideFramesUntilPreloaded: true,
1253
+ prependPreloadingComplete: true,
1254
+ hidePreloaderUsingCSS: true,
1255
+ hidePreloaderDelay: 0,
1256
+
1257
+ //Keyboard settings
1258
+ keyNavigation: true, //false prevents the following keyboard settings
1259
+ numericKeysGoToFrames: true,
1260
+ keyEvents: {
1261
+ left: "prev",
1262
+ right: "next"
1263
+ },
1264
+ customKeyEvents: {
1265
+ /* Example usage
1266
+ 65: "prev", //a
1267
+ 68: "next", //d
1268
+ 83: "prev", //s
1269
+ 87: "next" //w
1270
+ */
1271
+ },
1272
+
1273
+ //Touch Swipe Settings
1274
+ swipeNavigation: true,
1275
+ swipeThreshold: 20,
1276
+ swipePreventsDefault: false, //be careful if setting this to true
1277
+ swipeEvents: {
1278
+ left: "prev",
1279
+ right: "next",
1280
+ up: false,
1281
+ down: false
1282
+ },
1283
+
1284
+ //hashTags Settings
1285
+ //when using hashTags, please include a reference to Ben Alman's jQuery HashChange plugin above your reference to Sequence.js
1286
+
1287
+ //info: http://benalman.com/projects/jquery-hashchange-plugin/
1288
+ //plugin: https://raw.github.com/cowboy/jquery-hashchange/v1.3/jquery.ba-hashchange.min.js
1289
+ //GitHub: https://github.com/cowboy/jquery-hashchange
1290
+ hashTags: false, //when a frame is navigated to, change the hashtag to the frames ID
1291
+ hashDataAttribute: false, //false = the hashTag is taken from a frames ID attribute | true = the hashTag is taken from the data attribute "data-sequence-hash"
1292
+ hashChangesOnFirstFrame: false, //false = the hashTag won't change for the first frame but will for those after
1293
+
1294
+ //Fallback Theme Settings (For browsers that don't support CSS3 transitions)
1295
+ fallback: {
1296
+ theme: "slide",
1297
+ speed: 500
1298
+ }
1299
+ };
1300
+
1301
+ $.fn.sequence = function(options) {
1302
+ return this.each(function() {
1303
+ if (!$.data(this, 'sequence')) { //prevent multiple initiations on the same element
1304
+ $.data(this, 'sequence', new Sequence($(this), options, defaults));
1305
+ }
1306
+ });
1307
+ };
1308
+ })(jQuery);
skin/frontend/base/default/js/sequencejs-options.modern-slide-in.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // This is important!
2
+ jQuery.noConflict();
3
+ (function($){
4
+ $(document).ready(function() {
5
+
6
+ //Main Banner Slider
7
+ var options = {
8
+ nextButton: true,
9
+ prevButton: true,
10
+ pagination: true,
11
+ animateStartingFrameIn: true,
12
+ autoPlay: true,
13
+ autoPlayDelay: 3000,
14
+ preloader: true,
15
+ preloadTheseFrames: [1],
16
+ preloadTheseImages: [
17
+ "images/tn-model1.png",
18
+ "images/tn-model2.png",
19
+ "images/tn-model3.png"
20
+ ]
21
+ };
22
+
23
+ var mySequence = $("#sequence").sequence(options).data("sequence");
24
+
25
+ });//document ready close
26
+ }
27
+ (jQuery));