Version Notes
This is beautiful responsive thumbnail slider for magento sites.Admin can manages any number of images into the thumbnail slider. Admin can add,edit and delete thumbnail slider images.
Download this release
Release Info
Developer | dataman |
Extension | Thumbnailslider |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider.php +12 -0
- app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider/Edit.php +45 -0
- app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider/Edit/Form.php +19 -0
- app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider/Edit/Tab/Form.php +73 -0
- app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider/Edit/Tabs.php +24 -0
- app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider/Grid.php +122 -0
- app/code/local/Dataman/Thumbnailslider/Block/Thumbnailslider.php +24 -0
- app/code/local/Dataman/Thumbnailslider/Helper/Data.php +6 -0
- app/code/local/Dataman/Thumbnailslider/Model/Mysql4/Thumbnailslider.php +10 -0
- app/code/local/Dataman/Thumbnailslider/Model/Mysql4/Thumbnailslider/Collection.php +10 -0
- app/code/local/Dataman/Thumbnailslider/Model/Status.php +15 -0
- app/code/local/Dataman/Thumbnailslider/Model/Thumbnailslider.php +10 -0
- app/code/local/Dataman/Thumbnailslider/controllers/Adminhtml/ThumbnailsliderController.php +240 -0
- app/code/local/Dataman/Thumbnailslider/controllers/IndexController.php +47 -0
- app/code/local/Dataman/Thumbnailslider/etc/config.xml +120 -0
- app/code/local/Dataman/Thumbnailslider/sql/thumbnailslider_setup/mysql4-install-0.1.0.php +26 -0
- app/design/adminhtml/default/default/layout/thumbnailslider.xml +8 -0
- app/design/frontend/base/default/layout/thumbnailslider.xml +10 -0
- app/design/frontend/base/default/template/thumbnailslider/thumbnailslider.phtml +325 -0
- app/design/frontend/base/default/template/thumbnailslider/thumbnailslider.phtml~ +325 -0
- app/etc/modules/Dataman_Thumbnailslider.xml +9 -0
- js/thumbnailslider/jquery-1.9.1.min.js +20 -0
- js/thumbnailslider/jssor.js +2850 -0
- js/thumbnailslider/jssor.slider.js +4088 -0
- media/img/a11.png +0 -0
- media/img/b03.png +0 -0
- media/img/loading.gif +0 -0
- media/thumbnailslider/01.jpg +0 -0
- media/thumbnailslider/02.jpg +0 -0
- media/thumbnailslider/thumb-01.jpg +0 -0
- media/thumbnailslider/thumb-02.jpg +0 -0
- package.xml +18 -0
app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Dataman_Thumbnailslider_Block_Adminhtml_Thumbnailslider extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller = 'adminhtml_thumbnailslider';
|
7 |
+
$this->_blockGroup = 'thumbnailslider';
|
8 |
+
$this->_headerText = Mage::helper('thumbnailslider')->__('Item Manager');
|
9 |
+
$this->_addButtonLabel = Mage::helper('thumbnailslider')->__('Add Item');
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
+
}
|
app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider/Edit.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Dataman_Thumbnailslider_Block_Adminhtml_Thumbnailslider_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
|
9 |
+
$this->_objectId = 'id';
|
10 |
+
$this->_blockGroup = 'thumbnailslider';
|
11 |
+
$this->_controller = 'adminhtml_thumbnailslider';
|
12 |
+
|
13 |
+
$this->_updateButton('save', 'label', Mage::helper('thumbnailslider')->__('Save Item'));
|
14 |
+
$this->_updateButton('delete', 'label', Mage::helper('thumbnailslider')->__('Delete Item'));
|
15 |
+
|
16 |
+
$this->_addButton('saveandcontinue', array(
|
17 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
+
'onclick' => 'saveAndContinueEdit()',
|
19 |
+
'class' => 'save',
|
20 |
+
), -100);
|
21 |
+
|
22 |
+
$this->_formScripts[] = "
|
23 |
+
function toggleEditor() {
|
24 |
+
if (tinyMCE.getInstanceById('thumbnailslider_content') == null) {
|
25 |
+
tinyMCE.execCommand('mceAddControl', false, 'thumbnailslider_content');
|
26 |
+
} else {
|
27 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'thumbnailslider_content');
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
function saveAndContinueEdit(){
|
32 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
33 |
+
}
|
34 |
+
";
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getHeaderText()
|
38 |
+
{
|
39 |
+
if( Mage::registry('thumbnailslider_data') && Mage::registry('thumbnailslider_data')->getId() ) {
|
40 |
+
return Mage::helper('thumbnailslider')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('thumbnailslider_data')->getTitle()));
|
41 |
+
} else {
|
42 |
+
return Mage::helper('thumbnailslider')->__('Add Item');
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider/Edit/Form.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Dataman_Thumbnailslider_Block_Adminhtml_Thumbnailslider_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form(array(
|
8 |
+
'id' => 'edit_form',
|
9 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
+
'method' => 'post',
|
11 |
+
'enctype' => 'multipart/form-data'
|
12 |
+
)
|
13 |
+
);
|
14 |
+
|
15 |
+
$form->setUseContainer(true);
|
16 |
+
$this->setForm($form);
|
17 |
+
return parent::_prepareForm();
|
18 |
+
}
|
19 |
+
}
|
app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Dataman_Thumbnailslider_Block_Adminhtml_Thumbnailslider_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$fieldset = $form->addFieldset('thumbnailslider_form', array('legend'=>Mage::helper('thumbnailslider')->__('Item information')));
|
10 |
+
|
11 |
+
$fieldset->addField('title', 'text', array(
|
12 |
+
'label' => Mage::helper('thumbnailslider')->__('Title'),
|
13 |
+
'class' => 'required-entry',
|
14 |
+
'required' => true,
|
15 |
+
'name' => 'title',
|
16 |
+
));
|
17 |
+
$fieldset->addField('url', 'text', array(
|
18 |
+
'label' => Mage::helper('thumbnailslider')->__('URL'),
|
19 |
+
'required' => false,
|
20 |
+
'name' => 'url',
|
21 |
+
));
|
22 |
+
|
23 |
+
$fieldset->addField('filename', 'file', array(
|
24 |
+
'label' => Mage::helper('thumbnailslider')->__('Image'),
|
25 |
+
'required' => false,
|
26 |
+
'name' => 'filename',
|
27 |
+
));
|
28 |
+
$fieldset->addField('thumbimage', 'file', array(
|
29 |
+
'label' => Mage::helper('thumbnailslider')->__('Thumb Image'),
|
30 |
+
'required' => false,
|
31 |
+
'name' => 'thumbimage',
|
32 |
+
));
|
33 |
+
$fieldset->addField('position', 'text', array(
|
34 |
+
'label' => Mage::helper('thumbnailslider')->__('Position'),
|
35 |
+
'required' => true,
|
36 |
+
'name' => 'position',
|
37 |
+
));
|
38 |
+
|
39 |
+
$fieldset->addField('status', 'select', array(
|
40 |
+
'label' => Mage::helper('thumbnailslider')->__('Status'),
|
41 |
+
'name' => 'status',
|
42 |
+
'values' => array(
|
43 |
+
array(
|
44 |
+
'value' => 1,
|
45 |
+
'label' => Mage::helper('thumbnailslider')->__('Enabled'),
|
46 |
+
),
|
47 |
+
|
48 |
+
array(
|
49 |
+
'value' => 2,
|
50 |
+
'label' => Mage::helper('thumbnailslider')->__('Disabled'),
|
51 |
+
),
|
52 |
+
),
|
53 |
+
));
|
54 |
+
|
55 |
+
$fieldset->addField('content', 'editor', array(
|
56 |
+
'name' => 'content',
|
57 |
+
'label' => Mage::helper('thumbnailslider')->__('Content'),
|
58 |
+
'title' => Mage::helper('thumbnailslider')->__('Content'),
|
59 |
+
'style' => 'width:700px; height:500px;',
|
60 |
+
'wysiwyg' => false,
|
61 |
+
'required' => true,
|
62 |
+
));
|
63 |
+
|
64 |
+
if ( Mage::getSingleton('adminhtml/session')->getThumbnailsliderData() )
|
65 |
+
{
|
66 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getThumbnailsliderData());
|
67 |
+
Mage::getSingleton('adminhtml/session')->setThumbnailsliderData(null);
|
68 |
+
} elseif ( Mage::registry('thumbnailslider_data') ) {
|
69 |
+
$form->setValues(Mage::registry('thumbnailslider_data')->getData());
|
70 |
+
}
|
71 |
+
return parent::_prepareForm();
|
72 |
+
}
|
73 |
+
}
|
app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider/Edit/Tabs.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Dataman_Thumbnailslider_Block_Adminhtml_Thumbnailslider_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId('thumbnailslider_tabs');
|
10 |
+
$this->setDestElementId('edit_form');
|
11 |
+
$this->setTitle(Mage::helper('thumbnailslider')->__('Item Information'));
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('thumbnailslider')->__('Item Information'),
|
18 |
+
'title' => Mage::helper('thumbnailslider')->__('Item Information'),
|
19 |
+
'content' => $this->getLayout()->createBlock('thumbnailslider/adminhtml_thumbnailslider_edit_tab_form')->toHtml(),
|
20 |
+
));
|
21 |
+
|
22 |
+
return parent::_beforeToHtml();
|
23 |
+
}
|
24 |
+
}
|
app/code/local/Dataman/Thumbnailslider/Block/Adminhtml/Thumbnailslider/Grid.php
ADDED
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Dataman_Thumbnailslider_Block_Adminhtml_Thumbnailslider_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('thumbnailsliderGrid');
|
9 |
+
$this->setDefaultSort('thumbnailslider_id');
|
10 |
+
$this->setDefaultDir('ASC');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _prepareCollection()
|
15 |
+
{
|
16 |
+
$collection = Mage::getModel('thumbnailslider/thumbnailslider')->getCollection();
|
17 |
+
$this->setCollection($collection);
|
18 |
+
return parent::_prepareCollection();
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function _prepareColumns()
|
22 |
+
{
|
23 |
+
$this->addColumn('thumbnailslider_id', array(
|
24 |
+
'header' => Mage::helper('thumbnailslider')->__('ID'),
|
25 |
+
'align' =>'right',
|
26 |
+
'width' => '50px',
|
27 |
+
'index' => 'thumbnailslider_id',
|
28 |
+
));
|
29 |
+
|
30 |
+
$this->addColumn('title', array(
|
31 |
+
'header' => Mage::helper('thumbnailslider')->__('Title'),
|
32 |
+
'align' =>'left',
|
33 |
+
'index' => 'title',
|
34 |
+
));
|
35 |
+
|
36 |
+
/*
|
37 |
+
$this->addColumn('content', array(
|
38 |
+
'header' => Mage::helper('thumbnailslider')->__('Item Content'),
|
39 |
+
'width' => '150px',
|
40 |
+
'index' => 'content',
|
41 |
+
));
|
42 |
+
*/
|
43 |
+
|
44 |
+
$this->addColumn('position', array(
|
45 |
+
'header' => Mage::helper('thumbnailslider')->__('Position'),
|
46 |
+
'align' =>'left',
|
47 |
+
'index' => 'position',
|
48 |
+
));
|
49 |
+
|
50 |
+
$this->addColumn('status', array(
|
51 |
+
'header' => Mage::helper('thumbnailslider')->__('Status'),
|
52 |
+
'align' => 'left',
|
53 |
+
'width' => '80px',
|
54 |
+
'index' => 'status',
|
55 |
+
'type' => 'options',
|
56 |
+
'options' => array(
|
57 |
+
1 => 'Enabled',
|
58 |
+
2 => 'Disabled',
|
59 |
+
),
|
60 |
+
));
|
61 |
+
|
62 |
+
$this->addColumn('action',
|
63 |
+
array(
|
64 |
+
'header' => Mage::helper('thumbnailslider')->__('Action'),
|
65 |
+
'width' => '100',
|
66 |
+
'type' => 'action',
|
67 |
+
'getter' => 'getId',
|
68 |
+
'actions' => array(
|
69 |
+
array(
|
70 |
+
'caption' => Mage::helper('thumbnailslider')->__('Edit'),
|
71 |
+
'url' => array('base'=> '*/*/edit'),
|
72 |
+
'field' => 'id'
|
73 |
+
)
|
74 |
+
),
|
75 |
+
'filter' => false,
|
76 |
+
'sortable' => false,
|
77 |
+
'index' => 'stores',
|
78 |
+
'is_system' => true,
|
79 |
+
));
|
80 |
+
|
81 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('thumbnailslider')->__('CSV'));
|
82 |
+
$this->addExportType('*/*/exportXml', Mage::helper('thumbnailslider')->__('XML'));
|
83 |
+
|
84 |
+
return parent::_prepareColumns();
|
85 |
+
}
|
86 |
+
|
87 |
+
protected function _prepareMassaction()
|
88 |
+
{
|
89 |
+
$this->setMassactionIdField('thumbnailslider_id');
|
90 |
+
$this->getMassactionBlock()->setFormFieldName('thumbnailslider');
|
91 |
+
|
92 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
93 |
+
'label' => Mage::helper('thumbnailslider')->__('Delete'),
|
94 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
95 |
+
'confirm' => Mage::helper('thumbnailslider')->__('Are you sure?')
|
96 |
+
));
|
97 |
+
|
98 |
+
$statuses = Mage::getSingleton('thumbnailslider/status')->getOptionArray();
|
99 |
+
|
100 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
101 |
+
$this->getMassactionBlock()->addItem('status', array(
|
102 |
+
'label'=> Mage::helper('thumbnailslider')->__('Change status'),
|
103 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
104 |
+
'additional' => array(
|
105 |
+
'visibility' => array(
|
106 |
+
'name' => 'status',
|
107 |
+
'type' => 'select',
|
108 |
+
'class' => 'required-entry',
|
109 |
+
'label' => Mage::helper('thumbnailslider')->__('Status'),
|
110 |
+
'values' => $statuses
|
111 |
+
)
|
112 |
+
)
|
113 |
+
));
|
114 |
+
return $this;
|
115 |
+
}
|
116 |
+
|
117 |
+
public function getRowUrl($row)
|
118 |
+
{
|
119 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
120 |
+
}
|
121 |
+
|
122 |
+
}
|
app/code/local/Dataman/Thumbnailslider/Block/Thumbnailslider.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Dataman_Thumbnailslider_Block_Thumbnailslider extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
public function getThumbnailslider()
|
10 |
+
{
|
11 |
+
if (!$this->hasData('thumbnailslider')) {
|
12 |
+
$this->setData('thumbnailslider', Mage::registry('thumbnailslider'));
|
13 |
+
}
|
14 |
+
return $this->getData('thumbnailslider');
|
15 |
+
|
16 |
+
}
|
17 |
+
public function getSilderCollection()
|
18 |
+
{
|
19 |
+
$collection = Mage::getModel('thumbnailslider/thumbnailslider')->getCollection()
|
20 |
+
->addFieldToFilter('status', 1)
|
21 |
+
->setOrder('position', 'asc');
|
22 |
+
return $collection;
|
23 |
+
}
|
24 |
+
}
|
app/code/local/Dataman/Thumbnailslider/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Dataman_Thumbnailslider_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/local/Dataman/Thumbnailslider/Model/Mysql4/Thumbnailslider.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Dataman_Thumbnailslider_Model_Mysql4_Thumbnailslider extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
// Note that the thumbnailslider_id refers to the key field in your database table.
|
8 |
+
$this->_init('thumbnailslider/thumbnailslider', 'thumbnailslider_id');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Dataman/Thumbnailslider/Model/Mysql4/Thumbnailslider/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Dataman_Thumbnailslider_Model_Mysql4_Thumbnailslider_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('thumbnailslider/thumbnailslider');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Dataman/Thumbnailslider/Model/Status.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Dataman_Thumbnailslider_Model_Status extends Varien_Object
|
4 |
+
{
|
5 |
+
const STATUS_ENABLED = 1;
|
6 |
+
const STATUS_DISABLED = 2;
|
7 |
+
|
8 |
+
static public function getOptionArray()
|
9 |
+
{
|
10 |
+
return array(
|
11 |
+
self::STATUS_ENABLED => Mage::helper('thumbnailslider')->__('Enabled'),
|
12 |
+
self::STATUS_DISABLED => Mage::helper('thumbnailslider')->__('Disabled')
|
13 |
+
);
|
14 |
+
}
|
15 |
+
}
|
app/code/local/Dataman/Thumbnailslider/Model/Thumbnailslider.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Dataman_Thumbnailslider_Model_Thumbnailslider extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('thumbnailslider/thumbnailslider');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Dataman/Thumbnailslider/controllers/Adminhtml/ThumbnailsliderController.php
ADDED
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Dataman_Thumbnailslider_Adminhtml_ThumbnailsliderController extends Mage_Adminhtml_Controller_action
|
4 |
+
{
|
5 |
+
|
6 |
+
protected function _initAction() {
|
7 |
+
$this->loadLayout()
|
8 |
+
->_setActiveMenu('thumbnailslider/items')
|
9 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
+
|
11 |
+
return $this;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function indexAction() {
|
15 |
+
$this->_initAction()
|
16 |
+
->renderLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function editAction() {
|
20 |
+
$id = $this->getRequest()->getParam('id');
|
21 |
+
$model = Mage::getModel('thumbnailslider/thumbnailslider')->load($id);
|
22 |
+
|
23 |
+
if ($model->getId() || $id == 0) {
|
24 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
25 |
+
if (!empty($data)) {
|
26 |
+
$model->setData($data);
|
27 |
+
}
|
28 |
+
|
29 |
+
Mage::register('thumbnailslider_data', $model);
|
30 |
+
|
31 |
+
$this->loadLayout();
|
32 |
+
$this->_setActiveMenu('thumbnailslider/items');
|
33 |
+
|
34 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
35 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
36 |
+
|
37 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
38 |
+
|
39 |
+
$this->_addContent($this->getLayout()->createBlock('thumbnailslider/adminhtml_thumbnailslider_edit'))
|
40 |
+
->_addLeft($this->getLayout()->createBlock('thumbnailslider/adminhtml_thumbnailslider_edit_tabs'));
|
41 |
+
|
42 |
+
$this->renderLayout();
|
43 |
+
} else {
|
44 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('thumbnailslider')->__('Item does not exist'));
|
45 |
+
$this->_redirect('*/*/');
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
public function newAction() {
|
50 |
+
$this->_forward('edit');
|
51 |
+
}
|
52 |
+
|
53 |
+
public function saveAction() {
|
54 |
+
if ($data = $this->getRequest()->getPost()) {
|
55 |
+
|
56 |
+
if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
|
57 |
+
try {
|
58 |
+
/* Starting upload */
|
59 |
+
$uploader = new Varien_File_Uploader('filename');
|
60 |
+
|
61 |
+
// Any extention would work
|
62 |
+
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
|
63 |
+
$uploader->setAllowRenameFiles(false);
|
64 |
+
|
65 |
+
// Set the file upload mode
|
66 |
+
// false -> get the file directly in the specified folder
|
67 |
+
// true -> get the file in the product like folders
|
68 |
+
// (file.jpg will go in something like /media/f/i/file.jpg)
|
69 |
+
$uploader->setFilesDispersion(false);
|
70 |
+
|
71 |
+
// We set media as the upload dir
|
72 |
+
$path = Mage::getBaseDir('media') . DS . 'thumbnailslider' .DS;
|
73 |
+
$uploader->save($path, $_FILES['filename']['name'] );
|
74 |
+
|
75 |
+
} catch (Exception $e) {
|
76 |
+
|
77 |
+
}
|
78 |
+
|
79 |
+
//this way the name is saved in DB
|
80 |
+
$data['filename'] = $_FILES['filename']['name'];
|
81 |
+
}
|
82 |
+
if(isset($_FILES['thumbimage']['name']) && $_FILES['thumbimage']['name'] != '') {
|
83 |
+
try {
|
84 |
+
/* Starting upload */
|
85 |
+
$uploader = new Varien_File_Uploader('thumbimage');
|
86 |
+
|
87 |
+
// Any extention would work
|
88 |
+
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
|
89 |
+
$uploader->setAllowRenameFiles(false);
|
90 |
+
|
91 |
+
// Set the file upload mode
|
92 |
+
// false -> get the file directly in the specified folder
|
93 |
+
// true -> get the file in the product like folders
|
94 |
+
// (file.jpg will go in something like /media/f/i/file.jpg)
|
95 |
+
$uploader->setFilesDispersion(false);
|
96 |
+
|
97 |
+
// We set media as the upload dir
|
98 |
+
$path = Mage::getBaseDir('media') . DS . 'thumbnailslider' .DS;
|
99 |
+
$uploader->save($path, $_FILES['thumbimage']['name'] );
|
100 |
+
|
101 |
+
} catch (Exception $e) {
|
102 |
+
|
103 |
+
}
|
104 |
+
|
105 |
+
//this way the name is saved in DB
|
106 |
+
$data['thumbimage'] = $_FILES['thumbimage']['name'];
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
$model = Mage::getModel('thumbnailslider/thumbnailslider');
|
111 |
+
$model->setData($data)
|
112 |
+
->setId($this->getRequest()->getParam('id'));
|
113 |
+
|
114 |
+
try {
|
115 |
+
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
116 |
+
$model->setCreatedTime(now())
|
117 |
+
->setUpdateTime(now());
|
118 |
+
} else {
|
119 |
+
$model->setUpdateTime(now());
|
120 |
+
}
|
121 |
+
|
122 |
+
$model->save();
|
123 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('thumbnailslider')->__('Item was successfully saved'));
|
124 |
+
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
125 |
+
|
126 |
+
if ($this->getRequest()->getParam('back')) {
|
127 |
+
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
128 |
+
return;
|
129 |
+
}
|
130 |
+
$this->_redirect('*/*/');
|
131 |
+
return;
|
132 |
+
} catch (Exception $e) {
|
133 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
134 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
135 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
136 |
+
return;
|
137 |
+
}
|
138 |
+
}
|
139 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('thumbnailslider')->__('Unable to find item to save'));
|
140 |
+
$this->_redirect('*/*/');
|
141 |
+
}
|
142 |
+
|
143 |
+
public function deleteAction() {
|
144 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
145 |
+
try {
|
146 |
+
$model = Mage::getModel('thumbnailslider/thumbnailslider');
|
147 |
+
|
148 |
+
$model->setId($this->getRequest()->getParam('id'))
|
149 |
+
->delete();
|
150 |
+
|
151 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
152 |
+
$this->_redirect('*/*/');
|
153 |
+
} catch (Exception $e) {
|
154 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
155 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
156 |
+
}
|
157 |
+
}
|
158 |
+
$this->_redirect('*/*/');
|
159 |
+
}
|
160 |
+
|
161 |
+
public function massDeleteAction() {
|
162 |
+
$thumbnailsliderIds = $this->getRequest()->getParam('thumbnailslider');
|
163 |
+
if(!is_array($thumbnailsliderIds)) {
|
164 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
165 |
+
} else {
|
166 |
+
try {
|
167 |
+
foreach ($thumbnailsliderIds as $thumbnailsliderId) {
|
168 |
+
$thumbnailslider = Mage::getModel('thumbnailslider/thumbnailslider')->load($thumbnailsliderId);
|
169 |
+
$thumbnailslider->delete();
|
170 |
+
}
|
171 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
172 |
+
Mage::helper('adminhtml')->__(
|
173 |
+
'Total of %d record(s) were successfully deleted', count($thumbnailsliderIds)
|
174 |
+
)
|
175 |
+
);
|
176 |
+
} catch (Exception $e) {
|
177 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
178 |
+
}
|
179 |
+
}
|
180 |
+
$this->_redirect('*/*/index');
|
181 |
+
}
|
182 |
+
|
183 |
+
public function massStatusAction()
|
184 |
+
{
|
185 |
+
$thumbnailsliderIds = $this->getRequest()->getParam('thumbnailslider');
|
186 |
+
if(!is_array($thumbnailsliderIds)) {
|
187 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
188 |
+
} else {
|
189 |
+
try {
|
190 |
+
foreach ($thumbnailsliderIds as $thumbnailsliderId) {
|
191 |
+
$thumbnailslider = Mage::getSingleton('thumbnailslider/thumbnailslider')
|
192 |
+
->load($thumbnailsliderId)
|
193 |
+
->setStatus($this->getRequest()->getParam('status'))
|
194 |
+
->setIsMassupdate(true)
|
195 |
+
->save();
|
196 |
+
}
|
197 |
+
$this->_getSession()->addSuccess(
|
198 |
+
$this->__('Total of %d record(s) were successfully updated', count($thumbnailsliderIds))
|
199 |
+
);
|
200 |
+
} catch (Exception $e) {
|
201 |
+
$this->_getSession()->addError($e->getMessage());
|
202 |
+
}
|
203 |
+
}
|
204 |
+
$this->_redirect('*/*/index');
|
205 |
+
}
|
206 |
+
|
207 |
+
public function exportCsvAction()
|
208 |
+
{
|
209 |
+
$fileName = 'thumbnailslider.csv';
|
210 |
+
$content = $this->getLayout()->createBlock('thumbnailslider/adminhtml_thumbnailslider_grid')
|
211 |
+
->getCsv();
|
212 |
+
|
213 |
+
$this->_sendUploadResponse($fileName, $content);
|
214 |
+
}
|
215 |
+
|
216 |
+
public function exportXmlAction()
|
217 |
+
{
|
218 |
+
$fileName = 'thumbnailslider.xml';
|
219 |
+
$content = $this->getLayout()->createBlock('thumbnailslider/adminhtml_thumbnailslider_grid')
|
220 |
+
->getXml();
|
221 |
+
|
222 |
+
$this->_sendUploadResponse($fileName, $content);
|
223 |
+
}
|
224 |
+
|
225 |
+
protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
|
226 |
+
{
|
227 |
+
$response = $this->getResponse();
|
228 |
+
$response->setHeader('HTTP/1.1 200 OK','');
|
229 |
+
$response->setHeader('Pragma', 'public', true);
|
230 |
+
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
|
231 |
+
$response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
|
232 |
+
$response->setHeader('Last-Modified', date('r'));
|
233 |
+
$response->setHeader('Accept-Ranges', 'bytes');
|
234 |
+
$response->setHeader('Content-Length', strlen($content));
|
235 |
+
$response->setHeader('Content-type', $contentType);
|
236 |
+
$response->setBody($content);
|
237 |
+
$response->sendResponse();
|
238 |
+
die;
|
239 |
+
}
|
240 |
+
}
|
app/code/local/Dataman/Thumbnailslider/controllers/IndexController.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Dataman_Thumbnailslider_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
|
7 |
+
/*
|
8 |
+
* Load an object by id
|
9 |
+
* Request looking like:
|
10 |
+
* http://site.com/thumbnailslider?id=15
|
11 |
+
* or
|
12 |
+
* http://site.com/thumbnailslider/id/15
|
13 |
+
*/
|
14 |
+
/*
|
15 |
+
$thumbnailslider_id = $this->getRequest()->getParam('id');
|
16 |
+
|
17 |
+
if($thumbnailslider_id != null && $thumbnailslider_id != '') {
|
18 |
+
$thumbnailslider = Mage::getModel('thumbnailslider/thumbnailslider')->load($thumbnailslider_id)->getData();
|
19 |
+
} else {
|
20 |
+
$thumbnailslider = null;
|
21 |
+
}
|
22 |
+
*/
|
23 |
+
|
24 |
+
/*
|
25 |
+
* If no param we load a the last created item
|
26 |
+
*/
|
27 |
+
/*
|
28 |
+
if($thumbnailslider == null) {
|
29 |
+
$resource = Mage::getSingleton('core/resource');
|
30 |
+
$read= $resource->getConnection('core_read');
|
31 |
+
$thumbnailsliderTable = $resource->getTableName('thumbnailslider');
|
32 |
+
|
33 |
+
$select = $read->select()
|
34 |
+
->from($thumbnailsliderTable,array('thumbnailslider_id','title','content','status'))
|
35 |
+
->where('status',1)
|
36 |
+
->order('created_time DESC') ;
|
37 |
+
|
38 |
+
$thumbnailslider = $read->fetchRow($select);
|
39 |
+
}
|
40 |
+
Mage::register('thumbnailslider', $thumbnailslider);
|
41 |
+
*/
|
42 |
+
|
43 |
+
|
44 |
+
$this->loadLayout();
|
45 |
+
$this->renderLayout();
|
46 |
+
}
|
47 |
+
}
|
app/code/local/Dataman/Thumbnailslider/etc/config.xml
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Dataman_Thumbnailslider>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Dataman_Thumbnailslider>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<thumbnailslider>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Dataman_Thumbnailslider</module>
|
14 |
+
<frontName>thumbnailslider</frontName>
|
15 |
+
</args>
|
16 |
+
</thumbnailslider>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<thumbnailslider>
|
21 |
+
<file>thumbnailslider.xml</file>
|
22 |
+
</thumbnailslider>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<admin>
|
27 |
+
<routers>
|
28 |
+
<thumbnailslider>
|
29 |
+
<use>admin</use>
|
30 |
+
<args>
|
31 |
+
<module>Dataman_Thumbnailslider</module>
|
32 |
+
<frontName>thumbnailslider</frontName>
|
33 |
+
</args>
|
34 |
+
</thumbnailslider>
|
35 |
+
</routers>
|
36 |
+
</admin>
|
37 |
+
<adminhtml>
|
38 |
+
<menu>
|
39 |
+
<thumbnailslider module="thumbnailslider">
|
40 |
+
<title>Thumbnailslider</title>
|
41 |
+
<sort_order>71</sort_order>
|
42 |
+
<children>
|
43 |
+
<items module="thumbnailslider">
|
44 |
+
<title>Manage Items</title>
|
45 |
+
<sort_order>0</sort_order>
|
46 |
+
<action>thumbnailslider/adminhtml_thumbnailslider</action>
|
47 |
+
</items>
|
48 |
+
</children>
|
49 |
+
</thumbnailslider>
|
50 |
+
</menu>
|
51 |
+
<acl>
|
52 |
+
<resources>
|
53 |
+
<all>
|
54 |
+
<title>Allow Everything</title>
|
55 |
+
</all>
|
56 |
+
<admin>
|
57 |
+
<children>
|
58 |
+
<Dataman_Thumbnailslider>
|
59 |
+
<title>Thumbnailslider Module</title>
|
60 |
+
<sort_order>10</sort_order>
|
61 |
+
</Dataman_Thumbnailslider>
|
62 |
+
</children>
|
63 |
+
</admin>
|
64 |
+
</resources>
|
65 |
+
</acl>
|
66 |
+
<layout>
|
67 |
+
<updates>
|
68 |
+
<thumbnailslider>
|
69 |
+
<file>thumbnailslider.xml</file>
|
70 |
+
</thumbnailslider>
|
71 |
+
</updates>
|
72 |
+
</layout>
|
73 |
+
</adminhtml>
|
74 |
+
<global>
|
75 |
+
<models>
|
76 |
+
<thumbnailslider>
|
77 |
+
<class>Dataman_Thumbnailslider_Model</class>
|
78 |
+
<resourceModel>thumbnailslider_mysql4</resourceModel>
|
79 |
+
</thumbnailslider>
|
80 |
+
<thumbnailslider_mysql4>
|
81 |
+
<class>Dataman_Thumbnailslider_Model_Mysql4</class>
|
82 |
+
<entities>
|
83 |
+
<thumbnailslider>
|
84 |
+
<table>thumbnailslider</table>
|
85 |
+
</thumbnailslider>
|
86 |
+
</entities>
|
87 |
+
</thumbnailslider_mysql4>
|
88 |
+
</models>
|
89 |
+
<resources>
|
90 |
+
<thumbnailslider_setup>
|
91 |
+
<setup>
|
92 |
+
<module>Dataman_Thumbnailslider</module>
|
93 |
+
</setup>
|
94 |
+
<connection>
|
95 |
+
<use>core_setup</use>
|
96 |
+
</connection>
|
97 |
+
</thumbnailslider_setup>
|
98 |
+
<thumbnailslider_write>
|
99 |
+
<connection>
|
100 |
+
<use>core_write</use>
|
101 |
+
</connection>
|
102 |
+
</thumbnailslider_write>
|
103 |
+
<thumbnailslider_read>
|
104 |
+
<connection>
|
105 |
+
<use>core_read</use>
|
106 |
+
</connection>
|
107 |
+
</thumbnailslider_read>
|
108 |
+
</resources>
|
109 |
+
<blocks>
|
110 |
+
<thumbnailslider>
|
111 |
+
<class>Dataman_Thumbnailslider_Block</class>
|
112 |
+
</thumbnailslider>
|
113 |
+
</blocks>
|
114 |
+
<helpers>
|
115 |
+
<thumbnailslider>
|
116 |
+
<class>Dataman_Thumbnailslider_Helper</class>
|
117 |
+
</thumbnailslider>
|
118 |
+
</helpers>
|
119 |
+
</global>
|
120 |
+
</config>
|
app/code/local/Dataman/Thumbnailslider/sql/thumbnailslider_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
-- DROP TABLE IF EXISTS {$this->getTable('thumbnailslider')};
|
10 |
+
CREATE TABLE {$this->getTable('thumbnailslider')} (
|
11 |
+
`thumbnailslider_id` int(11) unsigned NOT NULL auto_increment,
|
12 |
+
`title` varchar(255) NOT NULL default '',
|
13 |
+
`filename` varchar(255) NOT NULL default '',
|
14 |
+
`thumbimage` varchar(255) NOT NULL default '',
|
15 |
+
`content` text NOT NULL default '',
|
16 |
+
`status` smallint(6) NOT NULL default '0',
|
17 |
+
`position` smallint(6) NOT NULL default '0',
|
18 |
+
`url` varchar(255) NOT NULL default '',
|
19 |
+
`created_time` datetime NULL,
|
20 |
+
`update_time` datetime NULL,
|
21 |
+
PRIMARY KEY (`thumbnailslider_id`)
|
22 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
23 |
+
|
24 |
+
");
|
25 |
+
|
26 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/thumbnailslider.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<thumbnailslider_adminhtml_thumbnailslider_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="thumbnailslider/adminhtml_thumbnailslider" name="thumbnailslider" />
|
6 |
+
</reference>
|
7 |
+
</thumbnailslider_adminhtml_thumbnailslider_index>
|
8 |
+
</layout>
|
app/design/frontend/base/default/layout/thumbnailslider.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
</default>
|
5 |
+
<thumbnailslider_index_index>
|
6 |
+
<reference name="content">
|
7 |
+
<block type="thumbnailslider/thumbnailslider" name="thumbnailslider" template="thumbnailslider/thumbnailslider.phtml" />
|
8 |
+
</reference>
|
9 |
+
</thumbnailslider_index_index>
|
10 |
+
</layout>
|
app/design/frontend/base/default/template/thumbnailslider/thumbnailslider.phtml
ADDED
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $collection = $this->getSilderCollection(); ?>
|
2 |
+
<?php if ($collection->count() > 0): ?>
|
3 |
+
<div id="slider1_container" style="position: relative; width: 720px; height: 480px; overflow: hidden;">
|
4 |
+
<!-- Loading Screen -->
|
5 |
+
<div u="loading" style="position: absolute; top: 0px; left: 0px;">
|
6 |
+
<div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block;
|
7 |
+
background-color: #000; top: 0px; left: 0px;width: 100%;height:100%;">
|
8 |
+
</div>
|
9 |
+
<div style="position: absolute; display: block; background: url(..images/img/loading.gif) no-repeat center center;
|
10 |
+
top: 0px; left: 0px;width: 100%;height:100%;">
|
11 |
+
</div>
|
12 |
+
</div>
|
13 |
+
<!-- Slides Container -->
|
14 |
+
<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 720px; height: 480px;
|
15 |
+
overflow: hidden;">
|
16 |
+
<?php $imagespath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'thumbnailslider/';?>
|
17 |
+
<?php foreach($collection as $silder):?>
|
18 |
+
<div>
|
19 |
+
<img u="image" src="<?php echo $imagespath.$silder->getFilename(); ?> " alt="" />
|
20 |
+
<img u="thumb" src="<?php echo $imagespath.$silder->getThumbimage(); ?>" alt="" />
|
21 |
+
</div>
|
22 |
+
<?php endforeach; ?>
|
23 |
+
</div>
|
24 |
+
|
25 |
+
<!-- Thumbnail Navigator Skin Begin -->
|
26 |
+
<div u="thumbnavigator" class="jssort07" style="position: absolute; width: 720px; height: 100px; left: 0px; bottom: 0px; overflow: hidden; ">
|
27 |
+
<div style=" background-color: #000; filter:alpha(opacity=30); opacity:.3; width: 100%; height:100%;"></div>
|
28 |
+
<!-- Thumbnail Item Skin Begin -->
|
29 |
+
|
30 |
+
<div u="slides" style="cursor: ;">
|
31 |
+
<div u="prototype" class="p" style="POSITION: absolute; WIDTH: 99px; HEIGHT: 66px; TOP: 0; LEFT: 0;">
|
32 |
+
<div u="thumbnailtemplate" class="i" style="position:absolute;"></div>
|
33 |
+
<div class="o">
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
<!-- Thumbnail Item Skin End -->
|
38 |
+
<!-- Arrow Navigator Skin Begin -->
|
39 |
+
|
40 |
+
<!-- Arrow Left -->
|
41 |
+
<span class="jssora11l" style="width: 37px; height: 37px; top: 123px; left: 8px;" u="arrowleft">
|
42 |
+
</span>
|
43 |
+
<!-- Arrow Right -->
|
44 |
+
<span class="jssora11r" style="width: 37px; height: 37px; top: 123px; right: 8px" u="arrowright">
|
45 |
+
</span>
|
46 |
+
<!-- Arrow Navigator Skin End -->
|
47 |
+
</div>
|
48 |
+
<!-- ThumbnailNavigator Skin End -->
|
49 |
+
<a style="display: none" href="www.dataman.in">image carousel</a>
|
50 |
+
<!-- Trigger -->
|
51 |
+
</div>
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
<script>
|
57 |
+
jQuery(document).ready(function($) {
|
58 |
+
var options = {
|
59 |
+
$AutoPlay: true, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
|
60 |
+
$AutoPlayInterval: 4000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000
|
61 |
+
$SlideDuration: 500, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
|
62 |
+
$DragOrientation: 3, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)
|
63 |
+
$UISearchMode: 0, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc).
|
64 |
+
|
65 |
+
$ThumbnailNavigatorOptions: {
|
66 |
+
$Class: $JssorThumbnailNavigator$, //[Required] Class to create thumbnail navigator instance
|
67 |
+
$ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
|
68 |
+
|
69 |
+
$Loop: 2, //[Optional] Enable loop(circular) of carousel or not, 0: stop, 1: loop, 2 rewind, default value is 1
|
70 |
+
$SpacingX: 3, //[Optional] Horizontal space between each thumbnail in pixel, default value is 0
|
71 |
+
$SpacingY: 3, //[Optional] Vertical space between each thumbnail in pixel, default value is 0
|
72 |
+
$DisplayPieces: 6, //[Optional] Number of pieces to display, default value is 1
|
73 |
+
$ParkingPosition: 204, //[Optional] The offset position to park thumbnail,
|
74 |
+
|
75 |
+
$ArrowNavigatorOptions: {
|
76 |
+
$Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance
|
77 |
+
$ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
|
78 |
+
$AutoCenter: 2, //[Optional] Auto center arrows in parent container, 0 No, 1 Horizontal, 2 Vertical, 3 Both, default value is 0
|
79 |
+
$Steps: 6 //[Optional] Steps to go for each navigation request, default value is 1
|
80 |
+
}
|
81 |
+
}
|
82 |
+
};
|
83 |
+
|
84 |
+
var jssor_slider1 = new $JssorSlider$("slider1_container", options);
|
85 |
+
|
86 |
+
//responsive code begin
|
87 |
+
//you can remove responsive code if you don't want the slider scales while window resizes
|
88 |
+
function ScaleSlider() {
|
89 |
+
var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;
|
90 |
+
if (parentWidth)
|
91 |
+
jssor_slider1.$ScaleWidth(Math.min(parentWidth, 720));
|
92 |
+
else
|
93 |
+
window.setTimeout(ScaleSlider, 30);
|
94 |
+
}
|
95 |
+
ScaleSlider();
|
96 |
+
|
97 |
+
$(window).bind("load", ScaleSlider);
|
98 |
+
$(window).bind("resize", ScaleSlider);
|
99 |
+
$(window).bind("orientationchange", ScaleSlider);
|
100 |
+
//responsive code end
|
101 |
+
});
|
102 |
+
</script>
|
103 |
+
|
104 |
+
|
105 |
+
|
106 |
+
|
107 |
+
<style type="text/css">
|
108 |
+
/* jssor slider thumbnail navigator skin 07 css */
|
109 |
+
/*
|
110 |
+
.jssort07 .p (normal)
|
111 |
+
.jssort07 .p:hover (normal mouseover)
|
112 |
+
.jssort07 .pav (active)
|
113 |
+
.jssort07 .pav:hover (active mouseover)
|
114 |
+
.jssort07 .pdn (mousedown)
|
115 |
+
*/
|
116 |
+
.jssort07 .i {
|
117 |
+
position: absolute;
|
118 |
+
top: 0px;
|
119 |
+
left: 0px;
|
120 |
+
width: 99px;
|
121 |
+
height: 66px;
|
122 |
+
filter: alpha(opacity=80);
|
123 |
+
opacity: .8;
|
124 |
+
}
|
125 |
+
|
126 |
+
.jssort07 .p:hover .i, .jssort07 .pav .i {
|
127 |
+
filter: alpha(opacity=100);
|
128 |
+
opacity: 1;
|
129 |
+
}
|
130 |
+
|
131 |
+
.jssort07 .o {
|
132 |
+
position: absolute;
|
133 |
+
top: 0px;
|
134 |
+
left: 0px;
|
135 |
+
width: 97px;
|
136 |
+
height: 64px;
|
137 |
+
border: 1px solid #000;
|
138 |
+
transition: border-color .6s;
|
139 |
+
-moz-transition: border-color .6s;
|
140 |
+
-webkit-transition: border-color .6s;
|
141 |
+
-o-transition: border-color .6s;
|
142 |
+
}
|
143 |
+
|
144 |
+
* html .jssort07 .o {
|
145 |
+
/* ie quirks mode adjust */
|
146 |
+
width /**/: 99px;
|
147 |
+
height /**/: 66px;
|
148 |
+
}
|
149 |
+
|
150 |
+
.jssort07 .pav .o, .jssort07 .p:hover .o {
|
151 |
+
border-color: #fff;
|
152 |
+
}
|
153 |
+
|
154 |
+
.jssort07 .pav:hover .o {
|
155 |
+
border-color: #0099FF;
|
156 |
+
}
|
157 |
+
|
158 |
+
.jssort07 .p:hover .o {
|
159 |
+
transition: none;
|
160 |
+
-moz-transition: none;
|
161 |
+
-webkit-transition: none;
|
162 |
+
-o-transition: none;
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
/* jssor slider arrow navigator skin 11 css */
|
167 |
+
/*
|
168 |
+
.jssora11l (normal)
|
169 |
+
.jssora11r (normal)
|
170 |
+
.jssora11l:hover (normal mouseover)
|
171 |
+
.jssora11r:hover (normal mouseover)
|
172 |
+
.jssora11ldn (mousedown)
|
173 |
+
.jssora11rdn (mousedown)
|
174 |
+
*/
|
175 |
+
.jssora11l, .jssora11r, .jssora11ldn, .jssora11rdn {
|
176 |
+
position: absolute;
|
177 |
+
cursor: pointer;
|
178 |
+
display: block;
|
179 |
+
background: url(../media/img/a11.png) no-repeat;
|
180 |
+
overflow: hidden;
|
181 |
+
}
|
182 |
+
|
183 |
+
.jssora11l {
|
184 |
+
background-position: -11px -41px;
|
185 |
+
}
|
186 |
+
|
187 |
+
.jssora11r {
|
188 |
+
background-position: -71px -41px;
|
189 |
+
}
|
190 |
+
|
191 |
+
.jssora11l:hover {
|
192 |
+
background-position: -131px -41px;
|
193 |
+
}
|
194 |
+
|
195 |
+
.jssora11r:hover {
|
196 |
+
background-position: -191px -41px;
|
197 |
+
}
|
198 |
+
|
199 |
+
.jssora11ldn {
|
200 |
+
background-position: -251px -41px;
|
201 |
+
}
|
202 |
+
|
203 |
+
.jssora11rdn {
|
204 |
+
background-position: -311px -41px;
|
205 |
+
}
|
206 |
+
|
207 |
+
|
208 |
+
|
209 |
+
/* jssor slider bullet navigator skin 03 css */
|
210 |
+
/*
|
211 |
+
.jssorb03 div (normal)
|
212 |
+
.jssorb03 div:hover (normal mouseover)
|
213 |
+
.jssorb03 .av (active)
|
214 |
+
.jssorb03 .av:hover (active mouseover)
|
215 |
+
.jssorb03 .dn (mousedown)
|
216 |
+
*/
|
217 |
+
.jssorb03 div, .jssorb03 div:hover, .jssorb03 .av
|
218 |
+
{
|
219 |
+
background: url(..media/img/b03.png) no-repeat;
|
220 |
+
overflow:hidden;
|
221 |
+
cursor: pointer;
|
222 |
+
}
|
223 |
+
.jssorb03 div { background-position: -5px -4px; }
|
224 |
+
.jssorb03 div:hover, .jssorb03 .av:hover { background-position: -35px -4px; }
|
225 |
+
.jssorb03 .av { background-position: -65px -4px; }
|
226 |
+
.jssorb03 .dn, .jssorb03 .dn:hover { background-position: -95px -4px; }
|
227 |
+
|
228 |
+
|
229 |
+
|
230 |
+
/* jssor slider bullet navigator skin 03 css */
|
231 |
+
/*
|
232 |
+
.jssorb03 div (normal)
|
233 |
+
.jssorb03 div:hover (normal mouseover)
|
234 |
+
.jssorb03 .av (active)
|
235 |
+
.jssorb03 .av:hover (active mouseover)
|
236 |
+
.jssorb03 .dn (mousedown)
|
237 |
+
*/
|
238 |
+
.jssorb03 div, .jssorb03 div:hover, .jssorb03 .av
|
239 |
+
{
|
240 |
+
background: url(..media/img/b03.png) no-repeat;
|
241 |
+
overflow:hidden;
|
242 |
+
cursor: pointer;
|
243 |
+
}
|
244 |
+
.jssorb03 div { background-position: -5px -4px; }
|
245 |
+
.jssorb03 div:hover, .jssorb03 .av:hover { background-position: -35px -4px; }
|
246 |
+
.jssorb03 .av { background-position: -65px -4px; }
|
247 |
+
.jssorb03 .dn, .jssorb03 .dn:hover { background-position: -95px -4px; }
|
248 |
+
|
249 |
+
.abca {
|
250 |
+
position: absolute; display: block; background: url(..media/img/loading.gif) no-repeat center center;
|
251 |
+
top: 0px; left: 0px;width: 100%;height:100%;
|
252 |
+
|
253 |
+
}
|
254 |
+
</style>
|
255 |
+
|
256 |
+
|
257 |
+
|
258 |
+
|
259 |
+
|
260 |
+
|
261 |
+
|
262 |
+
|
263 |
+
<script>
|
264 |
+
jQuery(document).ready(function ($) {
|
265 |
+
var options = {
|
266 |
+
$AutoPlay: true, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
|
267 |
+
$AutoPlayInterval: 4000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000
|
268 |
+
$SlideDuration: 500, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
|
269 |
+
$DragOrientation: 3, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)
|
270 |
+
$UISearchMode: 0, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc).
|
271 |
+
|
272 |
+
$ThumbnailNavigatorOptions: {
|
273 |
+
$Class: $JssorThumbnailNavigator$, //[Required] Class to create thumbnail navigator instance
|
274 |
+
$ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
|
275 |
+
|
276 |
+
$Loop: 2, //[Optional] Enable loop(circular) of carousel or not, 0: stop, 1: loop, 2 rewind, default value is 1
|
277 |
+
$SpacingX: 3, //[Optional] Horizontal space between each thumbnail in pixel, default value is 0
|
278 |
+
$SpacingY: 3, //[Optional] Vertical space between each thumbnail in pixel, default value is 0
|
279 |
+
$DisplayPieces: 6, //[Optional] Number of pieces to display, default value is 1
|
280 |
+
$ParkingPosition: 204, //[Optional] The offset position to park thumbnail,
|
281 |
+
|
282 |
+
$ArrowNavigatorOptions: {
|
283 |
+
$Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance
|
284 |
+
$ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
|
285 |
+
$AutoCenter: 2, //[Optional] Auto center arrows in parent container, 0 No, 1 Horizontal, 2 Vertical, 3 Both, default value is 0
|
286 |
+
$Steps: 6 //[Optional] Steps to go for each navigation request, default value is 1
|
287 |
+
}
|
288 |
+
}
|
289 |
+
};
|
290 |
+
|
291 |
+
var jssor_slider1 = new $JssorSlider$("slider1_container", options);
|
292 |
+
|
293 |
+
//responsive code begin
|
294 |
+
//you can remove responsive code if you don't want the slider scales while window resizes
|
295 |
+
function ScaleSlider() {
|
296 |
+
var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;
|
297 |
+
if (parentWidth)
|
298 |
+
jssor_slider1.$ScaleWidth(Math.min(parentWidth, 720));
|
299 |
+
else
|
300 |
+
window.setTimeout(ScaleSlider, 30);
|
301 |
+
}
|
302 |
+
ScaleSlider();
|
303 |
+
|
304 |
+
$(window).bind("load", ScaleSlider);
|
305 |
+
$(window).bind("resize", ScaleSlider);
|
306 |
+
$(window).bind("orientationchange", ScaleSlider);
|
307 |
+
//responsive code end
|
308 |
+
});
|
309 |
+
</script>
|
310 |
+
|
311 |
+
|
312 |
+
|
313 |
+
<script src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'js/thumbnailslider/jquery-1.9.1.min.js'?>" type="text/javascript"></script>
|
314 |
+
|
315 |
+
|
316 |
+
<script src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'js/thumbnailslider/jssor.js'?>" type="text/javascript"></script>
|
317 |
+
|
318 |
+
<script src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'js/thumbnailslider/jssor.slider.js'?>" type="text/javascript"></script>
|
319 |
+
|
320 |
+
|
321 |
+
|
322 |
+
|
323 |
+
|
324 |
+
|
325 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/thumbnailslider/thumbnailslider.phtml~
ADDED
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $collection = $this->getSilderCollection(); ?>
|
2 |
+
<?php if ($collection->count() > 0): ?>
|
3 |
+
<div id="slider1_container" style="position: relative; width: 720px; height: 480px; overflow: hidden;">
|
4 |
+
<!-- Loading Screen -->
|
5 |
+
<div u="loading" style="position: absolute; top: 0px; left: 0px;">
|
6 |
+
<div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block;
|
7 |
+
background-color: #000; top: 0px; left: 0px;width: 100%;height:100%;">
|
8 |
+
</div>
|
9 |
+
<div style="position: absolute; display: block; background: url(..images/img/loading.gif) no-repeat center center;
|
10 |
+
top: 0px; left: 0px;width: 100%;height:100%;">
|
11 |
+
</div>
|
12 |
+
</div>
|
13 |
+
<!-- Slides Container -->
|
14 |
+
<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 720px; height: 480px;
|
15 |
+
overflow: hidden;">
|
16 |
+
<?php $imagespath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'thumbnailslider/';?>
|
17 |
+
<?php foreach($collection as $silder):?>
|
18 |
+
<div>
|
19 |
+
<img u="image" src="<?php echo $imagespath.$silder->getFilename(); ?> " alt="" />
|
20 |
+
<img u="thumb" src="<?php echo $imagespath.$silder->getThumbimage(); ?>" alt="" />
|
21 |
+
</div>
|
22 |
+
<?php endforeach; ?>
|
23 |
+
</div>
|
24 |
+
|
25 |
+
<!-- Thumbnail Navigator Skin Begin -->
|
26 |
+
<div u="thumbnavigator" class="jssort07" style="position: absolute; width: 720px; height: 100px; left: 0px; bottom: 0px; overflow: hidden; ">
|
27 |
+
<div style=" background-color: #000; filter:alpha(opacity=30); opacity:.3; width: 100%; height:100%;"></div>
|
28 |
+
<!-- Thumbnail Item Skin Begin -->
|
29 |
+
|
30 |
+
<div u="slides" style="cursor: ;">
|
31 |
+
<div u="prototype" class="p" style="POSITION: absolute; WIDTH: 99px; HEIGHT: 66px; TOP: 0; LEFT: 0;">
|
32 |
+
<div u="thumbnailtemplate" class="i" style="position:absolute;"></div>
|
33 |
+
<div class="o">
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
<!-- Thumbnail Item Skin End -->
|
38 |
+
<!-- Arrow Navigator Skin Begin -->
|
39 |
+
|
40 |
+
<!-- Arrow Left -->
|
41 |
+
<span class="jssora11l" style="width: 37px; height: 37px; top: 123px; left: 8px;" u="arrowleft">
|
42 |
+
</span>
|
43 |
+
<!-- Arrow Right -->
|
44 |
+
<span class="jssora11r" style="width: 37px; height: 37px; top: 123px; right: 8px" u="arrowright">
|
45 |
+
</span>
|
46 |
+
<!-- Arrow Navigator Skin End -->
|
47 |
+
</div>
|
48 |
+
<!-- ThumbnailNavigator Skin End -->
|
49 |
+
<a style="display: none" href="www.dataman.in">image carousel</a>
|
50 |
+
<!-- Trigger -->
|
51 |
+
</div>
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
<script>
|
57 |
+
jQuery(document).ready(function($) {
|
58 |
+
var options = {
|
59 |
+
$AutoPlay: true, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
|
60 |
+
$AutoPlayInterval: 4000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000
|
61 |
+
$SlideDuration: 500, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
|
62 |
+
$DragOrientation: 3, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)
|
63 |
+
$UISearchMode: 0, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc).
|
64 |
+
|
65 |
+
$ThumbnailNavigatorOptions: {
|
66 |
+
$Class: $JssorThumbnailNavigator$, //[Required] Class to create thumbnail navigator instance
|
67 |
+
$ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
|
68 |
+
|
69 |
+
$Loop: 2, //[Optional] Enable loop(circular) of carousel or not, 0: stop, 1: loop, 2 rewind, default value is 1
|
70 |
+
$SpacingX: 3, //[Optional] Horizontal space between each thumbnail in pixel, default value is 0
|
71 |
+
$SpacingY: 3, //[Optional] Vertical space between each thumbnail in pixel, default value is 0
|
72 |
+
$DisplayPieces: 6, //[Optional] Number of pieces to display, default value is 1
|
73 |
+
$ParkingPosition: 204, //[Optional] The offset position to park thumbnail,
|
74 |
+
|
75 |
+
$ArrowNavigatorOptions: {
|
76 |
+
$Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance
|
77 |
+
$ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
|
78 |
+
$AutoCenter: 2, //[Optional] Auto center arrows in parent container, 0 No, 1 Horizontal, 2 Vertical, 3 Both, default value is 0
|
79 |
+
$Steps: 6 //[Optional] Steps to go for each navigation request, default value is 1
|
80 |
+
}
|
81 |
+
}
|
82 |
+
};
|
83 |
+
|
84 |
+
var jssor_slider1 = new $JssorSlider$("slider1_container", options);
|
85 |
+
|
86 |
+
//responsive code begin
|
87 |
+
//you can remove responsive code if you don't want the slider scales while window resizes
|
88 |
+
function ScaleSlider() {
|
89 |
+
var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;
|
90 |
+
if (parentWidth)
|
91 |
+
jssor_slider1.$ScaleWidth(Math.min(parentWidth, 720));
|
92 |
+
else
|
93 |
+
window.setTimeout(ScaleSlider, 30);
|
94 |
+
}
|
95 |
+
ScaleSlider();
|
96 |
+
|
97 |
+
$(window).bind("load", ScaleSlider);
|
98 |
+
$(window).bind("resize", ScaleSlider);
|
99 |
+
$(window).bind("orientationchange", ScaleSlider);
|
100 |
+
//responsive code end
|
101 |
+
});
|
102 |
+
</script>
|
103 |
+
|
104 |
+
|
105 |
+
|
106 |
+
|
107 |
+
<style type="text/css">
|
108 |
+
/* jssor slider thumbnail navigator skin 07 css */
|
109 |
+
/*
|
110 |
+
.jssort07 .p (normal)
|
111 |
+
.jssort07 .p:hover (normal mouseover)
|
112 |
+
.jssort07 .pav (active)
|
113 |
+
.jssort07 .pav:hover (active mouseover)
|
114 |
+
.jssort07 .pdn (mousedown)
|
115 |
+
*/
|
116 |
+
.jssort07 .i {
|
117 |
+
position: absolute;
|
118 |
+
top: 0px;
|
119 |
+
left: 0px;
|
120 |
+
width: 99px;
|
121 |
+
height: 66px;
|
122 |
+
filter: alpha(opacity=80);
|
123 |
+
opacity: .8;
|
124 |
+
}
|
125 |
+
|
126 |
+
.jssort07 .p:hover .i, .jssort07 .pav .i {
|
127 |
+
filter: alpha(opacity=100);
|
128 |
+
opacity: 1;
|
129 |
+
}
|
130 |
+
|
131 |
+
.jssort07 .o {
|
132 |
+
position: absolute;
|
133 |
+
top: 0px;
|
134 |
+
left: 0px;
|
135 |
+
width: 97px;
|
136 |
+
height: 64px;
|
137 |
+
border: 1px solid #000;
|
138 |
+
transition: border-color .6s;
|
139 |
+
-moz-transition: border-color .6s;
|
140 |
+
-webkit-transition: border-color .6s;
|
141 |
+
-o-transition: border-color .6s;
|
142 |
+
}
|
143 |
+
|
144 |
+
* html .jssort07 .o {
|
145 |
+
/* ie quirks mode adjust */
|
146 |
+
width /**/: 99px;
|
147 |
+
height /**/: 66px;
|
148 |
+
}
|
149 |
+
|
150 |
+
.jssort07 .pav .o, .jssort07 .p:hover .o {
|
151 |
+
border-color: #fff;
|
152 |
+
}
|
153 |
+
|
154 |
+
.jssort07 .pav:hover .o {
|
155 |
+
border-color: #0099FF;
|
156 |
+
}
|
157 |
+
|
158 |
+
.jssort07 .p:hover .o {
|
159 |
+
transition: none;
|
160 |
+
-moz-transition: none;
|
161 |
+
-webkit-transition: none;
|
162 |
+
-o-transition: none;
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
/* jssor slider arrow navigator skin 11 css */
|
167 |
+
/*
|
168 |
+
.jssora11l (normal)
|
169 |
+
.jssora11r (normal)
|
170 |
+
.jssora11l:hover (normal mouseover)
|
171 |
+
.jssora11r:hover (normal mouseover)
|
172 |
+
.jssora11ldn (mousedown)
|
173 |
+
.jssora11rdn (mousedown)
|
174 |
+
*/
|
175 |
+
.jssora11l, .jssora11r, .jssora11ldn, .jssora11rdn {
|
176 |
+
position: absolute;
|
177 |
+
cursor: pointer;
|
178 |
+
display: block;
|
179 |
+
background: url(../media/img/a11.png) no-repeat;
|
180 |
+
overflow: hidden;
|
181 |
+
}
|
182 |
+
|
183 |
+
.jssora11l {
|
184 |
+
background-position: -11px -41px;
|
185 |
+
}
|
186 |
+
|
187 |
+
.jssora11r {
|
188 |
+
background-position: -71px -41px;
|
189 |
+
}
|
190 |
+
|
191 |
+
.jssora11l:hover {
|
192 |
+
background-position: -131px -41px;
|
193 |
+
}
|
194 |
+
|
195 |
+
.jssora11r:hover {
|
196 |
+
background-position: -191px -41px;
|
197 |
+
}
|
198 |
+
|
199 |
+
.jssora11ldn {
|
200 |
+
background-position: -251px -41px;
|
201 |
+
}
|
202 |
+
|
203 |
+
.jssora11rdn {
|
204 |
+
background-position: -311px -41px;
|
205 |
+
}
|
206 |
+
|
207 |
+
|
208 |
+
|
209 |
+
/* jssor slider bullet navigator skin 03 css */
|
210 |
+
/*
|
211 |
+
.jssorb03 div (normal)
|
212 |
+
.jssorb03 div:hover (normal mouseover)
|
213 |
+
.jssorb03 .av (active)
|
214 |
+
.jssorb03 .av:hover (active mouseover)
|
215 |
+
.jssorb03 .dn (mousedown)
|
216 |
+
*/
|
217 |
+
.jssorb03 div, .jssorb03 div:hover, .jssorb03 .av
|
218 |
+
{
|
219 |
+
background: url(../media/img/b03.png) no-repeat;
|
220 |
+
overflow:hidden;
|
221 |
+
cursor: pointer;
|
222 |
+
}
|
223 |
+
.jssorb03 div { background-position: -5px -4px; }
|
224 |
+
.jssorb03 div:hover, .jssorb03 .av:hover { background-position: -35px -4px; }
|
225 |
+
.jssorb03 .av { background-position: -65px -4px; }
|
226 |
+
.jssorb03 .dn, .jssorb03 .dn:hover { background-position: -95px -4px; }
|
227 |
+
|
228 |
+
|
229 |
+
|
230 |
+
/* jssor slider bullet navigator skin 03 css */
|
231 |
+
/*
|
232 |
+
.jssorb03 div (normal)
|
233 |
+
.jssorb03 div:hover (normal mouseover)
|
234 |
+
.jssorb03 .av (active)
|
235 |
+
.jssorb03 .av:hover (active mouseover)
|
236 |
+
.jssorb03 .dn (mousedown)
|
237 |
+
*/
|
238 |
+
.jssorb03 div, .jssorb03 div:hover, .jssorb03 .av
|
239 |
+
{
|
240 |
+
background: url(../media/img/b03.png) no-repeat;
|
241 |
+
overflow:hidden;
|
242 |
+
cursor: pointer;
|
243 |
+
}
|
244 |
+
.jssorb03 div { background-position: -5px -4px; }
|
245 |
+
.jssorb03 div:hover, .jssorb03 .av:hover { background-position: -35px -4px; }
|
246 |
+
.jssorb03 .av { background-position: -65px -4px; }
|
247 |
+
.jssorb03 .dn, .jssorb03 .dn:hover { background-position: -95px -4px; }
|
248 |
+
|
249 |
+
.abca {
|
250 |
+
position: absolute; display: block; background: url(../media/img/loading.gif) no-repeat center center;
|
251 |
+
top: 0px; left: 0px;width: 100%;height:100%;
|
252 |
+
|
253 |
+
}
|
254 |
+
</style>
|
255 |
+
|
256 |
+
|
257 |
+
|
258 |
+
|
259 |
+
|
260 |
+
|
261 |
+
|
262 |
+
|
263 |
+
<script>
|
264 |
+
jQuery(document).ready(function ($) {
|
265 |
+
var options = {
|
266 |
+
$AutoPlay: true, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
|
267 |
+
$AutoPlayInterval: 4000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000
|
268 |
+
$SlideDuration: 500, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
|
269 |
+
$DragOrientation: 3, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)
|
270 |
+
$UISearchMode: 0, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc).
|
271 |
+
|
272 |
+
$ThumbnailNavigatorOptions: {
|
273 |
+
$Class: $JssorThumbnailNavigator$, //[Required] Class to create thumbnail navigator instance
|
274 |
+
$ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
|
275 |
+
|
276 |
+
$Loop: 2, //[Optional] Enable loop(circular) of carousel or not, 0: stop, 1: loop, 2 rewind, default value is 1
|
277 |
+
$SpacingX: 3, //[Optional] Horizontal space between each thumbnail in pixel, default value is 0
|
278 |
+
$SpacingY: 3, //[Optional] Vertical space between each thumbnail in pixel, default value is 0
|
279 |
+
$DisplayPieces: 6, //[Optional] Number of pieces to display, default value is 1
|
280 |
+
$ParkingPosition: 204, //[Optional] The offset position to park thumbnail,
|
281 |
+
|
282 |
+
$ArrowNavigatorOptions: {
|
283 |
+
$Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance
|
284 |
+
$ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
|
285 |
+
$AutoCenter: 2, //[Optional] Auto center arrows in parent container, 0 No, 1 Horizontal, 2 Vertical, 3 Both, default value is 0
|
286 |
+
$Steps: 6 //[Optional] Steps to go for each navigation request, default value is 1
|
287 |
+
}
|
288 |
+
}
|
289 |
+
};
|
290 |
+
|
291 |
+
var jssor_slider1 = new $JssorSlider$("slider1_container", options);
|
292 |
+
|
293 |
+
//responsive code begin
|
294 |
+
//you can remove responsive code if you don't want the slider scales while window resizes
|
295 |
+
function ScaleSlider() {
|
296 |
+
var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;
|
297 |
+
if (parentWidth)
|
298 |
+
jssor_slider1.$ScaleWidth(Math.min(parentWidth, 720));
|
299 |
+
else
|
300 |
+
window.setTimeout(ScaleSlider, 30);
|
301 |
+
}
|
302 |
+
ScaleSlider();
|
303 |
+
|
304 |
+
$(window).bind("load", ScaleSlider);
|
305 |
+
$(window).bind("resize", ScaleSlider);
|
306 |
+
$(window).bind("orientationchange", ScaleSlider);
|
307 |
+
//responsive code end
|
308 |
+
});
|
309 |
+
</script>
|
310 |
+
|
311 |
+
|
312 |
+
|
313 |
+
<script src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'js/thumbnailslider/jquery-1.9.1.min.js'?>" type="text/javascript"></script>
|
314 |
+
|
315 |
+
|
316 |
+
<script src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'js/thumbnailslider/jssor.js'?>" type="text/javascript"></script>
|
317 |
+
|
318 |
+
<script src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'js/thumbnailslider/jssor.slider.js'?>" type="text/javascript"></script>
|
319 |
+
|
320 |
+
|
321 |
+
|
322 |
+
|
323 |
+
|
324 |
+
|
325 |
+
<?php endif; ?>
|
app/etc/modules/Dataman_Thumbnailslider.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Dataman_Thumbnailslider>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Dataman_Thumbnailslider>
|
8 |
+
</modules>
|
9 |
+
</config>
|
js/thumbnailslider/jquery-1.9.1.min.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
|
3 |
+
//@ sourceMappingURL=jquery.min.map
|
4 |
+
*/
|
5 |
+
(function (e, t) {
|
6 |
+
var n, r, i = typeof t, o = e.document, a = e.location, s = e.jQuery, u = e.$, l = {}, c = [], p = "1.9.1", f = c.concat, d = c.push, h = c.slice, g = c.indexOf, m = l.toString, y = l.hasOwnProperty, v = p.trim, b = function (e, t) { return new b.fn.init(e, t, r) }, x = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, w = /\S+/g, T = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, N = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, C = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, k = /^[\],:{}\s]*$/, E = /(?:^|:|,)(?:\s*\[)+/g, S = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, A = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, j = /^-ms-/, D = /-([\da-z])/gi, L = function (e, t) { return t.toUpperCase() }, H = function (e) { (o.addEventListener || "load" === e.type || "complete" === o.readyState) && (q(), b.ready()) }, q = function () { o.addEventListener ? (o.removeEventListener("DOMContentLoaded", H, !1), e.removeEventListener("load", H, !1)) : (o.detachEvent("onreadystatechange", H), e.detachEvent("onload", H)) }; b.fn = b.prototype = { jquery: p, constructor: b, init: function (e, n, r) { var i, a; if (!e) return this; if ("string" == typeof e) { if (i = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : N.exec(e), !i || !i[1] && n) return !n || n.jquery ? (n || r).find(e) : this.constructor(n).find(e); if (i[1]) { if (n = n instanceof b ? n[0] : n, b.merge(this, b.parseHTML(i[1], n && n.nodeType ? n.ownerDocument || n : o, !0)), C.test(i[1]) && b.isPlainObject(n)) for (i in n) b.isFunction(this[i]) ? this[i](n[i]) : this.attr(i, n[i]); return this } if (a = o.getElementById(i[2]), a && a.parentNode) { if (a.id !== i[2]) return r.find(e); this.length = 1, this[0] = a } return this.context = o, this.selector = e, this } return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : b.isFunction(e) ? r.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), b.makeArray(e, this)) }, selector: "", length: 0, size: function () { return this.length }, toArray: function () { return h.call(this) }, get: function (e) { return null == e ? this.toArray() : 0 > e ? this[this.length + e] : this[e] }, pushStack: function (e) { var t = b.merge(this.constructor(), e); return t.prevObject = this, t.context = this.context, t }, each: function (e, t) { return b.each(this, e, t) }, ready: function (e) { return b.ready.promise().done(e), this }, slice: function () { return this.pushStack(h.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (e) { var t = this.length, n = +e + (0 > e ? t : 0); return this.pushStack(n >= 0 && t > n ? [this[n]] : []) }, map: function (e) { return this.pushStack(b.map(this, function (t, n) { return e.call(t, n, t) })) }, end: function () { return this.prevObject || this.constructor(null) }, push: d, sort: [].sort, splice: [].splice }, b.fn.init.prototype = b.fn, b.extend = b.fn.extend = function () { var e, n, r, i, o, a, s = arguments[0] || {}, u = 1, l = arguments.length, c = !1; for ("boolean" == typeof s && (c = s, s = arguments[1] || {}, u = 2), "object" == typeof s || b.isFunction(s) || (s = {}), l === u && (s = this, --u); l > u; u++) if (null != (o = arguments[u])) for (i in o) e = s[i], r = o[i], s !== r && (c && r && (b.isPlainObject(r) || (n = b.isArray(r))) ? (n ? (n = !1, a = e && b.isArray(e) ? e : []) : a = e && b.isPlainObject(e) ? e : {}, s[i] = b.extend(c, a, r)) : r !== t && (s[i] = r)); return s }, b.extend({ noConflict: function (t) { return e.$ === b && (e.$ = u), t && e.jQuery === b && (e.jQuery = s), b }, isReady: !1, readyWait: 1, holdReady: function (e) { e ? b.readyWait++ : b.ready(!0) }, ready: function (e) { if (e === !0 ? ! --b.readyWait : !b.isReady) { if (!o.body) return setTimeout(b.ready); b.isReady = !0, e !== !0 && --b.readyWait > 0 || (n.resolveWith(o, [b]), b.fn.trigger && b(o).trigger("ready").off("ready")) } }, isFunction: function (e) { return "function" === b.type(e) }, isArray: Array.isArray || function (e) { return "array" === b.type(e) }, isWindow: function (e) { return null != e && e == e.window }, isNumeric: function (e) { return !isNaN(parseFloat(e)) && isFinite(e) }, type: function (e) { return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? l[m.call(e)] || "object" : typeof e }, isPlainObject: function (e) { if (!e || "object" !== b.type(e) || e.nodeType || b.isWindow(e)) return !1; try { if (e.constructor && !y.call(e, "constructor") && !y.call(e.constructor.prototype, "isPrototypeOf")) return !1 } catch (n) { return !1 } var r; for (r in e); return r === t || y.call(e, r) }, isEmptyObject: function (e) { var t; for (t in e) return !1; return !0 }, error: function (e) { throw Error(e) }, parseHTML: function (e, t, n) { if (!e || "string" != typeof e) return null; "boolean" == typeof t && (n = t, t = !1), t = t || o; var r = C.exec(e), i = !n && []; return r ? [t.createElement(r[1])] : (r = b.buildFragment([e], t, i), i && b(i).remove(), b.merge([], r.childNodes)) }, parseJSON: function (n) { return e.JSON && e.JSON.parse ? e.JSON.parse(n) : null === n ? n : "string" == typeof n && (n = b.trim(n), n && k.test(n.replace(S, "@").replace(A, "]").replace(E, ""))) ? Function("return " + n)() : (b.error("Invalid JSON: " + n), t) }, parseXML: function (n) { var r, i; if (!n || "string" != typeof n) return null; try { e.DOMParser ? (i = new DOMParser, r = i.parseFromString(n, "text/xml")) : (r = new ActiveXObject("Microsoft.XMLDOM"), r.async = "false", r.loadXML(n)) } catch (o) { r = t } return r && r.documentElement && !r.getElementsByTagName("parsererror").length || b.error("Invalid XML: " + n), r }, noop: function () { }, globalEval: function (t) { t && b.trim(t) && (e.execScript || function (t) { e.eval.call(e, t) })(t) }, camelCase: function (e) { return e.replace(j, "ms-").replace(D, L) }, nodeName: function (e, t) { return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() }, each: function (e, t, n) { var r, i = 0, o = e.length, a = M(e); if (n) { if (a) { for (; o > i; i++) if (r = t.apply(e[i], n), r === !1) break } else for (i in e) if (r = t.apply(e[i], n), r === !1) break } else if (a) { for (; o > i; i++) if (r = t.call(e[i], i, e[i]), r === !1) break } else for (i in e) if (r = t.call(e[i], i, e[i]), r === !1) break; return e }, trim: v && !v.call("\ufeff\u00a0") ? function (e) { return null == e ? "" : v.call(e) } : function (e) { return null == e ? "" : (e + "").replace(T, "") }, makeArray: function (e, t) { var n = t || []; return null != e && (M(Object(e)) ? b.merge(n, "string" == typeof e ? [e] : e) : d.call(n, e)), n }, inArray: function (e, t, n) { var r; if (t) { if (g) return g.call(t, e, n); for (r = t.length, n = n ? 0 > n ? Math.max(0, r + n) : n : 0; r > n; n++) if (n in t && t[n] === e) return n } return -1 }, merge: function (e, n) { var r = n.length, i = e.length, o = 0; if ("number" == typeof r) for (; r > o; o++) e[i++] = n[o]; else while (n[o] !== t) e[i++] = n[o++]; return e.length = i, e }, grep: function (e, t, n) { var r, i = [], o = 0, a = e.length; for (n = !!n; a > o; o++) r = !!t(e[o], o), n !== r && i.push(e[o]); return i }, map: function (e, t, n) { var r, i = 0, o = e.length, a = M(e), s = []; if (a) for (; o > i; i++) r = t(e[i], i, n), null != r && (s[s.length] = r); else for (i in e) r = t(e[i], i, n), null != r && (s[s.length] = r); return f.apply([], s) }, guid: 1, proxy: function (e, n) { var r, i, o; return "string" == typeof n && (o = e[n], n = e, e = o), b.isFunction(e) ? (r = h.call(arguments, 2), i = function () { return e.apply(n || this, r.concat(h.call(arguments))) }, i.guid = e.guid = e.guid || b.guid++, i) : t }, access: function (e, n, r, i, o, a, s) { var u = 0, l = e.length, c = null == r; if ("object" === b.type(r)) { o = !0; for (u in r) b.access(e, n, u, r[u], !0, a, s) } else if (i !== t && (o = !0, b.isFunction(i) || (s = !0), c && (s ? (n.call(e, i), n = null) : (c = n, n = function (e, t, n) { return c.call(b(e), n) })), n)) for (; l > u; u++) n(e[u], r, s ? i : i.call(e[u], u, n(e[u], r))); return o ? e : c ? n.call(e) : l ? n(e[0], r) : a }, now: function () { return (new Date).getTime() } }), b.ready.promise = function (t) { if (!n) if (n = b.Deferred(), "complete" === o.readyState) setTimeout(b.ready); else if (o.addEventListener) o.addEventListener("DOMContentLoaded", H, !1), e.addEventListener("load", H, !1); else { o.attachEvent("onreadystatechange", H), e.attachEvent("onload", H); var r = !1; try { r = null == e.frameElement && o.documentElement } catch (i) { } r && r.doScroll && function a() { if (!b.isReady) { try { r.doScroll("left") } catch (e) { return setTimeout(a, 50) } q(), b.ready() } } () } return n.promise(t) }, b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (e, t) { l["[object " + t + "]"] = t.toLowerCase() }); function M(e) { var t = e.length, n = b.type(e); return b.isWindow(e) ? !1 : 1 === e.nodeType && t ? !0 : "array" === n || "function" !== n && (0 === t || "number" == typeof t && t > 0 && t - 1 in e) } r = b(o); var _ = {}; function F(e) { var t = _[e] = {}; return b.each(e.match(w) || [], function (e, n) { t[n] = !0 }), t } b.Callbacks = function (e) { e = "string" == typeof e ? _[e] || F(e) : b.extend({}, e); var n, r, i, o, a, s, u = [], l = !e.once && [], c = function (t) { for (r = e.memory && t, i = !0, a = s || 0, s = 0, o = u.length, n = !0; u && o > a; a++) if (u[a].apply(t[0], t[1]) === !1 && e.stopOnFalse) { r = !1; break } n = !1, u && (l ? l.length && c(l.shift()) : r ? u = [] : p.disable()) }, p = { add: function () { if (u) { var t = u.length; (function i(t) { b.each(t, function (t, n) { var r = b.type(n); "function" === r ? e.unique && p.has(n) || u.push(n) : n && n.length && "string" !== r && i(n) }) })(arguments), n ? o = u.length : r && (s = t, c(r)) } return this }, remove: function () { return u && b.each(arguments, function (e, t) { var r; while ((r = b.inArray(t, u, r)) > -1) u.splice(r, 1), n && (o >= r && o--, a >= r && a--) }), this }, has: function (e) { return e ? b.inArray(e, u) > -1 : !(!u || !u.length) }, empty: function () { return u = [], this }, disable: function () { return u = l = r = t, this }, disabled: function () { return !u }, lock: function () { return l = t, r || p.disable(), this }, locked: function () { return !l }, fireWith: function (e, t) { return t = t || [], t = [e, t.slice ? t.slice() : t], !u || i && !l || (n ? l.push(t) : c(t)), this }, fire: function () { return p.fireWith(this, arguments), this }, fired: function () { return !!i } }; return p }, b.extend({ Deferred: function (e) { var t = [["resolve", "done", b.Callbacks("once memory"), "resolved"], ["reject", "fail", b.Callbacks("once memory"), "rejected"], ["notify", "progress", b.Callbacks("memory")]], n = "pending", r = { state: function () { return n }, always: function () { return i.done(arguments).fail(arguments), this }, then: function () { var e = arguments; return b.Deferred(function (n) { b.each(t, function (t, o) { var a = o[0], s = b.isFunction(e[t]) && e[t]; i[o[1]](function () { var e = s && s.apply(this, arguments); e && b.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[a + "With"](this === r ? n.promise() : this, s ? [e] : arguments) }) }), e = null }).promise() }, promise: function (e) { return null != e ? b.extend(e, r) : r } }, i = {}; return r.pipe = r.then, b.each(t, function (e, o) { var a = o[2], s = o[3]; r[o[1]] = a.add, s && a.add(function () { n = s }, t[1 ^ e][2].disable, t[2][2].lock), i[o[0]] = function () { return i[o[0] + "With"](this === i ? r : this, arguments), this }, i[o[0] + "With"] = a.fireWith }), r.promise(i), e && e.call(i, i), i }, when: function (e) { var t = 0, n = h.call(arguments), r = n.length, i = 1 !== r || e && b.isFunction(e.promise) ? r : 0, o = 1 === i ? e : b.Deferred(), a = function (e, t, n) { return function (r) { t[e] = this, n[e] = arguments.length > 1 ? h.call(arguments) : r, n === s ? o.notifyWith(t, n) : --i || o.resolveWith(t, n) } }, s, u, l; if (r > 1) for (s = Array(r), u = Array(r), l = Array(r); r > t; t++) n[t] && b.isFunction(n[t].promise) ? n[t].promise().done(a(t, l, n)).fail(o.reject).progress(a(t, u, s)) : --i; return i || o.resolveWith(l, n), o.promise() } }), b.support = function () { var t, n, r, a, s, u, l, c, p, f, d = o.createElement("div"); if (d.setAttribute("className", "t"), d.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", n = d.getElementsByTagName("*"), r = d.getElementsByTagName("a")[0], !n || !r || !n.length) return {}; s = o.createElement("select"), l = s.appendChild(o.createElement("option")), a = d.getElementsByTagName("input")[0], r.style.cssText = "top:1px;float:left;opacity:.5", t = { getSetAttribute: "t" !== d.className, leadingWhitespace: 3 === d.firstChild.nodeType, tbody: !d.getElementsByTagName("tbody").length, htmlSerialize: !!d.getElementsByTagName("link").length, style: /top/.test(r.getAttribute("style")), hrefNormalized: "/a" === r.getAttribute("href"), opacity: /^0.5/.test(r.style.opacity), cssFloat: !!r.style.cssFloat, checkOn: !!a.value, optSelected: l.selected, enctype: !!o.createElement("form").enctype, html5Clone: "<:nav></:nav>" !== o.createElement("nav").cloneNode(!0).outerHTML, boxModel: "CSS1Compat" === o.compatMode, deleteExpando: !0, noCloneEvent: !0, inlineBlockNeedsLayout: !1, shrinkWrapBlocks: !1, reliableMarginRight: !0, boxSizingReliable: !0, pixelPosition: !1 }, a.checked = !0, t.noCloneChecked = a.cloneNode(!0).checked, s.disabled = !0, t.optDisabled = !l.disabled; try { delete d.test } catch (h) { t.deleteExpando = !1 } a = o.createElement("input"), a.setAttribute("value", ""), t.input = "" === a.getAttribute("value"), a.value = "t", a.setAttribute("type", "radio"), t.radioValue = "t" === a.value, a.setAttribute("checked", "t"), a.setAttribute("name", "t"), u = o.createDocumentFragment(), u.appendChild(a), t.appendChecked = a.checked, t.checkClone = u.cloneNode(!0).cloneNode(!0).lastChild.checked, d.attachEvent && (d.attachEvent("onclick", function () { t.noCloneEvent = !1 }), d.cloneNode(!0).click()); for (f in { submit: !0, change: !0, focusin: !0 }) d.setAttribute(c = "on" + f, "t"), t[f + "Bubbles"] = c in e || d.attributes[c].expando === !1; return d.style.backgroundClip = "content-box", d.cloneNode(!0).style.backgroundClip = "", t.clearCloneStyle = "content-box" === d.style.backgroundClip, b(function () { var n, r, a, s = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", u = o.getElementsByTagName("body")[0]; u && (n = o.createElement("div"), n.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", u.appendChild(n).appendChild(d), d.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", a = d.getElementsByTagName("td"), a[0].style.cssText = "padding:0;margin:0;border:0;display:none", p = 0 === a[0].offsetHeight, a[0].style.display = "", a[1].style.display = "none", t.reliableHiddenOffsets = p && 0 === a[0].offsetHeight, d.innerHTML = "", d.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", t.boxSizing = 4 === d.offsetWidth, t.doesNotIncludeMarginInBodyOffset = 1 !== u.offsetTop, e.getComputedStyle && (t.pixelPosition = "1%" !== (e.getComputedStyle(d, null) || {}).top, t.boxSizingReliable = "4px" === (e.getComputedStyle(d, null) || { width: "4px" }).width, r = d.appendChild(o.createElement("div")), r.style.cssText = d.style.cssText = s, r.style.marginRight = r.style.width = "0", d.style.width = "1px", t.reliableMarginRight = !parseFloat((e.getComputedStyle(r, null) || {}).marginRight)), typeof d.style.zoom !== i && (d.innerHTML = "", d.style.cssText = s + "width:1px;padding:1px;display:inline;zoom:1", t.inlineBlockNeedsLayout = 3 === d.offsetWidth, d.style.display = "block", d.innerHTML = "<div></div>", d.firstChild.style.width = "5px", t.shrinkWrapBlocks = 3 !== d.offsetWidth, t.inlineBlockNeedsLayout && (u.style.zoom = 1)), u.removeChild(n), n = d = a = r = null) }), n = s = u = l = r = a = null, t } (); var O = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, B = /([A-Z])/g; function P(e, n, r, i) { if (b.acceptData(e)) { var o, a, s = b.expando, u = "string" == typeof n, l = e.nodeType, p = l ? b.cache : e, f = l ? e[s] : e[s] && s; if (f && p[f] && (i || p[f].data) || !u || r !== t) return f || (l ? e[s] = f = c.pop() || b.guid++ : f = s), p[f] || (p[f] = {}, l || (p[f].toJSON = b.noop)), ("object" == typeof n || "function" == typeof n) && (i ? p[f] = b.extend(p[f], n) : p[f].data = b.extend(p[f].data, n)), o = p[f], i || (o.data || (o.data = {}), o = o.data), r !== t && (o[b.camelCase(n)] = r), u ? (a = o[n], null == a && (a = o[b.camelCase(n)])) : a = o, a } } function R(e, t, n) { if (b.acceptData(e)) { var r, i, o, a = e.nodeType, s = a ? b.cache : e, u = a ? e[b.expando] : b.expando; if (s[u]) { if (t && (o = n ? s[u] : s[u].data)) { b.isArray(t) ? t = t.concat(b.map(t, b.camelCase)) : t in o ? t = [t] : (t = b.camelCase(t), t = t in o ? [t] : t.split(" ")); for (r = 0, i = t.length; i > r; r++) delete o[t[r]]; if (!(n ? $ : b.isEmptyObject)(o)) return } (n || (delete s[u].data, $(s[u]))) && (a ? b.cleanData([e], !0) : b.support.deleteExpando || s != s.window ? delete s[u] : s[u] = null) } } } b.extend({ cache: {}, expando: "jQuery" + (p + Math.random()).replace(/\D/g, ""), noData: { embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", applet: !0 }, hasData: function (e) { return e = e.nodeType ? b.cache[e[b.expando]] : e[b.expando], !!e && !$(e) }, data: function (e, t, n) { return P(e, t, n) }, removeData: function (e, t) { return R(e, t) }, _data: function (e, t, n) { return P(e, t, n, !0) }, _removeData: function (e, t) { return R(e, t, !0) }, acceptData: function (e) { if (e.nodeType && 1 !== e.nodeType && 9 !== e.nodeType) return !1; var t = e.nodeName && b.noData[e.nodeName.toLowerCase()]; return !t || t !== !0 && e.getAttribute("classid") === t } }), b.fn.extend({ data: function (e, n) { var r, i, o = this[0], a = 0, s = null; if (e === t) { if (this.length && (s = b.data(o), 1 === o.nodeType && !b._data(o, "parsedAttrs"))) { for (r = o.attributes; r.length > a; a++) i = r[a].name, i.indexOf("data-") || (i = b.camelCase(i.slice(5)), W(o, i, s[i])); b._data(o, "parsedAttrs", !0) } return s } return "object" == typeof e ? this.each(function () { b.data(this, e) }) : b.access(this, function (n) { return n === t ? o ? W(o, e, b.data(o, e)) : null : (this.each(function () { b.data(this, e, n) }), t) }, null, n, arguments.length > 1, null, !0) }, removeData: function (e) { return this.each(function () { b.removeData(this, e) }) } }); function W(e, n, r) { if (r === t && 1 === e.nodeType) { var i = "data-" + n.replace(B, "-$1").toLowerCase(); if (r = e.getAttribute(i), "string" == typeof r) { try { r = "true" === r ? !0 : "false" === r ? !1 : "null" === r ? null : +r + "" === r ? +r : O.test(r) ? b.parseJSON(r) : r } catch (o) { } b.data(e, n, r) } else r = t } return r } function $(e) { var t; for (t in e) if (("data" !== t || !b.isEmptyObject(e[t])) && "toJSON" !== t) return !1; return !0 } b.extend({ queue: function (e, n, r) { var i; return e ? (n = (n || "fx") + "queue", i = b._data(e, n), r && (!i || b.isArray(r) ? i = b._data(e, n, b.makeArray(r)) : i.push(r)), i || []) : t }, dequeue: function (e, t) { t = t || "fx"; var n = b.queue(e, t), r = n.length, i = n.shift(), o = b._queueHooks(e, t), a = function () { b.dequeue(e, t) }; "inprogress" === i && (i = n.shift(), r--), o.cur = i, i && ("fx" === t && n.unshift("inprogress"), delete o.stop, i.call(e, a, o)), !r && o && o.empty.fire() }, _queueHooks: function (e, t) { var n = t + "queueHooks"; return b._data(e, n) || b._data(e, n, { empty: b.Callbacks("once memory").add(function () { b._removeData(e, t + "queue"), b._removeData(e, n) }) }) } }), b.fn.extend({ queue: function (e, n) { var r = 2; return "string" != typeof e && (n = e, e = "fx", r--), r > arguments.length ? b.queue(this[0], e) : n === t ? this : this.each(function () { var t = b.queue(this, e, n); b._queueHooks(this, e), "fx" === e && "inprogress" !== t[0] && b.dequeue(this, e) }) }, dequeue: function (e) { return this.each(function () { b.dequeue(this, e) }) }, delay: function (e, t) { return e = b.fx ? b.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function (t, n) { var r = setTimeout(t, e); n.stop = function () { clearTimeout(r) } }) }, clearQueue: function (e) { return this.queue(e || "fx", []) }, promise: function (e, n) { var r, i = 1, o = b.Deferred(), a = this, s = this.length, u = function () { --i || o.resolveWith(a, [a]) }; "string" != typeof e && (n = e, e = t), e = e || "fx"; while (s--) r = b._data(a[s], e + "queueHooks"), r && r.empty && (i++, r.empty.add(u)); return u(), o.promise(n) } }); var I, z, X = /[\t\r\n]/g, U = /\r/g, V = /^(?:input|select|textarea|button|object)$/i, Y = /^(?:a|area)$/i, J = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, G = /^(?:checked|selected)$/i, Q = b.support.getSetAttribute, K = b.support.input; b.fn.extend({ attr: function (e, t) { return b.access(this, b.attr, e, t, arguments.length > 1) }, removeAttr: function (e) { return this.each(function () { b.removeAttr(this, e) }) }, prop: function (e, t) { return b.access(this, b.prop, e, t, arguments.length > 1) }, removeProp: function (e) { return e = b.propFix[e] || e, this.each(function () { try { this[e] = t, delete this[e] } catch (n) { } }) }, addClass: function (e) { var t, n, r, i, o, a = 0, s = this.length, u = "string" == typeof e && e; if (b.isFunction(e)) return this.each(function (t) { b(this).addClass(e.call(this, t, this.className)) }); if (u) for (t = (e || "").match(w) || []; s > a; a++) if (n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(X, " ") : " ")) { o = 0; while (i = t[o++]) 0 > r.indexOf(" " + i + " ") && (r += i + " "); n.className = b.trim(r) } return this }, removeClass: function (e) { var t, n, r, i, o, a = 0, s = this.length, u = 0 === arguments.length || "string" == typeof e && e; if (b.isFunction(e)) return this.each(function (t) { b(this).removeClass(e.call(this, t, this.className)) }); if (u) for (t = (e || "").match(w) || []; s > a; a++) if (n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(X, " ") : "")) { o = 0; while (i = t[o++]) while (r.indexOf(" " + i + " ") >= 0) r = r.replace(" " + i + " ", " "); n.className = e ? b.trim(r) : "" } return this }, toggleClass: function (e, t) { var n = typeof e, r = "boolean" == typeof t; return b.isFunction(e) ? this.each(function (n) { b(this).toggleClass(e.call(this, n, this.className, t), t) }) : this.each(function () { if ("string" === n) { var o, a = 0, s = b(this), u = t, l = e.match(w) || []; while (o = l[a++]) u = r ? u : !s.hasClass(o), s[u ? "addClass" : "removeClass"](o) } else (n === i || "boolean" === n) && (this.className && b._data(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : b._data(this, "__className__") || "") }) }, hasClass: function (e) { var t = " " + e + " ", n = 0, r = this.length; for (; r > n; n++) if (1 === this[n].nodeType && (" " + this[n].className + " ").replace(X, " ").indexOf(t) >= 0) return !0; return !1 }, val: function (e) { var n, r, i, o = this[0]; { if (arguments.length) return i = b.isFunction(e), this.each(function (n) { var o, a = b(this); 1 === this.nodeType && (o = i ? e.call(this, n, a.val()) : e, null == o ? o = "" : "number" == typeof o ? o += "" : b.isArray(o) && (o = b.map(o, function (e) { return null == e ? "" : e + "" })), r = b.valHooks[this.type] || b.valHooks[this.nodeName.toLowerCase()], r && "set" in r && r.set(this, o, "value") !== t || (this.value = o)) }); if (o) return r = b.valHooks[o.type] || b.valHooks[o.nodeName.toLowerCase()], r && "get" in r && (n = r.get(o, "value")) !== t ? n : (n = o.value, "string" == typeof n ? n.replace(U, "") : null == n ? "" : n) } } }), b.extend({ valHooks: { option: { get: function (e) { var t = e.attributes.value; return !t || t.specified ? e.value : e.text } }, select: { get: function (e) { var t, n, r = e.options, i = e.selectedIndex, o = "select-one" === e.type || 0 > i, a = o ? null : [], s = o ? i + 1 : r.length, u = 0 > i ? s : o ? i : 0; for (; s > u; u++) if (n = r[u], !(!n.selected && u !== i || (b.support.optDisabled ? n.disabled : null !== n.getAttribute("disabled")) || n.parentNode.disabled && b.nodeName(n.parentNode, "optgroup"))) { if (t = b(n).val(), o) return t; a.push(t) } return a }, set: function (e, t) { var n = b.makeArray(t); return b(e).find("option").each(function () { this.selected = b.inArray(b(this).val(), n) >= 0 }), n.length || (e.selectedIndex = -1), n } } }, attr: function (e, n, r) { var o, a, s, u = e.nodeType; if (e && 3 !== u && 8 !== u && 2 !== u) return typeof e.getAttribute === i ? b.prop(e, n, r) : (a = 1 !== u || !b.isXMLDoc(e), a && (n = n.toLowerCase(), o = b.attrHooks[n] || (J.test(n) ? z : I)), r === t ? o && a && "get" in o && null !== (s = o.get(e, n)) ? s : (typeof e.getAttribute !== i && (s = e.getAttribute(n)), null == s ? t : s) : null !== r ? o && a && "set" in o && (s = o.set(e, r, n)) !== t ? s : (e.setAttribute(n, r + ""), r) : (b.removeAttr(e, n), t)) }, removeAttr: function (e, t) { var n, r, i = 0, o = t && t.match(w); if (o && 1 === e.nodeType) while (n = o[i++]) r = b.propFix[n] || n, J.test(n) ? !Q && G.test(n) ? e[b.camelCase("default-" + n)] = e[r] = !1 : e[r] = !1 : b.attr(e, n, ""), e.removeAttribute(Q ? n : r) }, attrHooks: { type: { set: function (e, t) { if (!b.support.radioValue && "radio" === t && b.nodeName(e, "input")) { var n = e.value; return e.setAttribute("type", t), n && (e.value = n), t } } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function (e, n, r) { var i, o, a, s = e.nodeType; if (e && 3 !== s && 8 !== s && 2 !== s) return a = 1 !== s || !b.isXMLDoc(e), a && (n = b.propFix[n] || n, o = b.propHooks[n]), r !== t ? o && "set" in o && (i = o.set(e, r, n)) !== t ? i : e[n] = r : o && "get" in o && null !== (i = o.get(e, n)) ? i : e[n] }, propHooks: { tabIndex: { get: function (e) { var n = e.getAttributeNode("tabindex"); return n && n.specified ? parseInt(n.value, 10) : V.test(e.nodeName) || Y.test(e.nodeName) && e.href ? 0 : t } }} }), z = { get: function (e, n) { var r = b.prop(e, n), i = "boolean" == typeof r && e.getAttribute(n), o = "boolean" == typeof r ? K && Q ? null != i : G.test(n) ? e[b.camelCase("default-" + n)] : !!i : e.getAttributeNode(n); return o && o.value !== !1 ? n.toLowerCase() : t }, set: function (e, t, n) { return t === !1 ? b.removeAttr(e, n) : K && Q || !G.test(n) ? e.setAttribute(!Q && b.propFix[n] || n, n) : e[b.camelCase("default-" + n)] = e[n] = !0, n } }, K && Q || (b.attrHooks.value = { get: function (e, n) { var r = e.getAttributeNode(n); return b.nodeName(e, "input") ? e.defaultValue : r && r.specified ? r.value : t }, set: function (e, n, r) { return b.nodeName(e, "input") ? (e.defaultValue = n, t) : I && I.set(e, n, r) } }), Q || (I = b.valHooks.button = { get: function (e, n) { var r = e.getAttributeNode(n); return r && ("id" === n || "name" === n || "coords" === n ? "" !== r.value : r.specified) ? r.value : t }, set: function (e, n, r) { var i = e.getAttributeNode(r); return i || e.setAttributeNode(i = e.ownerDocument.createAttribute(r)), i.value = n += "", "value" === r || n === e.getAttribute(r) ? n : t } }, b.attrHooks.contenteditable = { get: I.get, set: function (e, t, n) { I.set(e, "" === t ? !1 : t, n) } }, b.each(["width", "height"], function (e, n) { b.attrHooks[n] = b.extend(b.attrHooks[n], { set: function (e, r) { return "" === r ? (e.setAttribute(n, "auto"), r) : t } }) })), b.support.hrefNormalized || (b.each(["href", "src", "width", "height"], function (e, n) { b.attrHooks[n] = b.extend(b.attrHooks[n], { get: function (e) { var r = e.getAttribute(n, 2); return null == r ? t : r } }) }), b.each(["href", "src"], function (e, t) { b.propHooks[t] = { get: function (e) { return e.getAttribute(t, 4) } } })), b.support.style || (b.attrHooks.style = { get: function (e) { return e.style.cssText || t }, set: function (e, t) { return e.style.cssText = t + "" } }), b.support.optSelected || (b.propHooks.selected = b.extend(b.propHooks.selected, { get: function (e) { var t = e.parentNode; return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null } })), b.support.enctype || (b.propFix.enctype = "encoding"), b.support.checkOn || b.each(["radio", "checkbox"], function () { b.valHooks[this] = { get: function (e) { return null === e.getAttribute("value") ? "on" : e.value } } }), b.each(["radio", "checkbox"], function () { b.valHooks[this] = b.extend(b.valHooks[this], { set: function (e, n) { return b.isArray(n) ? e.checked = b.inArray(b(e).val(), n) >= 0 : t } }) }); var Z = /^(?:input|select|textarea)$/i, et = /^key/, tt = /^(?:mouse|contextmenu)|click/, nt = /^(?:focusinfocus|focusoutblur)$/, rt = /^([^.]*)(?:\.(.+)|)$/; function it() { return !0 } function ot() { return !1 } b.event = { global: {}, add: function (e, n, r, o, a) { var s, u, l, c, p, f, d, h, g, m, y, v = b._data(e); if (v) { r.handler && (c = r, r = c.handler, a = c.selector), r.guid || (r.guid = b.guid++), (u = v.events) || (u = v.events = {}), (f = v.handle) || (f = v.handle = function (e) { return typeof b === i || e && b.event.triggered === e.type ? t : b.event.dispatch.apply(f.elem, arguments) }, f.elem = e), n = (n || "").match(w) || [""], l = n.length; while (l--) s = rt.exec(n[l]) || [], g = y = s[1], m = (s[2] || "").split(".").sort(), p = b.event.special[g] || {}, g = (a ? p.delegateType : p.bindType) || g, p = b.event.special[g] || {}, d = b.extend({ type: g, origType: y, data: o, handler: r, guid: r.guid, selector: a, needsContext: a && b.expr.match.needsContext.test(a), namespace: m.join(".") }, c), (h = u[g]) || (h = u[g] = [], h.delegateCount = 0, p.setup && p.setup.call(e, o, m, f) !== !1 || (e.addEventListener ? e.addEventListener(g, f, !1) : e.attachEvent && e.attachEvent("on" + g, f))), p.add && (p.add.call(e, d), d.handler.guid || (d.handler.guid = r.guid)), a ? h.splice(h.delegateCount++, 0, d) : h.push(d), b.event.global[g] = !0; e = null } }, remove: function (e, t, n, r, i) { var o, a, s, u, l, c, p, f, d, h, g, m = b.hasData(e) && b._data(e); if (m && (c = m.events)) { t = (t || "").match(w) || [""], l = t.length; while (l--) if (s = rt.exec(t[l]) || [], d = g = s[1], h = (s[2] || "").split(".").sort(), d) { p = b.event.special[d] || {}, d = (r ? p.delegateType : p.bindType) || d, f = c[d] || [], s = s[2] && RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), u = o = f.length; while (o--) a = f[o], !i && g !== a.origType || n && n.guid !== a.guid || s && !s.test(a.namespace) || r && r !== a.selector && ("**" !== r || !a.selector) || (f.splice(o, 1), a.selector && f.delegateCount--, p.remove && p.remove.call(e, a)); u && !f.length && (p.teardown && p.teardown.call(e, h, m.handle) !== !1 || b.removeEvent(e, d, m.handle), delete c[d]) } else for (d in c) b.event.remove(e, d + t[l], n, r, !0); b.isEmptyObject(c) && (delete m.handle, b._removeData(e, "events")) } }, trigger: function (n, r, i, a) { var s, u, l, c, p, f, d, h = [i || o], g = y.call(n, "type") ? n.type : n, m = y.call(n, "namespace") ? n.namespace.split(".") : []; if (l = f = i = i || o, 3 !== i.nodeType && 8 !== i.nodeType && !nt.test(g + b.event.triggered) && (g.indexOf(".") >= 0 && (m = g.split("."), g = m.shift(), m.sort()), u = 0 > g.indexOf(":") && "on" + g, n = n[b.expando] ? n : new b.Event(g, "object" == typeof n && n), n.isTrigger = !0, n.namespace = m.join("."), n.namespace_re = n.namespace ? RegExp("(^|\\.)" + m.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, n.result = t, n.target || (n.target = i), r = null == r ? [n] : b.makeArray(r, [n]), p = b.event.special[g] || {}, a || !p.trigger || p.trigger.apply(i, r) !== !1)) { if (!a && !p.noBubble && !b.isWindow(i)) { for (c = p.delegateType || g, nt.test(c + g) || (l = l.parentNode); l; l = l.parentNode) h.push(l), f = l; f === (i.ownerDocument || o) && h.push(f.defaultView || f.parentWindow || e) } d = 0; while ((l = h[d++]) && !n.isPropagationStopped()) n.type = d > 1 ? c : p.bindType || g, s = (b._data(l, "events") || {})[n.type] && b._data(l, "handle"), s && s.apply(l, r), s = u && l[u], s && b.acceptData(l) && s.apply && s.apply(l, r) === !1 && n.preventDefault(); if (n.type = g, !(a || n.isDefaultPrevented() || p._default && p._default.apply(i.ownerDocument, r) !== !1 || "click" === g && b.nodeName(i, "a") || !b.acceptData(i) || !u || !i[g] || b.isWindow(i))) { f = i[u], f && (i[u] = null), b.event.triggered = g; try { i[g]() } catch (v) { } b.event.triggered = t, f && (i[u] = f) } return n.result } }, dispatch: function (e) { e = b.event.fix(e); var n, r, i, o, a, s = [], u = h.call(arguments), l = (b._data(this, "events") || {})[e.type] || [], c = b.event.special[e.type] || {}; if (u[0] = e, e.delegateTarget = this, !c.preDispatch || c.preDispatch.call(this, e) !== !1) { s = b.event.handlers.call(this, e, l), n = 0; while ((o = s[n++]) && !e.isPropagationStopped()) { e.currentTarget = o.elem, a = 0; while ((i = o.handlers[a++]) && !e.isImmediatePropagationStopped()) (!e.namespace_re || e.namespace_re.test(i.namespace)) && (e.handleObj = i, e.data = i.data, r = ((b.event.special[i.origType] || {}).handle || i.handler).apply(o.elem, u), r !== t && (e.result = r) === !1 && (e.preventDefault(), e.stopPropagation())) } return c.postDispatch && c.postDispatch.call(this, e), e.result } }, handlers: function (e, n) { var r, i, o, a, s = [], u = n.delegateCount, l = e.target; if (u && l.nodeType && (!e.button || "click" !== e.type)) for (; l != this; l = l.parentNode || this) if (1 === l.nodeType && (l.disabled !== !0 || "click" !== e.type)) { for (o = [], a = 0; u > a; a++) i = n[a], r = i.selector + " ", o[r] === t && (o[r] = i.needsContext ? b(r, this).index(l) >= 0 : b.find(r, this, null, [l]).length), o[r] && o.push(i); o.length && s.push({ elem: l, handlers: o }) } return n.length > u && s.push({ elem: this, handlers: n.slice(u) }), s }, fix: function (e) { if (e[b.expando]) return e; var t, n, r, i = e.type, a = e, s = this.fixHooks[i]; s || (this.fixHooks[i] = s = tt.test(i) ? this.mouseHooks : et.test(i) ? this.keyHooks : {}), r = s.props ? this.props.concat(s.props) : this.props, e = new b.Event(a), t = r.length; while (t--) n = r[t], e[n] = a[n]; return e.target || (e.target = a.srcElement || o), 3 === e.target.nodeType && (e.target = e.target.parentNode), e.metaKey = !!e.metaKey, s.filter ? s.filter(e, a) : e }, props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (e, t) { return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (e, n) { var r, i, a, s = n.button, u = n.fromElement; return null == e.pageX && null != n.clientX && (i = e.target.ownerDocument || o, a = i.documentElement, r = i.body, e.pageX = n.clientX + (a && a.scrollLeft || r && r.scrollLeft || 0) - (a && a.clientLeft || r && r.clientLeft || 0), e.pageY = n.clientY + (a && a.scrollTop || r && r.scrollTop || 0) - (a && a.clientTop || r && r.clientTop || 0)), !e.relatedTarget && u && (e.relatedTarget = u === e.target ? n.toElement : u), e.which || s === t || (e.which = 1 & s ? 1 : 2 & s ? 3 : 4 & s ? 2 : 0), e } }, special: { load: { noBubble: !0 }, click: { trigger: function () { return b.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : t } }, focus: { trigger: function () { if (this !== o.activeElement && this.focus) try { return this.focus(), !1 } catch (e) { } }, delegateType: "focusin" }, blur: { trigger: function () { return this === o.activeElement && this.blur ? (this.blur(), !1) : t }, delegateType: "focusout" }, beforeunload: { postDispatch: function (e) { e.result !== t && (e.originalEvent.returnValue = e.result) } } }, simulate: function (e, t, n, r) { var i = b.extend(new b.Event, n, { type: e, isSimulated: !0, originalEvent: {} }); r ? b.event.trigger(i, null, t) : b.event.dispatch.call(t, i), i.isDefaultPrevented() && n.preventDefault() } }, b.removeEvent = o.removeEventListener ? function (e, t, n) { e.removeEventListener && e.removeEventListener(t, n, !1) } : function (e, t, n) { var r = "on" + t; e.detachEvent && (typeof e[r] === i && (e[r] = null), e.detachEvent(r, n)) }, b.Event = function (e, n) { return this instanceof b.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || e.returnValue === !1 || e.getPreventDefault && e.getPreventDefault() ? it : ot) : this.type = e, n && b.extend(this, n), this.timeStamp = e && e.timeStamp || b.now(), this[b.expando] = !0, t) : new b.Event(e, n) }, b.Event.prototype = { isDefaultPrevented: ot, isPropagationStopped: ot, isImmediatePropagationStopped: ot, preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = it, e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1) }, stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = it, e && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0) }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = it, this.stopPropagation() } }, b.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (e, t) {
|
7 |
+
b.event.special[e] = { delegateType: t, bindType: t, handle: function (e) {
|
8 |
+
var n, r = this, i = e.relatedTarget, o = e.handleObj;
|
9 |
+
return (!i || i !== r && !b.contains(r, i)) && (e.type = o.origType, n = o.handler.apply(this, arguments), e.type = t), n
|
10 |
+
}
|
11 |
+
}
|
12 |
+
}), b.support.submitBubbles || (b.event.special.submit = { setup: function () { return b.nodeName(this, "form") ? !1 : (b.event.add(this, "click._submit keypress._submit", function (e) { var n = e.target, r = b.nodeName(n, "input") || b.nodeName(n, "button") ? n.form : t; r && !b._data(r, "submitBubbles") && (b.event.add(r, "submit._submit", function (e) { e._submit_bubble = !0 }), b._data(r, "submitBubbles", !0)) }), t) }, postDispatch: function (e) { e._submit_bubble && (delete e._submit_bubble, this.parentNode && !e.isTrigger && b.event.simulate("submit", this.parentNode, e, !0)) }, teardown: function () { return b.nodeName(this, "form") ? !1 : (b.event.remove(this, "._submit"), t) } }), b.support.changeBubbles || (b.event.special.change = { setup: function () { return Z.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (b.event.add(this, "propertychange._change", function (e) { "checked" === e.originalEvent.propertyName && (this._just_changed = !0) }), b.event.add(this, "click._change", function (e) { this._just_changed && !e.isTrigger && (this._just_changed = !1), b.event.simulate("change", this, e, !0) })), !1) : (b.event.add(this, "beforeactivate._change", function (e) { var t = e.target; Z.test(t.nodeName) && !b._data(t, "changeBubbles") && (b.event.add(t, "change._change", function (e) { !this.parentNode || e.isSimulated || e.isTrigger || b.event.simulate("change", this.parentNode, e, !0) }), b._data(t, "changeBubbles", !0)) }), t) }, handle: function (e) { var n = e.target; return this !== n || e.isSimulated || e.isTrigger || "radio" !== n.type && "checkbox" !== n.type ? e.handleObj.handler.apply(this, arguments) : t }, teardown: function () { return b.event.remove(this, "._change"), !Z.test(this.nodeName) } }), b.support.focusinBubbles || b.each({ focus: "focusin", blur: "focusout" }, function (e, t) { var n = 0, r = function (e) { b.event.simulate(t, e.target, b.event.fix(e), !0) }; b.event.special[t] = { setup: function () { 0 === n++ && o.addEventListener(e, r, !0) }, teardown: function () { 0 === --n && o.removeEventListener(e, r, !0) } } }), b.fn.extend({ on: function (e, n, r, i, o) { var a, s; if ("object" == typeof e) { "string" != typeof n && (r = r || n, n = t); for (a in e) this.on(a, n, r, e[a], o); return this } if (null == r && null == i ? (i = n, r = n = t) : null == i && ("string" == typeof n ? (i = r, r = t) : (i = r, r = n, n = t)), i === !1) i = ot; else if (!i) return this; return 1 === o && (s = i, i = function (e) { return b().off(e), s.apply(this, arguments) }, i.guid = s.guid || (s.guid = b.guid++)), this.each(function () { b.event.add(this, e, i, r, n) }) }, one: function (e, t, n, r) { return this.on(e, t, n, r, 1) }, off: function (e, n, r) { var i, o; if (e && e.preventDefault && e.handleObj) return i = e.handleObj, b(e.delegateTarget).off(i.namespace ? i.origType + "." + i.namespace : i.origType, i.selector, i.handler), this; if ("object" == typeof e) { for (o in e) this.off(o, n, e[o]); return this } return (n === !1 || "function" == typeof n) && (r = n, n = t), r === !1 && (r = ot), this.each(function () { b.event.remove(this, e, r, n) }) }, bind: function (e, t, n) { return this.on(e, null, t, n) }, unbind: function (e, t) { return this.off(e, null, t) }, delegate: function (e, t, n, r) { return this.on(t, e, n, r) }, undelegate: function (e, t, n) { return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n) }, trigger: function (e, t) { return this.each(function () { b.event.trigger(e, t, this) }) }, triggerHandler: function (e, n) { var r = this[0]; return r ? b.event.trigger(e, n, r, !0) : t } }), function (e, t) { var n, r, i, o, a, s, u, l, c, p, f, d, h, g, m, y, v, x = "sizzle" + -new Date, w = e.document, T = {}, N = 0, C = 0, k = it(), E = it(), S = it(), A = typeof t, j = 1 << 31, D = [], L = D.pop, H = D.push, q = D.slice, M = D.indexOf || function (e) { var t = 0, n = this.length; for (; n > t; t++) if (this[t] === e) return t; return -1 }, _ = "[\\x20\\t\\r\\n\\f]", F = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", O = F.replace("w", "w#"), B = "([*^$|!~]?=)", P = "\\[" + _ + "*(" + F + ")" + _ + "*(?:" + B + _ + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + O + ")|)|)" + _ + "*\\]", R = ":(" + F + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + P.replace(3, 8) + ")*)|.*)\\)|)", W = RegExp("^" + _ + "+|((?:^|[^\\\\])(?:\\\\.)*)" + _ + "+$", "g"), $ = RegExp("^" + _ + "*," + _ + "*"), I = RegExp("^" + _ + "*([\\x20\\t\\r\\n\\f>+~])" + _ + "*"), z = RegExp(R), X = RegExp("^" + O + "$"), U = { ID: RegExp("^#(" + F + ")"), CLASS: RegExp("^\\.(" + F + ")"), NAME: RegExp("^\\[name=['\"]?(" + F + ")['\"]?\\]"), TAG: RegExp("^(" + F.replace("w", "w*") + ")"), ATTR: RegExp("^" + P), PSEUDO: RegExp("^" + R), CHILD: RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + _ + "*(even|odd|(([+-]|)(\\d*)n|)" + _ + "*(?:([+-]|)" + _ + "*(\\d+)|))" + _ + "*\\)|)", "i"), needsContext: RegExp("^" + _ + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + _ + "*((?:-\\d)?\\d*)" + _ + "*\\)|)(?=[^-]|$)", "i") }, V = /[\x20\t\r\n\f]*[+~]/, Y = /^[^{]+\{\s*\[native code/, J = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, G = /^(?:input|select|textarea|button)$/i, Q = /^h\d$/i, K = /'|\\/g, Z = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, et = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, tt = function (e, t) { var n = "0x" + t - 65536; return n !== n ? t : 0 > n ? String.fromCharCode(n + 65536) : String.fromCharCode(55296 | n >> 10, 56320 | 1023 & n) }; try { q.call(w.documentElement.childNodes, 0)[0].nodeType } catch (nt) { q = function (e) { var t, n = []; while (t = this[e++]) n.push(t); return n } } function rt(e) { return Y.test(e + "") } function it() { var e, t = []; return e = function (n, r) { return t.push(n += " ") > i.cacheLength && delete e[t.shift()], e[n] = r } } function ot(e) { return e[x] = !0, e } function at(e) { var t = p.createElement("div"); try { return e(t) } catch (n) { return !1 } finally { t = null } } function st(e, t, n, r) { var i, o, a, s, u, l, f, g, m, v; if ((t ? t.ownerDocument || t : w) !== p && c(t), t = t || p, n = n || [], !e || "string" != typeof e) return n; if (1 !== (s = t.nodeType) && 9 !== s) return []; if (!d && !r) { if (i = J.exec(e)) if (a = i[1]) { if (9 === s) { if (o = t.getElementById(a), !o || !o.parentNode) return n; if (o.id === a) return n.push(o), n } else if (t.ownerDocument && (o = t.ownerDocument.getElementById(a)) && y(t, o) && o.id === a) return n.push(o), n } else { if (i[2]) return H.apply(n, q.call(t.getElementsByTagName(e), 0)), n; if ((a = i[3]) && T.getByClassName && t.getElementsByClassName) return H.apply(n, q.call(t.getElementsByClassName(a), 0)), n } if (T.qsa && !h.test(e)) { if (f = !0, g = x, m = t, v = 9 === s && e, 1 === s && "object" !== t.nodeName.toLowerCase()) { l = ft(e), (f = t.getAttribute("id")) ? g = f.replace(K, "\\$&") : t.setAttribute("id", g), g = "[id='" + g + "'] ", u = l.length; while (u--) l[u] = g + dt(l[u]); m = V.test(e) && t.parentNode || t, v = l.join(",") } if (v) try { return H.apply(n, q.call(m.querySelectorAll(v), 0)), n } catch (b) { } finally { f || t.removeAttribute("id") } } } return wt(e.replace(W, "$1"), t, n, r) } a = st.isXML = function (e) { var t = e && (e.ownerDocument || e).documentElement; return t ? "HTML" !== t.nodeName : !1 }, c = st.setDocument = function (e) { var n = e ? e.ownerDocument || e : w; return n !== p && 9 === n.nodeType && n.documentElement ? (p = n, f = n.documentElement, d = a(n), T.tagNameNoComments = at(function (e) { return e.appendChild(n.createComment("")), !e.getElementsByTagName("*").length }), T.attributes = at(function (e) { e.innerHTML = "<select></select>"; var t = typeof e.lastChild.getAttribute("multiple"); return "boolean" !== t && "string" !== t }), T.getByClassName = at(function (e) { return e.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>", e.getElementsByClassName && e.getElementsByClassName("e").length ? (e.lastChild.className = "e", 2 === e.getElementsByClassName("e").length) : !1 }), T.getByName = at(function (e) { e.id = x + 0, e.innerHTML = "<a name='" + x + "'></a><div name='" + x + "'></div>", f.insertBefore(e, f.firstChild); var t = n.getElementsByName && n.getElementsByName(x).length === 2 + n.getElementsByName(x + 0).length; return T.getIdNotName = !n.getElementById(x), f.removeChild(e), t }), i.attrHandle = at(function (e) { return e.innerHTML = "<a href='#'></a>", e.firstChild && typeof e.firstChild.getAttribute !== A && "#" === e.firstChild.getAttribute("href") }) ? {} : { href: function (e) { return e.getAttribute("href", 2) }, type: function (e) { return e.getAttribute("type") } }, T.getIdNotName ? (i.find.ID = function (e, t) { if (typeof t.getElementById !== A && !d) { var n = t.getElementById(e); return n && n.parentNode ? [n] : [] } }, i.filter.ID = function (e) { var t = e.replace(et, tt); return function (e) { return e.getAttribute("id") === t } }) : (i.find.ID = function (e, n) { if (typeof n.getElementById !== A && !d) { var r = n.getElementById(e); return r ? r.id === e || typeof r.getAttributeNode !== A && r.getAttributeNode("id").value === e ? [r] : t : [] } }, i.filter.ID = function (e) { var t = e.replace(et, tt); return function (e) { var n = typeof e.getAttributeNode !== A && e.getAttributeNode("id"); return n && n.value === t } }), i.find.TAG = T.tagNameNoComments ? function (e, n) { return typeof n.getElementsByTagName !== A ? n.getElementsByTagName(e) : t } : function (e, t) { var n, r = [], i = 0, o = t.getElementsByTagName(e); if ("*" === e) { while (n = o[i++]) 1 === n.nodeType && r.push(n); return r } return o }, i.find.NAME = T.getByName && function (e, n) { return typeof n.getElementsByName !== A ? n.getElementsByName(name) : t }, i.find.CLASS = T.getByClassName && function (e, n) { return typeof n.getElementsByClassName === A || d ? t : n.getElementsByClassName(e) }, g = [], h = [":focus"], (T.qsa = rt(n.querySelectorAll)) && (at(function (e) { e.innerHTML = "<select><option selected=''></option></select>", e.querySelectorAll("[selected]").length || h.push("\\[" + _ + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)"), e.querySelectorAll(":checked").length || h.push(":checked") }), at(function (e) { e.innerHTML = "<input type='hidden' i=''/>", e.querySelectorAll("[i^='']").length && h.push("[*^$]=" + _ + "*(?:\"\"|'')"), e.querySelectorAll(":enabled").length || h.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), h.push(",.*:") })), (T.matchesSelector = rt(m = f.matchesSelector || f.mozMatchesSelector || f.webkitMatchesSelector || f.oMatchesSelector || f.msMatchesSelector)) && at(function (e) { T.disconnectedMatch = m.call(e, "div"), m.call(e, "[s!='']:x"), g.push("!=", R) }), h = RegExp(h.join("|")), g = RegExp(g.join("|")), y = rt(f.contains) || f.compareDocumentPosition ? function (e, t) { var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode; return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r))) } : function (e, t) { if (t) while (t = t.parentNode) if (t === e) return !0; return !1 }, v = f.compareDocumentPosition ? function (e, t) { var r; return e === t ? (u = !0, 0) : (r = t.compareDocumentPosition && e.compareDocumentPosition && e.compareDocumentPosition(t)) ? 1 & r || e.parentNode && 11 === e.parentNode.nodeType ? e === n || y(w, e) ? -1 : t === n || y(w, t) ? 1 : 0 : 4 & r ? -1 : 1 : e.compareDocumentPosition ? -1 : 1 } : function (e, t) { var r, i = 0, o = e.parentNode, a = t.parentNode, s = [e], l = [t]; if (e === t) return u = !0, 0; if (!o || !a) return e === n ? -1 : t === n ? 1 : o ? -1 : a ? 1 : 0; if (o === a) return ut(e, t); r = e; while (r = r.parentNode) s.unshift(r); r = t; while (r = r.parentNode) l.unshift(r); while (s[i] === l[i]) i++; return i ? ut(s[i], l[i]) : s[i] === w ? -1 : l[i] === w ? 1 : 0 }, u = !1, [0, 0].sort(v), T.detectDuplicates = u, p) : p }, st.matches = function (e, t) { return st(e, null, null, t) }, st.matchesSelector = function (e, t) { if ((e.ownerDocument || e) !== p && c(e), t = t.replace(Z, "='$1']"), !(!T.matchesSelector || d || g && g.test(t) || h.test(t))) try { var n = m.call(e, t); if (n || T.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n } catch (r) { } return st(t, p, null, [e]).length > 0 }, st.contains = function (e, t) { return (e.ownerDocument || e) !== p && c(e), y(e, t) }, st.attr = function (e, t) { var n; return (e.ownerDocument || e) !== p && c(e), d || (t = t.toLowerCase()), (n = i.attrHandle[t]) ? n(e) : d || T.attributes ? e.getAttribute(t) : ((n = e.getAttributeNode(t)) || e.getAttribute(t)) && e[t] === !0 ? t : n && n.specified ? n.value : null }, st.error = function (e) { throw Error("Syntax error, unrecognized expression: " + e) }, st.uniqueSort = function (e) { var t, n = [], r = 1, i = 0; if (u = !T.detectDuplicates, e.sort(v), u) { for (; t = e[r]; r++) t === e[r - 1] && (i = n.push(r)); while (i--) e.splice(n[i], 1) } return e }; function ut(e, t) { var n = t && e, r = n && (~t.sourceIndex || j) - (~e.sourceIndex || j); if (r) return r; if (n) while (n = n.nextSibling) if (n === t) return -1; return e ? 1 : -1 } function lt(e) { return function (t) { var n = t.nodeName.toLowerCase(); return "input" === n && t.type === e } } function ct(e) { return function (t) { var n = t.nodeName.toLowerCase(); return ("input" === n || "button" === n) && t.type === e } } function pt(e) { return ot(function (t) { return t = +t, ot(function (n, r) { var i, o = e([], n.length, t), a = o.length; while (a--) n[i = o[a]] && (n[i] = !(r[i] = n[i])) }) }) } o = st.getText = function (e) { var t, n = "", r = 0, i = e.nodeType; if (i) { if (1 === i || 9 === i || 11 === i) { if ("string" == typeof e.textContent) return e.textContent; for (e = e.firstChild; e; e = e.nextSibling) n += o(e) } else if (3 === i || 4 === i) return e.nodeValue } else for (; t = e[r]; r++) n += o(t); return n }, i = st.selectors = { cacheLength: 50, createPseudo: ot, match: U, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling"} }, preFilter: { ATTR: function (e) { return e[1] = e[1].replace(et, tt), e[3] = (e[4] || e[5] || "").replace(et, tt), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4) }, CHILD: function (e) { return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || st.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && st.error(e[0]), e }, PSEUDO: function (e) { var t, n = !e[5] && e[2]; return U.CHILD.test(e[0]) ? null : (e[4] ? e[2] = e[4] : n && z.test(n) && (t = ft(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3)) } }, filter: { TAG: function (e) { return "*" === e ? function () { return !0 } : (e = e.replace(et, tt).toLowerCase(), function (t) { return t.nodeName && t.nodeName.toLowerCase() === e }) }, CLASS: function (e) { var t = k[e + " "]; return t || (t = RegExp("(^|" + _ + ")" + e + "(" + _ + "|$)")) && k(e, function (e) { return t.test(e.className || typeof e.getAttribute !== A && e.getAttribute("class") || "") }) }, ATTR: function (e, t, n) { return function (r) { var i = st.attr(r, e); return null == i ? "!=" === t : t ? (i += "", "=" === t ? i === n : "!=" === t ? i !== n : "^=" === t ? n && 0 === i.indexOf(n) : "*=" === t ? n && i.indexOf(n) > -1 : "$=" === t ? n && i.slice(-n.length) === n : "~=" === t ? (" " + i + " ").indexOf(n) > -1 : "|=" === t ? i === n || i.slice(0, n.length + 1) === n + "-" : !1) : !0 } }, CHILD: function (e, t, n, r, i) { var o = "nth" !== e.slice(0, 3), a = "last" !== e.slice(-4), s = "of-type" === t; return 1 === r && 0 === i ? function (e) { return !!e.parentNode } : function (t, n, u) { var l, c, p, f, d, h, g = o !== a ? "nextSibling" : "previousSibling", m = t.parentNode, y = s && t.nodeName.toLowerCase(), v = !u && !s; if (m) { if (o) { while (g) { p = t; while (p = p[g]) if (s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) return !1; h = g = "only" === e && !h && "nextSibling" } return !0 } if (h = [a ? m.firstChild : m.lastChild], a && v) { c = m[x] || (m[x] = {}), l = c[e] || [], d = l[0] === N && l[1], f = l[0] === N && l[2], p = d && m.childNodes[d]; while (p = ++d && p && p[g] || (f = d = 0) || h.pop()) if (1 === p.nodeType && ++f && p === t) { c[e] = [N, d, f]; break } } else if (v && (l = (t[x] || (t[x] = {}))[e]) && l[0] === N) f = l[1]; else while (p = ++d && p && p[g] || (f = d = 0) || h.pop()) if ((s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) && ++f && (v && ((p[x] || (p[x] = {}))[e] = [N, f]), p === t)) break; return f -= i, f === r || 0 === f % r && f / r >= 0 } } }, PSEUDO: function (e, t) { var n, r = i.pseudos[e] || i.setFilters[e.toLowerCase()] || st.error("unsupported pseudo: " + e); return r[x] ? r(t) : r.length > 1 ? (n = [e, e, "", t], i.setFilters.hasOwnProperty(e.toLowerCase()) ? ot(function (e, n) { var i, o = r(e, t), a = o.length; while (a--) i = M.call(e, o[a]), e[i] = !(n[i] = o[a]) }) : function (e) { return r(e, 0, n) }) : r } }, pseudos: { not: ot(function (e) { var t = [], n = [], r = s(e.replace(W, "$1")); return r[x] ? ot(function (e, t, n, i) { var o, a = r(e, null, i, []), s = e.length; while (s--) (o = a[s]) && (e[s] = !(t[s] = o)) }) : function (e, i, o) { return t[0] = e, r(t, null, o, n), !n.pop() } }), has: ot(function (e) { return function (t) { return st(e, t).length > 0 } }), contains: ot(function (e) { return function (t) { return (t.textContent || t.innerText || o(t)).indexOf(e) > -1 } }), lang: ot(function (e) { return X.test(e || "") || st.error("unsupported lang: " + e), e = e.replace(et, tt).toLowerCase(), function (t) { var n; do if (n = d ? t.getAttribute("xml:lang") || t.getAttribute("lang") : t.lang) return n = n.toLowerCase(), n === e || 0 === n.indexOf(e + "-"); while ((t = t.parentNode) && 1 === t.nodeType); return !1 } }), target: function (t) { var n = e.location && e.location.hash; return n && n.slice(1) === t.id }, root: function (e) { return e === f }, focus: function (e) { return e === p.activeElement && (!p.hasFocus || p.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) }, enabled: function (e) { return e.disabled === !1 }, disabled: function (e) { return e.disabled === !0 }, checked: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && !!e.checked || "option" === t && !!e.selected }, selected: function (e) { return e.parentNode && e.parentNode.selectedIndex, e.selected === !0 }, empty: function (e) { for (e = e.firstChild; e; e = e.nextSibling) if (e.nodeName > "@" || 3 === e.nodeType || 4 === e.nodeType) return !1; return !0 }, parent: function (e) { return !i.pseudos.empty(e) }, header: function (e) { return Q.test(e.nodeName) }, input: function (e) { return G.test(e.nodeName) }, button: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && "button" === e.type || "button" === t }, text: function (e) { var t; return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || t.toLowerCase() === e.type) }, first: pt(function () { return [0] }), last: pt(function (e, t) { return [t - 1] }), eq: pt(function (e, t, n) { return [0 > n ? n + t : n] }), even: pt(function (e, t) { var n = 0; for (; t > n; n += 2) e.push(n); return e }), odd: pt(function (e, t) { var n = 1; for (; t > n; n += 2) e.push(n); return e }), lt: pt(function (e, t, n) { var r = 0 > n ? n + t : n; for (; --r >= 0; ) e.push(r); return e }), gt: pt(function (e, t, n) { var r = 0 > n ? n + t : n; for (; t > ++r; ) e.push(r); return e })} }; for (n in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) i.pseudos[n] = lt(n); for (n in { submit: !0, reset: !0 }) i.pseudos[n] = ct(n); function ft(e, t) { var n, r, o, a, s, u, l, c = E[e + " "]; if (c) return t ? 0 : c.slice(0); s = e, u = [], l = i.preFilter; while (s) { (!n || (r = $.exec(s))) && (r && (s = s.slice(r[0].length) || s), u.push(o = [])), n = !1, (r = I.exec(s)) && (n = r.shift(), o.push({ value: n, type: r[0].replace(W, " ") }), s = s.slice(n.length)); for (a in i.filter) !(r = U[a].exec(s)) || l[a] && !(r = l[a](r)) || (n = r.shift(), o.push({ value: n, type: a, matches: r }), s = s.slice(n.length)); if (!n) break } return t ? s.length : s ? st.error(e) : E(e, u).slice(0) } function dt(e) { var t = 0, n = e.length, r = ""; for (; n > t; t++) r += e[t].value; return r } function ht(e, t, n) { var i = t.dir, o = n && "parentNode" === i, a = C++; return t.first ? function (t, n, r) { while (t = t[i]) if (1 === t.nodeType || o) return e(t, n, r) } : function (t, n, s) { var u, l, c, p = N + " " + a; if (s) { while (t = t[i]) if ((1 === t.nodeType || o) && e(t, n, s)) return !0 } else while (t = t[i]) if (1 === t.nodeType || o) if (c = t[x] || (t[x] = {}), (l = c[i]) && l[0] === p) { if ((u = l[1]) === !0 || u === r) return u === !0 } else if (l = c[i] = [p], l[1] = e(t, n, s) || r, l[1] === !0) return !0 } } function gt(e) { return e.length > 1 ? function (t, n, r) { var i = e.length; while (i--) if (!e[i](t, n, r)) return !1; return !0 } : e[0] } function mt(e, t, n, r, i) { var o, a = [], s = 0, u = e.length, l = null != t; for (; u > s; s++) (o = e[s]) && (!n || n(o, r, i)) && (a.push(o), l && t.push(s)); return a } function yt(e, t, n, r, i, o) { return r && !r[x] && (r = yt(r)), i && !i[x] && (i = yt(i, o)), ot(function (o, a, s, u) { var l, c, p, f = [], d = [], h = a.length, g = o || xt(t || "*", s.nodeType ? [s] : s, []), m = !e || !o && t ? g : mt(g, f, e, s, u), y = n ? i || (o ? e : h || r) ? [] : a : m; if (n && n(m, y, s, u), r) { l = mt(y, d), r(l, [], s, u), c = l.length; while (c--) (p = l[c]) && (y[d[c]] = !(m[d[c]] = p)) } if (o) { if (i || e) { if (i) { l = [], c = y.length; while (c--) (p = y[c]) && l.push(m[c] = p); i(null, y = [], l, u) } c = y.length; while (c--) (p = y[c]) && (l = i ? M.call(o, p) : f[c]) > -1 && (o[l] = !(a[l] = p)) } } else y = mt(y === a ? y.splice(h, y.length) : y), i ? i(null, a, y, u) : H.apply(a, y) }) } function vt(e) { var t, n, r, o = e.length, a = i.relative[e[0].type], s = a || i.relative[" "], u = a ? 1 : 0, c = ht(function (e) { return e === t }, s, !0), p = ht(function (e) { return M.call(t, e) > -1 }, s, !0), f = [function (e, n, r) { return !a && (r || n !== l) || ((t = n).nodeType ? c(e, n, r) : p(e, n, r)) } ]; for (; o > u; u++) if (n = i.relative[e[u].type]) f = [ht(gt(f), n)]; else { if (n = i.filter[e[u].type].apply(null, e[u].matches), n[x]) { for (r = ++u; o > r; r++) if (i.relative[e[r].type]) break; return yt(u > 1 && gt(f), u > 1 && dt(e.slice(0, u - 1)).replace(W, "$1"), n, r > u && vt(e.slice(u, r)), o > r && vt(e = e.slice(r)), o > r && dt(e)) } f.push(n) } return gt(f) } function bt(e, t) { var n = 0, o = t.length > 0, a = e.length > 0, s = function (s, u, c, f, d) { var h, g, m, y = [], v = 0, b = "0", x = s && [], w = null != d, T = l, C = s || a && i.find.TAG("*", d && u.parentNode || u), k = N += null == T ? 1 : Math.random() || .1; for (w && (l = u !== p && u, r = n); null != (h = C[b]); b++) { if (a && h) { g = 0; while (m = e[g++]) if (m(h, u, c)) { f.push(h); break } w && (N = k, r = ++n) } o && ((h = !m && h) && v--, s && x.push(h)) } if (v += b, o && b !== v) { g = 0; while (m = t[g++]) m(x, y, u, c); if (s) { if (v > 0) while (b--) x[b] || y[b] || (y[b] = L.call(f)); y = mt(y) } H.apply(f, y), w && !s && y.length > 0 && v + t.length > 1 && st.uniqueSort(f) } return w && (N = k, l = T), x }; return o ? ot(s) : s } s = st.compile = function (e, t) { var n, r = [], i = [], o = S[e + " "]; if (!o) { t || (t = ft(e)), n = t.length; while (n--) o = vt(t[n]), o[x] ? r.push(o) : i.push(o); o = S(e, bt(i, r)) } return o }; function xt(e, t, n) { var r = 0, i = t.length; for (; i > r; r++) st(e, t[r], n); return n } function wt(e, t, n, r) { var o, a, u, l, c, p = ft(e); if (!r && 1 === p.length) { if (a = p[0] = p[0].slice(0), a.length > 2 && "ID" === (u = a[0]).type && 9 === t.nodeType && !d && i.relative[a[1].type]) { if (t = i.find.ID(u.matches[0].replace(et, tt), t)[0], !t) return n; e = e.slice(a.shift().value.length) } o = U.needsContext.test(e) ? 0 : a.length; while (o--) { if (u = a[o], i.relative[l = u.type]) break; if ((c = i.find[l]) && (r = c(u.matches[0].replace(et, tt), V.test(a[0].type) && t.parentNode || t))) { if (a.splice(o, 1), e = r.length && dt(a), !e) return H.apply(n, q.call(r, 0)), n; break } } } return s(e, p)(r, t, d, n, V.test(e)), n } i.pseudos.nth = i.pseudos.eq; function Tt() { } i.filters = Tt.prototype = i.pseudos, i.setFilters = new Tt, c(), st.attr = b.attr, b.find = st, b.expr = st.selectors, b.expr[":"] = b.expr.pseudos, b.unique = st.uniqueSort, b.text = st.getText, b.isXMLDoc = st.isXML, b.contains = st.contains } (e); var at = /Until$/, st = /^(?:parents|prev(?:Until|All))/, ut = /^.[^:#\[\.,]*$/, lt = b.expr.match.needsContext, ct = { children: !0, contents: !0, next: !0, prev: !0 }; b.fn.extend({ find: function (e) { var t, n, r, i = this.length; if ("string" != typeof e) return r = this, this.pushStack(b(e).filter(function () { for (t = 0; i > t; t++) if (b.contains(r[t], this)) return !0 })); for (n = [], t = 0; i > t; t++) b.find(e, this[t], n); return n = this.pushStack(i > 1 ? b.unique(n) : n), n.selector = (this.selector ? this.selector + " " : "") + e, n }, has: function (e) { var t, n = b(e, this), r = n.length; return this.filter(function () { for (t = 0; r > t; t++) if (b.contains(this, n[t])) return !0 }) }, not: function (e) { return this.pushStack(ft(this, e, !1)) }, filter: function (e) { return this.pushStack(ft(this, e, !0)) }, is: function (e) { return !!e && ("string" == typeof e ? lt.test(e) ? b(e, this.context).index(this[0]) >= 0 : b.filter(e, this).length > 0 : this.filter(e).length > 0) }, closest: function (e, t) { var n, r = 0, i = this.length, o = [], a = lt.test(e) || "string" != typeof e ? b(e, t || this.context) : 0; for (; i > r; r++) { n = this[r]; while (n && n.ownerDocument && n !== t && 11 !== n.nodeType) { if (a ? a.index(n) > -1 : b.find.matchesSelector(n, e)) { o.push(n); break } n = n.parentNode } } return this.pushStack(o.length > 1 ? b.unique(o) : o) }, index: function (e) { return e ? "string" == typeof e ? b.inArray(this[0], b(e)) : b.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (e, t) { var n = "string" == typeof e ? b(e, t) : b.makeArray(e && e.nodeType ? [e] : e), r = b.merge(this.get(), n); return this.pushStack(b.unique(r)) }, addBack: function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) } }), b.fn.andSelf = b.fn.addBack; function pt(e, t) { do e = e[t]; while (e && 1 !== e.nodeType); return e } b.each({ parent: function (e) { var t = e.parentNode; return t && 11 !== t.nodeType ? t : null }, parents: function (e) { return b.dir(e, "parentNode") }, parentsUntil: function (e, t, n) { return b.dir(e, "parentNode", n) }, next: function (e) { return pt(e, "nextSibling") }, prev: function (e) { return pt(e, "previousSibling") }, nextAll: function (e) { return b.dir(e, "nextSibling") }, prevAll: function (e) { return b.dir(e, "previousSibling") }, nextUntil: function (e, t, n) { return b.dir(e, "nextSibling", n) }, prevUntil: function (e, t, n) { return b.dir(e, "previousSibling", n) }, siblings: function (e) { return b.sibling((e.parentNode || {}).firstChild, e) }, children: function (e) { return b.sibling(e.firstChild) }, contents: function (e) { return b.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : b.merge([], e.childNodes) } }, function (e, t) { b.fn[e] = function (n, r) { var i = b.map(this, t, n); return at.test(e) || (r = n), r && "string" == typeof r && (i = b.filter(r, i)), i = this.length > 1 && !ct[e] ? b.unique(i) : i, this.length > 1 && st.test(e) && (i = i.reverse()), this.pushStack(i) } }), b.extend({ filter: function (e, t, n) { return n && (e = ":not(" + e + ")"), 1 === t.length ? b.find.matchesSelector(t[0], e) ? [t[0]] : [] : b.find.matches(e, t) }, dir: function (e, n, r) { var i = [], o = e[n]; while (o && 9 !== o.nodeType && (r === t || 1 !== o.nodeType || !b(o).is(r))) 1 === o.nodeType && i.push(o), o = o[n]; return i }, sibling: function (e, t) { var n = []; for (; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e); return n } }); function ft(e, t, n) { if (t = t || 0, b.isFunction(t)) return b.grep(e, function (e, r) { var i = !!t.call(e, r, e); return i === n }); if (t.nodeType) return b.grep(e, function (e) { return e === t === n }); if ("string" == typeof t) { var r = b.grep(e, function (e) { return 1 === e.nodeType }); if (ut.test(t)) return b.filter(t, r, !n); t = b.filter(t, r) } return b.grep(e, function (e) { return b.inArray(e, t) >= 0 === n }) } function dt(e) { var t = ht.split("|"), n = e.createDocumentFragment(); if (n.createElement) while (t.length) n.createElement(t.pop()); return n } var ht = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", gt = / jQuery\d+="(?:null|\d+)"/g, mt = RegExp("<(?:" + ht + ")[\\s/>]", "i"), yt = /^\s+/, vt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, bt = /<([\w:]+)/, xt = /<tbody/i, wt = /<|&#?\w+;/, Tt = /<(?:script|style|link)/i, Nt = /^(?:checkbox|radio)$/i, Ct = /checked\s*(?:[^=]|=\s*.checked.)/i, kt = /^$|\/(?:java|ecma)script/i, Et = /^true\/(.*)/, St = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, At = { option: [1, "<select multiple='multiple'>", "</select>"], legend: [1, "<fieldset>", "</fieldset>"], area: [1, "<map>", "</map>"], param: [1, "<object>", "</object>"], thead: [1, "<table>", "</table>"], tr: [2, "<table><tbody>", "</tbody></table>"], col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], _default: b.support.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"] }, jt = dt(o), Dt = jt.appendChild(o.createElement("div")); At.optgroup = At.option, At.tbody = At.tfoot = At.colgroup = At.caption = At.thead, At.th = At.td, b.fn.extend({ text: function (e) { return b.access(this, function (e) { return e === t ? b.text(this) : this.empty().append((this[0] && this[0].ownerDocument || o).createTextNode(e)) }, null, e, arguments.length) }, wrapAll: function (e) { if (b.isFunction(e)) return this.each(function (t) { b(this).wrapAll(e.call(this, t)) }); if (this[0]) { var t = b(e, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && t.insertBefore(this[0]), t.map(function () { var e = this; while (e.firstChild && 1 === e.firstChild.nodeType) e = e.firstChild; return e }).append(this) } return this }, wrapInner: function (e) { return b.isFunction(e) ? this.each(function (t) { b(this).wrapInner(e.call(this, t)) }) : this.each(function () { var t = b(this), n = t.contents(); n.length ? n.wrapAll(e) : t.append(e) }) }, wrap: function (e) { var t = b.isFunction(e); return this.each(function (n) { b(this).wrapAll(t ? e.call(this, n) : e) }) }, unwrap: function () { return this.parent().each(function () { b.nodeName(this, "body") || b(this).replaceWith(this.childNodes) }).end() }, append: function () { return this.domManip(arguments, !0, function (e) { (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) && this.appendChild(e) }) }, prepend: function () { return this.domManip(arguments, !0, function (e) { (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) && this.insertBefore(e, this.firstChild) }) }, before: function () { return this.domManip(arguments, !1, function (e) { this.parentNode && this.parentNode.insertBefore(e, this) }) }, after: function () { return this.domManip(arguments, !1, function (e) { this.parentNode && this.parentNode.insertBefore(e, this.nextSibling) }) }, remove: function (e, t) { var n, r = 0; for (; null != (n = this[r]); r++) (!e || b.filter(e, [n]).length > 0) && (t || 1 !== n.nodeType || b.cleanData(Ot(n)), n.parentNode && (t && b.contains(n.ownerDocument, n) && Mt(Ot(n, "script")), n.parentNode.removeChild(n))); return this }, empty: function () { var e, t = 0; for (; null != (e = this[t]); t++) { 1 === e.nodeType && b.cleanData(Ot(e, !1)); while (e.firstChild) e.removeChild(e.firstChild); e.options && b.nodeName(e, "select") && (e.options.length = 0) } return this }, clone: function (e, t) { return e = null == e ? !1 : e, t = null == t ? e : t, this.map(function () { return b.clone(this, e, t) }) }, html: function (e) { return b.access(this, function (e) { var n = this[0] || {}, r = 0, i = this.length; if (e === t) return 1 === n.nodeType ? n.innerHTML.replace(gt, "") : t; if (!("string" != typeof e || Tt.test(e) || !b.support.htmlSerialize && mt.test(e) || !b.support.leadingWhitespace && yt.test(e) || At[(bt.exec(e) || ["", ""])[1].toLowerCase()])) { e = e.replace(vt, "<$1></$2>"); try { for (; i > r; r++) n = this[r] || {}, 1 === n.nodeType && (b.cleanData(Ot(n, !1)), n.innerHTML = e); n = 0 } catch (o) { } } n && this.empty().append(e) }, null, e, arguments.length) }, replaceWith: function (e) { var t = b.isFunction(e); return t || "string" == typeof e || (e = b(e).not(this).detach()), this.domManip([e], !0, function (e) { var t = this.nextSibling, n = this.parentNode; n && (b(this).remove(), n.insertBefore(e, t)) }) }, detach: function (e) { return this.remove(e, !0) }, domManip: function (e, n, r) { e = f.apply([], e); var i, o, a, s, u, l, c = 0, p = this.length, d = this, h = p - 1, g = e[0], m = b.isFunction(g); if (m || !(1 >= p || "string" != typeof g || b.support.checkClone) && Ct.test(g)) return this.each(function (i) { var o = d.eq(i); m && (e[0] = g.call(this, i, n ? o.html() : t)), o.domManip(e, n, r) }); if (p && (l = b.buildFragment(e, this[0].ownerDocument, !1, this), i = l.firstChild, 1 === l.childNodes.length && (l = i), i)) { for (n = n && b.nodeName(i, "tr"), s = b.map(Ot(l, "script"), Ht), a = s.length; p > c; c++) o = l, c !== h && (o = b.clone(o, !0, !0), a && b.merge(s, Ot(o, "script"))), r.call(n && b.nodeName(this[c], "table") ? Lt(this[c], "tbody") : this[c], o, c); if (a) for (u = s[s.length - 1].ownerDocument, b.map(s, qt), c = 0; a > c; c++) o = s[c], kt.test(o.type || "") && !b._data(o, "globalEval") && b.contains(u, o) && (o.src ? b.ajax({ url: o.src, type: "GET", dataType: "script", async: !1, global: !1, "throws": !0 }) : b.globalEval((o.text || o.textContent || o.innerHTML || "").replace(St, ""))); l = i = null } return this } }); function Lt(e, t) { return e.getElementsByTagName(t)[0] || e.appendChild(e.ownerDocument.createElement(t)) } function Ht(e) { var t = e.getAttributeNode("type"); return e.type = (t && t.specified) + "/" + e.type, e } function qt(e) { var t = Et.exec(e.type); return t ? e.type = t[1] : e.removeAttribute("type"), e } function Mt(e, t) { var n, r = 0; for (; null != (n = e[r]); r++) b._data(n, "globalEval", !t || b._data(t[r], "globalEval")) } function _t(e, t) { if (1 === t.nodeType && b.hasData(e)) { var n, r, i, o = b._data(e), a = b._data(t, o), s = o.events; if (s) { delete a.handle, a.events = {}; for (n in s) for (r = 0, i = s[n].length; i > r; r++) b.event.add(t, n, s[n][r]) } a.data && (a.data = b.extend({}, a.data)) } } function Ft(e, t) { var n, r, i; if (1 === t.nodeType) { if (n = t.nodeName.toLowerCase(), !b.support.noCloneEvent && t[b.expando]) { i = b._data(t); for (r in i.events) b.removeEvent(t, r, i.handle); t.removeAttribute(b.expando) } "script" === n && t.text !== e.text ? (Ht(t).text = e.text, qt(t)) : "object" === n ? (t.parentNode && (t.outerHTML = e.outerHTML), b.support.html5Clone && e.innerHTML && !b.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : "input" === n && Nt.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : "option" === n ? t.defaultSelected = t.selected = e.defaultSelected : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue) } } b.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (e, t) { b.fn[e] = function (e) { var n, r = 0, i = [], o = b(e), a = o.length - 1; for (; a >= r; r++) n = r === a ? this : this.clone(!0), b(o[r])[t](n), d.apply(i, n.get()); return this.pushStack(i) } }); function Ot(e, n) { var r, o, a = 0, s = typeof e.getElementsByTagName !== i ? e.getElementsByTagName(n || "*") : typeof e.querySelectorAll !== i ? e.querySelectorAll(n || "*") : t; if (!s) for (s = [], r = e.childNodes || e; null != (o = r[a]); a++) !n || b.nodeName(o, n) ? s.push(o) : b.merge(s, Ot(o, n)); return n === t || n && b.nodeName(e, n) ? b.merge([e], s) : s } function Bt(e) { Nt.test(e.type) && (e.defaultChecked = e.checked) } b.extend({ clone: function (e, t, n) { var r, i, o, a, s, u = b.contains(e.ownerDocument, e); if (b.support.html5Clone || b.isXMLDoc(e) || !mt.test("<" + e.nodeName + ">") ? o = e.cloneNode(!0) : (Dt.innerHTML = e.outerHTML, Dt.removeChild(o = Dt.firstChild)), !(b.support.noCloneEvent && b.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || b.isXMLDoc(e))) for (r = Ot(o), s = Ot(e), a = 0; null != (i = s[a]); ++a) r[a] && Ft(i, r[a]); if (t) if (n) for (s = s || Ot(e), r = r || Ot(o), a = 0; null != (i = s[a]); a++) _t(i, r[a]); else _t(e, o); return r = Ot(o, "script"), r.length > 0 && Mt(r, !u && Ot(e, "script")), r = s = i = null, o }, buildFragment: function (e, t, n, r) {
|
13 |
+
var i, o, a, s, u, l, c, p = e.length, f = dt(t), d = [], h = 0; for (; p > h; h++) if (o = e[h], o || 0 === o) if ("object" === b.type(o)) b.merge(d, o.nodeType ? [o] : o); else if (wt.test(o)) {
|
14 |
+
s = s || f.appendChild(t.createElement("div")), u = (bt.exec(o) || ["", ""])[1].toLowerCase(), c = At[u] || At._default, s.innerHTML = c[1] + o.replace(vt, "<$1></$2>") + c[2], i = c[0]; while (i--) s = s.lastChild; if (!b.support.leadingWhitespace && yt.test(o) && d.push(t.createTextNode(yt.exec(o)[0])), !b.support.tbody) {
|
15 |
+
o = "table" !== u || xt.test(o) ? "<table>" !== c[1] || xt.test(o) ? 0 : s : s.firstChild, i = o && o.childNodes.length; while (i--) b.nodeName(l = o.childNodes[i], "tbody") && !l.childNodes.length && o.removeChild(l)
|
16 |
+
} b.merge(d, s.childNodes), s.textContent = ""; while (s.firstChild) s.removeChild(s.firstChild); s = f.lastChild
|
17 |
+
} else d.push(t.createTextNode(o)); s && f.removeChild(s), b.support.appendChecked || b.grep(Ot(d, "input"), Bt), h = 0; while (o = d[h++]) if ((!r || -1 === b.inArray(o, r)) && (a = b.contains(o.ownerDocument, o), s = Ot(f.appendChild(o), "script"), a && Mt(s), n)) { i = 0; while (o = s[i++]) kt.test(o.type || "") && n.push(o) } return s = null, f
|
18 |
+
}, cleanData: function (e, t) { var n, r, o, a, s = 0, u = b.expando, l = b.cache, p = b.support.deleteExpando, f = b.event.special; for (; null != (n = e[s]); s++) if ((t || b.acceptData(n)) && (o = n[u], a = o && l[o])) { if (a.events) for (r in a.events) f[r] ? b.event.remove(n, r) : b.removeEvent(n, r, a.handle); l[o] && (delete l[o], p ? delete n[u] : typeof n.removeAttribute !== i ? n.removeAttribute(u) : n[u] = null, c.push(o)) } }
|
19 |
+
}); var Pt, Rt, Wt, $t = /alpha\([^)]*\)/i, It = /opacity\s*=\s*([^)]*)/, zt = /^(top|right|bottom|left)$/, Xt = /^(none|table(?!-c[ea]).+)/, Ut = /^margin/, Vt = RegExp("^(" + x + ")(.*)$", "i"), Yt = RegExp("^(" + x + ")(?!px)[a-z%]+$", "i"), Jt = RegExp("^([+-])=(" + x + ")", "i"), Gt = { BODY: "block" }, Qt = { position: "absolute", visibility: "hidden", display: "block" }, Kt = { letterSpacing: 0, fontWeight: 400 }, Zt = ["Top", "Right", "Bottom", "Left"], en = ["Webkit", "O", "Moz", "ms"]; function tn(e, t) { if (t in e) return t; var n = t.charAt(0).toUpperCase() + t.slice(1), r = t, i = en.length; while (i--) if (t = en[i] + n, t in e) return t; return r } function nn(e, t) { return e = t || e, "none" === b.css(e, "display") || !b.contains(e.ownerDocument, e) } function rn(e, t) { var n, r, i, o = [], a = 0, s = e.length; for (; s > a; a++) r = e[a], r.style && (o[a] = b._data(r, "olddisplay"), n = r.style.display, t ? (o[a] || "none" !== n || (r.style.display = ""), "" === r.style.display && nn(r) && (o[a] = b._data(r, "olddisplay", un(r.nodeName)))) : o[a] || (i = nn(r), (n && "none" !== n || !i) && b._data(r, "olddisplay", i ? n : b.css(r, "display")))); for (a = 0; s > a; a++) r = e[a], r.style && (t && "none" !== r.style.display && "" !== r.style.display || (r.style.display = t ? o[a] || "" : "none")); return e } b.fn.extend({ css: function (e, n) { return b.access(this, function (e, n, r) { var i, o, a = {}, s = 0; if (b.isArray(n)) { for (o = Rt(e), i = n.length; i > s; s++) a[n[s]] = b.css(e, n[s], !1, o); return a } return r !== t ? b.style(e, n, r) : b.css(e, n) }, e, n, arguments.length > 1) }, show: function () { return rn(this, !0) }, hide: function () { return rn(this) }, toggle: function (e) { var t = "boolean" == typeof e; return this.each(function () { (t ? e : nn(this)) ? b(this).show() : b(this).hide() }) } }), b.extend({ cssHooks: { opacity: { get: function (e, t) { if (t) { var n = Wt(e, "opacity"); return "" === n ? "1" : n } } } }, cssNumber: { columnCount: !0, fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": b.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (e, n, r, i) { if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) { var o, a, s, u = b.camelCase(n), l = e.style; if (n = b.cssProps[u] || (b.cssProps[u] = tn(l, u)), s = b.cssHooks[n] || b.cssHooks[u], r === t) return s && "get" in s && (o = s.get(e, !1, i)) !== t ? o : l[n]; if (a = typeof r, "string" === a && (o = Jt.exec(r)) && (r = (o[1] + 1) * o[2] + parseFloat(b.css(e, n)), a = "number"), !(null == r || "number" === a && isNaN(r) || ("number" !== a || b.cssNumber[u] || (r += "px"), b.support.clearCloneStyle || "" !== r || 0 !== n.indexOf("background") || (l[n] = "inherit"), s && "set" in s && (r = s.set(e, r, i)) === t))) try { l[n] = r } catch (c) { } } }, css: function (e, n, r, i) { var o, a, s, u = b.camelCase(n); return n = b.cssProps[u] || (b.cssProps[u] = tn(e.style, u)), s = b.cssHooks[n] || b.cssHooks[u], s && "get" in s && (a = s.get(e, !0, r)), a === t && (a = Wt(e, n, i)), "normal" === a && n in Kt && (a = Kt[n]), "" === r || r ? (o = parseFloat(a), r === !0 || b.isNumeric(o) ? o || 0 : a) : a }, swap: function (e, t, n, r) { var i, o, a = {}; for (o in t) a[o] = e.style[o], e.style[o] = t[o]; i = n.apply(e, r || []); for (o in t) e.style[o] = a[o]; return i } }), e.getComputedStyle ? (Rt = function (t) { return e.getComputedStyle(t, null) }, Wt = function (e, n, r) { var i, o, a, s = r || Rt(e), u = s ? s.getPropertyValue(n) || s[n] : t, l = e.style; return s && ("" !== u || b.contains(e.ownerDocument, e) || (u = b.style(e, n)), Yt.test(u) && Ut.test(n) && (i = l.width, o = l.minWidth, a = l.maxWidth, l.minWidth = l.maxWidth = l.width = u, u = s.width, l.width = i, l.minWidth = o, l.maxWidth = a)), u }) : o.documentElement.currentStyle && (Rt = function (e) { return e.currentStyle }, Wt = function (e, n, r) { var i, o, a, s = r || Rt(e), u = s ? s[n] : t, l = e.style; return null == u && l && l[n] && (u = l[n]), Yt.test(u) && !zt.test(n) && (i = l.left, o = e.runtimeStyle, a = o && o.left, a && (o.left = e.currentStyle.left), l.left = "fontSize" === n ? "1em" : u, u = l.pixelLeft + "px", l.left = i, a && (o.left = a)), "" === u ? "auto" : u }); function on(e, t, n) { var r = Vt.exec(t); return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : t } function an(e, t, n, r, i) { var o = n === (r ? "border" : "content") ? 4 : "width" === t ? 1 : 0, a = 0; for (; 4 > o; o += 2) "margin" === n && (a += b.css(e, n + Zt[o], !0, i)), r ? ("content" === n && (a -= b.css(e, "padding" + Zt[o], !0, i)), "margin" !== n && (a -= b.css(e, "border" + Zt[o] + "Width", !0, i))) : (a += b.css(e, "padding" + Zt[o], !0, i), "padding" !== n && (a += b.css(e, "border" + Zt[o] + "Width", !0, i))); return a } function sn(e, t, n) { var r = !0, i = "width" === t ? e.offsetWidth : e.offsetHeight, o = Rt(e), a = b.support.boxSizing && "border-box" === b.css(e, "boxSizing", !1, o); if (0 >= i || null == i) { if (i = Wt(e, t, o), (0 > i || null == i) && (i = e.style[t]), Yt.test(i)) return i; r = a && (b.support.boxSizingReliable || i === e.style[t]), i = parseFloat(i) || 0 } return i + an(e, t, n || (a ? "border" : "content"), r, o) + "px" } function un(e) { var t = o, n = Gt[e]; return n || (n = ln(e, t), "none" !== n && n || (Pt = (Pt || b("<iframe frameborder='0' width='0' height='0'/>").css("cssText", "display:block !important")).appendTo(t.documentElement), t = (Pt[0].contentWindow || Pt[0].contentDocument).document, t.write("<!doctype html><html><body>"), t.close(), n = ln(e, t), Pt.detach()), Gt[e] = n), n } function ln(e, t) { var n = b(t.createElement(e)).appendTo(t.body), r = b.css(n[0], "display"); return n.remove(), r } b.each(["height", "width"], function (e, n) { b.cssHooks[n] = { get: function (e, r, i) { return r ? 0 === e.offsetWidth && Xt.test(b.css(e, "display")) ? b.swap(e, Qt, function () { return sn(e, n, i) }) : sn(e, n, i) : t }, set: function (e, t, r) { var i = r && Rt(e); return on(e, t, r ? an(e, n, r, b.support.boxSizing && "border-box" === b.css(e, "boxSizing", !1, i), i) : 0) } } }), b.support.opacity || (b.cssHooks.opacity = { get: function (e, t) { return It.test((t && e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : t ? "1" : "" }, set: function (e, t) { var n = e.style, r = e.currentStyle, i = b.isNumeric(t) ? "alpha(opacity=" + 100 * t + ")" : "", o = r && r.filter || n.filter || ""; n.zoom = 1, (t >= 1 || "" === t) && "" === b.trim(o.replace($t, "")) && n.removeAttribute && (n.removeAttribute("filter"), "" === t || r && !r.filter) || (n.filter = $t.test(o) ? o.replace($t, i) : o + " " + i) } }), b(function () { b.support.reliableMarginRight || (b.cssHooks.marginRight = { get: function (e, n) { return n ? b.swap(e, { display: "inline-block" }, Wt, [e, "marginRight"]) : t } }), !b.support.pixelPosition && b.fn.position && b.each(["top", "left"], function (e, n) { b.cssHooks[n] = { get: function (e, r) { return r ? (r = Wt(e, n), Yt.test(r) ? b(e).position()[n] + "px" : r) : t } } }) }), b.expr && b.expr.filters && (b.expr.filters.hidden = function (e) { return 0 >= e.offsetWidth && 0 >= e.offsetHeight || !b.support.reliableHiddenOffsets && "none" === (e.style && e.style.display || b.css(e, "display")) }, b.expr.filters.visible = function (e) { return !b.expr.filters.hidden(e) }), b.each({ margin: "", padding: "", border: "Width" }, function (e, t) { b.cssHooks[e + t] = { expand: function (n) { var r = 0, i = {}, o = "string" == typeof n ? n.split(" ") : [n]; for (; 4 > r; r++) i[e + Zt[r] + t] = o[r] || o[r - 2] || o[0]; return i } }, Ut.test(e) || (b.cssHooks[e + t].set = on) }); var cn = /%20/g, pn = /\[\]$/, fn = /\r?\n/g, dn = /^(?:submit|button|image|reset|file)$/i, hn = /^(?:input|select|textarea|keygen)/i; b.fn.extend({ serialize: function () { return b.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { var e = b.prop(this, "elements"); return e ? b.makeArray(e) : this }).filter(function () { var e = this.type; return this.name && !b(this).is(":disabled") && hn.test(this.nodeName) && !dn.test(e) && (this.checked || !Nt.test(e)) }).map(function (e, t) { var n = b(this).val(); return null == n ? null : b.isArray(n) ? b.map(n, function (e) { return { name: t.name, value: e.replace(fn, "\r\n")} }) : { name: t.name, value: n.replace(fn, "\r\n")} }).get() } }), b.param = function (e, n) { var r, i = [], o = function (e, t) { t = b.isFunction(t) ? t() : null == t ? "" : t, i[i.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t) }; if (n === t && (n = b.ajaxSettings && b.ajaxSettings.traditional), b.isArray(e) || e.jquery && !b.isPlainObject(e)) b.each(e, function () { o(this.name, this.value) }); else for (r in e) gn(r, e[r], n, o); return i.join("&").replace(cn, "+") }; function gn(e, t, n, r) { var i; if (b.isArray(t)) b.each(t, function (t, i) { n || pn.test(e) ? r(e, i) : gn(e + "[" + ("object" == typeof i ? t : "") + "]", i, n, r) }); else if (n || "object" !== b.type(t)) r(e, t); else for (i in t) gn(e + "[" + i + "]", t[i], n, r) } b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (e, t) { b.fn[t] = function (e, n) { return arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t) } }), b.fn.hover = function (e, t) { return this.mouseenter(e).mouseleave(t || e) }; var mn, yn, vn = b.now(), bn = /\?/, xn = /#.*$/, wn = /([?&])_=[^&]*/, Tn = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, Nn = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, Cn = /^(?:GET|HEAD)$/, kn = /^\/\//, En = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, Sn = b.fn.load, An = {}, jn = {}, Dn = "*/".concat("*"); try { yn = a.href } catch (Ln) { yn = o.createElement("a"), yn.href = "", yn = yn.href } mn = En.exec(yn.toLowerCase()) || []; function Hn(e) { return function (t, n) { "string" != typeof t && (n = t, t = "*"); var r, i = 0, o = t.toLowerCase().match(w) || []; if (b.isFunction(n)) while (r = o[i++]) "+" === r[0] ? (r = r.slice(1) || "*", (e[r] = e[r] || []).unshift(n)) : (e[r] = e[r] || []).push(n) } } function qn(e, n, r, i) { var o = {}, a = e === jn; function s(u) { var l; return o[u] = !0, b.each(e[u] || [], function (e, u) { var c = u(n, r, i); return "string" != typeof c || a || o[c] ? a ? !(l = c) : t : (n.dataTypes.unshift(c), s(c), !1) }), l } return s(n.dataTypes[0]) || !o["*"] && s("*") } function Mn(e, n) { var r, i, o = b.ajaxSettings.flatOptions || {}; for (i in n) n[i] !== t && ((o[i] ? e : r || (r = {}))[i] = n[i]); return r && b.extend(!0, e, r), e } b.fn.load = function (e, n, r) { if ("string" != typeof e && Sn) return Sn.apply(this, arguments); var i, o, a, s = this, u = e.indexOf(" "); return u >= 0 && (i = e.slice(u, e.length), e = e.slice(0, u)), b.isFunction(n) ? (r = n, n = t) : n && "object" == typeof n && (a = "POST"), s.length > 0 && b.ajax({ url: e, type: a, dataType: "html", data: n }).done(function (e) { o = arguments, s.html(i ? b("<div>").append(b.parseHTML(e)).find(i) : e) }).complete(r && function (e, t) { s.each(r, o || [e.responseText, t, e]) }), this }, b.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (e, t) { b.fn[t] = function (e) { return this.on(t, e) } }), b.each(["get", "post"], function (e, n) { b[n] = function (e, r, i, o) { return b.isFunction(r) && (o = o || i, i = r, r = t), b.ajax({ url: e, type: n, dataType: o, data: r, success: i }) } }), b.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: yn, type: "GET", isLocal: Nn.test(mn[1]), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: { "*": Dn, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, converters: { "* text": e.String, "text html": !0, "text json": b.parseJSON, "text xml": b.parseXML }, flatOptions: { url: !0, context: !0} }, ajaxSetup: function (e, t) { return t ? Mn(Mn(e, b.ajaxSettings), t) : Mn(b.ajaxSettings, e) }, ajaxPrefilter: Hn(An), ajaxTransport: Hn(jn), ajax: function (e, n) { "object" == typeof e && (n = e, e = t), n = n || {}; var r, i, o, a, s, u, l, c, p = b.ajaxSetup({}, n), f = p.context || p, d = p.context && (f.nodeType || f.jquery) ? b(f) : b.event, h = b.Deferred(), g = b.Callbacks("once memory"), m = p.statusCode || {}, y = {}, v = {}, x = 0, T = "canceled", N = { readyState: 0, getResponseHeader: function (e) { var t; if (2 === x) { if (!c) { c = {}; while (t = Tn.exec(a)) c[t[1].toLowerCase()] = t[2] } t = c[e.toLowerCase()] } return null == t ? null : t }, getAllResponseHeaders: function () { return 2 === x ? a : null }, setRequestHeader: function (e, t) { var n = e.toLowerCase(); return x || (e = v[n] = v[n] || e, y[e] = t), this }, overrideMimeType: function (e) { return x || (p.mimeType = e), this }, statusCode: function (e) { var t; if (e) if (2 > x) for (t in e) m[t] = [m[t], e[t]]; else N.always(e[N.status]); return this }, abort: function (e) { var t = e || T; return l && l.abort(t), k(0, t), this } }; if (h.promise(N).complete = g.add, N.success = N.done, N.error = N.fail, p.url = ((e || p.url || yn) + "").replace(xn, "").replace(kn, mn[1] + "//"), p.type = n.method || n.type || p.method || p.type, p.dataTypes = b.trim(p.dataType || "*").toLowerCase().match(w) || [""], null == p.crossDomain && (r = En.exec(p.url.toLowerCase()), p.crossDomain = !(!r || r[1] === mn[1] && r[2] === mn[2] && (r[3] || ("http:" === r[1] ? 80 : 443)) == (mn[3] || ("http:" === mn[1] ? 80 : 443)))), p.data && p.processData && "string" != typeof p.data && (p.data = b.param(p.data, p.traditional)), qn(An, p, n, N), 2 === x) return N; u = p.global, u && 0 === b.active++ && b.event.trigger("ajaxStart"), p.type = p.type.toUpperCase(), p.hasContent = !Cn.test(p.type), o = p.url, p.hasContent || (p.data && (o = p.url += (bn.test(o) ? "&" : "?") + p.data, delete p.data), p.cache === !1 && (p.url = wn.test(o) ? o.replace(wn, "$1_=" + vn++) : o + (bn.test(o) ? "&" : "?") + "_=" + vn++)), p.ifModified && (b.lastModified[o] && N.setRequestHeader("If-Modified-Since", b.lastModified[o]), b.etag[o] && N.setRequestHeader("If-None-Match", b.etag[o])), (p.data && p.hasContent && p.contentType !== !1 || n.contentType) && N.setRequestHeader("Content-Type", p.contentType), N.setRequestHeader("Accept", p.dataTypes[0] && p.accepts[p.dataTypes[0]] ? p.accepts[p.dataTypes[0]] + ("*" !== p.dataTypes[0] ? ", " + Dn + "; q=0.01" : "") : p.accepts["*"]); for (i in p.headers) N.setRequestHeader(i, p.headers[i]); if (p.beforeSend && (p.beforeSend.call(f, N, p) === !1 || 2 === x)) return N.abort(); T = "abort"; for (i in { success: 1, error: 1, complete: 1 }) N[i](p[i]); if (l = qn(jn, p, n, N)) { N.readyState = 1, u && d.trigger("ajaxSend", [N, p]), p.async && p.timeout > 0 && (s = setTimeout(function () { N.abort("timeout") }, p.timeout)); try { x = 1, l.send(y, k) } catch (C) { if (!(2 > x)) throw C; k(-1, C) } } else k(-1, "No Transport"); function k(e, n, r, i) { var c, y, v, w, T, C = n; 2 !== x && (x = 2, s && clearTimeout(s), l = t, a = i || "", N.readyState = e > 0 ? 4 : 0, r && (w = _n(p, N, r)), e >= 200 && 300 > e || 304 === e ? (p.ifModified && (T = N.getResponseHeader("Last-Modified"), T && (b.lastModified[o] = T), T = N.getResponseHeader("etag"), T && (b.etag[o] = T)), 204 === e ? (c = !0, C = "nocontent") : 304 === e ? (c = !0, C = "notmodified") : (c = Fn(p, w), C = c.state, y = c.data, v = c.error, c = !v)) : (v = C, (e || !C) && (C = "error", 0 > e && (e = 0))), N.status = e, N.statusText = (n || C) + "", c ? h.resolveWith(f, [y, C, N]) : h.rejectWith(f, [N, C, v]), N.statusCode(m), m = t, u && d.trigger(c ? "ajaxSuccess" : "ajaxError", [N, p, c ? y : v]), g.fireWith(f, [N, C]), u && (d.trigger("ajaxComplete", [N, p]), --b.active || b.event.trigger("ajaxStop"))) } return N }, getScript: function (e, n) { return b.get(e, t, n, "script") }, getJSON: function (e, t, n) { return b.get(e, t, n, "json") } }); function _n(e, n, r) { var i, o, a, s, u = e.contents, l = e.dataTypes, c = e.responseFields; for (s in c) s in r && (n[c[s]] = r[s]); while ("*" === l[0]) l.shift(), o === t && (o = e.mimeType || n.getResponseHeader("Content-Type")); if (o) for (s in u) if (u[s] && u[s].test(o)) { l.unshift(s); break } if (l[0] in r) a = l[0]; else { for (s in r) { if (!l[0] || e.converters[s + " " + l[0]]) { a = s; break } i || (i = s) } a = a || i } return a ? (a !== l[0] && l.unshift(a), r[a]) : t } function Fn(e, t) { var n, r, i, o, a = {}, s = 0, u = e.dataTypes.slice(), l = u[0]; if (e.dataFilter && (t = e.dataFilter(t, e.dataType)), u[1]) for (i in e.converters) a[i.toLowerCase()] = e.converters[i]; for (; r = u[++s]; ) if ("*" !== r) { if ("*" !== l && l !== r) { if (i = a[l + " " + r] || a["* " + r], !i) for (n in a) if (o = n.split(" "), o[1] === r && (i = a[l + " " + o[0]] || a["* " + o[0]])) { i === !0 ? i = a[n] : a[n] !== !0 && (r = o[0], u.splice(s--, 0, r)); break } if (i !== !0) if (i && e["throws"]) t = i(t); else try { t = i(t) } catch (c) { return { state: "parsererror", error: i ? c : "No conversion from " + l + " to " + r} } } l = r } return { state: "success", data: t} } b.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function (e) { return b.globalEval(e), e } } }), b.ajaxPrefilter("script", function (e) { e.cache === t && (e.cache = !1), e.crossDomain && (e.type = "GET", e.global = !1) }), b.ajaxTransport("script", function (e) { if (e.crossDomain) { var n, r = o.head || b("head")[0] || o.documentElement; return { send: function (t, i) { n = o.createElement("script"), n.async = !0, e.scriptCharset && (n.charset = e.scriptCharset), n.src = e.url, n.onload = n.onreadystatechange = function (e, t) { (t || !n.readyState || /loaded|complete/.test(n.readyState)) && (n.onload = n.onreadystatechange = null, n.parentNode && n.parentNode.removeChild(n), n = null, t || i(200, "success")) }, r.insertBefore(n, r.firstChild) }, abort: function () { n && n.onload(t, !0) } } } }); var On = [], Bn = /(=)\?(?=&|$)|\?\?/; b.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var e = On.pop() || b.expando + "_" + vn++; return this[e] = !0, e } }), b.ajaxPrefilter("json jsonp", function (n, r, i) { var o, a, s, u = n.jsonp !== !1 && (Bn.test(n.url) ? "url" : "string" == typeof n.data && !(n.contentType || "").indexOf("application/x-www-form-urlencoded") && Bn.test(n.data) && "data"); return u || "jsonp" === n.dataTypes[0] ? (o = n.jsonpCallback = b.isFunction(n.jsonpCallback) ? n.jsonpCallback() : n.jsonpCallback, u ? n[u] = n[u].replace(Bn, "$1" + o) : n.jsonp !== !1 && (n.url += (bn.test(n.url) ? "&" : "?") + n.jsonp + "=" + o), n.converters["script json"] = function () { return s || b.error(o + " was not called"), s[0] }, n.dataTypes[0] = "json", a = e[o], e[o] = function () { s = arguments }, i.always(function () { e[o] = a, n[o] && (n.jsonpCallback = r.jsonpCallback, On.push(o)), s && b.isFunction(a) && a(s[0]), s = a = t }), "script") : t }); var Pn, Rn, Wn = 0, $n = e.ActiveXObject && function () { var e; for (e in Pn) Pn[e](t, !0) }; function In() { try { return new e.XMLHttpRequest } catch (t) { } } function zn() { try { return new e.ActiveXObject("Microsoft.XMLHTTP") } catch (t) { } } b.ajaxSettings.xhr = e.ActiveXObject ? function () { return !this.isLocal && In() || zn() } : In, Rn = b.ajaxSettings.xhr(), b.support.cors = !!Rn && "withCredentials" in Rn, Rn = b.support.ajax = !!Rn, Rn && b.ajaxTransport(function (n) { if (!n.crossDomain || b.support.cors) { var r; return { send: function (i, o) { var a, s, u = n.xhr(); if (n.username ? u.open(n.type, n.url, n.async, n.username, n.password) : u.open(n.type, n.url, n.async), n.xhrFields) for (s in n.xhrFields) u[s] = n.xhrFields[s]; n.mimeType && u.overrideMimeType && u.overrideMimeType(n.mimeType), n.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest"); try { for (s in i) u.setRequestHeader(s, i[s]) } catch (l) { } u.send(n.hasContent && n.data || null), r = function (e, i) { var s, l, c, p; try { if (r && (i || 4 === u.readyState)) if (r = t, a && (u.onreadystatechange = b.noop, $n && delete Pn[a]), i) 4 !== u.readyState && u.abort(); else { p = {}, s = u.status, l = u.getAllResponseHeaders(), "string" == typeof u.responseText && (p.text = u.responseText); try { c = u.statusText } catch (f) { c = "" } s || !n.isLocal || n.crossDomain ? 1223 === s && (s = 204) : s = p.text ? 200 : 404 } } catch (d) { i || o(-1, d) } p && o(s, c, p, l) }, n.async ? 4 === u.readyState ? setTimeout(r) : (a = ++Wn, $n && (Pn || (Pn = {}, b(e).unload($n)), Pn[a] = r), u.onreadystatechange = r) : r() }, abort: function () { r && r(t, !0) } } } }); var Xn, Un, Vn = /^(?:toggle|show|hide)$/, Yn = RegExp("^(?:([+-])=|)(" + x + ")([a-z%]*)$", "i"), Jn = /queueHooks$/, Gn = [nr], Qn = { "*": [function (e, t) { var n, r, i = this.createTween(e, t), o = Yn.exec(t), a = i.cur(), s = +a || 0, u = 1, l = 20; if (o) { if (n = +o[2], r = o[3] || (b.cssNumber[e] ? "" : "px"), "px" !== r && s) { s = b.css(i.elem, e, !0) || n || 1; do u = u || ".5", s /= u, b.style(i.elem, e, s + r); while (u !== (u = i.cur() / a) && 1 !== u && --l) } i.unit = r, i.start = s, i.end = o[1] ? s + (o[1] + 1) * n : n } return i } ] }; function Kn() { return setTimeout(function () { Xn = t }), Xn = b.now() } function Zn(e, t) { b.each(t, function (t, n) { var r = (Qn[t] || []).concat(Qn["*"]), i = 0, o = r.length; for (; o > i; i++) if (r[i].call(e, t, n)) return }) } function er(e, t, n) { var r, i, o = 0, a = Gn.length, s = b.Deferred().always(function () { delete u.elem }), u = function () { if (i) return !1; var t = Xn || Kn(), n = Math.max(0, l.startTime + l.duration - t), r = n / l.duration || 0, o = 1 - r, a = 0, u = l.tweens.length; for (; u > a; a++) l.tweens[a].run(o); return s.notifyWith(e, [l, o, n]), 1 > o && u ? n : (s.resolveWith(e, [l]), !1) }, l = s.promise({ elem: e, props: b.extend({}, t), opts: b.extend(!0, { specialEasing: {} }, n), originalProperties: t, originalOptions: n, startTime: Xn || Kn(), duration: n.duration, tweens: [], createTween: function (t, n) { var r = b.Tween(e, l.opts, t, n, l.opts.specialEasing[t] || l.opts.easing); return l.tweens.push(r), r }, stop: function (t) { var n = 0, r = t ? l.tweens.length : 0; if (i) return this; for (i = !0; r > n; n++) l.tweens[n].run(1); return t ? s.resolveWith(e, [l, t]) : s.rejectWith(e, [l, t]), this } }), c = l.props; for (tr(c, l.opts.specialEasing); a > o; o++) if (r = Gn[o].call(l, e, c, l.opts)) return r; return Zn(l, c), b.isFunction(l.opts.start) && l.opts.start.call(e, l), b.fx.timer(b.extend(u, { elem: e, anim: l, queue: l.opts.queue })), l.progress(l.opts.progress).done(l.opts.done, l.opts.complete).fail(l.opts.fail).always(l.opts.always) } function tr(e, t) { var n, r, i, o, a; for (i in e) if (r = b.camelCase(i), o = t[r], n = e[i], b.isArray(n) && (o = n[1], n = e[i] = n[0]), i !== r && (e[r] = n, delete e[i]), a = b.cssHooks[r], a && "expand" in a) { n = a.expand(n), delete e[r]; for (i in n) i in e || (e[i] = n[i], t[i] = o) } else t[r] = o } b.Animation = b.extend(er, { tweener: function (e, t) { b.isFunction(e) ? (t = e, e = ["*"]) : e = e.split(" "); var n, r = 0, i = e.length; for (; i > r; r++) n = e[r], Qn[n] = Qn[n] || [], Qn[n].unshift(t) }, prefilter: function (e, t) { t ? Gn.unshift(e) : Gn.push(e) } }); function nr(e, t, n) { var r, i, o, a, s, u, l, c, p, f = this, d = e.style, h = {}, g = [], m = e.nodeType && nn(e); n.queue || (c = b._queueHooks(e, "fx"), null == c.unqueued && (c.unqueued = 0, p = c.empty.fire, c.empty.fire = function () { c.unqueued || p() }), c.unqueued++, f.always(function () { f.always(function () { c.unqueued--, b.queue(e, "fx").length || c.empty.fire() }) })), 1 === e.nodeType && ("height" in t || "width" in t) && (n.overflow = [d.overflow, d.overflowX, d.overflowY], "inline" === b.css(e, "display") && "none" === b.css(e, "float") && (b.support.inlineBlockNeedsLayout && "inline" !== un(e.nodeName) ? d.zoom = 1 : d.display = "inline-block")), n.overflow && (d.overflow = "hidden", b.support.shrinkWrapBlocks || f.always(function () { d.overflow = n.overflow[0], d.overflowX = n.overflow[1], d.overflowY = n.overflow[2] })); for (i in t) if (a = t[i], Vn.exec(a)) { if (delete t[i], u = u || "toggle" === a, a === (m ? "hide" : "show")) continue; g.push(i) } if (o = g.length) { s = b._data(e, "fxshow") || b._data(e, "fxshow", {}), "hidden" in s && (m = s.hidden), u && (s.hidden = !m), m ? b(e).show() : f.done(function () { b(e).hide() }), f.done(function () { var t; b._removeData(e, "fxshow"); for (t in h) b.style(e, t, h[t]) }); for (i = 0; o > i; i++) r = g[i], l = f.createTween(r, m ? s[r] : 0), h[r] = s[r] || b.style(e, r), r in s || (s[r] = l.start, m && (l.end = l.start, l.start = "width" === r || "height" === r ? 1 : 0)) } } function rr(e, t, n, r, i) { return new rr.prototype.init(e, t, n, r, i) } b.Tween = rr, rr.prototype = { constructor: rr, init: function (e, t, n, r, i, o) { this.elem = e, this.prop = n, this.easing = i || "swing", this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = o || (b.cssNumber[n] ? "" : "px") }, cur: function () { var e = rr.propHooks[this.prop]; return e && e.get ? e.get(this) : rr.propHooks._default.get(this) }, run: function (e) { var t, n = rr.propHooks[this.prop]; return this.pos = t = this.options.duration ? b.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : rr.propHooks._default.set(this), this } }, rr.prototype.init.prototype = rr.prototype, rr.propHooks = { _default: { get: function (e) { var t; return null == e.elem[e.prop] || e.elem.style && null != e.elem.style[e.prop] ? (t = b.css(e.elem, e.prop, ""), t && "auto" !== t ? t : 0) : e.elem[e.prop] }, set: function (e) { b.fx.step[e.prop] ? b.fx.step[e.prop](e) : e.elem.style && (null != e.elem.style[b.cssProps[e.prop]] || b.cssHooks[e.prop]) ? b.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now } } }, rr.propHooks.scrollTop = rr.propHooks.scrollLeft = { set: function (e) { e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now) } }, b.each(["toggle", "show", "hide"], function (e, t) { var n = b.fn[t]; b.fn[t] = function (e, r, i) { return null == e || "boolean" == typeof e ? n.apply(this, arguments) : this.animate(ir(t, !0), e, r, i) } }), b.fn.extend({ fadeTo: function (e, t, n, r) { return this.filter(nn).css("opacity", 0).show().end().animate({ opacity: t }, e, n, r) }, animate: function (e, t, n, r) { var i = b.isEmptyObject(e), o = b.speed(t, n, r), a = function () { var t = er(this, b.extend({}, e), o); a.finish = function () { t.stop(!0) }, (i || b._data(this, "finish")) && t.stop(!0) }; return a.finish = a, i || o.queue === !1 ? this.each(a) : this.queue(o.queue, a) }, stop: function (e, n, r) { var i = function (e) { var t = e.stop; delete e.stop, t(r) }; return "string" != typeof e && (r = n, n = e, e = t), n && e !== !1 && this.queue(e || "fx", []), this.each(function () { var t = !0, n = null != e && e + "queueHooks", o = b.timers, a = b._data(this); if (n) a[n] && a[n].stop && i(a[n]); else for (n in a) a[n] && a[n].stop && Jn.test(n) && i(a[n]); for (n = o.length; n--; ) o[n].elem !== this || null != e && o[n].queue !== e || (o[n].anim.stop(r), t = !1, o.splice(n, 1)); (t || !r) && b.dequeue(this, e) }) }, finish: function (e) { return e !== !1 && (e = e || "fx"), this.each(function () { var t, n = b._data(this), r = n[e + "queue"], i = n[e + "queueHooks"], o = b.timers, a = r ? r.length : 0; for (n.finish = !0, b.queue(this, e, []), i && i.cur && i.cur.finish && i.cur.finish.call(this), t = o.length; t--; ) o[t].elem === this && o[t].queue === e && (o[t].anim.stop(!0), o.splice(t, 1)); for (t = 0; a > t; t++) r[t] && r[t].finish && r[t].finish.call(this); delete n.finish }) } }); function ir(e, t) { var n, r = { height: e }, i = 0; for (t = t ? 1 : 0; 4 > i; i += 2 - t) n = Zt[i], r["margin" + n] = r["padding" + n] = e; return t && (r.opacity = r.width = e), r } b.each({ slideDown: ir("show"), slideUp: ir("hide"), slideToggle: ir("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle"} }, function (e, t) { b.fn[e] = function (e, n, r) { return this.animate(t, e, n, r) } }), b.speed = function (e, t, n) { var r = e && "object" == typeof e ? b.extend({}, e) : { complete: n || !n && t || b.isFunction(e) && e, duration: e, easing: n && t || t && !b.isFunction(t) && t }; return r.duration = b.fx.off ? 0 : "number" == typeof r.duration ? r.duration : r.duration in b.fx.speeds ? b.fx.speeds[r.duration] : b.fx.speeds._default, (null == r.queue || r.queue === !0) && (r.queue = "fx"), r.old = r.complete, r.complete = function () { b.isFunction(r.old) && r.old.call(this), r.queue && b.dequeue(this, r.queue) }, r }, b.easing = { linear: function (e) { return e }, swing: function (e) { return .5 - Math.cos(e * Math.PI) / 2 } }, b.timers = [], b.fx = rr.prototype.init, b.fx.tick = function () { var e, n = b.timers, r = 0; for (Xn = b.now(); n.length > r; r++) e = n[r], e() || n[r] !== e || n.splice(r--, 1); n.length || b.fx.stop(), Xn = t }, b.fx.timer = function (e) { e() && b.timers.push(e) && b.fx.start() }, b.fx.interval = 13, b.fx.start = function () { Un || (Un = setInterval(b.fx.tick, b.fx.interval)) }, b.fx.stop = function () { clearInterval(Un), Un = null }, b.fx.speeds = { slow: 600, fast: 200, _default: 400 }, b.fx.step = {}, b.expr && b.expr.filters && (b.expr.filters.animated = function (e) { return b.grep(b.timers, function (t) { return e === t.elem }).length }), b.fn.offset = function (e) { if (arguments.length) return e === t ? this : this.each(function (t) { b.offset.setOffset(this, e, t) }); var n, r, o = { top: 0, left: 0 }, a = this[0], s = a && a.ownerDocument; if (s) return n = s.documentElement, b.contains(n, a) ? (typeof a.getBoundingClientRect !== i && (o = a.getBoundingClientRect()), r = or(s), { top: o.top + (r.pageYOffset || n.scrollTop) - (n.clientTop || 0), left: o.left + (r.pageXOffset || n.scrollLeft) - (n.clientLeft || 0) }) : o }, b.offset = { setOffset: function (e, t, n) { var r = b.css(e, "position"); "static" === r && (e.style.position = "relative"); var i = b(e), o = i.offset(), a = b.css(e, "top"), s = b.css(e, "left"), u = ("absolute" === r || "fixed" === r) && b.inArray("auto", [a, s]) > -1, l = {}, c = {}, p, f; u ? (c = i.position(), p = c.top, f = c.left) : (p = parseFloat(a) || 0, f = parseFloat(s) || 0), b.isFunction(t) && (t = t.call(e, n, o)), null != t.top && (l.top = t.top - o.top + p), null != t.left && (l.left = t.left - o.left + f), "using" in t ? t.using.call(e, l) : i.css(l) } }, b.fn.extend({ position: function () { if (this[0]) { var e, t, n = { top: 0, left: 0 }, r = this[0]; return "fixed" === b.css(r, "position") ? t = r.getBoundingClientRect() : (e = this.offsetParent(), t = this.offset(), b.nodeName(e[0], "html") || (n = e.offset()), n.top += b.css(e[0], "borderTopWidth", !0), n.left += b.css(e[0], "borderLeftWidth", !0)), { top: t.top - n.top - b.css(r, "marginTop", !0), left: t.left - n.left - b.css(r, "marginLeft", !0)} } }, offsetParent: function () { return this.map(function () { var e = this.offsetParent || o.documentElement; while (e && !b.nodeName(e, "html") && "static" === b.css(e, "position")) e = e.offsetParent; return e || o.documentElement }) } }), b.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (e, n) { var r = /Y/.test(n); b.fn[e] = function (i) { return b.access(this, function (e, i, o) { var a = or(e); return o === t ? a ? n in a ? a[n] : a.document.documentElement[i] : e[i] : (a ? a.scrollTo(r ? b(a).scrollLeft() : o, r ? o : b(a).scrollTop()) : e[i] = o, t) }, e, i, arguments.length, null) } }); function or(e) { return b.isWindow(e) ? e : 9 === e.nodeType ? e.defaultView || e.parentWindow : !1 } b.each({ Height: "height", Width: "width" }, function (e, n) { b.each({ padding: "inner" + e, content: n, "": "outer" + e }, function (r, i) { b.fn[i] = function (i, o) { var a = arguments.length && (r || "boolean" != typeof i), s = r || (i === !0 || o === !0 ? "margin" : "border"); return b.access(this, function (n, r, i) { var o; return b.isWindow(n) ? n.document.documentElement["client" + e] : 9 === n.nodeType ? (o = n.documentElement, Math.max(n.body["scroll" + e], o["scroll" + e], n.body["offset" + e], o["offset" + e], o["client" + e])) : i === t ? b.css(n, r, s) : b.style(n, r, i, s) }, n, a ? i : t, a, null) } }) }), e.jQuery = e.$ = b, "function" == typeof define && define.amd && define.amd.jQuery && define("jquery", [], function () { return b })
|
20 |
+
})(window);
|
js/thumbnailslider/jssor.js
ADDED
@@ -0,0 +1,2850 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Jssor 18.0
|
3 |
+
* http://www.jssor.com/
|
4 |
+
*
|
5 |
+
* Licensed under the MIT license:
|
6 |
+
* http://www.opensource.org/licenses/MIT
|
7 |
+
*
|
8 |
+
* TERMS OF USE - Jssor
|
9 |
+
*
|
10 |
+
* Copyright 2014 Jssor
|
11 |
+
*
|
12 |
+
* Permission is hereby granted, free of charge, to any person obtaining
|
13 |
+
* a copy of this software and associated documentation files (the
|
14 |
+
* "Software"), to deal in the Software without restriction, including
|
15 |
+
* without limitation the rights to use, copy, modify, merge, publish,
|
16 |
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
17 |
+
* permit persons to whom the Software is furnished to do so, subject to
|
18 |
+
* the following conditions:
|
19 |
+
*
|
20 |
+
* The above copyright notice and this permission notice shall be
|
21 |
+
* included in all copies or substantial portions of the Software.
|
22 |
+
*
|
23 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
24 |
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
25 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
26 |
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
27 |
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
28 |
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
29 |
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
30 |
+
*/
|
31 |
+
|
32 |
+
/*! Jssor */
|
33 |
+
|
34 |
+
//$JssorDebug$
|
35 |
+
var $JssorDebug$ = new function () {
|
36 |
+
|
37 |
+
this.$DebugMode = true;
|
38 |
+
|
39 |
+
// Methods
|
40 |
+
|
41 |
+
this.$Log = function (msg, important) {
|
42 |
+
var console = window.console || {};
|
43 |
+
var debug = this.$DebugMode;
|
44 |
+
|
45 |
+
if (debug && console.log) {
|
46 |
+
console.log(msg);
|
47 |
+
} else if (debug && important) {
|
48 |
+
alert(msg);
|
49 |
+
}
|
50 |
+
};
|
51 |
+
|
52 |
+
this.$Error = function (msg, e) {
|
53 |
+
var console = window.console || {};
|
54 |
+
var debug = this.$DebugMode;
|
55 |
+
|
56 |
+
if (debug && console.error) {
|
57 |
+
console.error(msg);
|
58 |
+
} else if (debug) {
|
59 |
+
alert(msg);
|
60 |
+
}
|
61 |
+
|
62 |
+
if (debug) {
|
63 |
+
// since we're debugging, fail fast by crashing
|
64 |
+
throw e || new Error(msg);
|
65 |
+
}
|
66 |
+
};
|
67 |
+
|
68 |
+
this.$Fail = function (msg) {
|
69 |
+
throw new Error(msg);
|
70 |
+
};
|
71 |
+
|
72 |
+
this.$Assert = function (value, msg) {
|
73 |
+
var debug = this.$DebugMode;
|
74 |
+
if (debug) {
|
75 |
+
if (!value)
|
76 |
+
throw new Error("Assert failed " + msg || "");
|
77 |
+
}
|
78 |
+
};
|
79 |
+
|
80 |
+
this.$Trace = function (msg) {
|
81 |
+
var console = window.console || {};
|
82 |
+
var debug = this.$DebugMode;
|
83 |
+
|
84 |
+
if (debug && console.log) {
|
85 |
+
console.log(msg);
|
86 |
+
}
|
87 |
+
};
|
88 |
+
|
89 |
+
this.$Execute = function (func) {
|
90 |
+
var debug = this.$DebugMode;
|
91 |
+
if (debug)
|
92 |
+
func();
|
93 |
+
};
|
94 |
+
|
95 |
+
this.$LiveStamp = function (obj, id) {
|
96 |
+
var debug = this.$DebugMode;
|
97 |
+
if (debug) {
|
98 |
+
var stamp = document.createElement("DIV");
|
99 |
+
stamp.setAttribute("id", id);
|
100 |
+
|
101 |
+
obj.$Live = stamp;
|
102 |
+
}
|
103 |
+
};
|
104 |
+
|
105 |
+
this.$C_AbstractMethod = function () {
|
106 |
+
/// <summary>
|
107 |
+
/// Tells compiler the method is abstract, it should be implemented by subclass.
|
108 |
+
/// </summary>
|
109 |
+
|
110 |
+
throw new Error("The method is abstract, it should be implemented by subclass.");
|
111 |
+
};
|
112 |
+
|
113 |
+
function C_AbstractClass (instance) {
|
114 |
+
/// <summary>
|
115 |
+
/// Tells compiler the class is abstract, it should be implemented by subclass.
|
116 |
+
/// </summary>
|
117 |
+
|
118 |
+
if(instance.constructor === C_AbstractClass.caller)
|
119 |
+
throw new Error("Cannot create instance of an abstract class.");
|
120 |
+
}
|
121 |
+
|
122 |
+
this.$C_AbstractClass = C_AbstractClass;
|
123 |
+
};
|
124 |
+
|
125 |
+
//$JssorEasing$
|
126 |
+
var $JssorEasing$ = window.$JssorEasing$ = {
|
127 |
+
$EaseLinear: function (t) {
|
128 |
+
return t;
|
129 |
+
},
|
130 |
+
$EaseGoBack: function (t) {
|
131 |
+
return 1 - Math.abs((t *= 2) - 1);
|
132 |
+
},
|
133 |
+
$EaseSwing: function (t) {
|
134 |
+
return -Math.cos(t * Math.PI) / 2 + .5;
|
135 |
+
},
|
136 |
+
$EaseInQuad: function (t) {
|
137 |
+
return t * t;
|
138 |
+
},
|
139 |
+
$EaseOutQuad: function (t) {
|
140 |
+
return -t * (t - 2);
|
141 |
+
},
|
142 |
+
$EaseInOutQuad: function (t) {
|
143 |
+
return (t *= 2) < 1 ? 1 / 2 * t * t : -1 / 2 * (--t * (t - 2) - 1);
|
144 |
+
},
|
145 |
+
$EaseInCubic: function (t) {
|
146 |
+
return t * t * t;
|
147 |
+
},
|
148 |
+
$EaseOutCubic: function (t) {
|
149 |
+
return (t -= 1) * t * t + 1;
|
150 |
+
},
|
151 |
+
$EaseInOutCubic: function (t) {
|
152 |
+
return (t *= 2) < 1 ? 1 / 2 * t * t * t : 1 / 2 * ((t -= 2) * t * t + 2);
|
153 |
+
},
|
154 |
+
$EaseInQuart: function (t) {
|
155 |
+
return t * t * t * t;
|
156 |
+
},
|
157 |
+
$EaseOutQuart: function (t) {
|
158 |
+
return -((t -= 1) * t * t * t - 1);
|
159 |
+
},
|
160 |
+
$EaseInOutQuart: function (t) {
|
161 |
+
return (t *= 2) < 1 ? 1 / 2 * t * t * t * t : -1 / 2 * ((t -= 2) * t * t * t - 2);
|
162 |
+
},
|
163 |
+
$EaseInQuint: function (t) {
|
164 |
+
return t * t * t * t * t;
|
165 |
+
},
|
166 |
+
$EaseOutQuint: function (t) {
|
167 |
+
return (t -= 1) * t * t * t * t + 1;
|
168 |
+
},
|
169 |
+
$EaseInOutQuint: function (t) {
|
170 |
+
return (t *= 2) < 1 ? 1 / 2 * t * t * t * t * t : 1 / 2 * ((t -= 2) * t * t * t * t + 2);
|
171 |
+
},
|
172 |
+
$EaseInSine: function (t) {
|
173 |
+
return 1 - Math.cos(t * Math.PI / 2);
|
174 |
+
},
|
175 |
+
$EaseOutSine: function (t) {
|
176 |
+
return Math.sin(t * Math.PI / 2);
|
177 |
+
},
|
178 |
+
$EaseInOutSine: function (t) {
|
179 |
+
return -1 / 2 * (Math.cos(Math.PI * t) - 1);
|
180 |
+
},
|
181 |
+
$EaseInExpo: function (t) {
|
182 |
+
return t == 0 ? 0 : Math.pow(2, 10 * (t - 1));
|
183 |
+
},
|
184 |
+
$EaseOutExpo: function (t) {
|
185 |
+
return t == 1 ? 1 : -Math.pow(2, -10 * t) + 1;
|
186 |
+
},
|
187 |
+
$EaseInOutExpo: function (t) {
|
188 |
+
return t == 0 || t == 1 ? t : (t *= 2) < 1 ? 1 / 2 * Math.pow(2, 10 * (t - 1)) : 1 / 2 * (-Math.pow(2, -10 * --t) + 2);
|
189 |
+
},
|
190 |
+
$EaseInCirc: function (t) {
|
191 |
+
return -(Math.sqrt(1 - t * t) - 1);
|
192 |
+
},
|
193 |
+
$EaseOutCirc: function (t) {
|
194 |
+
return Math.sqrt(1 - (t -= 1) * t);
|
195 |
+
},
|
196 |
+
$EaseInOutCirc: function (t) {
|
197 |
+
return (t *= 2) < 1 ? -1 / 2 * (Math.sqrt(1 - t * t) - 1) : 1 / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1);
|
198 |
+
},
|
199 |
+
$EaseInElastic: function (t) {
|
200 |
+
if (!t || t == 1)
|
201 |
+
return t;
|
202 |
+
var p = .3, s = .075;
|
203 |
+
return -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * 2 * Math.PI / p));
|
204 |
+
},
|
205 |
+
$EaseOutElastic: function (t) {
|
206 |
+
if (!t || t == 1)
|
207 |
+
return t;
|
208 |
+
var p = .3, s = .075;
|
209 |
+
return Math.pow(2, -10 * t) * Math.sin((t - s) * 2 * Math.PI / p) + 1;
|
210 |
+
},
|
211 |
+
$EaseInOutElastic: function (t) {
|
212 |
+
if (!t || t == 1)
|
213 |
+
return t;
|
214 |
+
var p = .45, s = .1125;
|
215 |
+
return (t *= 2) < 1 ? -.5 * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * 2 * Math.PI / p) : Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * 2 * Math.PI / p) * .5 + 1;
|
216 |
+
},
|
217 |
+
$EaseInBack: function (t) {
|
218 |
+
var s = 1.70158;
|
219 |
+
return t * t * ((s + 1) * t - s);
|
220 |
+
},
|
221 |
+
$EaseOutBack: function (t) {
|
222 |
+
var s = 1.70158;
|
223 |
+
return (t -= 1) * t * ((s + 1) * t + s) + 1;
|
224 |
+
},
|
225 |
+
$EaseInOutBack: function (t) {
|
226 |
+
var s = 1.70158;
|
227 |
+
return (t *= 2) < 1 ? 1 / 2 * t * t * (((s *= 1.525) + 1) * t - s) : 1 / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);
|
228 |
+
},
|
229 |
+
$EaseInBounce: function (t) {
|
230 |
+
return 1 - $JssorEasing$.$EaseOutBounce(1 - t)
|
231 |
+
},
|
232 |
+
$EaseOutBounce: function (t) {
|
233 |
+
return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;
|
234 |
+
},
|
235 |
+
$EaseInOutBounce: function (t) {
|
236 |
+
return t < 1 / 2 ? $JssorEasing$.$EaseInBounce(t * 2) * .5 : $JssorEasing$.$EaseOutBounce(t * 2 - 1) * .5 + .5;
|
237 |
+
},
|
238 |
+
$EaseInWave: function (t) {
|
239 |
+
return 1 - Math.cos(t * Math.PI * 2)
|
240 |
+
},
|
241 |
+
$EaseOutWave: function (t) {
|
242 |
+
return Math.sin(t * Math.PI * 2);
|
243 |
+
},
|
244 |
+
$EaseOutJump: function (t) {
|
245 |
+
return 1 - (((t *= 2) < 1) ? (t = 1 - t) * t * t : (t -= 1) * t * t);
|
246 |
+
},
|
247 |
+
$EaseInJump: function (t) {
|
248 |
+
return ((t *= 2) < 1) ? t * t * t : (t = 2 - t) * t * t;
|
249 |
+
}
|
250 |
+
};
|
251 |
+
|
252 |
+
var $JssorDirection$ = window.$JssorDirection$ = {
|
253 |
+
$TO_LEFT: 0x0001,
|
254 |
+
$TO_RIGHT: 0x0002,
|
255 |
+
$TO_TOP: 0x0004,
|
256 |
+
$TO_BOTTOM: 0x0008,
|
257 |
+
$HORIZONTAL: 0x0003,
|
258 |
+
$VERTICAL: 0x000C,
|
259 |
+
$LEFTRIGHT: 0x0003,
|
260 |
+
$TOPBOTOM: 0x000C,
|
261 |
+
$TOPLEFT: 0x0005,
|
262 |
+
$TOPRIGHT: 0x0006,
|
263 |
+
$BOTTOMLEFT: 0x0009,
|
264 |
+
$BOTTOMRIGHT: 0x000A,
|
265 |
+
$AROUND: 0x000F,
|
266 |
+
|
267 |
+
$GetDirectionHorizontal: function (direction) {
|
268 |
+
return direction & 0x0003;
|
269 |
+
},
|
270 |
+
$GetDirectionVertical: function (direction) {
|
271 |
+
return direction & 0x000C;
|
272 |
+
},
|
273 |
+
$ChessHorizontal: function (direction) {
|
274 |
+
return (~direction & 0x0003) + (direction & 0x000C);
|
275 |
+
},
|
276 |
+
$ChessVertical: function (direction) {
|
277 |
+
return (~direction & 0x000C) + (direction & 0x0003);
|
278 |
+
},
|
279 |
+
$IsToLeft: function (direction) {
|
280 |
+
return (direction & 0x0003) == 0x0001;
|
281 |
+
},
|
282 |
+
$IsToRight: function (direction) {
|
283 |
+
return (direction & 0x0003) == 0x0002;
|
284 |
+
},
|
285 |
+
$IsToTop: function (direction) {
|
286 |
+
return (direction & 0x000C) == 0x0004;
|
287 |
+
},
|
288 |
+
$IsToBottom: function (direction) {
|
289 |
+
return (direction & 0x000C) == 0x0008;
|
290 |
+
},
|
291 |
+
$IsHorizontal: function (direction) {
|
292 |
+
return (direction & 0x0003) > 0;
|
293 |
+
},
|
294 |
+
$IsVertical: function (direction) {
|
295 |
+
return (direction & 0x000C) > 0;
|
296 |
+
}
|
297 |
+
};
|
298 |
+
|
299 |
+
var $JssorKeyCode$ = {
|
300 |
+
$BACKSPACE: 8,
|
301 |
+
$COMMA: 188,
|
302 |
+
$DELETE: 46,
|
303 |
+
$DOWN: 40,
|
304 |
+
$END: 35,
|
305 |
+
$ENTER: 13,
|
306 |
+
$ESCAPE: 27,
|
307 |
+
$HOME: 36,
|
308 |
+
$LEFT: 37,
|
309 |
+
$NUMPAD_ADD: 107,
|
310 |
+
$NUMPAD_DECIMAL: 110,
|
311 |
+
$NUMPAD_DIVIDE: 111,
|
312 |
+
$NUMPAD_ENTER: 108,
|
313 |
+
$NUMPAD_MULTIPLY: 106,
|
314 |
+
$NUMPAD_SUBTRACT: 109,
|
315 |
+
$PAGE_DOWN: 34,
|
316 |
+
$PAGE_UP: 33,
|
317 |
+
$PERIOD: 190,
|
318 |
+
$RIGHT: 39,
|
319 |
+
$SPACE: 32,
|
320 |
+
$TAB: 9,
|
321 |
+
$UP: 38
|
322 |
+
};
|
323 |
+
|
324 |
+
var $JssorAlignment$ = {
|
325 |
+
$TopLeft: 0x11,
|
326 |
+
$TopCenter: 0x12,
|
327 |
+
$TopRight: 0x14,
|
328 |
+
$MiddleLeft: 0x21,
|
329 |
+
$MiddleCenter: 0x22,
|
330 |
+
$MiddleRight: 0x24,
|
331 |
+
$BottomLeft: 0x41,
|
332 |
+
$BottomCenter: 0x42,
|
333 |
+
$BottomRight: 0x44,
|
334 |
+
|
335 |
+
$IsTop: function (aligment) {
|
336 |
+
return aligment & 0x10 > 0;
|
337 |
+
},
|
338 |
+
$IsMiddle: function (alignment) {
|
339 |
+
return alignment & 0x20 > 0;
|
340 |
+
},
|
341 |
+
$IsBottom: function (alignment) {
|
342 |
+
return alignment & 0x40 > 0;
|
343 |
+
},
|
344 |
+
$IsLeft: function (alignment) {
|
345 |
+
return alignment & 0x01 > 0;
|
346 |
+
},
|
347 |
+
$IsCenter: function (alignment) {
|
348 |
+
return alignment & 0x02 > 0;
|
349 |
+
},
|
350 |
+
$IsRight: function (alignment) {
|
351 |
+
return alignment & 0x04 > 0;
|
352 |
+
}
|
353 |
+
};
|
354 |
+
|
355 |
+
var $JssorMatrix$;
|
356 |
+
|
357 |
+
var $JssorAnimator$;
|
358 |
+
|
359 |
+
// $Jssor$ is a static class, so make it singleton instance
|
360 |
+
var $Jssor$ = window.$Jssor$ = new function () {
|
361 |
+
// Fields
|
362 |
+
var _This = this;
|
363 |
+
|
364 |
+
var REGEX_WHITESPACE_GLOBAL = /\S+/g;
|
365 |
+
|
366 |
+
var ROWSER_UNKNOWN = 0;
|
367 |
+
var BROWSER_IE = 1;
|
368 |
+
var BROWSER_FIREFOX = 2;
|
369 |
+
var BROWSER_FIREFOX = 3;
|
370 |
+
var BROWSER_CHROME = 4;
|
371 |
+
var BROWSER_OPERA = 5;
|
372 |
+
|
373 |
+
//var arrActiveX = ["Msxml2.XMLHTTP", "Msxml3.XMLHTTP", "Microsoft.XMLHTTP"];
|
374 |
+
|
375 |
+
var browser = 0;
|
376 |
+
var browserRuntimeVersion = 0;
|
377 |
+
var browserEngineVersion = 0;
|
378 |
+
var browserJavascriptVersion = 0;
|
379 |
+
var webkitVersion = 0;
|
380 |
+
|
381 |
+
var app = navigator.appName;
|
382 |
+
var ver = navigator.appVersion;
|
383 |
+
var ua = navigator.userAgent;
|
384 |
+
|
385 |
+
var _DocElmt = document.documentElement;
|
386 |
+
var _TransformProperty;
|
387 |
+
|
388 |
+
function DetectBrowser() {
|
389 |
+
if (!browser) {
|
390 |
+
if (app == "Microsoft Internet Explorer" &&
|
391 |
+
!!window.attachEvent && !!window.ActiveXObject) {
|
392 |
+
|
393 |
+
var ieOffset = ua.indexOf("MSIE");
|
394 |
+
browser = BROWSER_IE;
|
395 |
+
browserEngineVersion = ParseFloat(ua.substring(ieOffset + 5, ua.indexOf(";", ieOffset)));
|
396 |
+
|
397 |
+
//check IE javascript version
|
398 |
+
/*@cc_on
|
399 |
+
browserJavascriptVersion = @_jscript_version;
|
400 |
+
@*/
|
401 |
+
|
402 |
+
// update: for intranet sites and compat view list sites, IE sends
|
403 |
+
// an IE7 User-Agent to the server to be interoperable, and even if
|
404 |
+
// the page requests a later IE version, IE will still report the
|
405 |
+
// IE7 UA to JS. we should be robust to self
|
406 |
+
//var docMode = document.documentMode;
|
407 |
+
//if (typeof docMode !== "undefined") {
|
408 |
+
// browserRuntimeVersion = docMode;
|
409 |
+
//}
|
410 |
+
|
411 |
+
browserRuntimeVersion = document.documentMode || browserEngineVersion;
|
412 |
+
|
413 |
+
}
|
414 |
+
else if (app == "Netscape" && !!window.addEventListener) {
|
415 |
+
|
416 |
+
var ffOffset = ua.indexOf("Firefox");
|
417 |
+
var saOffset = ua.indexOf("Safari");
|
418 |
+
var chOffset = ua.indexOf("Chrome");
|
419 |
+
var webkitOffset = ua.indexOf("AppleWebKit");
|
420 |
+
|
421 |
+
if (ffOffset >= 0) {
|
422 |
+
browser = BROWSER_FIREFOX;
|
423 |
+
browserRuntimeVersion = ParseFloat(ua.substring(ffOffset + 8));
|
424 |
+
}
|
425 |
+
else if (saOffset >= 0) {
|
426 |
+
var slash = ua.substring(0, saOffset).lastIndexOf("/");
|
427 |
+
browser = (chOffset >= 0) ? BROWSER_CHROME : BROWSER_FIREFOX;
|
428 |
+
browserRuntimeVersion = ParseFloat(ua.substring(slash + 1, saOffset));
|
429 |
+
}
|
430 |
+
|
431 |
+
if (webkitOffset >= 0)
|
432 |
+
webkitVersion = ParseFloat(ua.substring(webkitOffset + 12));
|
433 |
+
}
|
434 |
+
else {
|
435 |
+
var match = /(opera)(?:.*version|)[ \/]([\w.]+)/i.exec(ua);
|
436 |
+
if (match) {
|
437 |
+
browser = BROWSER_OPERA;
|
438 |
+
browserRuntimeVersion = ParseFloat(match[2]);
|
439 |
+
}
|
440 |
+
}
|
441 |
+
}
|
442 |
+
}
|
443 |
+
|
444 |
+
function IsBrowserIE() {
|
445 |
+
DetectBrowser();
|
446 |
+
return browser == BROWSER_IE;
|
447 |
+
}
|
448 |
+
|
449 |
+
function IsBrowserIeQuirks() {
|
450 |
+
return IsBrowserIE() && (browserRuntimeVersion < 6 || document.compatMode == "BackCompat"); //Composite to "CSS1Compat"
|
451 |
+
}
|
452 |
+
|
453 |
+
function IsBrowserFireFox() {
|
454 |
+
DetectBrowser();
|
455 |
+
return browser == BROWSER_FIREFOX;
|
456 |
+
}
|
457 |
+
|
458 |
+
function IsBrowserSafari() {
|
459 |
+
DetectBrowser();
|
460 |
+
return browser == BROWSER_FIREFOX;
|
461 |
+
}
|
462 |
+
|
463 |
+
function IsBrowserChrome() {
|
464 |
+
DetectBrowser();
|
465 |
+
return browser == BROWSER_CHROME;
|
466 |
+
}
|
467 |
+
|
468 |
+
function IsBrowserOpera() {
|
469 |
+
DetectBrowser();
|
470 |
+
return browser == BROWSER_OPERA;
|
471 |
+
}
|
472 |
+
|
473 |
+
function IsBrowserBadTransform() {
|
474 |
+
return IsBrowserSafari() && (webkitVersion > 534) && (webkitVersion < 535);
|
475 |
+
}
|
476 |
+
|
477 |
+
function IsBrowserIe9Earlier() {
|
478 |
+
return IsBrowserIE() && browserRuntimeVersion < 9;
|
479 |
+
}
|
480 |
+
|
481 |
+
function GetTransformProperty(elmt) {
|
482 |
+
|
483 |
+
if (!_TransformProperty) {
|
484 |
+
// Note that in some versions of IE9 it is critical that
|
485 |
+
// msTransform appear in this list before MozTransform
|
486 |
+
|
487 |
+
each(['transform', 'WebkitTransform', 'msTransform', 'MozTransform', 'OTransform'], function (property) {
|
488 |
+
if (elmt.style[property] != undefined) {
|
489 |
+
_TransformProperty = property;
|
490 |
+
return true;
|
491 |
+
}
|
492 |
+
});
|
493 |
+
|
494 |
+
_TransformProperty = _TransformProperty || "transform";
|
495 |
+
}
|
496 |
+
|
497 |
+
return _TransformProperty;
|
498 |
+
}
|
499 |
+
|
500 |
+
// Helpers
|
501 |
+
function getOffsetParent(elmt, isFixed) {
|
502 |
+
// IE and Opera "fixed" position elements don't have offset parents.
|
503 |
+
// regardless, if it's fixed, its offset parent is the body.
|
504 |
+
if (isFixed && elmt != document.body) {
|
505 |
+
return document.body;
|
506 |
+
} else {
|
507 |
+
return elmt.offsetParent;
|
508 |
+
}
|
509 |
+
}
|
510 |
+
|
511 |
+
function toString(obj) {
|
512 |
+
return Object.prototype.toString.call(obj);
|
513 |
+
}
|
514 |
+
|
515 |
+
// [[Class]] -> type pairs
|
516 |
+
var class2type;
|
517 |
+
|
518 |
+
function each(object, callback) {
|
519 |
+
if (toString(object) == "[object Array]") {
|
520 |
+
for (var i = 0; i < object.length; i++) {
|
521 |
+
if (callback(object[i], i, object)) {
|
522 |
+
return true;
|
523 |
+
}
|
524 |
+
}
|
525 |
+
}
|
526 |
+
else {
|
527 |
+
for (var name in object) {
|
528 |
+
if (callback(object[name], name, object)) {
|
529 |
+
return true;
|
530 |
+
}
|
531 |
+
}
|
532 |
+
}
|
533 |
+
}
|
534 |
+
|
535 |
+
function GetClass2Type() {
|
536 |
+
if (!class2type) {
|
537 |
+
class2type = {};
|
538 |
+
each(["Boolean", "Number", "String", "Function", "Array", "Date", "RegExp", "Object"], function (name) {
|
539 |
+
class2type["[object " + name + "]"] = name.toLowerCase();
|
540 |
+
});
|
541 |
+
}
|
542 |
+
|
543 |
+
return class2type;
|
544 |
+
}
|
545 |
+
|
546 |
+
function type(obj) {
|
547 |
+
return obj == null ? String(obj) : GetClass2Type()[toString(obj)] || "object";
|
548 |
+
}
|
549 |
+
|
550 |
+
function isPlainObject(obj) {
|
551 |
+
// Must be an Object.
|
552 |
+
// Because of IE, we also have to check the presence of the constructor property.
|
553 |
+
// Make sure that DOM nodes and window objects don't pass through, as well
|
554 |
+
if (!obj || type(obj) !== "object" || obj.nodeType || _This.$IsWindow(obj)) {
|
555 |
+
return false;
|
556 |
+
}
|
557 |
+
|
558 |
+
var hasOwn = Object.prototype.hasOwnProperty;
|
559 |
+
|
560 |
+
try {
|
561 |
+
// Not own constructor property must be Object
|
562 |
+
if (obj.constructor &&
|
563 |
+
!hasOwn.call(obj, "constructor") &&
|
564 |
+
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
|
565 |
+
return false;
|
566 |
+
}
|
567 |
+
} catch (e) {
|
568 |
+
// IE8,9 Will throw exceptions on certain host objects #9897
|
569 |
+
return false;
|
570 |
+
}
|
571 |
+
|
572 |
+
// Own properties are enumerated firstly, so to speed up,
|
573 |
+
// if last one is own, then all properties are own.
|
574 |
+
|
575 |
+
var key;
|
576 |
+
for (key in obj) { }
|
577 |
+
|
578 |
+
return key === undefined || hasOwn.call(obj, key);
|
579 |
+
}
|
580 |
+
|
581 |
+
function Point(x, y) {
|
582 |
+
return { x: x, y: y };
|
583 |
+
}
|
584 |
+
|
585 |
+
function Delay(code, delay) {
|
586 |
+
setTimeout(code, delay || 0);
|
587 |
+
}
|
588 |
+
|
589 |
+
function RemoveByReg(str, reg) {
|
590 |
+
var m = reg.exec(str);
|
591 |
+
|
592 |
+
if (m) {
|
593 |
+
var header = str.substr(0, m.index);
|
594 |
+
var tailer = str.substr(m.lastIndex + 1, str.length - (m.lastIndex + 1));
|
595 |
+
str = header + tailer;
|
596 |
+
}
|
597 |
+
|
598 |
+
return str;
|
599 |
+
}
|
600 |
+
|
601 |
+
function BuildNewCss(oldCss, removeRegs, replaceValue) {
|
602 |
+
var css = (!oldCss || oldCss == "inherit") ? "" : oldCss;
|
603 |
+
|
604 |
+
each(removeRegs, function (removeReg) {
|
605 |
+
var m = removeReg.exec(css);
|
606 |
+
|
607 |
+
if (m) {
|
608 |
+
var header = css.substr(0, m.index);
|
609 |
+
var tailer = css.substr(m.lastIndex + 1, css.length - (m.lastIndex + 1));
|
610 |
+
css = header + tailer;
|
611 |
+
}
|
612 |
+
});
|
613 |
+
|
614 |
+
css = replaceValue + (css.indexOf(" ") != 0 ? " " : "") + css;
|
615 |
+
|
616 |
+
return css;
|
617 |
+
}
|
618 |
+
|
619 |
+
function SetStyleFilterIE(elmt, value) {
|
620 |
+
if (browserRuntimeVersion < 9) {
|
621 |
+
elmt.style.filter = value;
|
622 |
+
}
|
623 |
+
}
|
624 |
+
|
625 |
+
function SetStyleMatrixIE(elmt, matrix, offset) {
|
626 |
+
//matrix is not for ie9+ running in ie8- mode
|
627 |
+
if (browserJavascriptVersion < 9) {
|
628 |
+
var oldFilterValue = elmt.style.filter;
|
629 |
+
var matrixReg = new RegExp(/[\s]*progid:DXImageTransform\.Microsoft\.Matrix\([^\)]*\)/g);
|
630 |
+
var matrixValue = matrix ? "progid:DXImageTransform.Microsoft.Matrix(" + "M11=" + matrix[0][0] + ", M12=" + matrix[0][1] + ", M21=" + matrix[1][0] + ", M22=" + matrix[1][1] + ", SizingMethod='auto expand')" : "";
|
631 |
+
|
632 |
+
var newFilterValue = BuildNewCss(oldFilterValue, [matrixReg], matrixValue);
|
633 |
+
|
634 |
+
SetStyleFilterIE(elmt, newFilterValue);
|
635 |
+
|
636 |
+
_This.$CssMarginTop(elmt, offset.y);
|
637 |
+
_This.$CssMarginLeft(elmt, offset.x);
|
638 |
+
}
|
639 |
+
}
|
640 |
+
|
641 |
+
// Methods
|
642 |
+
|
643 |
+
_This.$IsBrowserIE = IsBrowserIE;
|
644 |
+
|
645 |
+
_This.$IsBrowserIeQuirks = IsBrowserIeQuirks;
|
646 |
+
|
647 |
+
_This.$IsBrowserFireFox = IsBrowserFireFox;
|
648 |
+
|
649 |
+
_This.$IsBrowserSafari = IsBrowserSafari;
|
650 |
+
|
651 |
+
_This.$IsBrowserChrome = IsBrowserChrome;
|
652 |
+
|
653 |
+
_This.$IsBrowserOpera = IsBrowserOpera;
|
654 |
+
|
655 |
+
_This.$IsBrowserBadTransform = IsBrowserBadTransform;
|
656 |
+
|
657 |
+
_This.$IsBrowserIe9Earlier = IsBrowserIe9Earlier;
|
658 |
+
|
659 |
+
_This.$BrowserVersion = function () {
|
660 |
+
return browserRuntimeVersion;
|
661 |
+
};
|
662 |
+
|
663 |
+
_This.$BrowserEngineVersion = function () {
|
664 |
+
return browserEngineVersion || browserRuntimeVersion;
|
665 |
+
};
|
666 |
+
|
667 |
+
_This.$WebKitVersion = function () {
|
668 |
+
DetectBrowser();
|
669 |
+
|
670 |
+
return webkitVersion;
|
671 |
+
};
|
672 |
+
|
673 |
+
_This.$Delay = Delay;
|
674 |
+
|
675 |
+
_This.$Inherit = function (instance, baseClass) {
|
676 |
+
baseClass.apply(instance, [].slice.call(arguments, 2));
|
677 |
+
return Extend({}, instance);
|
678 |
+
};
|
679 |
+
|
680 |
+
function Construct(instance, constructor) {
|
681 |
+
instance.constructor === Construct.caller && instance.$Construct && instance.$Construct();
|
682 |
+
}
|
683 |
+
|
684 |
+
_This.$Construct = Construct;
|
685 |
+
|
686 |
+
_This.$GetElement = function (elmt) {
|
687 |
+
if (_This.$IsString(elmt)) {
|
688 |
+
elmt = document.getElementById(elmt);
|
689 |
+
}
|
690 |
+
|
691 |
+
return elmt;
|
692 |
+
};
|
693 |
+
|
694 |
+
function GetEvent(event) {
|
695 |
+
return event || window.event;
|
696 |
+
}
|
697 |
+
|
698 |
+
_This.$GetEvent = GetEvent;
|
699 |
+
|
700 |
+
_This.$EventSrc = function (event) {
|
701 |
+
event = GetEvent(event);
|
702 |
+
return event.target || event.srcElement || document;
|
703 |
+
};
|
704 |
+
|
705 |
+
_This.$EventDst = function (event) {
|
706 |
+
event = GetEvent(event);
|
707 |
+
return event.relatedTarget || event.toElement;
|
708 |
+
};
|
709 |
+
|
710 |
+
_This.$MousePosition = function (event) {
|
711 |
+
event = GetEvent(event);
|
712 |
+
var body = document.body;
|
713 |
+
|
714 |
+
return {
|
715 |
+
x: event.pageX || event.clientX + (_DocElmt.scrollLeft || body.scrollLeft || 0) - (_DocElmt.clientLeft || body.clientLeft || 0) || 0,
|
716 |
+
y: event.pageY || event.clientY + (_DocElmt.scrollTop || body.scrollTop || 0) - (_DocElmt.clientTop || body.clientTop || 0) || 0
|
717 |
+
};
|
718 |
+
};
|
719 |
+
|
720 |
+
_This.$PageScroll = function () {
|
721 |
+
var body = document.body;
|
722 |
+
|
723 |
+
return {
|
724 |
+
x: (window.pageXOffset || _DocElmt.scrollLeft || body.scrollLeft || 0) - (_DocElmt.clientLeft || body.clientLeft || 0),
|
725 |
+
y: (window.pageYOffset || _DocElmt.scrollTop || body.scrollTop || 0) - (_DocElmt.clientTop || body.clientTop || 0)
|
726 |
+
};
|
727 |
+
};
|
728 |
+
|
729 |
+
_This.$WindowSize = function () {
|
730 |
+
var body = document.body;
|
731 |
+
|
732 |
+
return {
|
733 |
+
x: body.clientWidth || _DocElmt.clientWidth,
|
734 |
+
y: body.clientHeight || _DocElmt.clientHeight
|
735 |
+
};
|
736 |
+
};
|
737 |
+
|
738 |
+
//_This.$GetElementPosition = function (elmt) {
|
739 |
+
// elmt = _This.$GetElement(elmt);
|
740 |
+
// var result = Point();
|
741 |
+
|
742 |
+
// // technique from:
|
743 |
+
// // http://www.quirksmode.org/js/findpos.html
|
744 |
+
// // with special check for "fixed" elements.
|
745 |
+
|
746 |
+
// while (elmt) {
|
747 |
+
// result.x += elmt.offsetLeft;
|
748 |
+
// result.y += elmt.offsetTop;
|
749 |
+
|
750 |
+
// var isFixed = _This.$GetElementStyle(elmt).position == "fixed";
|
751 |
+
|
752 |
+
// if (isFixed) {
|
753 |
+
// result = result.$Plus(_This.$PageScroll(window));
|
754 |
+
// }
|
755 |
+
|
756 |
+
// elmt = getOffsetParent(elmt, isFixed);
|
757 |
+
// }
|
758 |
+
|
759 |
+
// return result;
|
760 |
+
//};
|
761 |
+
|
762 |
+
//_This.$GetMouseScroll = function (event) {
|
763 |
+
// event = GetEvent(event);
|
764 |
+
// var delta = 0; // default value
|
765 |
+
|
766 |
+
// // technique from:
|
767 |
+
// // http://blog.paranoidferret.com/index.php/2007/10/31/javascript-tutorial-the-scroll-wheel/
|
768 |
+
|
769 |
+
// if (typeof (event.wheelDelta) == "number") {
|
770 |
+
// delta = event.wheelDelta;
|
771 |
+
// } else if (typeof (event.detail) == "number") {
|
772 |
+
// delta = event.detail * -1;
|
773 |
+
// } else {
|
774 |
+
// $JssorDebug$.$Fail("Unknown event mouse scroll, no known technique.");
|
775 |
+
// }
|
776 |
+
|
777 |
+
// // normalize value to [-1, 1]
|
778 |
+
// return delta ? delta / Math.abs(delta) : 0;
|
779 |
+
//};
|
780 |
+
|
781 |
+
//_This.$MakeAjaxRequest = function (url, callback) {
|
782 |
+
// var async = typeof (callback) == "function";
|
783 |
+
// var req = null;
|
784 |
+
|
785 |
+
// if (async) {
|
786 |
+
// var actual = callback;
|
787 |
+
// var callback = function () {
|
788 |
+
// Delay($Jssor$.$CreateCallback(null, actual, req), 1);
|
789 |
+
// };
|
790 |
+
// }
|
791 |
+
|
792 |
+
// if (window.ActiveXObject) {
|
793 |
+
// for (var i = 0; i < arrActiveX.length; i++) {
|
794 |
+
// try {
|
795 |
+
// req = new ActiveXObject(arrActiveX[i]);
|
796 |
+
// break;
|
797 |
+
// } catch (e) {
|
798 |
+
// continue;
|
799 |
+
// }
|
800 |
+
// }
|
801 |
+
// } else if (window.XMLHttpRequest) {
|
802 |
+
// req = new XMLHttpRequest();
|
803 |
+
// }
|
804 |
+
|
805 |
+
// if (!req) {
|
806 |
+
// $JssorDebug$.$Fail("Browser doesn't support XMLHttpRequest.");
|
807 |
+
// }
|
808 |
+
|
809 |
+
// if (async) {
|
810 |
+
// req.onreadystatechange = function () {
|
811 |
+
// if (req.readyState == 4) {
|
812 |
+
// // prevent memory leaks by breaking circular reference now
|
813 |
+
// req.onreadystatechange = new Function();
|
814 |
+
// callback();
|
815 |
+
// }
|
816 |
+
// };
|
817 |
+
// }
|
818 |
+
|
819 |
+
// try {
|
820 |
+
// req.open("GET", url, async);
|
821 |
+
// req.send(null);
|
822 |
+
// } catch (e) {
|
823 |
+
// $JssorDebug$.$Log(e.name + " while making AJAX request: " + e.message);
|
824 |
+
|
825 |
+
// req.onreadystatechange = null;
|
826 |
+
// req = null;
|
827 |
+
|
828 |
+
// if (async) {
|
829 |
+
// callback();
|
830 |
+
// }
|
831 |
+
// }
|
832 |
+
|
833 |
+
// return async ? null : req;
|
834 |
+
//};
|
835 |
+
|
836 |
+
//_This.$ParseXml = function (string) {
|
837 |
+
// var xmlDoc = null;
|
838 |
+
|
839 |
+
// if (window.ActiveXObject) {
|
840 |
+
// try {
|
841 |
+
// xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
|
842 |
+
// xmlDoc.async = false;
|
843 |
+
// xmlDoc.loadXML(string);
|
844 |
+
// } catch (e) {
|
845 |
+
// $JssorDebug$.$Log(e.name + " while parsing XML (ActiveX): " + e.message);
|
846 |
+
// }
|
847 |
+
// } else if (window.DOMParser) {
|
848 |
+
// try {
|
849 |
+
// var parser = new DOMParser();
|
850 |
+
// xmlDoc = parser.parseFromString(string, "text/xml");
|
851 |
+
// } catch (e) {
|
852 |
+
// $JssorDebug$.$Log(e.name + " while parsing XML (DOMParser): " + e.message);
|
853 |
+
// }
|
854 |
+
// } else {
|
855 |
+
// $JssorDebug$.$Fail("Browser doesn't support XML DOM.");
|
856 |
+
// }
|
857 |
+
|
858 |
+
// return xmlDoc;
|
859 |
+
//};
|
860 |
+
|
861 |
+
function Css(elmt, name, value) {
|
862 |
+
/// <summary>
|
863 |
+
/// access css
|
864 |
+
/// $Jssor$.$Css(elmt, name); //get css value
|
865 |
+
/// $Jssor$.$Css(elmt, name, value); //set css value
|
866 |
+
/// </summary>
|
867 |
+
/// <param name="elmt" type="HTMLElement">
|
868 |
+
/// the element to access css
|
869 |
+
/// </param>
|
870 |
+
/// <param name="name" type="String">
|
871 |
+
/// the name of css property
|
872 |
+
/// </param>
|
873 |
+
/// <param name="value" optional="true">
|
874 |
+
/// the value to set
|
875 |
+
/// </param>
|
876 |
+
if (value != undefined) {
|
877 |
+
elmt.style[name] = value;
|
878 |
+
}
|
879 |
+
else {
|
880 |
+
var style = elmt.currentStyle || elmt.style;
|
881 |
+
value = style[name];
|
882 |
+
|
883 |
+
if (value == "" && window.getComputedStyle) {
|
884 |
+
style = elmt.ownerDocument.defaultView.getComputedStyle(elmt, null);
|
885 |
+
|
886 |
+
style && (value = style.getPropertyValue(name) || style[name]);
|
887 |
+
}
|
888 |
+
|
889 |
+
return value;
|
890 |
+
}
|
891 |
+
}
|
892 |
+
|
893 |
+
function CssN(elmt, name, value, isDimensional) {
|
894 |
+
/// <summary>
|
895 |
+
/// access css as numeric
|
896 |
+
/// $Jssor$.$CssN(elmt, name); //get css value
|
897 |
+
/// $Jssor$.$CssN(elmt, name, value); //set css value
|
898 |
+
/// </summary>
|
899 |
+
/// <param name="elmt" type="HTMLElement">
|
900 |
+
/// the element to access css
|
901 |
+
/// </param>
|
902 |
+
/// <param name="name" type="String">
|
903 |
+
/// the name of css property
|
904 |
+
/// </param>
|
905 |
+
/// <param name="value" type="Number" optional="true">
|
906 |
+
/// the value to set
|
907 |
+
/// </param>
|
908 |
+
if (value != undefined) {
|
909 |
+
isDimensional && (value += "px");
|
910 |
+
Css(elmt, name, value);
|
911 |
+
}
|
912 |
+
else {
|
913 |
+
return ParseFloat(Css(elmt, name));
|
914 |
+
}
|
915 |
+
}
|
916 |
+
|
917 |
+
function CssP(elmt, name, value) {
|
918 |
+
/// <summary>
|
919 |
+
/// access css in pixel as numeric, like 'top', 'left', 'width', 'height'
|
920 |
+
/// $Jssor$.$CssP(elmt, name); //get css value
|
921 |
+
/// $Jssor$.$CssP(elmt, name, value); //set css value
|
922 |
+
/// </summary>
|
923 |
+
/// <param name="elmt" type="HTMLElement">
|
924 |
+
/// the element to access css
|
925 |
+
/// </param>
|
926 |
+
/// <param name="name" type="String">
|
927 |
+
/// the name of css property
|
928 |
+
/// </param>
|
929 |
+
/// <param name="value" type="Number" optional="true">
|
930 |
+
/// the value to set
|
931 |
+
/// </param>
|
932 |
+
return CssN(elmt, name, value, true);
|
933 |
+
}
|
934 |
+
|
935 |
+
function CssProxy(name, numericOrDimension) {
|
936 |
+
/// <summary>
|
937 |
+
/// create proxy to access css, CssProxy(name[, numericOrDimension]);
|
938 |
+
/// </summary>
|
939 |
+
/// <param name="elmt" type="HTMLElement">
|
940 |
+
/// the element to access css
|
941 |
+
/// </param>
|
942 |
+
/// <param name="numericOrDimension" type="Number" optional="true">
|
943 |
+
/// not set: access original css, 1: access css as numeric, 2: access css in pixel as numeric
|
944 |
+
/// </param>
|
945 |
+
var isDimensional = numericOrDimension & 2;
|
946 |
+
var cssAccessor = numericOrDimension ? CssN : Css;
|
947 |
+
return function (elmt, value) {
|
948 |
+
return cssAccessor(elmt, name, value, isDimensional);
|
949 |
+
};
|
950 |
+
}
|
951 |
+
|
952 |
+
function GetStyleOpacity(elmt) {
|
953 |
+
if (IsBrowserIE() && browserEngineVersion < 9) {
|
954 |
+
var match = /opacity=([^)]*)/.exec(elmt.style.filter || "");
|
955 |
+
return match ? (ParseFloat(match[1]) / 100) : 1;
|
956 |
+
}
|
957 |
+
else
|
958 |
+
return ParseFloat(elmt.style.opacity || "1");
|
959 |
+
}
|
960 |
+
|
961 |
+
function SetStyleOpacity(elmt, opacity, ie9EarlierForce) {
|
962 |
+
|
963 |
+
if (IsBrowserIE() && browserEngineVersion < 9) {
|
964 |
+
//var filterName = "filter"; // browserEngineVersion < 8 ? "filter" : "-ms-filter";
|
965 |
+
var finalFilter = elmt.style.filter || "";
|
966 |
+
|
967 |
+
// for CSS filter browsers (IE), remove alpha filter if it's unnecessary.
|
968 |
+
// update: doing _This always since IE9 beta seems to have broken the
|
969 |
+
// behavior if we rely on the programmatic filters collection.
|
970 |
+
var alphaReg = new RegExp(/[\s]*alpha\([^\)]*\)/g);
|
971 |
+
|
972 |
+
// important: note the lazy star! _This protects against
|
973 |
+
// multiple filters; we don't want to delete the other ones.
|
974 |
+
// update: also trimming extra whitespace around filter.
|
975 |
+
|
976 |
+
var ieOpacity = Math.round(100 * opacity);
|
977 |
+
var alphaFilter = "";
|
978 |
+
if (ieOpacity < 100 || ie9EarlierForce) {
|
979 |
+
alphaFilter = "alpha(opacity=" + ieOpacity + ") ";
|
980 |
+
//elmt.style["-ms-filter"] = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + ieOpacity + ") ";
|
981 |
+
}
|
982 |
+
|
983 |
+
var newFilterValue = BuildNewCss(finalFilter, [alphaReg], alphaFilter);
|
984 |
+
|
985 |
+
SetStyleFilterIE(elmt, newFilterValue);
|
986 |
+
}
|
987 |
+
|
988 |
+
//if (!IsBrowserIE() || browserEngineVersion >= 9)
|
989 |
+
else {
|
990 |
+
elmt.style.opacity = opacity == 1 ? "" : Math.round(opacity * 100) / 100;
|
991 |
+
}
|
992 |
+
}
|
993 |
+
|
994 |
+
function SetStyleTransformInternal(elmt, transform) {
|
995 |
+
var rotate = transform.$Rotate || 0;
|
996 |
+
var scale = transform.$Scale == undefined ? 1 : transform.$Scale;
|
997 |
+
|
998 |
+
if (IsBrowserIe9Earlier()) {
|
999 |
+
var matrix = _This.$CreateMatrix(rotate / 180 * Math.PI, scale, scale);
|
1000 |
+
SetStyleMatrixIE(elmt, (!rotate && scale == 1) ? null : matrix, _This.$GetMatrixOffset(matrix, transform.$OriginalWidth, transform.$OriginalHeight));
|
1001 |
+
}
|
1002 |
+
else {
|
1003 |
+
//rotate(15deg) scale(.5) translateZ(0)
|
1004 |
+
var transformProperty = GetTransformProperty(elmt);
|
1005 |
+
if (transformProperty) {
|
1006 |
+
var transformValue = "rotate(" + rotate % 360 + "deg) scale(" + scale + ")";
|
1007 |
+
|
1008 |
+
//needed for touch device, no need for desktop device
|
1009 |
+
if (IsBrowserChrome() && webkitVersion > 535 && "ontouchstart" in window)
|
1010 |
+
transformValue += " perspective(2000px)";
|
1011 |
+
|
1012 |
+
elmt.style[transformProperty] = transformValue;
|
1013 |
+
}
|
1014 |
+
}
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
_This.$SetStyleTransform = function (elmt, transform) {
|
1018 |
+
if (IsBrowserBadTransform()) {
|
1019 |
+
Delay(_This.$CreateCallback(null, SetStyleTransformInternal, elmt, transform));
|
1020 |
+
}
|
1021 |
+
else {
|
1022 |
+
SetStyleTransformInternal(elmt, transform);
|
1023 |
+
}
|
1024 |
+
};
|
1025 |
+
|
1026 |
+
_This.$SetStyleTransformOrigin = function (elmt, transformOrigin) {
|
1027 |
+
var transformProperty = GetTransformProperty(elmt);
|
1028 |
+
|
1029 |
+
if (transformProperty)
|
1030 |
+
elmt.style[transformProperty + "Origin"] = transformOrigin;
|
1031 |
+
};
|
1032 |
+
|
1033 |
+
_This.$CssScale = function (elmt, scale) {
|
1034 |
+
|
1035 |
+
if (IsBrowserIE() && browserEngineVersion < 9 || (browserEngineVersion < 10 && IsBrowserIeQuirks())) {
|
1036 |
+
elmt.style.zoom = (scale == 1) ? "" : scale;
|
1037 |
+
}
|
1038 |
+
else {
|
1039 |
+
var transformProperty = GetTransformProperty(elmt);
|
1040 |
+
|
1041 |
+
if (transformProperty) {
|
1042 |
+
//rotate(15deg) scale(.5)
|
1043 |
+
var transformValue = "scale(" + scale + ")";
|
1044 |
+
|
1045 |
+
var oldTransformValue = elmt.style[transformProperty];
|
1046 |
+
var scaleReg = new RegExp(/[\s]*scale\(.*?\)/g);
|
1047 |
+
|
1048 |
+
var newTransformValue = BuildNewCss(oldTransformValue, [scaleReg], transformValue);
|
1049 |
+
|
1050 |
+
elmt.style[transformProperty] = newTransformValue;
|
1051 |
+
}
|
1052 |
+
}
|
1053 |
+
};
|
1054 |
+
|
1055 |
+
_This.$EnableHWA = function (elmt) {
|
1056 |
+
if (!elmt.style[GetTransformProperty(elmt)] || elmt.style[GetTransformProperty(elmt)] == "none")
|
1057 |
+
elmt.style[GetTransformProperty(elmt)] = "perspective(2000px)";
|
1058 |
+
};
|
1059 |
+
|
1060 |
+
_This.$DisableHWA = function (elmt) {
|
1061 |
+
//if (force || elmt.style[GetTransformProperty(elmt)] == "perspective(2000px)")
|
1062 |
+
elmt.style[GetTransformProperty(elmt)] = "none";
|
1063 |
+
};
|
1064 |
+
|
1065 |
+
var ie8OffsetWidth = 0;
|
1066 |
+
var ie8OffsetHeight = 0;
|
1067 |
+
//var ie8WindowResizeCallbackHandlers;
|
1068 |
+
//var ie8LastVerticalScrollbar;
|
1069 |
+
//var toggleInfo = "";
|
1070 |
+
|
1071 |
+
//function Ie8WindowResizeFilter(window, handler) {
|
1072 |
+
|
1073 |
+
// var trigger = true;
|
1074 |
+
|
1075 |
+
// var checkElement = (IsBrowserIeQuirks() ? window.document.body : window.document.documentElement);
|
1076 |
+
// if (checkElement) {
|
1077 |
+
// //check vertical bar
|
1078 |
+
// //var hasVerticalBar = checkElement.scrollHeight > checkElement.clientHeight;
|
1079 |
+
// //var verticalBarToggle = hasVerticalBar != ie8LastVerticalScrollbar;
|
1080 |
+
// //ie8LastVerticalScrollbar = hasVerticalBar;
|
1081 |
+
|
1082 |
+
// var widthChange = checkElement.offsetWidth - ie8OffsetWidth;
|
1083 |
+
// var heightChange = checkElement.offsetHeight - ie8OffsetHeight;
|
1084 |
+
// if (widthChange || heightChange) {
|
1085 |
+
|
1086 |
+
// ie8OffsetWidth += widthChange;
|
1087 |
+
// ie8OffsetHeight += heightChange;
|
1088 |
+
// }
|
1089 |
+
// else
|
1090 |
+
// trigger = false;
|
1091 |
+
// }
|
1092 |
+
|
1093 |
+
// trigger && handler();
|
1094 |
+
//}
|
1095 |
+
|
1096 |
+
//_This.$OnWindowResize = function (window, handler) {
|
1097 |
+
|
1098 |
+
// if (IsBrowserIE() && browserEngineVersion < 9) {
|
1099 |
+
// if (!ie8WindowResizeCallbackHandlers) {
|
1100 |
+
// ie8WindowResizeCallbackHandlers = [handler];
|
1101 |
+
// handler = _This.$CreateCallback(null, Ie8WindowResizeFilter, window);
|
1102 |
+
// }
|
1103 |
+
// else {
|
1104 |
+
// ie8WindowResizeCallbackHandlers.push(handler);
|
1105 |
+
// return;
|
1106 |
+
// }
|
1107 |
+
// }
|
1108 |
+
|
1109 |
+
// _This.$AddEvent(window, "resize", handler);
|
1110 |
+
//};
|
1111 |
+
|
1112 |
+
_This.$WindowResizeFilter = function (window, handler) {
|
1113 |
+
return IsBrowserIe9Earlier() ? function () {
|
1114 |
+
|
1115 |
+
var trigger = true;
|
1116 |
+
|
1117 |
+
var checkElement = (IsBrowserIeQuirks() ? window.document.body : window.document.documentElement);
|
1118 |
+
if (checkElement) {
|
1119 |
+
//check vertical bar
|
1120 |
+
//var hasVerticalBar = checkElement.scrollHeight > checkElement.clientHeight;
|
1121 |
+
//var verticalBarToggle = hasVerticalBar != ie8LastVerticalScrollbar;
|
1122 |
+
//ie8LastVerticalScrollbar = hasVerticalBar;
|
1123 |
+
|
1124 |
+
var widthChange = checkElement.offsetWidth - ie8OffsetWidth;
|
1125 |
+
var heightChange = checkElement.offsetHeight - ie8OffsetHeight;
|
1126 |
+
if (widthChange || heightChange) {
|
1127 |
+
ie8OffsetWidth += widthChange;
|
1128 |
+
ie8OffsetHeight += heightChange;
|
1129 |
+
}
|
1130 |
+
else
|
1131 |
+
trigger = false;
|
1132 |
+
}
|
1133 |
+
|
1134 |
+
trigger && handler();
|
1135 |
+
|
1136 |
+
} : handler;
|
1137 |
+
};
|
1138 |
+
|
1139 |
+
_This.$MouseOverOutFilter = function (handler, target) {
|
1140 |
+
/// <param name="target" type="HTMLDomElement">
|
1141 |
+
/// The target element to detect mouse over/out events. (for ie < 9 compatibility)
|
1142 |
+
/// </param>
|
1143 |
+
|
1144 |
+
$JssorDebug$.$Execute(function () {
|
1145 |
+
if (!target) {
|
1146 |
+
throw new Error("Null reference, parameter \"target\".");
|
1147 |
+
}
|
1148 |
+
});
|
1149 |
+
|
1150 |
+
return function (event) {
|
1151 |
+
event = GetEvent(event);
|
1152 |
+
|
1153 |
+
var eventName = event.type;
|
1154 |
+
var related = event.relatedTarget || (eventName == "mouseout" ? event.toElement : event.fromElement);
|
1155 |
+
|
1156 |
+
if (!related || (related !== target && !_This.$IsChild(target, related))) {
|
1157 |
+
handler(event);
|
1158 |
+
}
|
1159 |
+
};
|
1160 |
+
};
|
1161 |
+
|
1162 |
+
_This.$AddEvent = function (elmt, eventName, handler, useCapture) {
|
1163 |
+
elmt = _This.$GetElement(elmt);
|
1164 |
+
|
1165 |
+
// technique from:
|
1166 |
+
// http://blog.paranoidferret.com/index.php/2007/08/10/javascript-working-with-events/
|
1167 |
+
|
1168 |
+
if (elmt.addEventListener) {
|
1169 |
+
if (eventName == "mousewheel") {
|
1170 |
+
elmt.addEventListener("DOMMouseScroll", handler, useCapture);
|
1171 |
+
}
|
1172 |
+
// we are still going to add the mousewheel -- not a mistake!
|
1173 |
+
// _This is for opera, since it uses onmousewheel but needs addEventListener.
|
1174 |
+
elmt.addEventListener(eventName, handler, useCapture);
|
1175 |
+
}
|
1176 |
+
else if (elmt.attachEvent) {
|
1177 |
+
elmt.attachEvent("on" + eventName, handler);
|
1178 |
+
if (useCapture && elmt.setCapture) {
|
1179 |
+
elmt.setCapture();
|
1180 |
+
}
|
1181 |
+
}
|
1182 |
+
|
1183 |
+
$JssorDebug$.$Execute(function () {
|
1184 |
+
if (!elmt.addEventListener && !elmt.attachEvent) {
|
1185 |
+
$JssorDebug$.$Fail("Unable to attach event handler, no known technique.");
|
1186 |
+
}
|
1187 |
+
});
|
1188 |
+
|
1189 |
+
};
|
1190 |
+
|
1191 |
+
_This.$RemoveEvent = function (elmt, eventName, handler, useCapture) {
|
1192 |
+
elmt = _This.$GetElement(elmt);
|
1193 |
+
|
1194 |
+
// technique from:
|
1195 |
+
// http://blog.paranoidferret.com/index.php/2007/08/10/javascript-working-with-events/
|
1196 |
+
|
1197 |
+
if (elmt.removeEventListener) {
|
1198 |
+
if (eventName == "mousewheel") {
|
1199 |
+
elmt.removeEventListener("DOMMouseScroll", handler, useCapture);
|
1200 |
+
}
|
1201 |
+
// we are still going to remove the mousewheel -- not a mistake!
|
1202 |
+
// _This is for opera, since it uses onmousewheel but needs removeEventListener.
|
1203 |
+
elmt.removeEventListener(eventName, handler, useCapture);
|
1204 |
+
}
|
1205 |
+
else if (elmt.detachEvent) {
|
1206 |
+
elmt.detachEvent("on" + eventName, handler);
|
1207 |
+
if (useCapture && elmt.releaseCapture) {
|
1208 |
+
elmt.releaseCapture();
|
1209 |
+
}
|
1210 |
+
}
|
1211 |
+
};
|
1212 |
+
|
1213 |
+
_This.$FireEvent = function (elmt, eventName) {
|
1214 |
+
//var document = elmt.document;
|
1215 |
+
|
1216 |
+
$JssorDebug$.$Execute(function () {
|
1217 |
+
if (!document.createEvent && !document.createEventObject) {
|
1218 |
+
$JssorDebug$.$Fail("Unable to fire event, no known technique.");
|
1219 |
+
}
|
1220 |
+
|
1221 |
+
if (!elmt.dispatchEvent && !elmt.fireEvent) {
|
1222 |
+
$JssorDebug$.$Fail("Unable to fire event, no known technique.");
|
1223 |
+
}
|
1224 |
+
});
|
1225 |
+
|
1226 |
+
var evento;
|
1227 |
+
|
1228 |
+
if (document.createEvent) {
|
1229 |
+
evento = document.createEvent("HTMLEvents");
|
1230 |
+
evento.initEvent(eventName, false, false);
|
1231 |
+
elmt.dispatchEvent(evento);
|
1232 |
+
}
|
1233 |
+
else {
|
1234 |
+
var ieEventName = "on" + eventName;
|
1235 |
+
evento = document.createEventObject();
|
1236 |
+
//event.eventType = ieEventName;
|
1237 |
+
//event.eventName = ieEventName;
|
1238 |
+
|
1239 |
+
elmt.fireEvent(ieEventName, evento);
|
1240 |
+
}
|
1241 |
+
};
|
1242 |
+
|
1243 |
+
_This.$AddEventBrowserMouseUp = function (handler, userCapture) {
|
1244 |
+
_This.$AddEvent((IsBrowserIe9Earlier()) ? document : window, "mouseup", handler, userCapture);
|
1245 |
+
};
|
1246 |
+
|
1247 |
+
_This.$RemoveEventBrowserMouseUp = function (handler, userCapture) {
|
1248 |
+
_This.$RemoveEvent((IsBrowserIe9Earlier()) ? document : window, "mouseup", handler, userCapture);
|
1249 |
+
};
|
1250 |
+
|
1251 |
+
//_This.$AddEventBrowserMouseDown = function (handler, userCapture) {
|
1252 |
+
// _This.$AddEvent((IsBrowserIe9Earlier()) ? document : window, "mousedown", handler, userCapture);
|
1253 |
+
//};
|
1254 |
+
|
1255 |
+
//_This.$RemoveEventBrowserMouseDown = function (handler, userCapture) {
|
1256 |
+
// _This.$RemoveEvent((IsBrowserIe9Earlier()) ? document : window, "mousedown", handler, userCapture);
|
1257 |
+
//};
|
1258 |
+
|
1259 |
+
_This.$CancelEvent = function (event) {
|
1260 |
+
event = GetEvent(event);
|
1261 |
+
|
1262 |
+
// technique from:
|
1263 |
+
// http://blog.paranoidferret.com/index.php/2007/08/10/javascript-working-with-events/
|
1264 |
+
|
1265 |
+
if (event.preventDefault) {
|
1266 |
+
event.preventDefault(); // W3C for preventing default
|
1267 |
+
}
|
1268 |
+
|
1269 |
+
event.cancel = true; // legacy for preventing default
|
1270 |
+
event.returnValue = false; // IE for preventing default
|
1271 |
+
};
|
1272 |
+
|
1273 |
+
_This.$StopEvent = function (event) {
|
1274 |
+
event = GetEvent(event);
|
1275 |
+
|
1276 |
+
// technique from:
|
1277 |
+
// http://blog.paranoidferret.com/index.php/2007/08/10/javascript-working-with-events/
|
1278 |
+
|
1279 |
+
if (event.stopPropagation) {
|
1280 |
+
event.stopPropagation(); // W3C for stopping propagation
|
1281 |
+
}
|
1282 |
+
|
1283 |
+
event.cancelBubble = true; // IE for stopping propagation
|
1284 |
+
};
|
1285 |
+
|
1286 |
+
_This.$CreateCallback = function (object, method) {
|
1287 |
+
// create callback args
|
1288 |
+
var initialArgs = [].slice.call(arguments, 2);
|
1289 |
+
|
1290 |
+
// create closure to apply method
|
1291 |
+
var callback = function () {
|
1292 |
+
// concatenate new args, but make a copy of initialArgs first
|
1293 |
+
var args = initialArgs.concat([].slice.call(arguments, 0));
|
1294 |
+
|
1295 |
+
return method.apply(object, args);
|
1296 |
+
};
|
1297 |
+
|
1298 |
+
//$JssorDebug$.$LiveStamp(callback, "callback_" + ($Jssor$.$GetNow() & 0xFFFFFF));
|
1299 |
+
|
1300 |
+
return callback;
|
1301 |
+
};
|
1302 |
+
|
1303 |
+
var _Freeer;
|
1304 |
+
_This.$FreeElement = function (elmt) {
|
1305 |
+
if (!_Freeer)
|
1306 |
+
_Freeer = _This.$CreateDiv();
|
1307 |
+
|
1308 |
+
if (elmt) {
|
1309 |
+
$Jssor$.$AppendChild(_Freeer, elmt);
|
1310 |
+
$Jssor$.$ClearInnerHtml(_Freeer);
|
1311 |
+
}
|
1312 |
+
};
|
1313 |
+
|
1314 |
+
_This.$InnerText = function (elmt, text) {
|
1315 |
+
if (text == undefined)
|
1316 |
+
return elmt.textContent || elmt.innerText;
|
1317 |
+
|
1318 |
+
var textNode = document.createTextNode(text);
|
1319 |
+
_This.$ClearInnerHtml(elmt);
|
1320 |
+
elmt.appendChild(textNode);
|
1321 |
+
};
|
1322 |
+
|
1323 |
+
_This.$InnerHtml = function (elmt, html) {
|
1324 |
+
if (html == undefined)
|
1325 |
+
return elmt.innerHTML;
|
1326 |
+
|
1327 |
+
elmt.innerHTML = html;
|
1328 |
+
};
|
1329 |
+
|
1330 |
+
_This.$GetClientRect = function (elmt) {
|
1331 |
+
var rect = elmt.getBoundingClientRect();
|
1332 |
+
|
1333 |
+
return { x: rect.left, y: rect.top, w: rect.right - rect.left, h: rect.bottom - rect.top };
|
1334 |
+
};
|
1335 |
+
|
1336 |
+
_This.$ClearInnerHtml = function (elmt) {
|
1337 |
+
elmt.innerHTML = "";
|
1338 |
+
};
|
1339 |
+
|
1340 |
+
_This.$EncodeHtml = function (text) {
|
1341 |
+
var div = _This.$CreateDiv();
|
1342 |
+
_This.$InnerText(div, text);
|
1343 |
+
return _This.$InnerHtml(div);
|
1344 |
+
};
|
1345 |
+
|
1346 |
+
_This.$DecodeHtml = function (html) {
|
1347 |
+
var div = _This.$CreateDiv();
|
1348 |
+
_This.$InnerHtml(div, html);
|
1349 |
+
return _This.$InnerText(div);
|
1350 |
+
};
|
1351 |
+
|
1352 |
+
_This.$SelectElement = function (elmt) {
|
1353 |
+
var userSelection;
|
1354 |
+
if (window.getSelection) {
|
1355 |
+
//W3C default
|
1356 |
+
userSelection = window.getSelection();
|
1357 |
+
}
|
1358 |
+
var theRange = null;
|
1359 |
+
if (document.createRange) {
|
1360 |
+
theRange = document.createRange();
|
1361 |
+
theRange.selectNode(elmt);
|
1362 |
+
}
|
1363 |
+
else {
|
1364 |
+
theRange = document.body.createTextRange();
|
1365 |
+
theRange.moveToElementText(elmt);
|
1366 |
+
theRange.select();
|
1367 |
+
}
|
1368 |
+
//set user selection
|
1369 |
+
if (userSelection)
|
1370 |
+
userSelection.addRange(theRange);
|
1371 |
+
};
|
1372 |
+
|
1373 |
+
_This.$DeselectElements = function () {
|
1374 |
+
if (document.selection) {
|
1375 |
+
document.selection.empty();
|
1376 |
+
} else if (window.getSelection) {
|
1377 |
+
window.getSelection().removeAllRanges();
|
1378 |
+
}
|
1379 |
+
};
|
1380 |
+
|
1381 |
+
_This.$Children = function (elmt) {
|
1382 |
+
var children = [];
|
1383 |
+
|
1384 |
+
for (var tmpEl = elmt.firstChild; tmpEl; tmpEl = tmpEl.nextSibling) {
|
1385 |
+
if (tmpEl.nodeType == 1) {
|
1386 |
+
children.push(tmpEl);
|
1387 |
+
}
|
1388 |
+
}
|
1389 |
+
|
1390 |
+
return children;
|
1391 |
+
};
|
1392 |
+
|
1393 |
+
function FindChild(elmt, attrValue, noDeep, attrName) {
|
1394 |
+
attrName = attrName || "u";
|
1395 |
+
|
1396 |
+
for (elmt = elmt ? elmt.firstChild : null; elmt; elmt = elmt.nextSibling) {
|
1397 |
+
if (elmt.nodeType == 1) {
|
1398 |
+
if (AttributeEx(elmt, attrName) == attrValue)
|
1399 |
+
return elmt;
|
1400 |
+
|
1401 |
+
if (!noDeep) {
|
1402 |
+
var childRet = FindChild(elmt, attrValue, noDeep, attrName);
|
1403 |
+
if (childRet)
|
1404 |
+
return childRet;
|
1405 |
+
}
|
1406 |
+
}
|
1407 |
+
}
|
1408 |
+
}
|
1409 |
+
|
1410 |
+
_This.$FindChild = FindChild;
|
1411 |
+
|
1412 |
+
function FindChildren(elmt, attrValue, noDeep, attrName) {
|
1413 |
+
attrName = attrName || "u";
|
1414 |
+
|
1415 |
+
var ret = [];
|
1416 |
+
|
1417 |
+
for (elmt = elmt ? elmt.firstChild : null; elmt; elmt = elmt.nextSibling) {
|
1418 |
+
if (elmt.nodeType == 1) {
|
1419 |
+
if (AttributeEx(elmt, attrName) == attrValue)
|
1420 |
+
ret.push(elmt);
|
1421 |
+
|
1422 |
+
if (!noDeep) {
|
1423 |
+
var childRet = FindChildren(elmt, attrValue, noDeep, attrName);
|
1424 |
+
if (childRet.length)
|
1425 |
+
ret = ret.concat(childRet);
|
1426 |
+
}
|
1427 |
+
}
|
1428 |
+
}
|
1429 |
+
|
1430 |
+
return ret;
|
1431 |
+
}
|
1432 |
+
|
1433 |
+
_This.$FindChildren = FindChildren;
|
1434 |
+
|
1435 |
+
function FindChildByTag(elmt, tagName, noDeep) {
|
1436 |
+
|
1437 |
+
for (elmt = elmt ? elmt.firstChild : null; elmt; elmt = elmt.nextSibling) {
|
1438 |
+
if (elmt.nodeType == 1) {
|
1439 |
+
if (elmt.tagName == tagName)
|
1440 |
+
return elmt;
|
1441 |
+
|
1442 |
+
if (!noDeep) {
|
1443 |
+
var childRet = FindChildByTag(elmt, tagName, noDeep);
|
1444 |
+
if (childRet)
|
1445 |
+
return childRet;
|
1446 |
+
}
|
1447 |
+
}
|
1448 |
+
}
|
1449 |
+
}
|
1450 |
+
|
1451 |
+
_This.$FindChildByTag = FindChildByTag;
|
1452 |
+
|
1453 |
+
function FindChildrenByTag(elmt, tagName, noDeep) {
|
1454 |
+
var ret = [];
|
1455 |
+
|
1456 |
+
for (elmt = elmt ? elmt.firstChild : null; elmt; elmt = elmt.nextSibling) {
|
1457 |
+
if (elmt.nodeType == 1) {
|
1458 |
+
if (!tagName || elmt.tagName == tagName)
|
1459 |
+
ret.push(elmt);
|
1460 |
+
|
1461 |
+
if (!noDeep) {
|
1462 |
+
var childRet = FindChildrenByTag(elmt, tagName, noDeep);
|
1463 |
+
if (childRet.length)
|
1464 |
+
ret = ret.concat(childRet);
|
1465 |
+
}
|
1466 |
+
}
|
1467 |
+
}
|
1468 |
+
|
1469 |
+
return ret;
|
1470 |
+
}
|
1471 |
+
|
1472 |
+
_This.$FindChildrenByTag = FindChildrenByTag;
|
1473 |
+
|
1474 |
+
_This.$GetElementsByTag = function (elmt, tagName) {
|
1475 |
+
return elmt.getElementsByTagName(tagName);
|
1476 |
+
};
|
1477 |
+
|
1478 |
+
function Extend(target) {
|
1479 |
+
for (var i = 1; i < arguments.length; i++) {
|
1480 |
+
|
1481 |
+
var options = arguments[i];
|
1482 |
+
|
1483 |
+
// Only deal with non-null/undefined values
|
1484 |
+
if (options) {
|
1485 |
+
// Extend the base object
|
1486 |
+
for (var name in options) {
|
1487 |
+
target[name] = options[name];
|
1488 |
+
}
|
1489 |
+
}
|
1490 |
+
}
|
1491 |
+
|
1492 |
+
// Return the modified object
|
1493 |
+
return target;
|
1494 |
+
}
|
1495 |
+
|
1496 |
+
_This.$Extend = Extend;
|
1497 |
+
|
1498 |
+
function Unextend(target, options) {
|
1499 |
+
$JssorDebug$.$Assert(options);
|
1500 |
+
|
1501 |
+
var unextended = {};
|
1502 |
+
|
1503 |
+
// Extend the base object
|
1504 |
+
for (var name in target) {
|
1505 |
+
if (target[name] != options[name]) {
|
1506 |
+
unextended[name] = target[name];
|
1507 |
+
}
|
1508 |
+
}
|
1509 |
+
|
1510 |
+
// Return the modified object
|
1511 |
+
return unextended;
|
1512 |
+
}
|
1513 |
+
|
1514 |
+
_This.$Unextend = Unextend;
|
1515 |
+
|
1516 |
+
_This.$IsUndefined = function (obj) {
|
1517 |
+
return type(obj) == "undefined";
|
1518 |
+
};
|
1519 |
+
|
1520 |
+
_This.$IsFunction = function (obj) {
|
1521 |
+
return type(obj) == "function";
|
1522 |
+
};
|
1523 |
+
|
1524 |
+
_This.$IsArray = function (obj) {
|
1525 |
+
return type(obj) == "array";
|
1526 |
+
};
|
1527 |
+
|
1528 |
+
_This.$IsString = function (obj) {
|
1529 |
+
return type(obj) == "string";
|
1530 |
+
};
|
1531 |
+
|
1532 |
+
_This.$IsNumeric = function (obj) {
|
1533 |
+
return !isNaN(ParseFloat(obj)) && isFinite(obj);
|
1534 |
+
};
|
1535 |
+
|
1536 |
+
_This.$IsWindow = function (obj) {
|
1537 |
+
return obj && obj == obj.window;
|
1538 |
+
};
|
1539 |
+
|
1540 |
+
_This.$Type = type;
|
1541 |
+
|
1542 |
+
// args is for internal usage only
|
1543 |
+
_This.$Each = each;
|
1544 |
+
|
1545 |
+
_This.$IsPlainObject = isPlainObject;
|
1546 |
+
|
1547 |
+
function CreateElement(tagName) {
|
1548 |
+
return document.createElement(tagName);
|
1549 |
+
}
|
1550 |
+
|
1551 |
+
_This.$CreateElement = CreateElement;
|
1552 |
+
|
1553 |
+
_This.$CreateDiv = function () {
|
1554 |
+
return CreateElement("DIV", document);
|
1555 |
+
};
|
1556 |
+
|
1557 |
+
_This.$CreateSpan = function () {
|
1558 |
+
return CreateElement("SPAN", document);
|
1559 |
+
};
|
1560 |
+
|
1561 |
+
_This.$EmptyFunction = function () { };
|
1562 |
+
|
1563 |
+
function Attribute(elmt, name, value) {
|
1564 |
+
if (value == undefined)
|
1565 |
+
return elmt.getAttribute(name);
|
1566 |
+
|
1567 |
+
elmt.setAttribute(name, value);
|
1568 |
+
}
|
1569 |
+
|
1570 |
+
function AttributeEx(elmt, name) {
|
1571 |
+
return Attribute(elmt, name) || Attribute(elmt, "data-" + name);
|
1572 |
+
}
|
1573 |
+
|
1574 |
+
_This.$Attribute = Attribute;
|
1575 |
+
_This.$AttributeEx = AttributeEx;
|
1576 |
+
|
1577 |
+
function ClassName(elmt, className) {
|
1578 |
+
if (className == undefined)
|
1579 |
+
return elmt.className;
|
1580 |
+
|
1581 |
+
elmt.className = className;
|
1582 |
+
}
|
1583 |
+
|
1584 |
+
_This.$ClassName = ClassName;
|
1585 |
+
|
1586 |
+
function ToHash(array) {
|
1587 |
+
var hash = {};
|
1588 |
+
|
1589 |
+
each(array, function (item) {
|
1590 |
+
hash[item] = item;
|
1591 |
+
});
|
1592 |
+
|
1593 |
+
return hash;
|
1594 |
+
}
|
1595 |
+
|
1596 |
+
_This.$ToHash = ToHash;
|
1597 |
+
|
1598 |
+
function Join(separator, strings) {
|
1599 |
+
/// <param name="separator" type="String">
|
1600 |
+
/// The element to show the dialog around
|
1601 |
+
/// </param>
|
1602 |
+
/// <param name="strings" type="Array" value="['1']">
|
1603 |
+
/// The element to show the dialog around
|
1604 |
+
/// </param>
|
1605 |
+
|
1606 |
+
var joined = "";
|
1607 |
+
|
1608 |
+
each(strings, function (str) {
|
1609 |
+
joined && (joined += separator);
|
1610 |
+
joined += str;
|
1611 |
+
});
|
1612 |
+
|
1613 |
+
return joined;
|
1614 |
+
}
|
1615 |
+
|
1616 |
+
_This.$Join = Join;
|
1617 |
+
|
1618 |
+
_This.$AddClass = function (elmt, className) {
|
1619 |
+
var newClassName = ClassName(elmt) + " " + className;
|
1620 |
+
ClassName(elmt, Join(" ", ToHash(newClassName.match(REGEX_WHITESPACE_GLOBAL))));
|
1621 |
+
};
|
1622 |
+
|
1623 |
+
_This.$RemoveClass = function (elmt, className) {
|
1624 |
+
ClassName(elmt, Join(" ", _This.$Unextend(ToHash(ClassName(elmt).match(REGEX_WHITESPACE_GLOBAL)), ToHash(className.match(REGEX_WHITESPACE_GLOBAL)))));
|
1625 |
+
};
|
1626 |
+
|
1627 |
+
_This.$ParentNode = function (elmt) {
|
1628 |
+
return elmt.parentNode;
|
1629 |
+
};
|
1630 |
+
|
1631 |
+
_This.$HideElement = function (elmt) {
|
1632 |
+
_This.$CssDisplay(elmt, "none");
|
1633 |
+
};
|
1634 |
+
|
1635 |
+
_This.$EnableElement = function (elmt, notEnable) {
|
1636 |
+
if (notEnable) {
|
1637 |
+
_This.$Attribute(elmt, "disabled", true);
|
1638 |
+
}
|
1639 |
+
else {
|
1640 |
+
_This.$RemoveAttribute(elmt, "disabled");
|
1641 |
+
}
|
1642 |
+
};
|
1643 |
+
|
1644 |
+
_This.$HideElements = function (elmts) {
|
1645 |
+
for (var i = 0; i < elmts.length; i++) {
|
1646 |
+
_This.$HideElement(elmts[i]);
|
1647 |
+
}
|
1648 |
+
};
|
1649 |
+
|
1650 |
+
_This.$ShowElement = function (elmt, hide) {
|
1651 |
+
_This.$CssDisplay(elmt, hide ? "none" : "");
|
1652 |
+
};
|
1653 |
+
|
1654 |
+
_This.$ShowElements = function (elmts, hide) {
|
1655 |
+
for (var i = 0; i < elmts.length; i++) {
|
1656 |
+
_This.$ShowElement(elmts[i], hide);
|
1657 |
+
}
|
1658 |
+
};
|
1659 |
+
|
1660 |
+
_This.$RemoveAttribute = function (elmt, attrbuteName) {
|
1661 |
+
elmt.removeAttribute(attrbuteName);
|
1662 |
+
};
|
1663 |
+
|
1664 |
+
_This.$CanClearClip = function () {
|
1665 |
+
return IsBrowserIE() && browserRuntimeVersion < 10;
|
1666 |
+
};
|
1667 |
+
|
1668 |
+
_This.$SetStyleClip = function (elmt, clip) {
|
1669 |
+
if (clip) {
|
1670 |
+
elmt.style.clip = "rect(" + Math.round(clip.$Top) + "px " + Math.round(clip.$Right) + "px " + Math.round(clip.$Bottom) + "px " + Math.round(clip.$Left) + "px)";
|
1671 |
+
}
|
1672 |
+
else {
|
1673 |
+
var cssText = elmt.style.cssText;
|
1674 |
+
var clipRegs = [
|
1675 |
+
new RegExp(/[\s]*clip: rect\(.*?\)[;]?/i),
|
1676 |
+
new RegExp(/[\s]*cliptop: .*?[;]?/i),
|
1677 |
+
new RegExp(/[\s]*clipright: .*?[;]?/i),
|
1678 |
+
new RegExp(/[\s]*clipbottom: .*?[;]?/i),
|
1679 |
+
new RegExp(/[\s]*clipleft: .*?[;]?/i)
|
1680 |
+
];
|
1681 |
+
|
1682 |
+
var newCssText = BuildNewCss(cssText, clipRegs, "");
|
1683 |
+
|
1684 |
+
$Jssor$.$CssCssText(elmt, newCssText);
|
1685 |
+
}
|
1686 |
+
};
|
1687 |
+
|
1688 |
+
_This.$GetNow = function () {
|
1689 |
+
return new Date().getTime();
|
1690 |
+
};
|
1691 |
+
|
1692 |
+
_This.$AppendChild = function (elmt, child) {
|
1693 |
+
elmt.appendChild(child);
|
1694 |
+
};
|
1695 |
+
|
1696 |
+
_This.$AppendChildren = function (elmt, children) {
|
1697 |
+
each(children, function (child) {
|
1698 |
+
_This.$AppendChild(elmt, child);
|
1699 |
+
});
|
1700 |
+
};
|
1701 |
+
|
1702 |
+
_This.$InsertBefore = function (elmt, child, refObject) {
|
1703 |
+
elmt.insertBefore(child, refObject);
|
1704 |
+
};
|
1705 |
+
|
1706 |
+
_This.$InsertAdjacentHtml = function (elmt, where, text) {
|
1707 |
+
elmt.insertAdjacentHTML(where, text);
|
1708 |
+
};
|
1709 |
+
|
1710 |
+
_This.$RemoveChild = function (elmt, child) {
|
1711 |
+
elmt.removeChild(child);
|
1712 |
+
};
|
1713 |
+
|
1714 |
+
_This.$RemoveChildren = function (elmt, children) {
|
1715 |
+
each(children, function (child) {
|
1716 |
+
_This.$RemoveChild(elmt, child);
|
1717 |
+
});
|
1718 |
+
};
|
1719 |
+
|
1720 |
+
_This.$ClearChildren = function (elmt) {
|
1721 |
+
_This.$RemoveChildren(elmt, _This.$Children(elmt));
|
1722 |
+
};
|
1723 |
+
|
1724 |
+
_This.$ParseInt = function (str, radix) {
|
1725 |
+
return parseInt(str, radix || 10);
|
1726 |
+
};
|
1727 |
+
|
1728 |
+
function ParseFloat(str) {
|
1729 |
+
return parseFloat(str);
|
1730 |
+
}
|
1731 |
+
|
1732 |
+
_This.$ParseFloat = ParseFloat;
|
1733 |
+
|
1734 |
+
_This.$IsChild = function (elmtA, elmtB) {
|
1735 |
+
var body = document.body;
|
1736 |
+
while (elmtB && elmtA != elmtB && body != elmtB) {
|
1737 |
+
try {
|
1738 |
+
elmtB = elmtB.parentNode;
|
1739 |
+
} catch (e) {
|
1740 |
+
// Firefox sometimes fires events for XUL elements, which throws
|
1741 |
+
// a "permission denied" error. so this is not a child.
|
1742 |
+
return false;
|
1743 |
+
}
|
1744 |
+
}
|
1745 |
+
return elmtA == elmtB;
|
1746 |
+
};
|
1747 |
+
|
1748 |
+
function CloneNode(elmt, noDeep) {
|
1749 |
+
return elmt.cloneNode(!noDeep);
|
1750 |
+
}
|
1751 |
+
|
1752 |
+
_This.$CloneNode = CloneNode;
|
1753 |
+
|
1754 |
+
function TranslateTransition(transition) {
|
1755 |
+
if (transition) {
|
1756 |
+
var flyDirection = transition.$FlyDirection;
|
1757 |
+
|
1758 |
+
if (flyDirection & 1) {
|
1759 |
+
transition.x = transition.$ScaleHorizontal || 1;
|
1760 |
+
}
|
1761 |
+
if (flyDirection & 2) {
|
1762 |
+
transition.x = -transition.$ScaleHorizontal || -1;
|
1763 |
+
}
|
1764 |
+
if (flyDirection & 4) {
|
1765 |
+
transition.y = transition.$ScaleVertical || 1;
|
1766 |
+
}
|
1767 |
+
if (flyDirection & 8) {
|
1768 |
+
transition.y = -transition.$ScaleVertical || -1;
|
1769 |
+
}
|
1770 |
+
|
1771 |
+
if (transition.$Rotate == true)
|
1772 |
+
transition.$Rotate = 1;
|
1773 |
+
|
1774 |
+
TranslateTransition(transition.$Brother);
|
1775 |
+
}
|
1776 |
+
}
|
1777 |
+
|
1778 |
+
_This.$TranslateTransitions = function (transitions) {
|
1779 |
+
/// <summary>
|
1780 |
+
/// For backward compatibility only.
|
1781 |
+
/// </summary>
|
1782 |
+
if (transitions) {
|
1783 |
+
for (var i = 0; i < transitions.length; i++) {
|
1784 |
+
TranslateTransition(transitions[i]);
|
1785 |
+
}
|
1786 |
+
for (var name in transitions) {
|
1787 |
+
TranslateTransition(transitions[name]);
|
1788 |
+
}
|
1789 |
+
}
|
1790 |
+
};
|
1791 |
+
|
1792 |
+
//function ImageLoader() {
|
1793 |
+
// var _ThisImageLoader = this;
|
1794 |
+
// var _BaseImageLoader = _This.$Inherit(_ThisImageLoader, $JssorObject$);
|
1795 |
+
|
1796 |
+
// var _ImageLoading = 1;
|
1797 |
+
// var _MainImageSrc;
|
1798 |
+
// var _MainImage;
|
1799 |
+
// var _CompleteCallback;
|
1800 |
+
// var _MainImageAbort;
|
1801 |
+
|
1802 |
+
// function LoadCompleteCallback(image, abort) {
|
1803 |
+
// _ImageLoading--;
|
1804 |
+
|
1805 |
+
// if (image) {
|
1806 |
+
// _This.$RemoveEvent(image, "load");
|
1807 |
+
// _This.$RemoveEvent(image, "abort");
|
1808 |
+
// _This.$RemoveEvent(image, "error");
|
1809 |
+
|
1810 |
+
// if (_MainImageSrc == image.src) {
|
1811 |
+
// _MainImage = image;
|
1812 |
+
// _MainImageAbort = abort;
|
1813 |
+
// }
|
1814 |
+
// }
|
1815 |
+
|
1816 |
+
// _CompleteCallback && _CompleteCallback(_MainImage, _MainImageAbort);
|
1817 |
+
// }
|
1818 |
+
|
1819 |
+
// function LoadImage(src) {
|
1820 |
+
// _ImageLoading++;
|
1821 |
+
|
1822 |
+
// if (IsBrowserOpera() && browserRuntimeVersion < 11.6 || !src) {
|
1823 |
+
// LoadImageCallback(callback, null, !src);
|
1824 |
+
// }
|
1825 |
+
// else {
|
1826 |
+
// var image = new Image();
|
1827 |
+
|
1828 |
+
// _This.$AddEvent(image, "load", _This.$CreateCallback(null, LoadImageCallback, image, false));
|
1829 |
+
|
1830 |
+
// var abortHandler = _This.$CreateCallback(null, LoadImageCallback, image, true);
|
1831 |
+
// _This.$AddEvent(image, "abort", abortHandler);
|
1832 |
+
// _This.$AddEvent(image, "error", abortHandler);
|
1833 |
+
|
1834 |
+
// image.src = src;
|
1835 |
+
// }
|
1836 |
+
// }
|
1837 |
+
|
1838 |
+
// _ThisImageLoader.$LoadImage = function (src, callback) {
|
1839 |
+
// _MainImageSrc = src;
|
1840 |
+
// _CompleteCallback = callback;
|
1841 |
+
|
1842 |
+
// LoadImage(src);
|
1843 |
+
// LoadComplete();
|
1844 |
+
// };
|
1845 |
+
|
1846 |
+
// _ThisImageLoader.$LoadImages = function (imageElmts, mainImageElmt, callback) {
|
1847 |
+
// mainImageElmt && (_MainImageSrc = mainImageElmt.src);
|
1848 |
+
// _CompleteCallback = callback;
|
1849 |
+
|
1850 |
+
// each(imageElmts, function (imageElmt) {
|
1851 |
+
// LoadImage(imageElmt.src);
|
1852 |
+
// });
|
1853 |
+
// LoadComplete();
|
1854 |
+
// };
|
1855 |
+
//}
|
1856 |
+
|
1857 |
+
_This.$LoadImage = function (src, callback) {
|
1858 |
+
var image = new Image();
|
1859 |
+
|
1860 |
+
function LoadImageCompleteHandler(abort) {
|
1861 |
+
_This.$RemoveEvent(image, "load", LoadImageCompleteHandler);
|
1862 |
+
_This.$RemoveEvent(image, "abort", ErrorOrAbortHandler);
|
1863 |
+
_This.$RemoveEvent(image, "error", ErrorOrAbortHandler);
|
1864 |
+
|
1865 |
+
if (callback)
|
1866 |
+
callback(image, abort);
|
1867 |
+
}
|
1868 |
+
|
1869 |
+
function ErrorOrAbortHandler() {
|
1870 |
+
LoadImageCompleteHandler(true);
|
1871 |
+
}
|
1872 |
+
|
1873 |
+
if (IsBrowserOpera() && browserRuntimeVersion < 11.6 || !src) {
|
1874 |
+
LoadImageCompleteHandler(!src);
|
1875 |
+
}
|
1876 |
+
else {
|
1877 |
+
|
1878 |
+
_This.$AddEvent(image, "load", LoadImageCompleteHandler);
|
1879 |
+
_This.$AddEvent(image, "abort", ErrorOrAbortHandler);
|
1880 |
+
_This.$AddEvent(image, "error", ErrorOrAbortHandler);
|
1881 |
+
|
1882 |
+
image.src = src;
|
1883 |
+
}
|
1884 |
+
};
|
1885 |
+
|
1886 |
+
_This.$LoadImages = function (imageElmts, mainImageElmt, callback) {
|
1887 |
+
|
1888 |
+
var _ImageLoading = imageElmts.length + 1;
|
1889 |
+
|
1890 |
+
function LoadImageCompleteEventHandler(image, abort) {
|
1891 |
+
_ImageLoading--;
|
1892 |
+
if (mainImageElmt && image && image.src == mainImageElmt.src)
|
1893 |
+
mainImageElmt = image;
|
1894 |
+
!_ImageLoading && callback && callback(mainImageElmt);
|
1895 |
+
}
|
1896 |
+
|
1897 |
+
each(imageElmts, function (imageElmt) {
|
1898 |
+
_This.$LoadImage(imageElmt.src, LoadImageCompleteEventHandler);
|
1899 |
+
});
|
1900 |
+
|
1901 |
+
LoadImageCompleteEventHandler();
|
1902 |
+
};
|
1903 |
+
|
1904 |
+
_This.$BuildElement = function (template, tagName, replacer, createCopy) {
|
1905 |
+
if (createCopy)
|
1906 |
+
template = CloneNode(template);
|
1907 |
+
|
1908 |
+
var templateHolders = FindChildren(template, tagName);
|
1909 |
+
if (!templateHolders.length)
|
1910 |
+
templateHolders = $Jssor$.$GetElementsByTag(template, tagName);
|
1911 |
+
|
1912 |
+
for (var j = templateHolders.length -1; j > -1; j--) {
|
1913 |
+
var templateHolder = templateHolders[j];
|
1914 |
+
var replaceItem = CloneNode(replacer);
|
1915 |
+
ClassName(replaceItem, ClassName(templateHolder));
|
1916 |
+
$Jssor$.$CssCssText(replaceItem, templateHolder.style.cssText);
|
1917 |
+
|
1918 |
+
var thumbnailPlaceHolderParent = $Jssor$.$ParentNode(templateHolder);
|
1919 |
+
$Jssor$.$InsertBefore(thumbnailPlaceHolderParent, replaceItem, templateHolder);
|
1920 |
+
$Jssor$.$RemoveChild(thumbnailPlaceHolderParent, templateHolder);
|
1921 |
+
}
|
1922 |
+
|
1923 |
+
return template;
|
1924 |
+
};
|
1925 |
+
|
1926 |
+
var _MouseDownButtons;
|
1927 |
+
function JssorButtonEx(elmt) {
|
1928 |
+
var _Self = this;
|
1929 |
+
|
1930 |
+
var _OriginClassName;
|
1931 |
+
|
1932 |
+
var _IsMouseDown; //class name 'dn'
|
1933 |
+
var _IsActive; //class name 'av'
|
1934 |
+
var _IsDisabled; //class name 'ds'
|
1935 |
+
|
1936 |
+
function Highlight() {
|
1937 |
+
var className = _OriginClassName;
|
1938 |
+
|
1939 |
+
if (_IsDisabled) {
|
1940 |
+
className += 'ds';
|
1941 |
+
}
|
1942 |
+
else if (_IsMouseDown) {
|
1943 |
+
className += 'dn';
|
1944 |
+
}
|
1945 |
+
else if (_IsActive) {
|
1946 |
+
className += "av";
|
1947 |
+
}
|
1948 |
+
|
1949 |
+
ClassName(elmt, className);
|
1950 |
+
}
|
1951 |
+
|
1952 |
+
function OnMouseDown(event) {
|
1953 |
+
if (_IsDisabled) {
|
1954 |
+
_This.$CancelEvent(event);
|
1955 |
+
}
|
1956 |
+
else {
|
1957 |
+
_MouseDownButtons.push(_Self);
|
1958 |
+
|
1959 |
+
_IsMouseDown = true;
|
1960 |
+
|
1961 |
+
Highlight();
|
1962 |
+
}
|
1963 |
+
}
|
1964 |
+
|
1965 |
+
_Self.$MouseUp = function () {
|
1966 |
+
/// <summary>
|
1967 |
+
/// Internal member function, do not use it.
|
1968 |
+
/// </summary>
|
1969 |
+
/// <private />
|
1970 |
+
|
1971 |
+
_IsMouseDown = false;
|
1972 |
+
|
1973 |
+
Highlight();
|
1974 |
+
};
|
1975 |
+
|
1976 |
+
_Self.$Activate = function (activate) {
|
1977 |
+
if (activate != undefined) {
|
1978 |
+
_IsActive = activate;
|
1979 |
+
|
1980 |
+
Highlight();
|
1981 |
+
}
|
1982 |
+
else {
|
1983 |
+
return _IsActive;
|
1984 |
+
}
|
1985 |
+
};
|
1986 |
+
|
1987 |
+
_Self.$Enable = function (enable) {
|
1988 |
+
if (enable != undefined) {
|
1989 |
+
_IsDisabled = !enable;
|
1990 |
+
|
1991 |
+
Highlight();
|
1992 |
+
}
|
1993 |
+
else {
|
1994 |
+
return !_IsDisabled;
|
1995 |
+
}
|
1996 |
+
};
|
1997 |
+
|
1998 |
+
//JssorButtonEx Constructor
|
1999 |
+
{
|
2000 |
+
elmt = _This.$GetElement(elmt);
|
2001 |
+
|
2002 |
+
if (!_MouseDownButtons) {
|
2003 |
+
_This.$AddEventBrowserMouseUp(function () {
|
2004 |
+
var oldMouseDownButtons = _MouseDownButtons;
|
2005 |
+
_MouseDownButtons = [];
|
2006 |
+
|
2007 |
+
each(oldMouseDownButtons, function (button) {
|
2008 |
+
button.$MouseUp();
|
2009 |
+
});
|
2010 |
+
});
|
2011 |
+
|
2012 |
+
_MouseDownButtons = [];
|
2013 |
+
}
|
2014 |
+
|
2015 |
+
_OriginClassName = ClassName(elmt);
|
2016 |
+
|
2017 |
+
$Jssor$.$AddEvent(elmt, "mousedown", OnMouseDown);
|
2018 |
+
}
|
2019 |
+
}
|
2020 |
+
|
2021 |
+
_This.$Buttonize = function (elmt) {
|
2022 |
+
return new JssorButtonEx(elmt);
|
2023 |
+
};
|
2024 |
+
|
2025 |
+
_This.$Css = Css;
|
2026 |
+
_This.$CssN = CssN;
|
2027 |
+
_This.$CssP = CssP;
|
2028 |
+
|
2029 |
+
_This.$CssOverflow = CssProxy("overflow");
|
2030 |
+
|
2031 |
+
_This.$CssTop = CssProxy("top", 2);
|
2032 |
+
_This.$CssLeft = CssProxy("left", 2);
|
2033 |
+
_This.$CssWidth = CssProxy("width", 2);
|
2034 |
+
_This.$CssHeight = CssProxy("height", 2);
|
2035 |
+
_This.$CssMarginLeft = CssProxy("marginLeft", 2);
|
2036 |
+
_This.$CssMarginTop = CssProxy("marginTop", 2);
|
2037 |
+
_This.$CssPosition = CssProxy("position");
|
2038 |
+
_This.$CssDisplay = CssProxy("display");
|
2039 |
+
_This.$CssZIndex = CssProxy("zIndex", 1);
|
2040 |
+
_This.$CssFloat = function (elmt, float) {
|
2041 |
+
return Css(elmt, IsBrowserIE() ? "styleFloat" : "cssFloat", float);
|
2042 |
+
};
|
2043 |
+
_This.$CssOpacity = function (elmt, opacity, ie9EarlierForce) {
|
2044 |
+
if (opacity != undefined) {
|
2045 |
+
SetStyleOpacity(elmt, opacity, ie9EarlierForce);
|
2046 |
+
}
|
2047 |
+
else {
|
2048 |
+
return GetStyleOpacity(elmt);
|
2049 |
+
}
|
2050 |
+
};
|
2051 |
+
|
2052 |
+
_This.$CssCssText = function (elmt, text) {
|
2053 |
+
if (text != undefined) {
|
2054 |
+
elmt.style.cssText = text;
|
2055 |
+
}
|
2056 |
+
else {
|
2057 |
+
return elmt.style.cssText;
|
2058 |
+
}
|
2059 |
+
};
|
2060 |
+
|
2061 |
+
var _StyleGetter = {
|
2062 |
+
$Opacity: _This.$CssOpacity,
|
2063 |
+
$Top: _This.$CssTop,
|
2064 |
+
$Left: _This.$CssLeft,
|
2065 |
+
$Width: _This.$CssWidth,
|
2066 |
+
$Height: _This.$CssHeight,
|
2067 |
+
$Position: _This.$CssPosition,
|
2068 |
+
$Display: _This.$CssDisplay,
|
2069 |
+
$ZIndex: _This.$CssZIndex
|
2070 |
+
};
|
2071 |
+
|
2072 |
+
var _StyleSetterReserved;
|
2073 |
+
|
2074 |
+
function StyleSetter() {
|
2075 |
+
if (!_StyleSetterReserved) {
|
2076 |
+
_StyleSetterReserved = Extend({
|
2077 |
+
$MarginTop: _This.$CssMarginTop,
|
2078 |
+
$MarginLeft: _This.$CssMarginLeft,
|
2079 |
+
$Clip: _This.$SetStyleClip,
|
2080 |
+
$Transform: _This.$SetStyleTransform
|
2081 |
+
}, _StyleGetter);
|
2082 |
+
}
|
2083 |
+
return _StyleSetterReserved;
|
2084 |
+
}
|
2085 |
+
|
2086 |
+
function StyleSetterEx() {
|
2087 |
+
StyleSetter();
|
2088 |
+
|
2089 |
+
//For Compression Only
|
2090 |
+
_StyleSetterReserved.$Transform = _StyleSetterReserved.$Transform;
|
2091 |
+
|
2092 |
+
return _StyleSetterReserved;
|
2093 |
+
}
|
2094 |
+
|
2095 |
+
_This.$StyleSetter = StyleSetter;
|
2096 |
+
|
2097 |
+
_This.$StyleSetterEx = StyleSetterEx;
|
2098 |
+
|
2099 |
+
_This.$GetStyles = function (elmt, originStyles) {
|
2100 |
+
StyleSetter();
|
2101 |
+
|
2102 |
+
var styles = {};
|
2103 |
+
|
2104 |
+
each(originStyles, function (value, key) {
|
2105 |
+
if (_StyleGetter[key]) {
|
2106 |
+
styles[key] = _StyleGetter[key](elmt);
|
2107 |
+
}
|
2108 |
+
});
|
2109 |
+
|
2110 |
+
return styles;
|
2111 |
+
};
|
2112 |
+
|
2113 |
+
_This.$SetStyles = function (elmt, styles) {
|
2114 |
+
var styleSetter = StyleSetter();
|
2115 |
+
|
2116 |
+
each(styles, function (value, key) {
|
2117 |
+
styleSetter[key] && styleSetter[key](elmt, value);
|
2118 |
+
});
|
2119 |
+
};
|
2120 |
+
|
2121 |
+
_This.$SetStylesEx = function (elmt, styles) {
|
2122 |
+
StyleSetterEx();
|
2123 |
+
|
2124 |
+
_This.$SetStyles(elmt, styles);
|
2125 |
+
};
|
2126 |
+
|
2127 |
+
$JssorMatrix$ = new function () {
|
2128 |
+
var _ThisMatrix = this;
|
2129 |
+
|
2130 |
+
function Multiply(ma, mb) {
|
2131 |
+
var acs = ma[0].length;
|
2132 |
+
var rows = ma.length;
|
2133 |
+
var cols = mb[0].length;
|
2134 |
+
|
2135 |
+
var matrix = [];
|
2136 |
+
|
2137 |
+
for (var r = 0; r < rows; r++) {
|
2138 |
+
var row = matrix[r] = [];
|
2139 |
+
for (var c = 0; c < cols; c++) {
|
2140 |
+
var unitValue = 0;
|
2141 |
+
|
2142 |
+
for (var ac = 0; ac < acs; ac++) {
|
2143 |
+
unitValue += ma[r][ac] * mb[ac][c];
|
2144 |
+
}
|
2145 |
+
|
2146 |
+
row[c] = unitValue;
|
2147 |
+
}
|
2148 |
+
}
|
2149 |
+
|
2150 |
+
return matrix;
|
2151 |
+
}
|
2152 |
+
|
2153 |
+
_ThisMatrix.$ScaleX = function (matrix, sx) {
|
2154 |
+
return _ThisMatrix.$ScaleXY(matrix, sx, 0);
|
2155 |
+
};
|
2156 |
+
|
2157 |
+
_ThisMatrix.$ScaleY = function (matrix, sy) {
|
2158 |
+
return _ThisMatrix.$ScaleXY(matrix, 0, sy);
|
2159 |
+
};
|
2160 |
+
|
2161 |
+
_ThisMatrix.$ScaleXY = function (matrix, sx, sy) {
|
2162 |
+
return Multiply(matrix, [[sx, 0], [0, sy]]);
|
2163 |
+
};
|
2164 |
+
|
2165 |
+
_ThisMatrix.$TransformPoint = function (matrix, p) {
|
2166 |
+
var pMatrix = Multiply(matrix, [[p.x], [p.y]]);
|
2167 |
+
|
2168 |
+
return Point(pMatrix[0][0], pMatrix[1][0]);
|
2169 |
+
};
|
2170 |
+
};
|
2171 |
+
|
2172 |
+
_This.$CreateMatrix = function (alpha, scaleX, scaleY) {
|
2173 |
+
var cos = Math.cos(alpha);
|
2174 |
+
var sin = Math.sin(alpha);
|
2175 |
+
//var r11 = cos;
|
2176 |
+
//var r21 = sin;
|
2177 |
+
//var r12 = -sin;
|
2178 |
+
//var r22 = cos;
|
2179 |
+
|
2180 |
+
//var m11 = cos * scaleX;
|
2181 |
+
//var m12 = -sin * scaleY;
|
2182 |
+
//var m21 = sin * scaleX;
|
2183 |
+
//var m22 = cos * scaleY;
|
2184 |
+
|
2185 |
+
return [[cos * scaleX, -sin * scaleY], [sin * scaleX, cos * scaleY]];
|
2186 |
+
};
|
2187 |
+
|
2188 |
+
_This.$GetMatrixOffset = function (matrix, width, height) {
|
2189 |
+
var p1 = $JssorMatrix$.$TransformPoint(matrix, Point(-width / 2, -height / 2));
|
2190 |
+
var p2 = $JssorMatrix$.$TransformPoint(matrix, Point(width / 2, -height / 2));
|
2191 |
+
var p3 = $JssorMatrix$.$TransformPoint(matrix, Point(width / 2, height / 2));
|
2192 |
+
var p4 = $JssorMatrix$.$TransformPoint(matrix, Point(-width / 2, height / 2));
|
2193 |
+
|
2194 |
+
return Point(Math.min(p1.x, p2.x, p3.x, p4.x) + width / 2, Math.min(p1.y, p2.y, p3.y, p4.y) + height / 2);
|
2195 |
+
};
|
2196 |
+
|
2197 |
+
_This.$Transform = function (fromStyles, toStyles, interPosition, easings, durings, rounds, options) {
|
2198 |
+
|
2199 |
+
var currentStyles = toStyles;
|
2200 |
+
|
2201 |
+
if (fromStyles) {
|
2202 |
+
currentStyles = {};
|
2203 |
+
|
2204 |
+
for (var key in toStyles) {
|
2205 |
+
var round = rounds[key] || 1;
|
2206 |
+
var during = durings[key] || [0, 1];
|
2207 |
+
var propertyInterPosition = (interPosition - during[0]) / during[1];
|
2208 |
+
propertyInterPosition = Math.min(Math.max(propertyInterPosition, 0), 1);
|
2209 |
+
propertyInterPosition = propertyInterPosition * round;
|
2210 |
+
var floorPosition = Math.floor(propertyInterPosition);
|
2211 |
+
if (propertyInterPosition != floorPosition)
|
2212 |
+
propertyInterPosition -= floorPosition;
|
2213 |
+
|
2214 |
+
var easing = easings[key] || easings.$Default;
|
2215 |
+
var easingValue = easing(propertyInterPosition);
|
2216 |
+
var currentPropertyValue;
|
2217 |
+
var value = fromStyles[key];
|
2218 |
+
var toValue = toStyles[key];
|
2219 |
+
|
2220 |
+
if ($Jssor$.$IsNumeric(toValue)) {
|
2221 |
+
currentPropertyValue = value + (toValue - value) * easingValue;
|
2222 |
+
}
|
2223 |
+
else {
|
2224 |
+
currentPropertyValue = $Jssor$.$Extend({ $Offset: {} }, fromStyles[key]);
|
2225 |
+
|
2226 |
+
$Jssor$.$Each(toValue.$Offset, function (rectX, n) {
|
2227 |
+
var offsetValue = rectX * easingValue;
|
2228 |
+
currentPropertyValue.$Offset[n] = offsetValue;
|
2229 |
+
currentPropertyValue[n] += offsetValue;
|
2230 |
+
});
|
2231 |
+
}
|
2232 |
+
currentStyles[key] = currentPropertyValue;
|
2233 |
+
}
|
2234 |
+
|
2235 |
+
if (fromStyles.$Zoom) {
|
2236 |
+
currentStyles.$Transform = { $Rotate: currentStyles.$Rotate || 0, $Scale: currentStyles.$Zoom, $OriginalWidth: options.$OriginalWidth, $OriginalHeight: options.$OriginalHeight };
|
2237 |
+
}
|
2238 |
+
}
|
2239 |
+
|
2240 |
+
if (toStyles.$Clip && options.$Move) {
|
2241 |
+
var styleFrameNClipOffset = currentStyles.$Clip.$Offset;
|
2242 |
+
|
2243 |
+
var offsetY = (styleFrameNClipOffset.$Top || 0) + (styleFrameNClipOffset.$Bottom || 0);
|
2244 |
+
var offsetX = (styleFrameNClipOffset.$Left || 0) + (styleFrameNClipOffset.$Right || 0);
|
2245 |
+
|
2246 |
+
currentStyles.$Left = (currentStyles.$Left || 0) + offsetX;
|
2247 |
+
currentStyles.$Top = (currentStyles.$Top || 0) + offsetY;
|
2248 |
+
currentStyles.$Clip.$Left -= offsetX;
|
2249 |
+
currentStyles.$Clip.$Right -= offsetX;
|
2250 |
+
currentStyles.$Clip.$Top -= offsetY;
|
2251 |
+
currentStyles.$Clip.$Bottom -= offsetY;
|
2252 |
+
}
|
2253 |
+
|
2254 |
+
if (currentStyles.$Clip && $Jssor$.$CanClearClip() && !currentStyles.$Clip.$Top && !currentStyles.$Clip.$Left && (currentStyles.$Clip.$Right == options.$OriginalWidth) && (currentStyles.$Clip.$Bottom == options.$OriginalHeight))
|
2255 |
+
currentStyles.$Clip = null;
|
2256 |
+
|
2257 |
+
return currentStyles;
|
2258 |
+
};
|
2259 |
+
};
|
2260 |
+
|
2261 |
+
//$JssorObject$
|
2262 |
+
var $JssorObject$ = window.$JssorObject$ = function () {
|
2263 |
+
var _ThisObject = this;
|
2264 |
+
// Fields
|
2265 |
+
|
2266 |
+
var _Listeners = []; // dictionary of eventName --> array of handlers
|
2267 |
+
var _Listenees = [];
|
2268 |
+
|
2269 |
+
// Private Methods
|
2270 |
+
function AddListener(eventName, handler) {
|
2271 |
+
|
2272 |
+
$JssorDebug$.$Execute(function () {
|
2273 |
+
if (eventName == undefined || eventName == null)
|
2274 |
+
throw new Error("param 'eventName' is null or empty.");
|
2275 |
+
|
2276 |
+
if (typeof (handler) != "function") {
|
2277 |
+
throw "param 'handler' must be a function.";
|
2278 |
+
}
|
2279 |
+
|
2280 |
+
$Jssor$.$Each(_Listeners, function (listener) {
|
2281 |
+
if (listener.$EventName == eventName && listener.$Handler === handler) {
|
2282 |
+
throw new Error("The handler listened to the event already, cannot listen to the same event of the same object with the same handler twice.");
|
2283 |
+
}
|
2284 |
+
});
|
2285 |
+
});
|
2286 |
+
|
2287 |
+
_Listeners.push({ $EventName: eventName, $Handler: handler });
|
2288 |
+
}
|
2289 |
+
|
2290 |
+
function RemoveListener(eventName, handler) {
|
2291 |
+
|
2292 |
+
$JssorDebug$.$Execute(function () {
|
2293 |
+
if (eventName == undefined || eventName == null)
|
2294 |
+
throw new Error("param 'eventName' is null or empty.");
|
2295 |
+
|
2296 |
+
if (typeof (handler) != "function") {
|
2297 |
+
throw "param 'handler' must be a function.";
|
2298 |
+
}
|
2299 |
+
});
|
2300 |
+
|
2301 |
+
$Jssor$.$Each(_Listeners, function (listener, index) {
|
2302 |
+
if (listener.$EventName == eventName && listener.$Handler === handler) {
|
2303 |
+
_Listeners.splice(index, 1);
|
2304 |
+
}
|
2305 |
+
});
|
2306 |
+
}
|
2307 |
+
|
2308 |
+
function ClearListeners() {
|
2309 |
+
_Listeners = [];
|
2310 |
+
}
|
2311 |
+
|
2312 |
+
function ClearListenees() {
|
2313 |
+
|
2314 |
+
$Jssor$.$Each(_Listenees, function (listenee) {
|
2315 |
+
$Jssor$.$RemoveEvent(listenee.$Obj, listenee.$EventName, listenee.$Handler);
|
2316 |
+
});
|
2317 |
+
|
2318 |
+
_Listenees = [];
|
2319 |
+
}
|
2320 |
+
|
2321 |
+
//Protected Methods
|
2322 |
+
_ThisObject.$Listen = function (obj, eventName, handler, useCapture) {
|
2323 |
+
|
2324 |
+
$JssorDebug$.$Execute(function () {
|
2325 |
+
if (!obj)
|
2326 |
+
throw new Error("param 'obj' is null or empty.");
|
2327 |
+
|
2328 |
+
if (eventName == undefined || eventName == null)
|
2329 |
+
throw new Error("param 'eventName' is null or empty.");
|
2330 |
+
|
2331 |
+
if (typeof (handler) != "function") {
|
2332 |
+
throw "param 'handler' must be a function.";
|
2333 |
+
}
|
2334 |
+
|
2335 |
+
$Jssor$.$Each(_Listenees, function (listenee) {
|
2336 |
+
if (listenee.$Obj === obj && listenee.$EventName == eventName && listenee.$Handler === handler) {
|
2337 |
+
throw new Error("The handler listened to the event already, cannot listen to the same event of the same object with the same handler twice.");
|
2338 |
+
}
|
2339 |
+
});
|
2340 |
+
});
|
2341 |
+
|
2342 |
+
$Jssor$.$AddEvent(obj, eventName, handler, useCapture);
|
2343 |
+
_Listenees.push({ $Obj: obj, $EventName: eventName, $Handler: handler });
|
2344 |
+
};
|
2345 |
+
|
2346 |
+
_ThisObject.$Unlisten = function (obj, eventName, handler) {
|
2347 |
+
|
2348 |
+
$JssorDebug$.$Execute(function () {
|
2349 |
+
if (!obj)
|
2350 |
+
throw new Error("param 'obj' is null or empty.");
|
2351 |
+
|
2352 |
+
if (eventName == undefined || eventName == null)
|
2353 |
+
throw new Error("param 'eventName' is null or empty.");
|
2354 |
+
|
2355 |
+
if (typeof (handler) != "function") {
|
2356 |
+
throw "param 'handler' must be a function.";
|
2357 |
+
}
|
2358 |
+
});
|
2359 |
+
|
2360 |
+
$Jssor$.$Each(_Listenees, function (listenee, index) {
|
2361 |
+
if (listenee.$Obj === obj && listenee.$EventName == eventName && listenee.$Handler === handler) {
|
2362 |
+
$Jssor$.$RemoveEvent(obj, eventName, handler);
|
2363 |
+
_Listenees.splice(index, 1);
|
2364 |
+
}
|
2365 |
+
});
|
2366 |
+
};
|
2367 |
+
|
2368 |
+
_ThisObject.$UnlistenAll = ClearListenees;
|
2369 |
+
|
2370 |
+
// Public Methods
|
2371 |
+
_ThisObject.$On = _ThisObject.addEventListener = AddListener;
|
2372 |
+
|
2373 |
+
_ThisObject.$Off = _ThisObject.removeEventListener = RemoveListener;
|
2374 |
+
|
2375 |
+
_ThisObject.$TriggerEvent = function (eventName) {
|
2376 |
+
|
2377 |
+
var args = [].slice.call(arguments, 1);
|
2378 |
+
|
2379 |
+
$Jssor$.$Each(_Listeners, function (listener) {
|
2380 |
+
try {
|
2381 |
+
listener.$EventName == eventName && listener.$Handler.apply(window, args);
|
2382 |
+
} catch (e) {
|
2383 |
+
// handler threw an error, ignore, go on to next one
|
2384 |
+
$JssorDebug$.$Error(e.name + " while executing " + eventName +
|
2385 |
+
" handler: " + e.message, e);
|
2386 |
+
}
|
2387 |
+
});
|
2388 |
+
};
|
2389 |
+
|
2390 |
+
_ThisObject.$Destroy = function () {
|
2391 |
+
ClearListenees();
|
2392 |
+
ClearListeners();
|
2393 |
+
|
2394 |
+
for (var name in _ThisObject)
|
2395 |
+
delete _ThisObject[name];
|
2396 |
+
};
|
2397 |
+
|
2398 |
+
$JssorDebug$.$C_AbstractClass(_ThisObject);
|
2399 |
+
};
|
2400 |
+
|
2401 |
+
$JssorAnimator$ = function (delay, duration, options, elmt, fromStyles, toStyles) {
|
2402 |
+
delay = delay || 0;
|
2403 |
+
|
2404 |
+
var _ThisAnimator = this;
|
2405 |
+
var _AutoPlay;
|
2406 |
+
var _Hiden;
|
2407 |
+
var _CombineMode;
|
2408 |
+
var _PlayToPosition;
|
2409 |
+
var _PlayDirection;
|
2410 |
+
var _NoStop;
|
2411 |
+
var _TimeStampLastFrame = 0;
|
2412 |
+
|
2413 |
+
var _SubEasings;
|
2414 |
+
var _SubRounds;
|
2415 |
+
var _SubDurings;
|
2416 |
+
var _Callback;
|
2417 |
+
|
2418 |
+
var _Position_Current = 0;
|
2419 |
+
var _Position_Display = 0;
|
2420 |
+
var _Hooked;
|
2421 |
+
|
2422 |
+
var _Position_InnerBegin = delay;
|
2423 |
+
var _Position_InnerEnd = delay + duration;
|
2424 |
+
var _Position_OuterBegin;
|
2425 |
+
var _Position_OuterEnd;
|
2426 |
+
var _LoopLength;
|
2427 |
+
|
2428 |
+
var _NestedAnimators = [];
|
2429 |
+
var _StyleSetter;
|
2430 |
+
|
2431 |
+
function GetPositionRange(position, begin, end) {
|
2432 |
+
var range = 0;
|
2433 |
+
|
2434 |
+
if (position < begin)
|
2435 |
+
range = -1;
|
2436 |
+
|
2437 |
+
else if (position > end)
|
2438 |
+
range = 1;
|
2439 |
+
|
2440 |
+
return range;
|
2441 |
+
}
|
2442 |
+
|
2443 |
+
function GetInnerPositionRange(position) {
|
2444 |
+
return GetPositionRange(position, _Position_InnerBegin, _Position_InnerEnd);
|
2445 |
+
}
|
2446 |
+
|
2447 |
+
function GetOuterPositionRange(position) {
|
2448 |
+
return GetPositionRange(position, _Position_OuterBegin, _Position_OuterEnd);
|
2449 |
+
}
|
2450 |
+
|
2451 |
+
function Shift(offset) {
|
2452 |
+
_Position_OuterBegin += offset;
|
2453 |
+
_Position_OuterEnd += offset;
|
2454 |
+
_Position_InnerBegin += offset;
|
2455 |
+
_Position_InnerEnd += offset;
|
2456 |
+
|
2457 |
+
_Position_Current += offset;
|
2458 |
+
_Position_Display += offset;
|
2459 |
+
|
2460 |
+
$Jssor$.$Each(_NestedAnimators, function (animator) {
|
2461 |
+
animator, animator.$Shift(offset);
|
2462 |
+
});
|
2463 |
+
}
|
2464 |
+
|
2465 |
+
function Locate(position, relative) {
|
2466 |
+
var offset = position - _Position_OuterBegin + delay * relative;
|
2467 |
+
|
2468 |
+
Shift(offset);
|
2469 |
+
|
2470 |
+
//$JssorDebug$.$Execute(function () {
|
2471 |
+
// _ThisAnimator.$Position_InnerBegin = _Position_InnerBegin;
|
2472 |
+
// _ThisAnimator.$Position_InnerEnd = _Position_InnerEnd;
|
2473 |
+
// _ThisAnimator.$Position_OuterBegin = _Position_OuterBegin;
|
2474 |
+
// _ThisAnimator.$Position_OuterEnd = _Position_OuterEnd;
|
2475 |
+
//});
|
2476 |
+
|
2477 |
+
return _Position_OuterEnd;
|
2478 |
+
}
|
2479 |
+
|
2480 |
+
function GoToPosition(positionOuter, force) {
|
2481 |
+
var trimedPositionOuter = positionOuter;
|
2482 |
+
|
2483 |
+
if (_LoopLength && (trimedPositionOuter >= _Position_OuterEnd || trimedPositionOuter <= _Position_OuterBegin)) {
|
2484 |
+
trimedPositionOuter = ((trimedPositionOuter - _Position_OuterBegin) % _LoopLength + _LoopLength) % _LoopLength + _Position_OuterBegin;
|
2485 |
+
}
|
2486 |
+
|
2487 |
+
if (!_Hooked || _NoStop || force || _Position_Current != trimedPositionOuter) {
|
2488 |
+
|
2489 |
+
var positionToDisplay = Math.min(trimedPositionOuter, _Position_OuterEnd);
|
2490 |
+
positionToDisplay = Math.max(positionToDisplay, _Position_OuterBegin);
|
2491 |
+
|
2492 |
+
if (!_Hooked || _NoStop || force || positionToDisplay != _Position_Display) {
|
2493 |
+
if (toStyles) {
|
2494 |
+
|
2495 |
+
var interPosition = (positionToDisplay - _Position_InnerBegin) / (duration || 1);
|
2496 |
+
|
2497 |
+
//if (options.$Optimize && $Jssor$.$IsBrowserChrome() && duration) {
|
2498 |
+
// interPosition = Math.round(interPosition / 8 * duration) * 8 / duration;
|
2499 |
+
//}
|
2500 |
+
|
2501 |
+
if (options.$Reverse)
|
2502 |
+
interPosition = 1 - interPosition;
|
2503 |
+
|
2504 |
+
var currentStyles = $Jssor$.$Transform(fromStyles, toStyles, interPosition, _SubEasings, _SubDurings, _SubRounds, options);
|
2505 |
+
|
2506 |
+
$Jssor$.$Each(currentStyles, function (value, key) {
|
2507 |
+
_StyleSetter[key] && _StyleSetter[key](elmt, value);
|
2508 |
+
});
|
2509 |
+
}
|
2510 |
+
|
2511 |
+
_ThisAnimator.$OnInnerOffsetChange(_Position_Display - _Position_InnerBegin, positionToDisplay - _Position_InnerBegin);
|
2512 |
+
}
|
2513 |
+
|
2514 |
+
_Position_Display = positionToDisplay;
|
2515 |
+
|
2516 |
+
$Jssor$.$Each(_NestedAnimators, function (animator, i) {
|
2517 |
+
var nestedAnimator = positionOuter < _Position_Current ? _NestedAnimators[_NestedAnimators.length - i - 1] : animator;
|
2518 |
+
nestedAnimator.$GoToPosition(positionOuter, force);
|
2519 |
+
});
|
2520 |
+
|
2521 |
+
var positionOld = _Position_Current;
|
2522 |
+
var positionNew = positionOuter;
|
2523 |
+
|
2524 |
+
_Position_Current = trimedPositionOuter;
|
2525 |
+
_Hooked = true;
|
2526 |
+
|
2527 |
+
_ThisAnimator.$OnPositionChange(positionOld, positionNew);
|
2528 |
+
}
|
2529 |
+
}
|
2530 |
+
|
2531 |
+
function Join(animator, combineMode) {
|
2532 |
+
/// <summary>
|
2533 |
+
/// Combine another animator as nested animator
|
2534 |
+
/// </summary>
|
2535 |
+
/// <param name="animator" type="$JssorAnimator$">
|
2536 |
+
/// An instance of $JssorAnimator$
|
2537 |
+
/// </param>
|
2538 |
+
/// <param name="combineMode" type="int">
|
2539 |
+
/// 0: parallel - place the animator parallel to this animator.
|
2540 |
+
/// 1: chain - chain the animator at the _Position_InnerEnd of this animator.
|
2541 |
+
/// </param>
|
2542 |
+
$JssorDebug$.$Execute(function () {
|
2543 |
+
if (combineMode !== 0 && combineMode !== 1)
|
2544 |
+
$JssorDebug$.$Fail("Argument out of range, the value of 'combineMode' should be either 0 or 1.");
|
2545 |
+
});
|
2546 |
+
|
2547 |
+
if (combineMode)
|
2548 |
+
animator.$Locate(_Position_OuterEnd, 1);
|
2549 |
+
|
2550 |
+
_Position_OuterEnd = Math.max(_Position_OuterEnd, animator.$GetPosition_OuterEnd());
|
2551 |
+
_NestedAnimators.push(animator);
|
2552 |
+
}
|
2553 |
+
|
2554 |
+
var RequestAnimationFrame = window.requestAnimationFrame
|
2555 |
+
|| window.webkitRequestAnimationFrame
|
2556 |
+
|| window.mozRequestAnimationFrame
|
2557 |
+
|| window.msRequestAnimationFrame;
|
2558 |
+
|
2559 |
+
if ($Jssor$.$IsBrowserSafari() && $Jssor$.$BrowserVersion() < 7) {
|
2560 |
+
RequestAnimationFrame = null;
|
2561 |
+
|
2562 |
+
$JssorDebug$.$Log("Custom animation frame for safari before 7.");
|
2563 |
+
}
|
2564 |
+
|
2565 |
+
RequestAnimationFrame = RequestAnimationFrame || function (callback) {
|
2566 |
+
$Jssor$.$Delay(callback, options.$Interval);
|
2567 |
+
};
|
2568 |
+
|
2569 |
+
function ShowFrame() {
|
2570 |
+
if (_AutoPlay) {
|
2571 |
+
var now = $Jssor$.$GetNow();
|
2572 |
+
var timeOffset = Math.min(now - _TimeStampLastFrame, options.$IntervalMax);
|
2573 |
+
var timePosition = _Position_Current + timeOffset * _PlayDirection;
|
2574 |
+
_TimeStampLastFrame = now;
|
2575 |
+
|
2576 |
+
if (timePosition * _PlayDirection >= _PlayToPosition * _PlayDirection)
|
2577 |
+
timePosition = _PlayToPosition;
|
2578 |
+
|
2579 |
+
GoToPosition(timePosition);
|
2580 |
+
|
2581 |
+
if (!_NoStop && timePosition * _PlayDirection >= _PlayToPosition * _PlayDirection) {
|
2582 |
+
Stop(_Callback);
|
2583 |
+
}
|
2584 |
+
else {
|
2585 |
+
RequestAnimationFrame(ShowFrame);
|
2586 |
+
}
|
2587 |
+
}
|
2588 |
+
}
|
2589 |
+
|
2590 |
+
function PlayToPosition(toPosition, callback, noStop) {
|
2591 |
+
if (!_AutoPlay) {
|
2592 |
+
_AutoPlay = true;
|
2593 |
+
_NoStop = noStop
|
2594 |
+
_Callback = callback;
|
2595 |
+
toPosition = Math.max(toPosition, _Position_OuterBegin);
|
2596 |
+
toPosition = Math.min(toPosition, _Position_OuterEnd);
|
2597 |
+
_PlayToPosition = toPosition;
|
2598 |
+
_PlayDirection = _PlayToPosition < _Position_Current ? -1 : 1;
|
2599 |
+
_ThisAnimator.$OnStart();
|
2600 |
+
_TimeStampLastFrame = $Jssor$.$GetNow();
|
2601 |
+
RequestAnimationFrame(ShowFrame);
|
2602 |
+
}
|
2603 |
+
}
|
2604 |
+
|
2605 |
+
function Stop(callback) {
|
2606 |
+
if (_AutoPlay) {
|
2607 |
+
_NoStop = _AutoPlay = _Callback = false;
|
2608 |
+
_ThisAnimator.$OnStop();
|
2609 |
+
|
2610 |
+
if (callback)
|
2611 |
+
callback();
|
2612 |
+
}
|
2613 |
+
}
|
2614 |
+
|
2615 |
+
_ThisAnimator.$Play = function (positionLength, callback, noStop) {
|
2616 |
+
PlayToPosition(positionLength ? _Position_Current + positionLength : _Position_OuterEnd, callback, noStop);
|
2617 |
+
};
|
2618 |
+
|
2619 |
+
_ThisAnimator.$PlayToPosition = PlayToPosition;
|
2620 |
+
|
2621 |
+
_ThisAnimator.$PlayToBegin = function (callback, noStop) {
|
2622 |
+
PlayToPosition(_Position_OuterBegin, callback, noStop);
|
2623 |
+
};
|
2624 |
+
|
2625 |
+
_ThisAnimator.$PlayToEnd = function (callback, noStop) {
|
2626 |
+
PlayToPosition(_Position_OuterEnd, callback, noStop);
|
2627 |
+
};
|
2628 |
+
|
2629 |
+
_ThisAnimator.$Stop = Stop;
|
2630 |
+
|
2631 |
+
_ThisAnimator.$Continue = function (toPosition) {
|
2632 |
+
PlayToPosition(toPosition);
|
2633 |
+
};
|
2634 |
+
|
2635 |
+
_ThisAnimator.$GetPosition = function () {
|
2636 |
+
return _Position_Current;
|
2637 |
+
};
|
2638 |
+
|
2639 |
+
_ThisAnimator.$GetPlayToPosition = function () {
|
2640 |
+
return _PlayToPosition;
|
2641 |
+
};
|
2642 |
+
|
2643 |
+
_ThisAnimator.$GetPosition_Display = function () {
|
2644 |
+
return _Position_Display;
|
2645 |
+
};
|
2646 |
+
|
2647 |
+
_ThisAnimator.$GoToPosition = GoToPosition;
|
2648 |
+
|
2649 |
+
_ThisAnimator.$GoToBegin = function () {
|
2650 |
+
GoToPosition(_Position_OuterBegin, true);
|
2651 |
+
};
|
2652 |
+
|
2653 |
+
_ThisAnimator.$GoToEnd = function () {
|
2654 |
+
GoToPosition(_Position_OuterEnd, true);
|
2655 |
+
};
|
2656 |
+
|
2657 |
+
_ThisAnimator.$Move = function (offset) {
|
2658 |
+
GoToPosition(_Position_Current + offset);
|
2659 |
+
};
|
2660 |
+
|
2661 |
+
_ThisAnimator.$CombineMode = function () {
|
2662 |
+
return _CombineMode;
|
2663 |
+
};
|
2664 |
+
|
2665 |
+
_ThisAnimator.$GetDuration = function () {
|
2666 |
+
return duration;
|
2667 |
+
};
|
2668 |
+
|
2669 |
+
_ThisAnimator.$IsPlaying = function () {
|
2670 |
+
return _AutoPlay;
|
2671 |
+
};
|
2672 |
+
|
2673 |
+
_ThisAnimator.$IsOnTheWay = function () {
|
2674 |
+
return _Position_Current > _Position_InnerBegin && _Position_Current <= _Position_InnerEnd;
|
2675 |
+
};
|
2676 |
+
|
2677 |
+
_ThisAnimator.$SetLoopLength = function (length) {
|
2678 |
+
_LoopLength = length;
|
2679 |
+
};
|
2680 |
+
|
2681 |
+
_ThisAnimator.$Locate = Locate;
|
2682 |
+
|
2683 |
+
_ThisAnimator.$Shift = Shift;
|
2684 |
+
|
2685 |
+
_ThisAnimator.$Join = Join;
|
2686 |
+
|
2687 |
+
_ThisAnimator.$Combine = function (animator) {
|
2688 |
+
/// <summary>
|
2689 |
+
/// Combine another animator parallel to this animator
|
2690 |
+
/// </summary>
|
2691 |
+
/// <param name="animator" type="$JssorAnimator$">
|
2692 |
+
/// An instance of $JssorAnimator$
|
2693 |
+
/// </param>
|
2694 |
+
Join(animator, 0);
|
2695 |
+
};
|
2696 |
+
|
2697 |
+
_ThisAnimator.$Chain = function (animator) {
|
2698 |
+
/// <summary>
|
2699 |
+
/// Chain another animator at the _Position_InnerEnd of this animator
|
2700 |
+
/// </summary>
|
2701 |
+
/// <param name="animator" type="$JssorAnimator$">
|
2702 |
+
/// An instance of $JssorAnimator$
|
2703 |
+
/// </param>
|
2704 |
+
Join(animator, 1);
|
2705 |
+
};
|
2706 |
+
|
2707 |
+
_ThisAnimator.$GetPosition_InnerBegin = function () {
|
2708 |
+
/// <summary>
|
2709 |
+
/// Internal member function, do not use it.
|
2710 |
+
/// </summary>
|
2711 |
+
/// <private />
|
2712 |
+
/// <returns type="int" />
|
2713 |
+
return _Position_InnerBegin;
|
2714 |
+
};
|
2715 |
+
|
2716 |
+
_ThisAnimator.$GetPosition_InnerEnd = function () {
|
2717 |
+
/// <summary>
|
2718 |
+
/// Internal member function, do not use it.
|
2719 |
+
/// </summary>
|
2720 |
+
/// <private />
|
2721 |
+
/// <returns type="int" />
|
2722 |
+
return _Position_InnerEnd;
|
2723 |
+
};
|
2724 |
+
|
2725 |
+
_ThisAnimator.$GetPosition_OuterBegin = function () {
|
2726 |
+
/// <summary>
|
2727 |
+
/// Internal member function, do not use it.
|
2728 |
+
/// </summary>
|
2729 |
+
/// <private />
|
2730 |
+
/// <returns type="int" />
|
2731 |
+
return _Position_OuterBegin;
|
2732 |
+
};
|
2733 |
+
|
2734 |
+
_ThisAnimator.$GetPosition_OuterEnd = function () {
|
2735 |
+
/// <summary>
|
2736 |
+
/// Internal member function, do not use it.
|
2737 |
+
/// </summary>
|
2738 |
+
/// <private />
|
2739 |
+
/// <returns type="int" />
|
2740 |
+
return _Position_OuterEnd;
|
2741 |
+
};
|
2742 |
+
|
2743 |
+
_ThisAnimator.$OnPositionChange = _ThisAnimator.$OnStart = _ThisAnimator.$OnStop = _ThisAnimator.$OnInnerOffsetChange = $Jssor$.$EmptyFunction;
|
2744 |
+
_ThisAnimator.$Version = $Jssor$.$GetNow();
|
2745 |
+
|
2746 |
+
//Constructor 1
|
2747 |
+
{
|
2748 |
+
options = $Jssor$.$Extend({
|
2749 |
+
$Interval: 16,
|
2750 |
+
$IntervalMax: 50
|
2751 |
+
}, options);
|
2752 |
+
|
2753 |
+
//Sodo statement, for development time intellisence only
|
2754 |
+
$JssorDebug$.$Execute(function () {
|
2755 |
+
options = $Jssor$.$Extend({
|
2756 |
+
$LoopLength: undefined,
|
2757 |
+
$Setter: undefined,
|
2758 |
+
$Easing: undefined
|
2759 |
+
}, options);
|
2760 |
+
});
|
2761 |
+
|
2762 |
+
_LoopLength = options.$LoopLength;
|
2763 |
+
|
2764 |
+
_StyleSetter = $Jssor$.$Extend({}, $Jssor$.$StyleSetter(), options.$Setter);
|
2765 |
+
|
2766 |
+
_Position_OuterBegin = _Position_InnerBegin = delay;
|
2767 |
+
_Position_OuterEnd = _Position_InnerEnd = delay + duration;
|
2768 |
+
|
2769 |
+
_SubRounds = options.$Round || {};
|
2770 |
+
_SubDurings = options.$During || {};
|
2771 |
+
_SubEasings = $Jssor$.$Extend({ $Default: $Jssor$.$IsFunction(options.$Easing) && options.$Easing || $JssorEasing$.$EaseSwing }, options.$Easing);
|
2772 |
+
}
|
2773 |
+
};
|
2774 |
+
|
2775 |
+
function $JssorPlayerClass$() {
|
2776 |
+
|
2777 |
+
var _ThisPlayer = this;
|
2778 |
+
var _PlayerControllers = [];
|
2779 |
+
|
2780 |
+
function PlayerController(playerElement) {
|
2781 |
+
var _SelfPlayerController = this;
|
2782 |
+
var _PlayerInstance;
|
2783 |
+
var _PlayerInstantces = [];
|
2784 |
+
|
2785 |
+
function OnPlayerInstanceDataAvailable(event) {
|
2786 |
+
var srcElement = $Jssor$.$EventSrc(event);
|
2787 |
+
_PlayerInstance = srcElement.pInstance;
|
2788 |
+
|
2789 |
+
$Jssor$.$RemoveEvent(srcElement, "dataavailable", OnPlayerInstanceDataAvailable);
|
2790 |
+
$Jssor$.$Each(_PlayerInstantces, function (playerInstance) {
|
2791 |
+
if (playerInstance != _PlayerInstance) {
|
2792 |
+
playerInstance.$Remove();
|
2793 |
+
}
|
2794 |
+
});
|
2795 |
+
|
2796 |
+
playerElement.pTagName = _PlayerInstance.tagName;
|
2797 |
+
_PlayerInstantces = null;
|
2798 |
+
}
|
2799 |
+
|
2800 |
+
function HandlePlayerInstance(playerInstanceElement) {
|
2801 |
+
var playerHandler;
|
2802 |
+
|
2803 |
+
if (!playerInstanceElement.pInstance) {
|
2804 |
+
var playerHandlerAttribute = $Jssor$.$AttributeEx(playerInstanceElement, "pHandler");
|
2805 |
+
|
2806 |
+
if ($JssorPlayer$[playerHandlerAttribute]) {
|
2807 |
+
$Jssor$.$AddEvent(playerInstanceElement, "dataavailable", OnPlayerInstanceDataAvailable);
|
2808 |
+
playerHandler = new $JssorPlayer$[playerHandlerAttribute](playerElement, playerInstanceElement);
|
2809 |
+
_PlayerInstantces.push(playerHandler);
|
2810 |
+
|
2811 |
+
$JssorDebug$.$Execute(function () {
|
2812 |
+
if ($Jssor$.$Type(playerHandler.$Remove) != "function") {
|
2813 |
+
$JssorDebug$.$Fail("'pRemove' interface not implemented for player handler '" + playerHandlerAttribute + "'.");
|
2814 |
+
}
|
2815 |
+
});
|
2816 |
+
}
|
2817 |
+
}
|
2818 |
+
|
2819 |
+
return playerHandler;
|
2820 |
+
}
|
2821 |
+
|
2822 |
+
_SelfPlayerController.$InitPlayerController = function () {
|
2823 |
+
if (!playerElement.pInstance && !HandlePlayerInstance(playerElement)) {
|
2824 |
+
|
2825 |
+
var playerInstanceElements = $Jssor$.$Children(playerElement);
|
2826 |
+
|
2827 |
+
$Jssor$.$Each(playerInstanceElements, function (playerInstanceElement) {
|
2828 |
+
HandlePlayerInstance(playerInstanceElement);
|
2829 |
+
});
|
2830 |
+
}
|
2831 |
+
};
|
2832 |
+
}
|
2833 |
+
|
2834 |
+
_ThisPlayer.$EVT_SWITCH = 21;
|
2835 |
+
|
2836 |
+
_ThisPlayer.$FetchPlayers = function (elmt) {
|
2837 |
+
elmt = elmt || document.body;
|
2838 |
+
|
2839 |
+
var playerElements = $Jssor$.$FindChildren(elmt, "player");
|
2840 |
+
|
2841 |
+
$Jssor$.$Each(playerElements, function (playerElement) {
|
2842 |
+
if (!_PlayerControllers[playerElement.pId]) {
|
2843 |
+
playerElement.pId = _PlayerControllers.length;
|
2844 |
+
_PlayerControllers.push(new PlayerController(playerElement));
|
2845 |
+
}
|
2846 |
+
var playerController = _PlayerControllers[playerElement.pId];
|
2847 |
+
playerController.$InitPlayerController();
|
2848 |
+
});
|
2849 |
+
};
|
2850 |
+
}
|
js/thumbnailslider/jssor.slider.js
ADDED
@@ -0,0 +1,4088 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/// <reference path="Jssor.js" />
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Jssor.Slider 18.0
|
5 |
+
* http://www.jssor.com/
|
6 |
+
*
|
7 |
+
* Licensed under the MIT license:
|
8 |
+
* http://www.opensource.org/licenses/MIT
|
9 |
+
*
|
10 |
+
* TERMS OF USE - Jssor.Slider
|
11 |
+
*
|
12 |
+
* Copyright 2014 Jssor
|
13 |
+
*
|
14 |
+
* Permission is hereby granted, free of charge, to any person obtaining
|
15 |
+
* a copy of this software and associated documentation files (the
|
16 |
+
* "Software"), to deal in the Software without restriction, including
|
17 |
+
* without limitation the rights to use, copy, modify, merge, publish,
|
18 |
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
19 |
+
* permit persons to whom the Software is furnished to do so, subject to
|
20 |
+
* the following conditions:
|
21 |
+
*
|
22 |
+
* The above copyright notice and this permission notice shall be
|
23 |
+
* included in all copies or substantial portions of the Software.
|
24 |
+
*
|
25 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
26 |
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
27 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
28 |
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
29 |
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
30 |
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
31 |
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
32 |
+
*/
|
33 |
+
|
34 |
+
var $JssorSlider$;
|
35 |
+
var $JssorSlideshowFormations$ = window.$JssorSlideshowFormations$ = {};
|
36 |
+
var $JssorSlideshowRunner$;
|
37 |
+
|
38 |
+
new function () {
|
39 |
+
//Constants +++++++
|
40 |
+
|
41 |
+
var COLUMN_INCREASE = 0;
|
42 |
+
var COLUMN_DECREASE = 1;
|
43 |
+
var ROW_INCREASE = 2;
|
44 |
+
var ROW_DECREASE = 3;
|
45 |
+
|
46 |
+
var DIRECTION_HORIZONTAL = 0x0003;
|
47 |
+
var DIRECTION_VERTICAL = 0x000C;
|
48 |
+
|
49 |
+
var TO_LEFT = 0x0001;
|
50 |
+
var TO_RIGHT = 0x0002;
|
51 |
+
var TO_TOP = 0x0004;
|
52 |
+
var TO_BOTTOM = 0x0008;
|
53 |
+
|
54 |
+
var FROM_LEFT = 0x0100;
|
55 |
+
var FROM_TOP = 0x0200;
|
56 |
+
var FROM_RIGHT = 0x0400;
|
57 |
+
var FROM_BOTTOM = 0x0800;
|
58 |
+
|
59 |
+
var ASSEMBLY_BOTTOM_LEFT = FROM_BOTTOM + TO_LEFT;
|
60 |
+
var ASSEMBLY_BOTTOM_RIGHT = FROM_BOTTOM + TO_RIGHT;
|
61 |
+
var ASSEMBLY_TOP_LEFT = FROM_TOP + TO_LEFT;
|
62 |
+
var ASSEMBLY_TOP_RIGHT = FROM_TOP + TO_RIGHT;
|
63 |
+
var ASSEMBLY_LEFT_TOP = FROM_LEFT + TO_TOP;
|
64 |
+
var ASSEMBLY_LEFT_BOTTOM = FROM_LEFT + TO_BOTTOM;
|
65 |
+
var ASSEMBLY_RIGHT_TOP = FROM_RIGHT + TO_TOP;
|
66 |
+
var ASSEMBLY_RIGHT_BOTTOM = FROM_RIGHT + TO_BOTTOM;
|
67 |
+
|
68 |
+
//Constants -------
|
69 |
+
|
70 |
+
//Formation Definition +++++++
|
71 |
+
function isToLeft(roadValue) {
|
72 |
+
return (roadValue & TO_LEFT) == TO_LEFT;
|
73 |
+
}
|
74 |
+
|
75 |
+
function isToRight(roadValue) {
|
76 |
+
return (roadValue & TO_RIGHT) == TO_RIGHT;
|
77 |
+
}
|
78 |
+
|
79 |
+
function isToTop(roadValue) {
|
80 |
+
return (roadValue & TO_TOP) == TO_TOP;
|
81 |
+
}
|
82 |
+
|
83 |
+
function isToBottom(roadValue) {
|
84 |
+
return (roadValue & TO_BOTTOM) == TO_BOTTOM;
|
85 |
+
}
|
86 |
+
|
87 |
+
function PushFormationOrder(arr, order, formationItem) {
|
88 |
+
formationItem.push(order);
|
89 |
+
arr[order] = arr[order] || [];
|
90 |
+
arr[order].push(formationItem);
|
91 |
+
}
|
92 |
+
|
93 |
+
$JssorSlideshowFormations$.$FormationStraight = function (transition) {
|
94 |
+
var cols = transition.$Cols;
|
95 |
+
var rows = transition.$Rows;
|
96 |
+
var formationDirection = transition.$Assembly;
|
97 |
+
var count = transition.$Count;
|
98 |
+
var a = [];
|
99 |
+
var i = 0;
|
100 |
+
var col = 0;
|
101 |
+
var r = 0;
|
102 |
+
var cl = cols - 1;
|
103 |
+
var rl = rows - 1;
|
104 |
+
var il = count - 1;
|
105 |
+
var cr;
|
106 |
+
var order;
|
107 |
+
for (r = 0; r < rows; r++) {
|
108 |
+
for (col = 0; col < cols; col++) {
|
109 |
+
cr = r + ',' + col;
|
110 |
+
switch (formationDirection) {
|
111 |
+
case ASSEMBLY_BOTTOM_LEFT:
|
112 |
+
order = il - (col * rows + (rl - r));
|
113 |
+
break;
|
114 |
+
case ASSEMBLY_RIGHT_TOP:
|
115 |
+
order = il - (r * cols + (cl - col));
|
116 |
+
break;
|
117 |
+
case ASSEMBLY_TOP_LEFT:
|
118 |
+
order = il - (col * rows + r);
|
119 |
+
case ASSEMBLY_LEFT_TOP:
|
120 |
+
order = il - (r * cols + col);
|
121 |
+
break;
|
122 |
+
case ASSEMBLY_BOTTOM_RIGHT:
|
123 |
+
order = col * rows + r;
|
124 |
+
break;
|
125 |
+
case ASSEMBLY_LEFT_BOTTOM:
|
126 |
+
order = r * cols + (cl - col);
|
127 |
+
break;
|
128 |
+
case ASSEMBLY_TOP_RIGHT:
|
129 |
+
order = col * rows + (rl - r);
|
130 |
+
break;
|
131 |
+
default:
|
132 |
+
order = r * cols + col;
|
133 |
+
break; //ASSEMBLY_RIGHT_BOTTOM
|
134 |
+
}
|
135 |
+
PushFormationOrder(a, order, [r, col]);
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
return a;
|
140 |
+
};
|
141 |
+
|
142 |
+
$JssorSlideshowFormations$.$FormationSwirl = function (transition) {
|
143 |
+
var cols = transition.$Cols;
|
144 |
+
var rows = transition.$Rows;
|
145 |
+
var formationDirection = transition.$Assembly;
|
146 |
+
var count = transition.$Count;
|
147 |
+
var a = [];
|
148 |
+
var hit = [];
|
149 |
+
var i = 0;
|
150 |
+
var col = 0;
|
151 |
+
var r = 0;
|
152 |
+
var cl = cols - 1;
|
153 |
+
var rl = rows - 1;
|
154 |
+
var il = count - 1;
|
155 |
+
var cr;
|
156 |
+
var courses;
|
157 |
+
var course = 0;
|
158 |
+
switch (formationDirection) {
|
159 |
+
case ASSEMBLY_BOTTOM_LEFT:
|
160 |
+
col = cl;
|
161 |
+
r = 0;
|
162 |
+
courses = [ROW_INCREASE, COLUMN_DECREASE, ROW_DECREASE, COLUMN_INCREASE];
|
163 |
+
break;
|
164 |
+
case ASSEMBLY_RIGHT_TOP:
|
165 |
+
col = 0;
|
166 |
+
r = rl;
|
167 |
+
courses = [COLUMN_INCREASE, ROW_DECREASE, COLUMN_DECREASE, ROW_INCREASE];
|
168 |
+
break;
|
169 |
+
case ASSEMBLY_TOP_LEFT:
|
170 |
+
col = cl;
|
171 |
+
r = rl;
|
172 |
+
courses = [ROW_DECREASE, COLUMN_DECREASE, ROW_INCREASE, COLUMN_INCREASE];
|
173 |
+
break;
|
174 |
+
case ASSEMBLY_LEFT_TOP:
|
175 |
+
col = cl;
|
176 |
+
r = rl;
|
177 |
+
courses = [COLUMN_DECREASE, ROW_DECREASE, COLUMN_INCREASE, ROW_INCREASE];
|
178 |
+
break;
|
179 |
+
case ASSEMBLY_BOTTOM_RIGHT:
|
180 |
+
col = 0;
|
181 |
+
r = 0;
|
182 |
+
courses = [ROW_INCREASE, COLUMN_INCREASE, ROW_DECREASE, COLUMN_DECREASE];
|
183 |
+
break;
|
184 |
+
case ASSEMBLY_LEFT_BOTTOM:
|
185 |
+
col = cl;
|
186 |
+
r = 0;
|
187 |
+
courses = [COLUMN_DECREASE, ROW_INCREASE, COLUMN_INCREASE, ROW_DECREASE];
|
188 |
+
break;
|
189 |
+
case ASSEMBLY_TOP_RIGHT:
|
190 |
+
col = 0;
|
191 |
+
r = rl;
|
192 |
+
courses = [ROW_DECREASE, COLUMN_INCREASE, ROW_INCREASE, COLUMN_DECREASE];
|
193 |
+
break;
|
194 |
+
default:
|
195 |
+
col = 0;
|
196 |
+
r = 0;
|
197 |
+
courses = [COLUMN_INCREASE, ROW_INCREASE, COLUMN_DECREASE, ROW_DECREASE];
|
198 |
+
break; //ASSEMBLY_RIGHT_BOTTOM
|
199 |
+
}
|
200 |
+
i = 0;
|
201 |
+
while (i < count) {
|
202 |
+
cr = r + ',' + col;
|
203 |
+
if (col >= 0 && col < cols && r >= 0 && r < rows && !hit[cr]) {
|
204 |
+
//a[cr] = i++;
|
205 |
+
hit[cr] = true;
|
206 |
+
PushFormationOrder(a, i++, [r, col]);
|
207 |
+
}
|
208 |
+
else {
|
209 |
+
switch (courses[course++ % courses.length]) {
|
210 |
+
case COLUMN_INCREASE:
|
211 |
+
col--;
|
212 |
+
break;
|
213 |
+
case ROW_INCREASE:
|
214 |
+
r--;
|
215 |
+
break;
|
216 |
+
case COLUMN_DECREASE:
|
217 |
+
col++;
|
218 |
+
break;
|
219 |
+
case ROW_DECREASE:
|
220 |
+
r++;
|
221 |
+
break;
|
222 |
+
}
|
223 |
+
}
|
224 |
+
|
225 |
+
switch (courses[course % courses.length]) {
|
226 |
+
case COLUMN_INCREASE:
|
227 |
+
col++;
|
228 |
+
break;
|
229 |
+
case ROW_INCREASE:
|
230 |
+
r++;
|
231 |
+
break;
|
232 |
+
case COLUMN_DECREASE:
|
233 |
+
col--;
|
234 |
+
break;
|
235 |
+
case ROW_DECREASE:
|
236 |
+
r--;
|
237 |
+
break;
|
238 |
+
}
|
239 |
+
}
|
240 |
+
return a;
|
241 |
+
};
|
242 |
+
|
243 |
+
$JssorSlideshowFormations$.$FormationZigZag = function (transition) {
|
244 |
+
var cols = transition.$Cols;
|
245 |
+
var rows = transition.$Rows;
|
246 |
+
var formationDirection = transition.$Assembly;
|
247 |
+
var count = transition.$Count;
|
248 |
+
var a = [];
|
249 |
+
var i = 0;
|
250 |
+
var col = 0;
|
251 |
+
var r = 0;
|
252 |
+
var cl = cols - 1;
|
253 |
+
var rl = rows - 1;
|
254 |
+
var il = count - 1;
|
255 |
+
var cr;
|
256 |
+
var courses;
|
257 |
+
var course = 0;
|
258 |
+
switch (formationDirection) {
|
259 |
+
case ASSEMBLY_BOTTOM_LEFT:
|
260 |
+
col = cl;
|
261 |
+
r = 0;
|
262 |
+
courses = [ROW_INCREASE, COLUMN_DECREASE, ROW_DECREASE, COLUMN_DECREASE];
|
263 |
+
break;
|
264 |
+
case ASSEMBLY_RIGHT_TOP:
|
265 |
+
col = 0;
|
266 |
+
r = rl;
|
267 |
+
courses = [COLUMN_INCREASE, ROW_DECREASE, COLUMN_DECREASE, ROW_DECREASE];
|
268 |
+
break;
|
269 |
+
case ASSEMBLY_TOP_LEFT:
|
270 |
+
col = cl;
|
271 |
+
r = rl;
|
272 |
+
courses = [ROW_DECREASE, COLUMN_DECREASE, ROW_INCREASE, COLUMN_DECREASE];
|
273 |
+
break;
|
274 |
+
case ASSEMBLY_LEFT_TOP:
|
275 |
+
col = cl;
|
276 |
+
r = rl;
|
277 |
+
courses = [COLUMN_DECREASE, ROW_DECREASE, COLUMN_INCREASE, ROW_DECREASE];
|
278 |
+
break;
|
279 |
+
case ASSEMBLY_BOTTOM_RIGHT:
|
280 |
+
col = 0;
|
281 |
+
r = 0;
|
282 |
+
courses = [ROW_INCREASE, COLUMN_INCREASE, ROW_DECREASE, COLUMN_INCREASE];
|
283 |
+
break;
|
284 |
+
case ASSEMBLY_LEFT_BOTTOM:
|
285 |
+
col = cl;
|
286 |
+
r = 0;
|
287 |
+
courses = [COLUMN_DECREASE, ROW_INCREASE, COLUMN_INCREASE, ROW_INCREASE];
|
288 |
+
break;
|
289 |
+
case ASSEMBLY_TOP_RIGHT:
|
290 |
+
col = 0;
|
291 |
+
r = rl;
|
292 |
+
courses = [ROW_DECREASE, COLUMN_INCREASE, ROW_INCREASE, COLUMN_INCREASE];
|
293 |
+
break;
|
294 |
+
default:
|
295 |
+
col = 0;
|
296 |
+
r = 0;
|
297 |
+
courses = [COLUMN_INCREASE, ROW_INCREASE, COLUMN_DECREASE, ROW_INCREASE];
|
298 |
+
break; //ASSEMBLY_RIGHT_BOTTOM
|
299 |
+
}
|
300 |
+
i = 0;
|
301 |
+
while (i < count) {
|
302 |
+
cr = r + ',' + col;
|
303 |
+
if (col >= 0 && col < cols && r >= 0 && r < rows && typeof (a[cr]) == 'undefined') {
|
304 |
+
PushFormationOrder(a, i++, [r, col]);
|
305 |
+
//a[cr] = i++;
|
306 |
+
switch (courses[course % courses.length]) {
|
307 |
+
case COLUMN_INCREASE:
|
308 |
+
col++;
|
309 |
+
break;
|
310 |
+
case ROW_INCREASE:
|
311 |
+
r++;
|
312 |
+
break;
|
313 |
+
case COLUMN_DECREASE:
|
314 |
+
col--;
|
315 |
+
break;
|
316 |
+
case ROW_DECREASE:
|
317 |
+
r--;
|
318 |
+
break;
|
319 |
+
}
|
320 |
+
}
|
321 |
+
else {
|
322 |
+
switch (courses[course++ % courses.length]) {
|
323 |
+
case COLUMN_INCREASE:
|
324 |
+
col--;
|
325 |
+
break;
|
326 |
+
case ROW_INCREASE:
|
327 |
+
r--;
|
328 |
+
break;
|
329 |
+
case COLUMN_DECREASE:
|
330 |
+
col++;
|
331 |
+
break;
|
332 |
+
case ROW_DECREASE:
|
333 |
+
r++;
|
334 |
+
break;
|
335 |
+
}
|
336 |
+
switch (courses[course++ % courses.length]) {
|
337 |
+
case COLUMN_INCREASE:
|
338 |
+
col++;
|
339 |
+
break;
|
340 |
+
case ROW_INCREASE:
|
341 |
+
r++;
|
342 |
+
break;
|
343 |
+
case COLUMN_DECREASE:
|
344 |
+
col--;
|
345 |
+
break;
|
346 |
+
case ROW_DECREASE:
|
347 |
+
r--;
|
348 |
+
break;
|
349 |
+
}
|
350 |
+
}
|
351 |
+
}
|
352 |
+
return a;
|
353 |
+
};
|
354 |
+
|
355 |
+
$JssorSlideshowFormations$.$FormationStraightStairs = function (transition) {
|
356 |
+
var cols = transition.$Cols;
|
357 |
+
var rows = transition.$Rows;
|
358 |
+
var formationDirection = transition.$Assembly;
|
359 |
+
var count = transition.$Count;
|
360 |
+
var a = [];
|
361 |
+
var i = 0;
|
362 |
+
var col = 0;
|
363 |
+
var r = 0;
|
364 |
+
var cl = cols - 1;
|
365 |
+
var rl = rows - 1;
|
366 |
+
var il = count - 1;
|
367 |
+
var cr;
|
368 |
+
switch (formationDirection) {
|
369 |
+
case ASSEMBLY_BOTTOM_LEFT:
|
370 |
+
case ASSEMBLY_TOP_RIGHT:
|
371 |
+
case ASSEMBLY_TOP_LEFT:
|
372 |
+
case ASSEMBLY_BOTTOM_RIGHT:
|
373 |
+
var C = 0;
|
374 |
+
var R = 0;
|
375 |
+
break;
|
376 |
+
case ASSEMBLY_LEFT_BOTTOM:
|
377 |
+
case ASSEMBLY_RIGHT_TOP:
|
378 |
+
case ASSEMBLY_LEFT_TOP:
|
379 |
+
case ASSEMBLY_RIGHT_BOTTOM:
|
380 |
+
var C = cl;
|
381 |
+
var R = 0;
|
382 |
+
break;
|
383 |
+
default:
|
384 |
+
formationDirection = ASSEMBLY_RIGHT_BOTTOM;
|
385 |
+
var C = cl;
|
386 |
+
var R = 0;
|
387 |
+
break;
|
388 |
+
}
|
389 |
+
col = C;
|
390 |
+
r = R;
|
391 |
+
while (i < count) {
|
392 |
+
cr = r + ',' + col;
|
393 |
+
if (isToTop(formationDirection) || isToRight(formationDirection)) {
|
394 |
+
PushFormationOrder(a, il - i++, [r, col]);
|
395 |
+
//a[cr] = il - i++;
|
396 |
+
}
|
397 |
+
else {
|
398 |
+
PushFormationOrder(a, i++, [r, col]);
|
399 |
+
//a[cr] = i++;
|
400 |
+
}
|
401 |
+
switch (formationDirection) {
|
402 |
+
case ASSEMBLY_BOTTOM_LEFT:
|
403 |
+
case ASSEMBLY_TOP_RIGHT:
|
404 |
+
col--;
|
405 |
+
r++;
|
406 |
+
break;
|
407 |
+
case ASSEMBLY_TOP_LEFT:
|
408 |
+
case ASSEMBLY_BOTTOM_RIGHT:
|
409 |
+
col++;
|
410 |
+
r--;
|
411 |
+
break;
|
412 |
+
case ASSEMBLY_LEFT_BOTTOM:
|
413 |
+
case ASSEMBLY_RIGHT_TOP:
|
414 |
+
col--;
|
415 |
+
r--;
|
416 |
+
break;
|
417 |
+
case ASSEMBLY_RIGHT_BOTTOM:
|
418 |
+
case ASSEMBLY_LEFT_TOP:
|
419 |
+
default:
|
420 |
+
col++;
|
421 |
+
r++;
|
422 |
+
break;
|
423 |
+
}
|
424 |
+
if (col < 0 || r < 0 || col > cl || r > rl) {
|
425 |
+
switch (formationDirection) {
|
426 |
+
case ASSEMBLY_BOTTOM_LEFT:
|
427 |
+
case ASSEMBLY_TOP_RIGHT:
|
428 |
+
C++;
|
429 |
+
break;
|
430 |
+
case ASSEMBLY_LEFT_BOTTOM:
|
431 |
+
case ASSEMBLY_RIGHT_TOP:
|
432 |
+
case ASSEMBLY_TOP_LEFT:
|
433 |
+
case ASSEMBLY_BOTTOM_RIGHT:
|
434 |
+
R++;
|
435 |
+
break;
|
436 |
+
case ASSEMBLY_RIGHT_BOTTOM:
|
437 |
+
case ASSEMBLY_LEFT_TOP:
|
438 |
+
default:
|
439 |
+
C--;
|
440 |
+
break;
|
441 |
+
}
|
442 |
+
if (C < 0 || R < 0 || C > cl || R > rl) {
|
443 |
+
switch (formationDirection) {
|
444 |
+
case ASSEMBLY_BOTTOM_LEFT:
|
445 |
+
case ASSEMBLY_TOP_RIGHT:
|
446 |
+
C = cl;
|
447 |
+
R++;
|
448 |
+
break;
|
449 |
+
case ASSEMBLY_TOP_LEFT:
|
450 |
+
case ASSEMBLY_BOTTOM_RIGHT:
|
451 |
+
R = rl;
|
452 |
+
C++;
|
453 |
+
break;
|
454 |
+
case ASSEMBLY_LEFT_BOTTOM:
|
455 |
+
case ASSEMBLY_RIGHT_TOP: R = rl; C--;
|
456 |
+
break;
|
457 |
+
case ASSEMBLY_RIGHT_BOTTOM:
|
458 |
+
case ASSEMBLY_LEFT_TOP:
|
459 |
+
default:
|
460 |
+
C = 0;
|
461 |
+
R++;
|
462 |
+
break;
|
463 |
+
}
|
464 |
+
if (R > rl)
|
465 |
+
R = rl;
|
466 |
+
else if (R < 0)
|
467 |
+
R = 0;
|
468 |
+
else if (C > cl)
|
469 |
+
C = cl;
|
470 |
+
else if (C < 0)
|
471 |
+
C = 0;
|
472 |
+
}
|
473 |
+
r = R;
|
474 |
+
col = C;
|
475 |
+
}
|
476 |
+
}
|
477 |
+
return a;
|
478 |
+
};
|
479 |
+
|
480 |
+
$JssorSlideshowFormations$.$FormationSquare = function (transition) {
|
481 |
+
var cols = transition.$Cols || 1;
|
482 |
+
var rows = transition.$Rows || 1;
|
483 |
+
var arr = [];
|
484 |
+
var i = 0;
|
485 |
+
var col;
|
486 |
+
var r;
|
487 |
+
var dc;
|
488 |
+
var dr;
|
489 |
+
var cr;
|
490 |
+
dc = cols < rows ? (rows - cols) / 2 : 0;
|
491 |
+
dr = cols > rows ? (cols - rows) / 2 : 0;
|
492 |
+
cr = Math.round(Math.max(cols / 2, rows / 2)) + 1;
|
493 |
+
for (col = 0; col < cols; col++) {
|
494 |
+
for (r = 0; r < rows; r++)
|
495 |
+
PushFormationOrder(arr, cr - Math.min(col + 1 + dc, r + 1 + dr, cols - col + dc, rows - r + dr), [r, col]);
|
496 |
+
}
|
497 |
+
return arr;
|
498 |
+
};
|
499 |
+
|
500 |
+
$JssorSlideshowFormations$.$FormationRectangle = function (transition) {
|
501 |
+
var cols = transition.$Cols || 1;
|
502 |
+
var rows = transition.$Rows || 1;
|
503 |
+
var arr = [];
|
504 |
+
var i = 0;
|
505 |
+
var col;
|
506 |
+
var r;
|
507 |
+
var cr;
|
508 |
+
cr = Math.round(Math.min(cols / 2, rows / 2)) + 1;
|
509 |
+
for (col = 0; col < cols; col++) {
|
510 |
+
for (r = 0; r < rows; r++)
|
511 |
+
PushFormationOrder(arr, cr - Math.min(col + 1, r + 1, cols - col, rows - r), [r, col]);
|
512 |
+
}
|
513 |
+
return arr;
|
514 |
+
};
|
515 |
+
|
516 |
+
$JssorSlideshowFormations$.$FormationRandom = function (transition) {
|
517 |
+
var a = [];
|
518 |
+
var r, col, i;
|
519 |
+
for (r = 0; r < transition.$Rows; r++) {
|
520 |
+
for (col = 0; col < transition.$Cols; col++)
|
521 |
+
PushFormationOrder(a, Math.ceil(100000 * Math.random()) % 13, [r, col]);
|
522 |
+
}
|
523 |
+
|
524 |
+
return a;
|
525 |
+
};
|
526 |
+
|
527 |
+
$JssorSlideshowFormations$.$FormationCircle = function (transition) {
|
528 |
+
var cols = transition.$Cols || 1;
|
529 |
+
var rows = transition.$Rows || 1;
|
530 |
+
var arr = [];
|
531 |
+
var i = 0;
|
532 |
+
var col;
|
533 |
+
var r;
|
534 |
+
var hc = cols / 2 - 0.5;
|
535 |
+
var hr = rows / 2 - 0.5;
|
536 |
+
for (col = 0; col < cols; col++) {
|
537 |
+
for (r = 0; r < rows; r++)
|
538 |
+
PushFormationOrder(arr, Math.round(Math.sqrt(Math.pow(col - hc, 2) + Math.pow(r - hr, 2))), [r, col]);
|
539 |
+
}
|
540 |
+
return arr;
|
541 |
+
};
|
542 |
+
|
543 |
+
$JssorSlideshowFormations$.$FormationCross = function (transition) {
|
544 |
+
var cols = transition.$Cols || 1;
|
545 |
+
var rows = transition.$Rows || 1;
|
546 |
+
var arr = [];
|
547 |
+
var i = 0;
|
548 |
+
var col;
|
549 |
+
var r;
|
550 |
+
var hc = cols / 2 - 0.5;
|
551 |
+
var hr = rows / 2 - 0.5;
|
552 |
+
for (col = 0; col < cols; col++) {
|
553 |
+
for (r = 0; r < rows; r++)
|
554 |
+
PushFormationOrder(arr, Math.round(Math.min(Math.abs(col - hc), Math.abs(r - hr))), [r, col]);
|
555 |
+
}
|
556 |
+
return arr;
|
557 |
+
};
|
558 |
+
|
559 |
+
$JssorSlideshowFormations$.$FormationRectangleCross = function (transition) {
|
560 |
+
var cols = transition.$Cols || 1;
|
561 |
+
var rows = transition.$Rows || 1;
|
562 |
+
var arr = [];
|
563 |
+
var i = 0;
|
564 |
+
var col;
|
565 |
+
var r;
|
566 |
+
var hc = cols / 2 - 0.5;
|
567 |
+
var hr = rows / 2 - 0.5;
|
568 |
+
var cr = Math.max(hc, hr) + 1;
|
569 |
+
for (col = 0; col < cols; col++) {
|
570 |
+
for (r = 0; r < rows; r++)
|
571 |
+
PushFormationOrder(arr, Math.round(cr - Math.max(hc - Math.abs(col - hc), hr - Math.abs(r - hr))) - 1, [r, col]);
|
572 |
+
}
|
573 |
+
return arr;
|
574 |
+
};
|
575 |
+
|
576 |
+
function GetFormation(transition) {
|
577 |
+
|
578 |
+
var formationInstance = transition.$Formation(transition);
|
579 |
+
|
580 |
+
return transition.$Reverse ? formationInstance.reverse() : formationInstance;
|
581 |
+
|
582 |
+
} //GetFormation
|
583 |
+
|
584 |
+
//var _PrototypeTransitions = [];
|
585 |
+
function EnsureTransitionInstance(options, slideshowInterval) {
|
586 |
+
|
587 |
+
var _SlideshowTransition = {
|
588 |
+
$Interval: slideshowInterval, //Delay to play next frame
|
589 |
+
$Duration: 1, //Duration to finish the entire transition
|
590 |
+
$Delay: 0, //Delay to assembly blocks
|
591 |
+
$Cols: 1, //Number of columns
|
592 |
+
$Rows: 1, //Number of rows
|
593 |
+
$Opacity: 0, //Fade block or not
|
594 |
+
$Zoom: 0, //Zoom block or not
|
595 |
+
$Clip: 0, //Clip block or not
|
596 |
+
$Move: false, //Move block or not
|
597 |
+
$SlideOut: false, //Slide the previous slide out to display next slide instead
|
598 |
+
//$FlyDirection: 0, //Specify fly transform with direction
|
599 |
+
$Reverse: false, //Reverse the assembly or not
|
600 |
+
$Formation: $JssorSlideshowFormations$.$FormationRandom, //Shape that assembly blocks as
|
601 |
+
$Assembly: ASSEMBLY_RIGHT_BOTTOM, //The way to assembly blocks
|
602 |
+
$ChessMode: { $Column: 0, $Row: 0 }, //Chess move or fly direction
|
603 |
+
$Easing: $JssorEasing$.$EaseSwing, //Specify variation of speed during transition
|
604 |
+
$Round: {},
|
605 |
+
$Blocks: [],
|
606 |
+
$During: {}
|
607 |
+
};
|
608 |
+
|
609 |
+
$Jssor$.$Extend(_SlideshowTransition, options);
|
610 |
+
|
611 |
+
_SlideshowTransition.$Count = _SlideshowTransition.$Cols * _SlideshowTransition.$Rows;
|
612 |
+
if ($Jssor$.$IsFunction(_SlideshowTransition.$Easing))
|
613 |
+
_SlideshowTransition.$Easing = { $Default: _SlideshowTransition.$Easing };
|
614 |
+
|
615 |
+
_SlideshowTransition.$FramesCount = Math.ceil(_SlideshowTransition.$Duration / _SlideshowTransition.$Interval);
|
616 |
+
_SlideshowTransition.$EasingInstance = GetEasing(_SlideshowTransition);
|
617 |
+
|
618 |
+
_SlideshowTransition.$GetBlocks = function (width, height) {
|
619 |
+
width /= _SlideshowTransition.$Cols;
|
620 |
+
height /= _SlideshowTransition.$Rows;
|
621 |
+
var wh = width + 'x' + height;
|
622 |
+
if (!_SlideshowTransition.$Blocks[wh]) {
|
623 |
+
_SlideshowTransition.$Blocks[wh] = { $Width: width, $Height: height };
|
624 |
+
for (var col = 0; col < _SlideshowTransition.$Cols; col++) {
|
625 |
+
for (var r = 0; r < _SlideshowTransition.$Rows; r++)
|
626 |
+
_SlideshowTransition.$Blocks[wh][r + ',' + col] = { $Top: r * height, $Right: col * width + width, $Bottom: r * height + height, $Left: col * width };
|
627 |
+
}
|
628 |
+
}
|
629 |
+
|
630 |
+
return _SlideshowTransition.$Blocks[wh];
|
631 |
+
};
|
632 |
+
|
633 |
+
if (_SlideshowTransition.$Brother) {
|
634 |
+
_SlideshowTransition.$Brother = EnsureTransitionInstance(_SlideshowTransition.$Brother, slideshowInterval);
|
635 |
+
_SlideshowTransition.$SlideOut = true;
|
636 |
+
}
|
637 |
+
|
638 |
+
return _SlideshowTransition;
|
639 |
+
}
|
640 |
+
|
641 |
+
function GetEasing(transition) {
|
642 |
+
var easing = transition.$Easing;
|
643 |
+
if (!easing.$Default)
|
644 |
+
easing.$Default = $JssorEasing$.$EaseSwing;
|
645 |
+
|
646 |
+
var duration = transition.$FramesCount;
|
647 |
+
|
648 |
+
var cache = easing.$Cache;
|
649 |
+
if (!cache) {
|
650 |
+
var enumerator = $Jssor$.$Extend({}, transition.$Easing, transition.$Round);
|
651 |
+
cache = easing.$Cache = {};
|
652 |
+
|
653 |
+
$Jssor$.$Each(enumerator, function (v, easingName) {
|
654 |
+
var easingFunction = easing[easingName] || easing.$Default;
|
655 |
+
var round = transition.$Round[easingName] || 1;
|
656 |
+
|
657 |
+
if (!$Jssor$.$IsArray(easingFunction.$Cache))
|
658 |
+
easingFunction.$Cache = [];
|
659 |
+
|
660 |
+
var easingFunctionCache = easingFunction.$Cache[duration] = easingFunction.$Cache[duration] || [];
|
661 |
+
|
662 |
+
if (!easingFunctionCache[round]) {
|
663 |
+
easingFunctionCache[round] = [0];
|
664 |
+
for (var t = 1; t <= duration; t++) {
|
665 |
+
var tRound = t / duration * round;
|
666 |
+
var tRoundFloor = Math.floor(tRound);
|
667 |
+
if (tRound != tRoundFloor)
|
668 |
+
tRound -= tRoundFloor;
|
669 |
+
easingFunctionCache[round][t] = easingFunction(tRound);
|
670 |
+
}
|
671 |
+
}
|
672 |
+
|
673 |
+
cache[easingName] = easingFunctionCache;
|
674 |
+
|
675 |
+
});
|
676 |
+
}
|
677 |
+
|
678 |
+
return cache;
|
679 |
+
} //GetEasing
|
680 |
+
|
681 |
+
//Formation Definition -------
|
682 |
+
|
683 |
+
function JssorSlideshowPlayer(slideContainer, slideElement, slideTransition, beginTime, slideContainerWidth, slideContainerHeight) {
|
684 |
+
var _Self = this;
|
685 |
+
|
686 |
+
var _Block;
|
687 |
+
var _StartStylesArr = {};
|
688 |
+
var _AnimationStylesArrs = {};
|
689 |
+
var _AnimationBlockItems = [];
|
690 |
+
var _StyleStart;
|
691 |
+
var _StyleEnd;
|
692 |
+
var _StyleDif;
|
693 |
+
var _ChessModeColumn = slideTransition.$ChessMode.$Column || 0;
|
694 |
+
var _ChessModeRow = slideTransition.$ChessMode.$Row || 0;
|
695 |
+
|
696 |
+
var _Blocks = slideTransition.$GetBlocks(slideContainerWidth, slideContainerHeight);
|
697 |
+
var _FormationInstance = GetFormation(slideTransition);
|
698 |
+
var _MaxOrder = _FormationInstance.length - 1;
|
699 |
+
var _Period = slideTransition.$Duration + slideTransition.$Delay * _MaxOrder;
|
700 |
+
var _EndTime = beginTime + _Period;
|
701 |
+
|
702 |
+
var _SlideOut = slideTransition.$SlideOut;
|
703 |
+
var _IsIn;
|
704 |
+
|
705 |
+
_EndTime += $Jssor$.$IsBrowserChrome() ? 260 : 50;
|
706 |
+
|
707 |
+
_Self.$EndTime = _EndTime;
|
708 |
+
|
709 |
+
_Self.$ShowFrame = function (time) {
|
710 |
+
time -= beginTime;
|
711 |
+
|
712 |
+
var isIn = time < _Period;
|
713 |
+
|
714 |
+
if (isIn || _IsIn) {
|
715 |
+
_IsIn = isIn;
|
716 |
+
|
717 |
+
if (!_SlideOut)
|
718 |
+
time = _Period - time;
|
719 |
+
|
720 |
+
var frameIndex = Math.ceil(time / slideTransition.$Interval);
|
721 |
+
|
722 |
+
$Jssor$.$Each(_AnimationStylesArrs, function (value, index) {
|
723 |
+
|
724 |
+
var itemFrameIndex = Math.max(frameIndex, value.$Min);
|
725 |
+
itemFrameIndex = Math.min(itemFrameIndex, value.length - 1);
|
726 |
+
|
727 |
+
if (value.$LastFrameIndex != itemFrameIndex) {
|
728 |
+
if (!value.$LastFrameIndex && !_SlideOut) {
|
729 |
+
$Jssor$.$ShowElement(_AnimationBlockItems[index]);
|
730 |
+
}
|
731 |
+
else if (itemFrameIndex == value.$Max && _SlideOut) {
|
732 |
+
$Jssor$.$HideElement(_AnimationBlockItems[index]);
|
733 |
+
}
|
734 |
+
value.$LastFrameIndex = itemFrameIndex;
|
735 |
+
$Jssor$.$SetStylesEx(_AnimationBlockItems[index], value[itemFrameIndex]);
|
736 |
+
}
|
737 |
+
});
|
738 |
+
}
|
739 |
+
};
|
740 |
+
|
741 |
+
function DisableHWA(elmt) {
|
742 |
+
$Jssor$.$DisableHWA(elmt);
|
743 |
+
|
744 |
+
var children = $Jssor$.$Children(elmt);
|
745 |
+
|
746 |
+
$Jssor$.$Each(children, function (child) {
|
747 |
+
DisableHWA(child);
|
748 |
+
});
|
749 |
+
}
|
750 |
+
|
751 |
+
//constructor
|
752 |
+
{
|
753 |
+
slideElement = $Jssor$.$CloneNode(slideElement);
|
754 |
+
DisableHWA(slideElement);
|
755 |
+
if ($Jssor$.$IsBrowserIe9Earlier()) {
|
756 |
+
var hasImage = !slideElement["no-image"];
|
757 |
+
var slideChildElements = $Jssor$.$FindChildrenByTag(slideElement);
|
758 |
+
$Jssor$.$Each(slideChildElements, function (slideChildElement) {
|
759 |
+
if (hasImage || slideChildElement["jssor-slider"])
|
760 |
+
$Jssor$.$CssOpacity(slideChildElement, $Jssor$.$CssOpacity(slideChildElement), true);
|
761 |
+
});
|
762 |
+
}
|
763 |
+
|
764 |
+
$Jssor$.$Each(_FormationInstance, function (formationItems, order) {
|
765 |
+
$Jssor$.$Each(formationItems, function (formationItem) {
|
766 |
+
var row = formationItem[0];
|
767 |
+
var col = formationItem[1];
|
768 |
+
{
|
769 |
+
var columnRow = row + ',' + col;
|
770 |
+
|
771 |
+
var chessHorizontal = false;
|
772 |
+
var chessVertical = false;
|
773 |
+
var chessRotate = false;
|
774 |
+
|
775 |
+
if (_ChessModeColumn && col % 2) {
|
776 |
+
if ($JssorDirection$.$IsHorizontal(_ChessModeColumn)) {
|
777 |
+
chessHorizontal = !chessHorizontal;
|
778 |
+
}
|
779 |
+
if ($JssorDirection$.$IsVertical(_ChessModeColumn)) {
|
780 |
+
chessVertical = !chessVertical;
|
781 |
+
}
|
782 |
+
|
783 |
+
if (_ChessModeColumn & 16)
|
784 |
+
chessRotate = !chessRotate;
|
785 |
+
}
|
786 |
+
|
787 |
+
if (_ChessModeRow && row % 2) {
|
788 |
+
if ($JssorDirection$.$IsHorizontal(_ChessModeRow)) {
|
789 |
+
chessHorizontal = !chessHorizontal;
|
790 |
+
}
|
791 |
+
if ($JssorDirection$.$IsVertical(_ChessModeRow)) {
|
792 |
+
chessVertical = !chessVertical;
|
793 |
+
}
|
794 |
+
if (_ChessModeRow & 16)
|
795 |
+
chessRotate = !chessRotate;
|
796 |
+
}
|
797 |
+
|
798 |
+
slideTransition.$Top = slideTransition.$Top || (slideTransition.$Clip & 4);
|
799 |
+
slideTransition.$Bottom = slideTransition.$Bottom || (slideTransition.$Clip & 8);
|
800 |
+
slideTransition.$Left = slideTransition.$Left || (slideTransition.$Clip & 1);
|
801 |
+
slideTransition.$Right = slideTransition.$Right || (slideTransition.$Clip & 2);
|
802 |
+
|
803 |
+
var topBenchmark = chessVertical ? slideTransition.$Bottom : slideTransition.$Top;
|
804 |
+
var bottomBenchmark = chessVertical ? slideTransition.$Top : slideTransition.$Bottom;
|
805 |
+
var leftBenchmark = chessHorizontal ? slideTransition.$Right : slideTransition.$Left;
|
806 |
+
var rightBenchmark = chessHorizontal ? slideTransition.$Left : slideTransition.$Right;
|
807 |
+
|
808 |
+
//$JssorDebug$.$Execute(function () {
|
809 |
+
// topBenchmark = bottomBenchmark = leftBenchmark = rightBenchmark = false;
|
810 |
+
//});
|
811 |
+
|
812 |
+
slideTransition.$Clip = topBenchmark || bottomBenchmark || leftBenchmark || rightBenchmark;
|
813 |
+
|
814 |
+
_StyleDif = {};
|
815 |
+
_StyleEnd = { $Top: 0, $Left: 0, $Opacity: 1, $Width: slideContainerWidth, $Height: slideContainerHeight };
|
816 |
+
_StyleStart = $Jssor$.$Extend({}, _StyleEnd);
|
817 |
+
_Block = $Jssor$.$Extend({}, _Blocks[columnRow]);
|
818 |
+
|
819 |
+
if (slideTransition.$Opacity) {
|
820 |
+
_StyleEnd.$Opacity = 2 - slideTransition.$Opacity;
|
821 |
+
}
|
822 |
+
|
823 |
+
if (slideTransition.$ZIndex) {
|
824 |
+
_StyleEnd.$ZIndex = slideTransition.$ZIndex;
|
825 |
+
_StyleStart.$ZIndex = 0;
|
826 |
+
}
|
827 |
+
|
828 |
+
var allowClip = slideTransition.$Cols * slideTransition.$Rows > 1 || slideTransition.$Clip;
|
829 |
+
|
830 |
+
if (slideTransition.$Zoom || slideTransition.$Rotate) {
|
831 |
+
var allowRotate = true;
|
832 |
+
if ($Jssor$.$IsBrowserIE() && $Jssor$.$BrowserEngineVersion() < 9) {
|
833 |
+
if (slideTransition.$Cols * slideTransition.$Rows > 1)
|
834 |
+
allowRotate = false;
|
835 |
+
else
|
836 |
+
allowClip = false;
|
837 |
+
}
|
838 |
+
|
839 |
+
if (allowRotate) {
|
840 |
+
_StyleEnd.$Zoom = slideTransition.$Zoom ? slideTransition.$Zoom - 1 : 1;
|
841 |
+
_StyleStart.$Zoom = 1;
|
842 |
+
|
843 |
+
if ($Jssor$.$IsBrowserIe9Earlier() || $Jssor$.$IsBrowserOpera())
|
844 |
+
_StyleEnd.$Zoom = Math.min(_StyleEnd.$Zoom, 2);
|
845 |
+
|
846 |
+
var rotate = slideTransition.$Rotate;
|
847 |
+
|
848 |
+
_StyleEnd.$Rotate = rotate * 360 * ((chessRotate) ? -1 : 1);
|
849 |
+
_StyleStart.$Rotate = 0;
|
850 |
+
}
|
851 |
+
}
|
852 |
+
|
853 |
+
if (allowClip) {
|
854 |
+
if (slideTransition.$Clip) {
|
855 |
+
var clipScale = slideTransition.$ScaleClip || 1;
|
856 |
+
var blockOffset = _Block.$Offset = {};
|
857 |
+
if (topBenchmark && bottomBenchmark) {
|
858 |
+
blockOffset.$Top = _Blocks.$Height / 2 * clipScale;
|
859 |
+
blockOffset.$Bottom = -blockOffset.$Top;
|
860 |
+
}
|
861 |
+
else if (topBenchmark) {
|
862 |
+
blockOffset.$Bottom = -_Blocks.$Height * clipScale;
|
863 |
+
}
|
864 |
+
else if (bottomBenchmark) {
|
865 |
+
blockOffset.$Top = _Blocks.$Height * clipScale;
|
866 |
+
}
|
867 |
+
|
868 |
+
if (leftBenchmark && rightBenchmark) {
|
869 |
+
blockOffset.$Left = _Blocks.$Width / 2 * clipScale;
|
870 |
+
blockOffset.$Right = -blockOffset.$Left;
|
871 |
+
}
|
872 |
+
else if (leftBenchmark) {
|
873 |
+
blockOffset.$Right = -_Blocks.$Width * clipScale;
|
874 |
+
}
|
875 |
+
else if (rightBenchmark) {
|
876 |
+
blockOffset.$Left = _Blocks.$Width * clipScale;
|
877 |
+
}
|
878 |
+
}
|
879 |
+
|
880 |
+
_StyleDif.$Clip = _Block;
|
881 |
+
_StyleStart.$Clip = _Blocks[columnRow];
|
882 |
+
}
|
883 |
+
|
884 |
+
//fly
|
885 |
+
{
|
886 |
+
var chessHor = chessHorizontal ? 1 : -1;
|
887 |
+
var chessVer = chessVertical ? 1 : -1;
|
888 |
+
|
889 |
+
if (slideTransition.x)
|
890 |
+
_StyleEnd.$Left += slideContainerWidth * slideTransition.x * chessHor;
|
891 |
+
|
892 |
+
if (slideTransition.y)
|
893 |
+
_StyleEnd.$Top += slideContainerHeight * slideTransition.y * chessVer;
|
894 |
+
}
|
895 |
+
|
896 |
+
$Jssor$.$Each(_StyleEnd, function (propertyEnd, property) {
|
897 |
+
if ($Jssor$.$IsNumeric(propertyEnd)) {
|
898 |
+
if (propertyEnd != _StyleStart[property]) {
|
899 |
+
_StyleDif[property] = propertyEnd - _StyleStart[property];
|
900 |
+
}
|
901 |
+
}
|
902 |
+
});
|
903 |
+
|
904 |
+
_StartStylesArr[columnRow] = _SlideOut ? _StyleStart : _StyleEnd;
|
905 |
+
|
906 |
+
var animationStylesArr = [];
|
907 |
+
var virtualFrameCount = Math.round(order * slideTransition.$Delay / slideTransition.$Interval);
|
908 |
+
_AnimationStylesArrs[columnRow] = new Array(virtualFrameCount);
|
909 |
+
_AnimationStylesArrs[columnRow].$Min = virtualFrameCount;
|
910 |
+
|
911 |
+
var framesCount = slideTransition.$FramesCount;
|
912 |
+
for (var frameN = 0; frameN <= framesCount; frameN++) {
|
913 |
+
var styleFrameN = {};
|
914 |
+
|
915 |
+
$Jssor$.$Each(_StyleDif, function (propertyDiff, property) {
|
916 |
+
var propertyEasings = slideTransition.$EasingInstance[property] || slideTransition.$EasingInstance.$Default;
|
917 |
+
var propertyEasingArray = propertyEasings[slideTransition.$Round[property] || 1];
|
918 |
+
|
919 |
+
var propertyDuring = slideTransition.$During[property] || [0, 1];
|
920 |
+
var propertyFrameN = (frameN / framesCount - propertyDuring[0]) / propertyDuring[1] * framesCount;
|
921 |
+
propertyFrameN = Math.round(Math.min(framesCount, Math.max(propertyFrameN, 0)));
|
922 |
+
|
923 |
+
var propertyEasingValue = propertyEasingArray[propertyFrameN];
|
924 |
+
|
925 |
+
if ($Jssor$.$IsNumeric(propertyDiff)) {
|
926 |
+
styleFrameN[property] = _StyleStart[property] + propertyDiff * propertyEasingValue;
|
927 |
+
}
|
928 |
+
else {
|
929 |
+
var value = styleFrameN[property] = $Jssor$.$Extend({}, _StyleStart[property]);
|
930 |
+
value.$Offset = [];
|
931 |
+
$Jssor$.$Each(propertyDiff.$Offset, function (rectX, n) {
|
932 |
+
var offsetValue = rectX * propertyEasingValue;
|
933 |
+
value.$Offset[n] = offsetValue;
|
934 |
+
value[n] += offsetValue;
|
935 |
+
});
|
936 |
+
}
|
937 |
+
});
|
938 |
+
|
939 |
+
if (_StyleStart.$Zoom) {
|
940 |
+
styleFrameN.$Transform = { $Rotate: styleFrameN.$Rotate || 0, $Scale: styleFrameN.$Zoom, $OriginalWidth: slideContainerWidth, $OriginalHeight: slideContainerHeight };
|
941 |
+
}
|
942 |
+
if (styleFrameN.$Clip && slideTransition.$Move) {
|
943 |
+
var styleFrameNClipOffset = styleFrameN.$Clip.$Offset;
|
944 |
+
var offsetY = (styleFrameNClipOffset.$Top || 0) + (styleFrameNClipOffset.$Bottom || 0);
|
945 |
+
var offsetX = (styleFrameNClipOffset.$Left || 0) + (styleFrameNClipOffset.$Right || 0);
|
946 |
+
|
947 |
+
styleFrameN.$Left = (styleFrameN.$Left || 0) + offsetX;
|
948 |
+
styleFrameN.$Top = (styleFrameN.$Top || 0) + offsetY;
|
949 |
+
styleFrameN.$Clip.$Left -= offsetX;
|
950 |
+
styleFrameN.$Clip.$Right -= offsetX;
|
951 |
+
styleFrameN.$Clip.$Top -= offsetY;
|
952 |
+
styleFrameN.$Clip.$Bottom -= offsetY;
|
953 |
+
}
|
954 |
+
|
955 |
+
styleFrameN.$ZIndex = styleFrameN.$ZIndex || 1;
|
956 |
+
|
957 |
+
_AnimationStylesArrs[columnRow].push(styleFrameN);
|
958 |
+
}
|
959 |
+
|
960 |
+
} //for
|
961 |
+
});
|
962 |
+
});
|
963 |
+
|
964 |
+
_FormationInstance.reverse();
|
965 |
+
$Jssor$.$Each(_FormationInstance, function (formationItems) {
|
966 |
+
$Jssor$.$Each(formationItems, function (formationItem) {
|
967 |
+
var row = formationItem[0];
|
968 |
+
var col = formationItem[1];
|
969 |
+
|
970 |
+
var columnRow = row + ',' + col;
|
971 |
+
|
972 |
+
var image = slideElement;
|
973 |
+
if (col || row)
|
974 |
+
image = $Jssor$.$CloneNode(slideElement);
|
975 |
+
|
976 |
+
$Jssor$.$SetStyles(image, _StartStylesArr[columnRow]);
|
977 |
+
$Jssor$.$CssOverflow(image, "hidden");
|
978 |
+
|
979 |
+
$Jssor$.$CssPosition(image, "absolute");
|
980 |
+
slideContainer.$AddClipElement(image);
|
981 |
+
_AnimationBlockItems[columnRow] = image;
|
982 |
+
$Jssor$.$ShowElement(image, !_SlideOut);
|
983 |
+
});
|
984 |
+
});
|
985 |
+
}
|
986 |
+
}
|
987 |
+
|
988 |
+
//JssorSlideshowRunner++++++++
|
989 |
+
var _SlideshowRunnerCount = 1;
|
990 |
+
$JssorSlideshowRunner$ = window.$JssorSlideshowRunner$ = function (slideContainer, slideContainerWidth, slideContainerHeight, slideshowOptions, handleTouchEventOnly) {
|
991 |
+
|
992 |
+
var _SelfSlideshowRunner = this;
|
993 |
+
|
994 |
+
//var _State = 0; //-1 fullfill, 0 clean, 1 initializing, 2 stay, 3 playing
|
995 |
+
var _EndTime;
|
996 |
+
|
997 |
+
var _SliderFrameCount;
|
998 |
+
|
999 |
+
var _SlideshowPlayerBelow;
|
1000 |
+
var _SlideshowPlayerAbove;
|
1001 |
+
|
1002 |
+
var _PrevItem;
|
1003 |
+
var _SlideItem;
|
1004 |
+
|
1005 |
+
var _TransitionIndex = 0;
|
1006 |
+
var _TransitionsOrder = slideshowOptions.$TransitionsOrder;
|
1007 |
+
|
1008 |
+
var _SlideshowTransition;
|
1009 |
+
|
1010 |
+
var _SlideshowPerformance = 8;
|
1011 |
+
|
1012 |
+
function SlideshowProcessor() {
|
1013 |
+
var _SelfSlideshowProcessor = this;
|
1014 |
+
var _CurrentTime = 0;
|
1015 |
+
|
1016 |
+
$JssorAnimator$.call(_SelfSlideshowProcessor, 0, _EndTime);
|
1017 |
+
|
1018 |
+
_SelfSlideshowProcessor.$OnPositionChange = function (oldPosition, newPosition) {
|
1019 |
+
if ((newPosition - _CurrentTime) > _SlideshowPerformance) {
|
1020 |
+
_CurrentTime = newPosition;
|
1021 |
+
|
1022 |
+
_SlideshowPlayerAbove && _SlideshowPlayerAbove.$ShowFrame(newPosition);
|
1023 |
+
_SlideshowPlayerBelow && _SlideshowPlayerBelow.$ShowFrame(newPosition);
|
1024 |
+
}
|
1025 |
+
};
|
1026 |
+
|
1027 |
+
_SelfSlideshowProcessor.$Transition = _SlideshowTransition;
|
1028 |
+
}
|
1029 |
+
|
1030 |
+
//member functions
|
1031 |
+
_SelfSlideshowRunner.$GetTransition = function (slideCount) {
|
1032 |
+
var n = 0;
|
1033 |
+
|
1034 |
+
var transitions = slideshowOptions.$Transitions;
|
1035 |
+
|
1036 |
+
var transitionCount = transitions.length;
|
1037 |
+
|
1038 |
+
if (_TransitionsOrder) { /*Sequence*/
|
1039 |
+
//if (transitionCount > slideCount && ($Jssor$.$IsBrowserChrome() || $Jssor$.$IsBrowserSafari() || $Jssor$.$IsBrowserFireFox())) {
|
1040 |
+
// transitionCount -= transitionCount % slideCount;
|
1041 |
+
//}
|
1042 |
+
n = _TransitionIndex++ % transitionCount;
|
1043 |
+
}
|
1044 |
+
else { /*Random*/
|
1045 |
+
n = Math.floor(Math.random() * transitionCount);
|
1046 |
+
}
|
1047 |
+
|
1048 |
+
transitions[n] && (transitions[n].$Index = n);
|
1049 |
+
|
1050 |
+
return transitions[n];
|
1051 |
+
};
|
1052 |
+
|
1053 |
+
_SelfSlideshowRunner.$Initialize = function (slideIndex, prevIndex, slideItem, prevItem, slideshowTransition) {
|
1054 |
+
$JssorDebug$.$Execute(function () {
|
1055 |
+
if (_SlideshowPlayerBelow) {
|
1056 |
+
$JssorDebug$.$Fail("slideshow runner has not been cleared.");
|
1057 |
+
}
|
1058 |
+
});
|
1059 |
+
|
1060 |
+
_SlideshowTransition = slideshowTransition;
|
1061 |
+
|
1062 |
+
slideshowTransition = EnsureTransitionInstance(slideshowTransition, _SlideshowPerformance);
|
1063 |
+
|
1064 |
+
_SlideItem = slideItem;
|
1065 |
+
_PrevItem = prevItem;
|
1066 |
+
|
1067 |
+
var prevSlideElement = prevItem.$Item;
|
1068 |
+
var currentSlideElement = slideItem.$Item;
|
1069 |
+
prevSlideElement["no-image"] = !prevItem.$Image;
|
1070 |
+
currentSlideElement["no-image"] = !slideItem.$Image;
|
1071 |
+
|
1072 |
+
var slideElementAbove = prevSlideElement;
|
1073 |
+
var slideElementBelow = currentSlideElement;
|
1074 |
+
|
1075 |
+
var slideTransitionAbove = slideshowTransition;
|
1076 |
+
var slideTransitionBelow = slideshowTransition.$Brother || EnsureTransitionInstance({}, _SlideshowPerformance);
|
1077 |
+
|
1078 |
+
if (!slideshowTransition.$SlideOut) {
|
1079 |
+
slideElementAbove = currentSlideElement;
|
1080 |
+
slideElementBelow = prevSlideElement;
|
1081 |
+
}
|
1082 |
+
|
1083 |
+
var shift = slideTransitionBelow.$Shift || 0;
|
1084 |
+
|
1085 |
+
_SlideshowPlayerBelow = new JssorSlideshowPlayer(slideContainer, slideElementBelow, slideTransitionBelow, Math.max(shift - slideTransitionBelow.$Interval, 0), slideContainerWidth, slideContainerHeight);
|
1086 |
+
_SlideshowPlayerAbove = new JssorSlideshowPlayer(slideContainer, slideElementAbove, slideTransitionAbove, Math.max(slideTransitionBelow.$Interval - shift, 0), slideContainerWidth, slideContainerHeight);
|
1087 |
+
|
1088 |
+
_SlideshowPlayerBelow.$ShowFrame(0);
|
1089 |
+
_SlideshowPlayerAbove.$ShowFrame(0);
|
1090 |
+
|
1091 |
+
_EndTime = Math.max(_SlideshowPlayerBelow.$EndTime, _SlideshowPlayerAbove.$EndTime);
|
1092 |
+
|
1093 |
+
_SelfSlideshowRunner.$Index = slideIndex;
|
1094 |
+
};
|
1095 |
+
|
1096 |
+
_SelfSlideshowRunner.$Clear = function () {
|
1097 |
+
slideContainer.$Clear();
|
1098 |
+
_SlideshowPlayerBelow = null;
|
1099 |
+
_SlideshowPlayerAbove = null;
|
1100 |
+
};
|
1101 |
+
|
1102 |
+
_SelfSlideshowRunner.$GetProcessor = function () {
|
1103 |
+
var slideshowProcessor = null;
|
1104 |
+
|
1105 |
+
if (_SlideshowPlayerAbove)
|
1106 |
+
slideshowProcessor = new SlideshowProcessor();
|
1107 |
+
|
1108 |
+
return slideshowProcessor;
|
1109 |
+
};
|
1110 |
+
|
1111 |
+
//Constructor
|
1112 |
+
{
|
1113 |
+
if ($Jssor$.$IsBrowserIe9Earlier() || $Jssor$.$IsBrowserOpera() || (handleTouchEventOnly && $Jssor$.$WebKitVersion() < 537)) {
|
1114 |
+
_SlideshowPerformance = 16;
|
1115 |
+
}
|
1116 |
+
|
1117 |
+
$JssorObject$.call(_SelfSlideshowRunner);
|
1118 |
+
$JssorAnimator$.call(_SelfSlideshowRunner, -10000000, 10000000);
|
1119 |
+
|
1120 |
+
$JssorDebug$.$LiveStamp(_SelfSlideshowRunner, "slideshow_runner_" + _SlideshowRunnerCount++);
|
1121 |
+
}
|
1122 |
+
};
|
1123 |
+
//JssorSlideshowRunner--------
|
1124 |
+
|
1125 |
+
//JssorSlider
|
1126 |
+
function JssorSlider(elmt, options) {
|
1127 |
+
var _SelfSlider = this;
|
1128 |
+
|
1129 |
+
//private classes
|
1130 |
+
function Conveyor() {
|
1131 |
+
var _SelfConveyor = this;
|
1132 |
+
$JssorAnimator$.call(_SelfConveyor, -100000000, 200000000);
|
1133 |
+
|
1134 |
+
_SelfConveyor.$GetCurrentSlideInfo = function () {
|
1135 |
+
var positionDisplay = _SelfConveyor.$GetPosition_Display();
|
1136 |
+
var virtualIndex = Math.floor(positionDisplay);
|
1137 |
+
var slideIndex = GetRealIndex(virtualIndex);
|
1138 |
+
var slidePosition = positionDisplay - Math.floor(positionDisplay);
|
1139 |
+
|
1140 |
+
return { $Index: slideIndex, $VirtualIndex: virtualIndex, $Position: slidePosition };
|
1141 |
+
};
|
1142 |
+
|
1143 |
+
_SelfConveyor.$OnPositionChange = function (oldPosition, newPosition) {
|
1144 |
+
|
1145 |
+
var index = Math.floor(newPosition);
|
1146 |
+
if (index != newPosition && newPosition > oldPosition)
|
1147 |
+
index++;
|
1148 |
+
|
1149 |
+
ResetNavigator(index, true);
|
1150 |
+
|
1151 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_POSITION_CHANGE, GetRealIndex(newPosition), GetRealIndex(oldPosition), newPosition, oldPosition);
|
1152 |
+
};
|
1153 |
+
}
|
1154 |
+
|
1155 |
+
//Carousel
|
1156 |
+
function Carousel() {
|
1157 |
+
var _SelfCarousel = this;
|
1158 |
+
|
1159 |
+
$JssorAnimator$.call(_SelfCarousel, 0, 0, { $LoopLength: _SlideCount });
|
1160 |
+
|
1161 |
+
//Carousel Constructor
|
1162 |
+
{
|
1163 |
+
$Jssor$.$Each(_SlideItems, function (slideItem) {
|
1164 |
+
(_Loop & 1) && slideItem.$SetLoopLength(_SlideCount);
|
1165 |
+
_SelfCarousel.$Chain(slideItem);
|
1166 |
+
slideItem.$Shift(_ParkingPosition / _StepLength);
|
1167 |
+
});
|
1168 |
+
}
|
1169 |
+
}
|
1170 |
+
//Carousel
|
1171 |
+
|
1172 |
+
//Slideshow
|
1173 |
+
function Slideshow() {
|
1174 |
+
var _SelfSlideshow = this;
|
1175 |
+
var _Wrapper = _SlideContainer.$Elmt;
|
1176 |
+
|
1177 |
+
$JssorAnimator$.call(_SelfSlideshow, -1, 2, { $Easing: $JssorEasing$.$EaseLinear, $Setter: { $Position: SetPosition }, $LoopLength: _SlideCount }, _Wrapper, { $Position: 1 }, { $Position: -1 });
|
1178 |
+
|
1179 |
+
_SelfSlideshow.$Wrapper = _Wrapper;
|
1180 |
+
|
1181 |
+
//Slideshow Constructor
|
1182 |
+
{
|
1183 |
+
$JssorDebug$.$Execute(function () {
|
1184 |
+
$Jssor$.$Attribute(_SlideContainer.$Elmt, "debug-id", "slide_container");
|
1185 |
+
});
|
1186 |
+
}
|
1187 |
+
}
|
1188 |
+
//Slideshow
|
1189 |
+
|
1190 |
+
//CarouselPlayer
|
1191 |
+
function CarouselPlayer(carousel, slideshow) {
|
1192 |
+
var _SelfCarouselPlayer = this;
|
1193 |
+
var _FromPosition;
|
1194 |
+
var _ToPosition;
|
1195 |
+
var _Duration;
|
1196 |
+
var _StandBy;
|
1197 |
+
var _StandByPosition;
|
1198 |
+
|
1199 |
+
$JssorAnimator$.call(_SelfCarouselPlayer, -100000000, 200000000, { $IntervalMax: 100 });
|
1200 |
+
|
1201 |
+
_SelfCarouselPlayer.$OnStart = function () {
|
1202 |
+
_IsSliding = true;
|
1203 |
+
_LoadingTicket = null;
|
1204 |
+
|
1205 |
+
//EVT_SWIPE_START
|
1206 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_SWIPE_START, GetRealIndex(_Conveyor.$GetPosition()), _Conveyor.$GetPosition());
|
1207 |
+
};
|
1208 |
+
|
1209 |
+
_SelfCarouselPlayer.$OnStop = function () {
|
1210 |
+
|
1211 |
+
_IsSliding = false;
|
1212 |
+
_StandBy = false;
|
1213 |
+
|
1214 |
+
var currentSlideInfo = _Conveyor.$GetCurrentSlideInfo();
|
1215 |
+
|
1216 |
+
//EVT_SWIPE_END
|
1217 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_SWIPE_END, GetRealIndex(_Conveyor.$GetPosition()), _Conveyor.$GetPosition());
|
1218 |
+
|
1219 |
+
if (!currentSlideInfo.$Position) {
|
1220 |
+
OnPark(currentSlideInfo.$VirtualIndex, _CurrentSlideIndex);
|
1221 |
+
}
|
1222 |
+
};
|
1223 |
+
|
1224 |
+
_SelfCarouselPlayer.$OnPositionChange = function (oldPosition, newPosition) {
|
1225 |
+
|
1226 |
+
var toPosition;
|
1227 |
+
|
1228 |
+
if (_StandBy)
|
1229 |
+
toPosition = _StandByPosition;
|
1230 |
+
else {
|
1231 |
+
toPosition = _ToPosition;
|
1232 |
+
|
1233 |
+
if (_Duration) {
|
1234 |
+
var interPosition = newPosition / _Duration;
|
1235 |
+
//if ($Jssor$.$IsBrowserChrome() || $Jssor$.$IsBrowserFireFox()) {
|
1236 |
+
// Math.round(interPosition * 8 / _Duration) / 8 * _Duration;
|
1237 |
+
|
1238 |
+
// if ($Jssor$.$BrowserVersion() < 38)
|
1239 |
+
// interPosition = parseFloat(interPosition.toFixed(4));
|
1240 |
+
//}
|
1241 |
+
toPosition = _Options.$SlideEasing(interPosition) * (_ToPosition - _FromPosition) + _FromPosition;
|
1242 |
+
}
|
1243 |
+
}
|
1244 |
+
|
1245 |
+
_Conveyor.$GoToPosition(toPosition);
|
1246 |
+
};
|
1247 |
+
|
1248 |
+
_SelfCarouselPlayer.$PlayCarousel = function (fromPosition, toPosition, duration, callback) {
|
1249 |
+
$JssorDebug$.$Execute(function () {
|
1250 |
+
if (_SelfCarouselPlayer.$IsPlaying())
|
1251 |
+
$JssorDebug$.$Fail("The carousel is already playing.");
|
1252 |
+
});
|
1253 |
+
|
1254 |
+
_FromPosition = fromPosition;
|
1255 |
+
_ToPosition = toPosition;
|
1256 |
+
_Duration = duration;
|
1257 |
+
|
1258 |
+
_Conveyor.$GoToPosition(fromPosition);
|
1259 |
+
_SelfCarouselPlayer.$GoToPosition(0);
|
1260 |
+
|
1261 |
+
_SelfCarouselPlayer.$PlayToPosition(duration, callback);
|
1262 |
+
};
|
1263 |
+
|
1264 |
+
_SelfCarouselPlayer.$StandBy = function (standByPosition) {
|
1265 |
+
_StandBy = true;
|
1266 |
+
_StandByPosition = standByPosition;
|
1267 |
+
_SelfCarouselPlayer.$Play(standByPosition, null, true);
|
1268 |
+
};
|
1269 |
+
|
1270 |
+
_SelfCarouselPlayer.$SetStandByPosition = function (standByPosition) {
|
1271 |
+
_StandByPosition = standByPosition;
|
1272 |
+
};
|
1273 |
+
|
1274 |
+
_SelfCarouselPlayer.$MoveCarouselTo = function (position) {
|
1275 |
+
_Conveyor.$GoToPosition(position);
|
1276 |
+
};
|
1277 |
+
|
1278 |
+
//CarouselPlayer Constructor
|
1279 |
+
{
|
1280 |
+
_Conveyor = new Conveyor();
|
1281 |
+
|
1282 |
+
_Conveyor.$Combine(carousel);
|
1283 |
+
_Conveyor.$Combine(slideshow);
|
1284 |
+
}
|
1285 |
+
}
|
1286 |
+
//CarouselPlayer
|
1287 |
+
|
1288 |
+
//SlideContainer
|
1289 |
+
function SlideContainer() {
|
1290 |
+
var _Self = this;
|
1291 |
+
var elmt = CreatePanel();
|
1292 |
+
|
1293 |
+
$Jssor$.$CssZIndex(elmt, 0);
|
1294 |
+
$Jssor$.$Css(elmt, "pointerEvents", "none");
|
1295 |
+
|
1296 |
+
_Self.$Elmt = elmt;
|
1297 |
+
|
1298 |
+
_Self.$AddClipElement = function (clipElement) {
|
1299 |
+
$Jssor$.$AppendChild(elmt, clipElement);
|
1300 |
+
$Jssor$.$ShowElement(elmt);
|
1301 |
+
};
|
1302 |
+
|
1303 |
+
_Self.$Clear = function () {
|
1304 |
+
$Jssor$.$HideElement(elmt);
|
1305 |
+
$Jssor$.$ClearInnerHtml(elmt);
|
1306 |
+
};
|
1307 |
+
}
|
1308 |
+
//SlideContainer
|
1309 |
+
|
1310 |
+
//SlideItem
|
1311 |
+
function SlideItem(slideElmt, slideIndex) {
|
1312 |
+
|
1313 |
+
var _SelfSlideItem = this;
|
1314 |
+
|
1315 |
+
var _CaptionSliderIn;
|
1316 |
+
var _CaptionSliderOut;
|
1317 |
+
var _CaptionSliderCurrent;
|
1318 |
+
var _IsCaptionSliderPlayingWhenDragStart;
|
1319 |
+
|
1320 |
+
var _Wrapper;
|
1321 |
+
var _BaseElement = slideElmt;
|
1322 |
+
|
1323 |
+
var _LoadingScreen;
|
1324 |
+
|
1325 |
+
var _ImageItem;
|
1326 |
+
var _ImageElmts = [];
|
1327 |
+
var _LinkItemOrigin;
|
1328 |
+
var _LinkItem;
|
1329 |
+
var _ImageLoading;
|
1330 |
+
var _ImageLoaded;
|
1331 |
+
var _ImageLazyLoading;
|
1332 |
+
var _ContentRefreshed;
|
1333 |
+
|
1334 |
+
var _Processor;
|
1335 |
+
|
1336 |
+
var _PlayerInstanceElement;
|
1337 |
+
var _PlayerInstance;
|
1338 |
+
|
1339 |
+
var _SequenceNumber; //for debug only
|
1340 |
+
|
1341 |
+
$JssorAnimator$.call(_SelfSlideItem, -_DisplayPieces, _DisplayPieces + 1, { $SlideItemAnimator: true });
|
1342 |
+
|
1343 |
+
function ResetCaptionSlider(fresh) {
|
1344 |
+
_CaptionSliderOut && _CaptionSliderOut.$Revert();
|
1345 |
+
_CaptionSliderIn && _CaptionSliderIn.$Revert();
|
1346 |
+
|
1347 |
+
RefreshContent(slideElmt, fresh);
|
1348 |
+
_ContentRefreshed = true;
|
1349 |
+
|
1350 |
+
_CaptionSliderIn = new _CaptionSliderOptions.$Class(slideElmt, _CaptionSliderOptions, 1);
|
1351 |
+
$JssorDebug$.$LiveStamp(_CaptionSliderIn, "caption_slider_" + _CaptionSliderCount + "_in");
|
1352 |
+
_CaptionSliderOut = new _CaptionSliderOptions.$Class(slideElmt, _CaptionSliderOptions);
|
1353 |
+
$JssorDebug$.$LiveStamp(_CaptionSliderOut, "caption_slider_" + _CaptionSliderCount + "_out");
|
1354 |
+
|
1355 |
+
$JssorDebug$.$Execute(function () {
|
1356 |
+
_CaptionSliderCount++;
|
1357 |
+
});
|
1358 |
+
|
1359 |
+
_CaptionSliderOut.$GoToBegin();
|
1360 |
+
_CaptionSliderIn.$GoToBegin();
|
1361 |
+
}
|
1362 |
+
|
1363 |
+
function EnsureCaptionSliderVersion() {
|
1364 |
+
if (_CaptionSliderIn.$Version < _CaptionSliderOptions.$Version) {
|
1365 |
+
ResetCaptionSlider();
|
1366 |
+
}
|
1367 |
+
}
|
1368 |
+
|
1369 |
+
//event handling begin
|
1370 |
+
function LoadImageCompleteEventHandler(completeCallback, loadingScreen, image) {
|
1371 |
+
if (!_ImageLoaded) {
|
1372 |
+
_ImageLoaded = true;
|
1373 |
+
|
1374 |
+
if (_ImageItem && image) {
|
1375 |
+
var imageWidth = image.width;
|
1376 |
+
var imageHeight = image.height;
|
1377 |
+
var fillWidth = imageWidth;
|
1378 |
+
var fillHeight = imageHeight;
|
1379 |
+
|
1380 |
+
if (imageWidth && imageHeight && _Options.$FillMode) {
|
1381 |
+
|
1382 |
+
//0 stretch, 1 contain (keep aspect ratio and put all inside slide), 2 cover (keep aspect ratio and cover whole slide), 4 actual size, 5 contain for large image, actual size for small image, default value is 0
|
1383 |
+
if (_Options.$FillMode & 3 && (!(_Options.$FillMode & 4) || imageWidth > _SlideWidth || imageHeight > _SlideHeight)) {
|
1384 |
+
var fitHeight = false;
|
1385 |
+
var ratio = _SlideWidth / _SlideHeight * imageHeight / imageWidth;
|
1386 |
+
|
1387 |
+
if (_Options.$FillMode & 1) {
|
1388 |
+
fitHeight = (ratio > 1);
|
1389 |
+
}
|
1390 |
+
else if (_Options.$FillMode & 2) {
|
1391 |
+
fitHeight = (ratio < 1);
|
1392 |
+
}
|
1393 |
+
fillWidth = fitHeight ? imageWidth * _SlideHeight / imageHeight : _SlideWidth;
|
1394 |
+
fillHeight = fitHeight ? _SlideHeight : imageHeight * _SlideWidth / imageWidth;
|
1395 |
+
}
|
1396 |
+
|
1397 |
+
$Jssor$.$CssWidth(_ImageItem, fillWidth);
|
1398 |
+
$Jssor$.$CssHeight(_ImageItem, fillHeight);
|
1399 |
+
$Jssor$.$CssTop(_ImageItem, (_SlideHeight - fillHeight) / 2);
|
1400 |
+
$Jssor$.$CssLeft(_ImageItem, (_SlideWidth - fillWidth) / 2);
|
1401 |
+
}
|
1402 |
+
|
1403 |
+
$Jssor$.$CssPosition(_ImageItem, "absolute");
|
1404 |
+
|
1405 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_LOAD_END, slideItem);
|
1406 |
+
}
|
1407 |
+
}
|
1408 |
+
|
1409 |
+
$Jssor$.$HideElement(loadingScreen);
|
1410 |
+
completeCallback && completeCallback(_SelfSlideItem);
|
1411 |
+
}
|
1412 |
+
|
1413 |
+
function LoadSlideshowImageCompleteEventHandler(nextIndex, nextItem, slideshowTransition, loadingTicket) {
|
1414 |
+
if (loadingTicket == _LoadingTicket && _CurrentSlideIndex == slideIndex && _AutoPlay) {
|
1415 |
+
if (!_Frozen) {
|
1416 |
+
var nextRealIndex = GetRealIndex(nextIndex);
|
1417 |
+
_SlideshowRunner.$Initialize(nextRealIndex, slideIndex, nextItem, _SelfSlideItem, slideshowTransition);
|
1418 |
+
nextItem.$HideContentForSlideshow();
|
1419 |
+
_Slideshow.$Locate(nextRealIndex, 1);
|
1420 |
+
_Slideshow.$GoToPosition(nextRealIndex);
|
1421 |
+
_CarouselPlayer.$PlayCarousel(nextIndex, nextIndex, 0);
|
1422 |
+
}
|
1423 |
+
}
|
1424 |
+
}
|
1425 |
+
|
1426 |
+
function SlideReadyEventHandler(loadingTicket) {
|
1427 |
+
if (loadingTicket == _LoadingTicket && _CurrentSlideIndex == slideIndex) {
|
1428 |
+
|
1429 |
+
if (!_Processor) {
|
1430 |
+
var slideshowProcessor = null;
|
1431 |
+
if (_SlideshowRunner) {
|
1432 |
+
if (_SlideshowRunner.$Index == slideIndex)
|
1433 |
+
slideshowProcessor = _SlideshowRunner.$GetProcessor();
|
1434 |
+
else
|
1435 |
+
_SlideshowRunner.$Clear();
|
1436 |
+
}
|
1437 |
+
|
1438 |
+
EnsureCaptionSliderVersion();
|
1439 |
+
|
1440 |
+
_Processor = new Processor(slideElmt, slideIndex, slideshowProcessor, _SelfSlideItem.$GetCaptionSliderIn(), _SelfSlideItem.$GetCaptionSliderOut());
|
1441 |
+
_Processor.$SetPlayer(_PlayerInstance);
|
1442 |
+
}
|
1443 |
+
|
1444 |
+
!_Processor.$IsPlaying() && _Processor.$Replay();
|
1445 |
+
}
|
1446 |
+
}
|
1447 |
+
|
1448 |
+
function ParkEventHandler(currentIndex, previousIndex, manualActivate) {
|
1449 |
+
if (currentIndex == slideIndex) {
|
1450 |
+
|
1451 |
+
if (currentIndex != previousIndex)
|
1452 |
+
_SlideItems[previousIndex] && _SlideItems[previousIndex].$ParkOut();
|
1453 |
+
else
|
1454 |
+
!manualActivate && _Processor && _Processor.$AdjustIdleOnPark();
|
1455 |
+
|
1456 |
+
_PlayerInstance && _PlayerInstance.$Enable();
|
1457 |
+
|
1458 |
+
//park in
|
1459 |
+
var loadingTicket = _LoadingTicket = $Jssor$.$GetNow();
|
1460 |
+
_SelfSlideItem.$LoadImage($Jssor$.$CreateCallback(null, SlideReadyEventHandler, loadingTicket));
|
1461 |
+
}
|
1462 |
+
else {
|
1463 |
+
var distance = Math.abs(slideIndex - currentIndex);
|
1464 |
+
var loadRange = _DisplayPieces + _Options.$LazyLoading;
|
1465 |
+
if (!_ImageLazyLoading || distance <= loadRange || _SlideCount - distance <= loadRange) {
|
1466 |
+
_SelfSlideItem.$LoadImage();
|
1467 |
+
}
|
1468 |
+
}
|
1469 |
+
}
|
1470 |
+
|
1471 |
+
function SwipeStartEventHandler() {
|
1472 |
+
if (_CurrentSlideIndex == slideIndex && _Processor) {
|
1473 |
+
_Processor.$Stop();
|
1474 |
+
_PlayerInstance && _PlayerInstance.$Quit();
|
1475 |
+
_PlayerInstance && _PlayerInstance.$Disable();
|
1476 |
+
_Processor.$OpenSlideshowPanel();
|
1477 |
+
}
|
1478 |
+
}
|
1479 |
+
|
1480 |
+
function FreezeEventHandler() {
|
1481 |
+
if (_CurrentSlideIndex == slideIndex && _Processor) {
|
1482 |
+
_Processor.$Stop();
|
1483 |
+
}
|
1484 |
+
}
|
1485 |
+
|
1486 |
+
function LinkClickEventHandler(event) {
|
1487 |
+
if (_LastDragSucceded) {
|
1488 |
+
$Jssor$.$CancelEvent(event);
|
1489 |
+
}
|
1490 |
+
else {
|
1491 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_CLICK, slideIndex, event);
|
1492 |
+
}
|
1493 |
+
}
|
1494 |
+
|
1495 |
+
function PlayerAvailableEventHandler() {
|
1496 |
+
_PlayerInstance = _PlayerInstanceElement.pInstance;
|
1497 |
+
_Processor && _Processor.$SetPlayer(_PlayerInstance);
|
1498 |
+
}
|
1499 |
+
|
1500 |
+
_SelfSlideItem.$LoadImage = function (completeCallback, loadingScreen) {
|
1501 |
+
loadingScreen = loadingScreen || _LoadingScreen;
|
1502 |
+
|
1503 |
+
if (_ImageElmts.length && !_ImageLoaded) {
|
1504 |
+
|
1505 |
+
$Jssor$.$ShowElement(loadingScreen);
|
1506 |
+
|
1507 |
+
if (!_ImageLoading) {
|
1508 |
+
_ImageLoading = true;
|
1509 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_LOAD_START);
|
1510 |
+
|
1511 |
+
$Jssor$.$Each(_ImageElmts, function (imageElmt) {
|
1512 |
+
|
1513 |
+
if (!imageElmt.src) {
|
1514 |
+
imageElmt.src = $Jssor$.$AttributeEx(imageElmt, "src2");
|
1515 |
+
$Jssor$.$CssDisplay(imageElmt, imageElmt["display-origin"]);
|
1516 |
+
}
|
1517 |
+
});
|
1518 |
+
}
|
1519 |
+
$Jssor$.$LoadImages(_ImageElmts, _ImageItem, $Jssor$.$CreateCallback(null, LoadImageCompleteEventHandler, completeCallback, loadingScreen));
|
1520 |
+
}
|
1521 |
+
else {
|
1522 |
+
LoadImageCompleteEventHandler(completeCallback, loadingScreen);
|
1523 |
+
}
|
1524 |
+
};
|
1525 |
+
|
1526 |
+
_SelfSlideItem.$GoForNextSlide = function () {
|
1527 |
+
if (_SlideshowRunner) {
|
1528 |
+
var slideshowTransition = _SlideshowRunner.$GetTransition(_SlideCount);
|
1529 |
+
|
1530 |
+
if (slideshowTransition) {
|
1531 |
+
var loadingTicket = _LoadingTicket = $Jssor$.$GetNow();
|
1532 |
+
|
1533 |
+
var nextIndex = slideIndex + _PlayReverse;
|
1534 |
+
var nextItem = _SlideItems[GetRealIndex(nextIndex)];
|
1535 |
+
return nextItem.$LoadImage($Jssor$.$CreateCallback(null, LoadSlideshowImageCompleteEventHandler, nextIndex, nextItem, slideshowTransition, loadingTicket), _LoadingScreen);
|
1536 |
+
}
|
1537 |
+
}
|
1538 |
+
|
1539 |
+
PlayTo(_CurrentSlideIndex + _Options.$AutoPlaySteps * _PlayReverse);
|
1540 |
+
};
|
1541 |
+
|
1542 |
+
_SelfSlideItem.$TryActivate = function () {
|
1543 |
+
ParkEventHandler(slideIndex, slideIndex, true);
|
1544 |
+
};
|
1545 |
+
|
1546 |
+
_SelfSlideItem.$ParkOut = function () {
|
1547 |
+
//park out
|
1548 |
+
_PlayerInstance && _PlayerInstance.$Quit();
|
1549 |
+
_PlayerInstance && _PlayerInstance.$Disable();
|
1550 |
+
_SelfSlideItem.$UnhideContentForSlideshow();
|
1551 |
+
_Processor && _Processor.$Abort();
|
1552 |
+
_Processor = null;
|
1553 |
+
ResetCaptionSlider();
|
1554 |
+
};
|
1555 |
+
|
1556 |
+
//for debug only
|
1557 |
+
_SelfSlideItem.$StampSlideItemElements = function (stamp) {
|
1558 |
+
stamp = _SequenceNumber + "_" + stamp;
|
1559 |
+
|
1560 |
+
$JssorDebug$.$Execute(function () {
|
1561 |
+
if (_ImageItem)
|
1562 |
+
$Jssor$.$Attribute(_ImageItem, "debug-id", stamp + "_slide_item_image_id");
|
1563 |
+
|
1564 |
+
$Jssor$.$Attribute(slideElmt, "debug-id", stamp + "_slide_item_item_id");
|
1565 |
+
});
|
1566 |
+
|
1567 |
+
$JssorDebug$.$Execute(function () {
|
1568 |
+
$Jssor$.$Attribute(_Wrapper, "debug-id", stamp + "_slide_item_wrapper_id");
|
1569 |
+
});
|
1570 |
+
|
1571 |
+
$JssorDebug$.$Execute(function () {
|
1572 |
+
$Jssor$.$Attribute(_LoadingScreen, "debug-id", stamp + "_loading_container_id");
|
1573 |
+
});
|
1574 |
+
};
|
1575 |
+
|
1576 |
+
_SelfSlideItem.$HideContentForSlideshow = function () {
|
1577 |
+
$Jssor$.$HideElement(slideElmt);
|
1578 |
+
};
|
1579 |
+
|
1580 |
+
_SelfSlideItem.$UnhideContentForSlideshow = function () {
|
1581 |
+
$Jssor$.$ShowElement(slideElmt);
|
1582 |
+
};
|
1583 |
+
|
1584 |
+
_SelfSlideItem.$EnablePlayer = function () {
|
1585 |
+
_PlayerInstance && _PlayerInstance.$Enable();
|
1586 |
+
};
|
1587 |
+
|
1588 |
+
function RefreshContent(elmt, fresh, level) {
|
1589 |
+
if (elmt["jssor-slider"])
|
1590 |
+
return;
|
1591 |
+
|
1592 |
+
level = level || 0;
|
1593 |
+
|
1594 |
+
if (!_ContentRefreshed) {
|
1595 |
+
if (elmt.tagName == "IMG") {
|
1596 |
+
_ImageElmts.push(elmt);
|
1597 |
+
|
1598 |
+
if (!elmt.src) {
|
1599 |
+
_ImageLazyLoading = true;
|
1600 |
+
elmt["display-origin"] = $Jssor$.$CssDisplay(elmt);
|
1601 |
+
$Jssor$.$HideElement(elmt);
|
1602 |
+
}
|
1603 |
+
}
|
1604 |
+
if ($Jssor$.$IsBrowserIe9Earlier()) {
|
1605 |
+
$Jssor$.$CssZIndex(elmt, ($Jssor$.$CssZIndex(elmt) || 0) + 1);
|
1606 |
+
}
|
1607 |
+
if (_Options.$HWA && $Jssor$.$WebKitVersion()) {
|
1608 |
+
if (!_IsTouchDevice || $Jssor$.$WebKitVersion() < 534 || (!_SlideshowEnabled && !$Jssor$.$IsBrowserChrome())) {
|
1609 |
+
$Jssor$.$EnableHWA(elmt);
|
1610 |
+
}
|
1611 |
+
}
|
1612 |
+
}
|
1613 |
+
|
1614 |
+
var childElements = $Jssor$.$Children(elmt);
|
1615 |
+
|
1616 |
+
$Jssor$.$Each(childElements, function (childElement, i) {
|
1617 |
+
|
1618 |
+
var uAttribute = $Jssor$.$AttributeEx(childElement, "u");
|
1619 |
+
if (uAttribute == "player" && !_PlayerInstanceElement) {
|
1620 |
+
_PlayerInstanceElement = childElement;
|
1621 |
+
if (_PlayerInstanceElement.pInstance) {
|
1622 |
+
PlayerAvailableEventHandler();
|
1623 |
+
}
|
1624 |
+
else {
|
1625 |
+
$Jssor$.$AddEvent(_PlayerInstanceElement, "dataavailable", PlayerAvailableEventHandler);
|
1626 |
+
}
|
1627 |
+
}
|
1628 |
+
|
1629 |
+
if (uAttribute == "caption") {
|
1630 |
+
if (!$Jssor$.$IsBrowserIE() && !fresh) {
|
1631 |
+
var captionElement = $Jssor$.$CloneNode(childElement);
|
1632 |
+
$Jssor$.$InsertBefore(elmt, captionElement, childElement);
|
1633 |
+
$Jssor$.$RemoveChild(elmt, childElement);
|
1634 |
+
childElement = captionElement;
|
1635 |
+
|
1636 |
+
fresh = true;
|
1637 |
+
}
|
1638 |
+
}
|
1639 |
+
else if (!_ContentRefreshed && !level && !_ImageItem && $Jssor$.$AttributeEx(childElement, "u") == "image") {
|
1640 |
+
_ImageItem = childElement;
|
1641 |
+
|
1642 |
+
if (_ImageItem) {
|
1643 |
+
if (_ImageItem.tagName == "A") {
|
1644 |
+
_LinkItemOrigin = _ImageItem;
|
1645 |
+
$Jssor$.$SetStyles(_LinkItemOrigin, _StyleDef);
|
1646 |
+
|
1647 |
+
_LinkItem = $Jssor$.$CloneNode(_ImageItem, true);
|
1648 |
+
//cancel click event on <A> element when a drag of slide succeeded
|
1649 |
+
$Jssor$.$AddEvent(_LinkItem, "click", LinkClickEventHandler);
|
1650 |
+
|
1651 |
+
$Jssor$.$SetStyles(_LinkItem, _StyleDef);
|
1652 |
+
$Jssor$.$CssDisplay(_LinkItem, "block");
|
1653 |
+
$Jssor$.$CssOpacity(_LinkItem, 0);
|
1654 |
+
$Jssor$.$Css(_LinkItem, "backgroundColor", "#000");
|
1655 |
+
|
1656 |
+
_ImageItem = $Jssor$.$FindChildByTag(_ImageItem, "IMG");
|
1657 |
+
|
1658 |
+
$JssorDebug$.$Execute(function () {
|
1659 |
+
if (!_ImageItem) {
|
1660 |
+
$JssorDebug$.$Error("slide html code definition error, no 'IMG' found in a 'image with link' slide.\r\n" + elmt.outerHTML);
|
1661 |
+
}
|
1662 |
+
});
|
1663 |
+
}
|
1664 |
+
_ImageItem.border = 0;
|
1665 |
+
|
1666 |
+
$Jssor$.$SetStyles(_ImageItem, _StyleDef);
|
1667 |
+
}
|
1668 |
+
}
|
1669 |
+
|
1670 |
+
RefreshContent(childElement, fresh, level + 1);
|
1671 |
+
});
|
1672 |
+
}
|
1673 |
+
|
1674 |
+
_SelfSlideItem.$OnInnerOffsetChange = function (oldOffset, newOffset) {
|
1675 |
+
var slidePosition = _DisplayPieces - newOffset;
|
1676 |
+
|
1677 |
+
SetPosition(_Wrapper, slidePosition);
|
1678 |
+
|
1679 |
+
//following lines are for future usage, not ready yet
|
1680 |
+
//if (!_IsDragging || !_IsCaptionSliderPlayingWhenDragStart) {
|
1681 |
+
// var _DealWithParallax;
|
1682 |
+
// if (IsCurrentSlideIndex(slideIndex)) {
|
1683 |
+
// if (_CaptionSliderOptions.$PlayOutMode == 2)
|
1684 |
+
// _DealWithParallax = true;
|
1685 |
+
// }
|
1686 |
+
// else {
|
1687 |
+
// if (!_CaptionSliderOptions.$PlayInMode) {
|
1688 |
+
// //PlayInMode: 0 none
|
1689 |
+
// _CaptionSliderIn.$GoToEnd();
|
1690 |
+
// }
|
1691 |
+
// //else if (_CaptionSliderOptions.$PlayInMode == 1) {
|
1692 |
+
// // //PlayInMode: 1 chain
|
1693 |
+
// // _CaptionSliderIn.$GoToBegin();
|
1694 |
+
// //}
|
1695 |
+
// else if (_CaptionSliderOptions.$PlayInMode == 2) {
|
1696 |
+
// //PlayInMode: 2 parallel
|
1697 |
+
// _DealWithParallax = true;
|
1698 |
+
// }
|
1699 |
+
// }
|
1700 |
+
|
1701 |
+
// if (_DealWithParallax) {
|
1702 |
+
// _CaptionSliderIn.$GoToPosition((_CaptionSliderIn.$GetPosition_OuterEnd() - _CaptionSliderIn.$GetPosition_OuterBegin()) * Math.abs(newOffset - 1) * .8 + _CaptionSliderIn.$GetPosition_OuterBegin());
|
1703 |
+
// }
|
1704 |
+
//}
|
1705 |
+
};
|
1706 |
+
|
1707 |
+
_SelfSlideItem.$GetCaptionSliderIn = function () {
|
1708 |
+
return _CaptionSliderIn;
|
1709 |
+
};
|
1710 |
+
|
1711 |
+
_SelfSlideItem.$GetCaptionSliderOut = function () {
|
1712 |
+
return _CaptionSliderOut;
|
1713 |
+
};
|
1714 |
+
|
1715 |
+
_SelfSlideItem.$Index = slideIndex;
|
1716 |
+
|
1717 |
+
$JssorObject$.call(_SelfSlideItem);
|
1718 |
+
|
1719 |
+
//SlideItem Constructor
|
1720 |
+
{
|
1721 |
+
|
1722 |
+
var thumb = $Jssor$.$FindChild(slideElmt, "thumb", true);
|
1723 |
+
if (thumb) {
|
1724 |
+
_SelfSlideItem.$Thumb = $Jssor$.$CloneNode(thumb);
|
1725 |
+
$Jssor$.$RemoveAttribute(thumb, "id");
|
1726 |
+
$Jssor$.$HideElement(thumb);
|
1727 |
+
}
|
1728 |
+
$Jssor$.$ShowElement(slideElmt);
|
1729 |
+
|
1730 |
+
_LoadingScreen = $Jssor$.$CloneNode(_LoadingContainer);
|
1731 |
+
$Jssor$.$CssZIndex(_LoadingScreen, 1000);
|
1732 |
+
|
1733 |
+
//cancel click event on <A> element when a drag of slide succeeded
|
1734 |
+
$Jssor$.$AddEvent(slideElmt, "click", LinkClickEventHandler);
|
1735 |
+
|
1736 |
+
ResetCaptionSlider(true);
|
1737 |
+
|
1738 |
+
_SelfSlideItem.$Image = _ImageItem;
|
1739 |
+
_SelfSlideItem.$Link = _LinkItem;
|
1740 |
+
|
1741 |
+
_SelfSlideItem.$Item = slideElmt;
|
1742 |
+
|
1743 |
+
_SelfSlideItem.$Wrapper = _Wrapper = slideElmt;
|
1744 |
+
$Jssor$.$AppendChild(_Wrapper, _LoadingScreen);
|
1745 |
+
|
1746 |
+
_SelfSlider.$On(203, ParkEventHandler);
|
1747 |
+
_SelfSlider.$On(28, FreezeEventHandler);
|
1748 |
+
_SelfSlider.$On(24, SwipeStartEventHandler);
|
1749 |
+
|
1750 |
+
$JssorDebug$.$Execute(function () {
|
1751 |
+
_SequenceNumber = _SlideItemCreatedCount++;
|
1752 |
+
});
|
1753 |
+
|
1754 |
+
$JssorDebug$.$Execute(function () {
|
1755 |
+
$Jssor$.$Attribute(_Wrapper, "debug-id", "slide-" + slideIndex);
|
1756 |
+
});
|
1757 |
+
}
|
1758 |
+
}
|
1759 |
+
//SlideItem
|
1760 |
+
|
1761 |
+
//Processor
|
1762 |
+
function Processor(slideElmt, slideIndex, slideshowProcessor, captionSliderIn, captionSliderOut) {
|
1763 |
+
|
1764 |
+
var _SelfProcessor = this;
|
1765 |
+
|
1766 |
+
var _ProgressBegin = 0;
|
1767 |
+
var _SlideshowBegin = 0;
|
1768 |
+
var _SlideshowEnd;
|
1769 |
+
var _CaptionInBegin;
|
1770 |
+
var _IdleBegin;
|
1771 |
+
var _IdleEnd;
|
1772 |
+
var _ProgressEnd;
|
1773 |
+
|
1774 |
+
var _IsSlideshowRunning;
|
1775 |
+
var _IsRollingBack;
|
1776 |
+
|
1777 |
+
var _PlayerInstance;
|
1778 |
+
var _IsPlayerOnService;
|
1779 |
+
|
1780 |
+
var slideItem = _SlideItems[slideIndex];
|
1781 |
+
|
1782 |
+
$JssorAnimator$.call(_SelfProcessor, 0, 0);
|
1783 |
+
|
1784 |
+
function UpdateLink() {
|
1785 |
+
|
1786 |
+
$Jssor$.$ClearChildren(_LinkContainer);
|
1787 |
+
|
1788 |
+
if (_ShowLink && _IsSlideshowRunning && slideItem.$Link) {
|
1789 |
+
$Jssor$.$AppendChild(_LinkContainer, slideItem.$Link);
|
1790 |
+
}
|
1791 |
+
|
1792 |
+
$Jssor$.$ShowElement(_LinkContainer, !_IsSlideshowRunning && slideItem.$Image);
|
1793 |
+
}
|
1794 |
+
|
1795 |
+
function ProcessCompleteEventHandler() {
|
1796 |
+
|
1797 |
+
if (_IsRollingBack) {
|
1798 |
+
_IsRollingBack = false;
|
1799 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_ROLLBACK_END, slideIndex, _IdleEnd, _ProgressBegin, _IdleBegin, _IdleEnd, _ProgressEnd);
|
1800 |
+
_SelfProcessor.$GoToPosition(_IdleBegin);
|
1801 |
+
}
|
1802 |
+
|
1803 |
+
_SelfProcessor.$Replay();
|
1804 |
+
}
|
1805 |
+
|
1806 |
+
function PlayerSwitchEventHandler(isOnService) {
|
1807 |
+
_IsPlayerOnService = isOnService;
|
1808 |
+
|
1809 |
+
_SelfProcessor.$Stop();
|
1810 |
+
_SelfProcessor.$Replay();
|
1811 |
+
}
|
1812 |
+
|
1813 |
+
_SelfProcessor.$Replay = function () {
|
1814 |
+
|
1815 |
+
var currentPosition = _SelfProcessor.$GetPosition_Display();
|
1816 |
+
|
1817 |
+
if (!_IsDragging && !_IsSliding && !_IsPlayerOnService && _CurrentSlideIndex == slideIndex) {
|
1818 |
+
|
1819 |
+
if (!currentPosition) {
|
1820 |
+
if (_SlideshowEnd && !_IsSlideshowRunning) {
|
1821 |
+
_IsSlideshowRunning = true;
|
1822 |
+
|
1823 |
+
_SelfProcessor.$OpenSlideshowPanel(true);
|
1824 |
+
|
1825 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_SLIDESHOW_START, slideIndex, _ProgressBegin, _SlideshowBegin, _SlideshowEnd, _ProgressEnd);
|
1826 |
+
}
|
1827 |
+
|
1828 |
+
UpdateLink();
|
1829 |
+
}
|
1830 |
+
|
1831 |
+
var toPosition;
|
1832 |
+
var stateEvent = JssorSlider.$EVT_STATE_CHANGE;
|
1833 |
+
|
1834 |
+
if (currentPosition != _ProgressEnd) {
|
1835 |
+
if (currentPosition == _IdleEnd) {
|
1836 |
+
toPosition = _ProgressEnd;
|
1837 |
+
}
|
1838 |
+
else if (currentPosition == _IdleBegin) {
|
1839 |
+
toPosition = _IdleEnd;
|
1840 |
+
}
|
1841 |
+
else if (!currentPosition) {
|
1842 |
+
toPosition = _IdleBegin;
|
1843 |
+
}
|
1844 |
+
else if (currentPosition > _IdleEnd) {
|
1845 |
+
_IsRollingBack = true;
|
1846 |
+
toPosition = _IdleEnd;
|
1847 |
+
stateEvent = JssorSlider.$EVT_ROLLBACK_START;
|
1848 |
+
}
|
1849 |
+
else {
|
1850 |
+
//continue from break (by drag or lock)
|
1851 |
+
toPosition = _SelfProcessor.$GetPlayToPosition();
|
1852 |
+
}
|
1853 |
+
}
|
1854 |
+
|
1855 |
+
//$JssorDebug$.$Execute(function () {
|
1856 |
+
// if (currentPosition == _ProgressEnd) {
|
1857 |
+
// debugger;
|
1858 |
+
// }
|
1859 |
+
//});
|
1860 |
+
|
1861 |
+
_SelfSlider.$TriggerEvent(stateEvent, slideIndex, currentPosition, _ProgressBegin, _IdleBegin, _IdleEnd, _ProgressEnd);
|
1862 |
+
|
1863 |
+
var allowAutoPlay = _AutoPlay && (!_HoverToPause || _NotOnHover);
|
1864 |
+
|
1865 |
+
if (currentPosition == _ProgressEnd) {
|
1866 |
+
(_IdleEnd != _ProgressEnd && !(_HoverToPause & 12) || allowAutoPlay) && slideItem.$GoForNextSlide();
|
1867 |
+
}
|
1868 |
+
else if (allowAutoPlay || currentPosition != _IdleEnd) {
|
1869 |
+
_SelfProcessor.$PlayToPosition(toPosition, ProcessCompleteEventHandler);
|
1870 |
+
}
|
1871 |
+
}
|
1872 |
+
};
|
1873 |
+
|
1874 |
+
_SelfProcessor.$AdjustIdleOnPark = function () {
|
1875 |
+
if (_IdleEnd == _ProgressEnd && _IdleEnd == _SelfProcessor.$GetPosition_Display())
|
1876 |
+
_SelfProcessor.$GoToPosition(_IdleBegin);
|
1877 |
+
};
|
1878 |
+
|
1879 |
+
_SelfProcessor.$Abort = function () {
|
1880 |
+
_SlideshowRunner && _SlideshowRunner.$Index == slideIndex && _SlideshowRunner.$Clear();
|
1881 |
+
|
1882 |
+
var currentPosition = _SelfProcessor.$GetPosition_Display();
|
1883 |
+
if (currentPosition < _ProgressEnd) {
|
1884 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_STATE_CHANGE, slideIndex, -currentPosition -1, _ProgressBegin, _IdleBegin, _IdleEnd, _ProgressEnd);
|
1885 |
+
}
|
1886 |
+
};
|
1887 |
+
|
1888 |
+
_SelfProcessor.$OpenSlideshowPanel = function (open) {
|
1889 |
+
if (slideshowProcessor) {
|
1890 |
+
$Jssor$.$CssOverflow(_SlideshowPanel, open && slideshowProcessor.$Transition.$Outside ? "" : "hidden");
|
1891 |
+
}
|
1892 |
+
};
|
1893 |
+
|
1894 |
+
_SelfProcessor.$OnInnerOffsetChange = function (oldPosition, newPosition) {
|
1895 |
+
|
1896 |
+
if (_IsSlideshowRunning && newPosition >= _SlideshowEnd) {
|
1897 |
+
_IsSlideshowRunning = false;
|
1898 |
+
UpdateLink();
|
1899 |
+
slideItem.$UnhideContentForSlideshow();
|
1900 |
+
_SlideshowRunner.$Clear();
|
1901 |
+
|
1902 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_SLIDESHOW_END, slideIndex, _ProgressBegin, _SlideshowBegin, _SlideshowEnd, _ProgressEnd);
|
1903 |
+
}
|
1904 |
+
|
1905 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_PROGRESS_CHANGE, slideIndex, newPosition, _ProgressBegin, _IdleBegin, _IdleEnd, _ProgressEnd);
|
1906 |
+
};
|
1907 |
+
|
1908 |
+
_SelfProcessor.$SetPlayer = function (playerInstance) {
|
1909 |
+
if (playerInstance && !_PlayerInstance) {
|
1910 |
+
_PlayerInstance = playerInstance;
|
1911 |
+
|
1912 |
+
playerInstance.$On($JssorPlayer$.$EVT_SWITCH, PlayerSwitchEventHandler);
|
1913 |
+
}
|
1914 |
+
};
|
1915 |
+
|
1916 |
+
//Processor Constructor
|
1917 |
+
{
|
1918 |
+
if (slideshowProcessor) {
|
1919 |
+
_SelfProcessor.$Chain(slideshowProcessor);
|
1920 |
+
}
|
1921 |
+
|
1922 |
+
_SlideshowEnd = _SelfProcessor.$GetPosition_OuterEnd();
|
1923 |
+
_CaptionInBegin = _SelfProcessor.$GetPosition_OuterEnd();
|
1924 |
+
_SelfProcessor.$Chain(captionSliderIn);
|
1925 |
+
_IdleBegin = captionSliderIn.$GetPosition_OuterEnd();
|
1926 |
+
_IdleEnd = _IdleBegin + ($Jssor$.$ParseFloat($Jssor$.$AttributeEx(slideElmt, "idle")) || _Options.$AutoPlayInterval);
|
1927 |
+
|
1928 |
+
captionSliderOut.$Shift(_IdleEnd);
|
1929 |
+
_SelfProcessor.$Combine(captionSliderOut);
|
1930 |
+
_ProgressEnd = _SelfProcessor.$GetPosition_OuterEnd();
|
1931 |
+
}
|
1932 |
+
}
|
1933 |
+
//Processor
|
1934 |
+
//private classes
|
1935 |
+
|
1936 |
+
function SetPosition(elmt, position) {
|
1937 |
+
var orientation = _DragOrientation > 0 ? _DragOrientation : _PlayOrientation;
|
1938 |
+
var x = _StepLengthX * position * (orientation & 1);
|
1939 |
+
var y = _StepLengthY * position * ((orientation >> 1) & 1);
|
1940 |
+
|
1941 |
+
if ($Jssor$.$IsBrowserChrome() && $Jssor$.$BrowserVersion() < 38) {
|
1942 |
+
x = x.toFixed(3);
|
1943 |
+
y = y.toFixed(3);
|
1944 |
+
}
|
1945 |
+
else {
|
1946 |
+
x = Math.round(x);
|
1947 |
+
y = Math.round(y);
|
1948 |
+
}
|
1949 |
+
|
1950 |
+
if ($Jssor$.$IsBrowserIE() && $Jssor$.$BrowserVersion() >= 10 && $Jssor$.$BrowserVersion() < 11) {
|
1951 |
+
elmt.style.msTransform = "translate(" + x + "px, " + y + "px)";
|
1952 |
+
}
|
1953 |
+
else if ($Jssor$.$IsBrowserChrome() && $Jssor$.$BrowserVersion() >= 30 && $Jssor$.$BrowserVersion() < 34) {
|
1954 |
+
elmt.style.WebkitTransition = "transform 0s";
|
1955 |
+
elmt.style.WebkitTransform = "translate3d(" + x + "px, " + y + "px, 0px) perspective(2000px)";
|
1956 |
+
}
|
1957 |
+
else {
|
1958 |
+
$Jssor$.$CssLeft(elmt, x);
|
1959 |
+
$Jssor$.$CssTop(elmt, y);
|
1960 |
+
}
|
1961 |
+
}
|
1962 |
+
|
1963 |
+
//Event handling begin
|
1964 |
+
|
1965 |
+
function OnMouseDown(event) {
|
1966 |
+
var tagName = $Jssor$.$EventSrc(event).tagName;
|
1967 |
+
if (!_DragOrientationRegistered && tagName != "INPUT" && tagName != "TEXTAREA" && tagName != "SELECT" && RegisterDrag()) {
|
1968 |
+
OnDragStart(event);
|
1969 |
+
}
|
1970 |
+
}
|
1971 |
+
|
1972 |
+
function RecordFreezePoint() {
|
1973 |
+
|
1974 |
+
_CarouselPlaying_OnFreeze = _IsSliding;
|
1975 |
+
_PlayToPosition_OnFreeze = _CarouselPlayer.$GetPlayToPosition();
|
1976 |
+
_Position_OnFreeze = _Conveyor.$GetPosition();
|
1977 |
+
|
1978 |
+
}
|
1979 |
+
|
1980 |
+
function Freeze() {
|
1981 |
+
|
1982 |
+
RecordFreezePoint();
|
1983 |
+
|
1984 |
+
if (_IsDragging || !_NotOnHover && (_HoverToPause & 12)) {
|
1985 |
+
_CarouselPlayer.$Stop();
|
1986 |
+
|
1987 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_FREEZE);
|
1988 |
+
}
|
1989 |
+
|
1990 |
+
}
|
1991 |
+
|
1992 |
+
function Unfreeze(byDrag) {
|
1993 |
+
|
1994 |
+
byDrag && RecordFreezePoint();
|
1995 |
+
|
1996 |
+
if (!_IsDragging && (_NotOnHover || !(_HoverToPause & 12)) && !_CarouselPlayer.$IsPlaying()) {
|
1997 |
+
|
1998 |
+
var currentPosition = _Conveyor.$GetPosition();
|
1999 |
+
var toPosition = Math.ceil(_Position_OnFreeze);
|
2000 |
+
|
2001 |
+
if (byDrag && Math.abs(_DragOffsetTotal) >= _Options.$MinDragOffsetToSlide) {
|
2002 |
+
toPosition = Math.ceil(currentPosition);
|
2003 |
+
toPosition += _DragIndexAdjust;
|
2004 |
+
}
|
2005 |
+
|
2006 |
+
if (!(_Loop & 1)) {
|
2007 |
+
toPosition = Math.min(_SlideCount - _DisplayPieces, Math.max(toPosition, 0));
|
2008 |
+
}
|
2009 |
+
|
2010 |
+
var t = Math.abs(toPosition - currentPosition);
|
2011 |
+
t = 1 - Math.pow(1 - t, 5);
|
2012 |
+
|
2013 |
+
if (!_LastDragSucceded && _CarouselPlaying_OnFreeze) {
|
2014 |
+
_CarouselPlayer.$Continue(_PlayToPosition_OnFreeze);
|
2015 |
+
}
|
2016 |
+
else if (currentPosition == toPosition) {
|
2017 |
+
_CurrentSlideItem.$EnablePlayer();
|
2018 |
+
_CurrentSlideItem.$TryActivate();
|
2019 |
+
}
|
2020 |
+
else {
|
2021 |
+
|
2022 |
+
_CarouselPlayer.$PlayCarousel(currentPosition, toPosition, t * _SlideDuration);
|
2023 |
+
}
|
2024 |
+
}
|
2025 |
+
}
|
2026 |
+
|
2027 |
+
function OnDragStart(event) {
|
2028 |
+
|
2029 |
+
_IsDragging = true;
|
2030 |
+
_DragInvalid = false;
|
2031 |
+
_LoadingTicket = null;
|
2032 |
+
|
2033 |
+
$Jssor$.$AddEvent(document, _MoveEvent, OnDragMove);
|
2034 |
+
|
2035 |
+
_LastTimeMoveByDrag = $Jssor$.$GetNow() - 50;
|
2036 |
+
|
2037 |
+
_LastDragSucceded = 0;
|
2038 |
+
Freeze();
|
2039 |
+
|
2040 |
+
if (!_CarouselPlaying_OnFreeze)
|
2041 |
+
_DragOrientation = 0;
|
2042 |
+
|
2043 |
+
if (_HandleTouchEventOnly) {
|
2044 |
+
var touchPoint = event.touches[0];
|
2045 |
+
_DragStartMouseX = touchPoint.clientX;
|
2046 |
+
_DragStartMouseY = touchPoint.clientY;
|
2047 |
+
}
|
2048 |
+
else {
|
2049 |
+
var mousePoint = $Jssor$.$MousePosition(event);
|
2050 |
+
|
2051 |
+
_DragStartMouseX = mousePoint.x;
|
2052 |
+
_DragStartMouseY = mousePoint.y;
|
2053 |
+
|
2054 |
+
$Jssor$.$CancelEvent(event);
|
2055 |
+
}
|
2056 |
+
|
2057 |
+
_DragOffsetTotal = 0;
|
2058 |
+
_DragOffsetLastTime = 0;
|
2059 |
+
_DragIndexAdjust = 0;
|
2060 |
+
|
2061 |
+
//Trigger EVT_DRAGSTART
|
2062 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_DRAG_START, GetRealIndex(_Position_OnFreeze), _Position_OnFreeze, event);
|
2063 |
+
}
|
2064 |
+
|
2065 |
+
function OnDragMove(event) {
|
2066 |
+
if (_IsDragging && (!$Jssor$.$IsBrowserIe9Earlier() || event.button)) {
|
2067 |
+
var actionPoint;
|
2068 |
+
|
2069 |
+
if (_HandleTouchEventOnly) {
|
2070 |
+
var touches = event.touches;
|
2071 |
+
if (touches && touches.length > 0) {
|
2072 |
+
actionPoint = { x: touches[0].clientX, y: touches[0].clientY };
|
2073 |
+
}
|
2074 |
+
}
|
2075 |
+
else {
|
2076 |
+
actionPoint = $Jssor$.$MousePosition(event);
|
2077 |
+
}
|
2078 |
+
|
2079 |
+
if (actionPoint) {
|
2080 |
+
var distanceX = actionPoint.x - _DragStartMouseX;
|
2081 |
+
var distanceY = actionPoint.y - _DragStartMouseY;
|
2082 |
+
|
2083 |
+
|
2084 |
+
if (Math.floor(_Position_OnFreeze) != _Position_OnFreeze)
|
2085 |
+
_DragOrientation = _DragOrientation || (_PlayOrientation & _DragOrientationRegistered);
|
2086 |
+
|
2087 |
+
if ((distanceX || distanceY) && !_DragOrientation) {
|
2088 |
+
if (_DragOrientationRegistered == 3) {
|
2089 |
+
if (Math.abs(distanceY) > Math.abs(distanceX)) {
|
2090 |
+
_DragOrientation = 2;
|
2091 |
+
}
|
2092 |
+
else
|
2093 |
+
_DragOrientation = 1;
|
2094 |
+
}
|
2095 |
+
else {
|
2096 |
+
_DragOrientation = _DragOrientationRegistered;
|
2097 |
+
}
|
2098 |
+
|
2099 |
+
if (_IsTouchDevice && _DragOrientation == 1 && Math.abs(distanceY) - Math.abs(distanceX) > 3) {
|
2100 |
+
_DragInvalid = true;
|
2101 |
+
}
|
2102 |
+
}
|
2103 |
+
|
2104 |
+
if (_DragOrientation) {
|
2105 |
+
var distance = distanceY;
|
2106 |
+
var stepLength = _StepLengthY;
|
2107 |
+
|
2108 |
+
if (_DragOrientation == 1) {
|
2109 |
+
distance = distanceX;
|
2110 |
+
stepLength = _StepLengthX;
|
2111 |
+
}
|
2112 |
+
|
2113 |
+
if (!(_Loop & 1)) {
|
2114 |
+
if (distance > 0) {
|
2115 |
+
var normalDistance = stepLength * _CurrentSlideIndex;
|
2116 |
+
var sqrtDistance = distance - normalDistance;
|
2117 |
+
if (sqrtDistance > 0) {
|
2118 |
+
distance = normalDistance + Math.sqrt(sqrtDistance) * 5;
|
2119 |
+
}
|
2120 |
+
}
|
2121 |
+
|
2122 |
+
if (distance < 0) {
|
2123 |
+
var normalDistance = stepLength * (_SlideCount - _DisplayPieces - _CurrentSlideIndex);
|
2124 |
+
var sqrtDistance = -distance - normalDistance;
|
2125 |
+
|
2126 |
+
if (sqrtDistance > 0) {
|
2127 |
+
distance = -normalDistance - Math.sqrt(sqrtDistance) * 5;
|
2128 |
+
}
|
2129 |
+
}
|
2130 |
+
}
|
2131 |
+
|
2132 |
+
if (_DragOffsetTotal - _DragOffsetLastTime < -2) {
|
2133 |
+
_DragIndexAdjust = 0;
|
2134 |
+
}
|
2135 |
+
else if (_DragOffsetTotal - _DragOffsetLastTime > 2) {
|
2136 |
+
_DragIndexAdjust = -1;
|
2137 |
+
}
|
2138 |
+
|
2139 |
+
_DragOffsetLastTime = _DragOffsetTotal;
|
2140 |
+
_DragOffsetTotal = distance;
|
2141 |
+
_PositionToGoByDrag = _Position_OnFreeze - _DragOffsetTotal / stepLength / (_ScaleRatio || 1);
|
2142 |
+
|
2143 |
+
if (_DragOffsetTotal && _DragOrientation && !_DragInvalid) {
|
2144 |
+
$Jssor$.$CancelEvent(event);
|
2145 |
+
if (!_IsSliding) {
|
2146 |
+
_CarouselPlayer.$StandBy(_PositionToGoByDrag);
|
2147 |
+
}
|
2148 |
+
else
|
2149 |
+
_CarouselPlayer.$SetStandByPosition(_PositionToGoByDrag);
|
2150 |
+
}
|
2151 |
+
else if ($Jssor$.$IsBrowserIe9Earlier()) {
|
2152 |
+
$Jssor$.$CancelEvent(event);
|
2153 |
+
}
|
2154 |
+
}
|
2155 |
+
}
|
2156 |
+
}
|
2157 |
+
else {
|
2158 |
+
OnDragEnd(event);
|
2159 |
+
}
|
2160 |
+
}
|
2161 |
+
|
2162 |
+
function OnDragEnd(event) {
|
2163 |
+
UnregisterDrag();
|
2164 |
+
|
2165 |
+
if (_IsDragging) {
|
2166 |
+
|
2167 |
+
_IsDragging = false;
|
2168 |
+
|
2169 |
+
_LastTimeMoveByDrag = $Jssor$.$GetNow();
|
2170 |
+
|
2171 |
+
$Jssor$.$RemoveEvent(document, _MoveEvent, OnDragMove);
|
2172 |
+
|
2173 |
+
_LastDragSucceded = _DragOffsetTotal;
|
2174 |
+
|
2175 |
+
_LastDragSucceded && $Jssor$.$CancelEvent(event);
|
2176 |
+
|
2177 |
+
_CarouselPlayer.$Stop();
|
2178 |
+
|
2179 |
+
var currentPosition = _Conveyor.$GetPosition();
|
2180 |
+
|
2181 |
+
//Trigger EVT_DRAG_END
|
2182 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_DRAG_END, GetRealIndex(currentPosition), currentPosition, GetRealIndex(_Position_OnFreeze), _Position_OnFreeze, event);
|
2183 |
+
|
2184 |
+
Unfreeze(true);
|
2185 |
+
}
|
2186 |
+
}
|
2187 |
+
//Event handling end
|
2188 |
+
|
2189 |
+
function SetCurrentSlideIndex(index) {
|
2190 |
+
_PrevSlideItem = _SlideItems[_CurrentSlideIndex];
|
2191 |
+
_PreviousSlideIndex = _CurrentSlideIndex;
|
2192 |
+
_CurrentSlideIndex = GetRealIndex(index);
|
2193 |
+
_CurrentSlideItem = _SlideItems[_CurrentSlideIndex];
|
2194 |
+
ResetNavigator(index);
|
2195 |
+
return _CurrentSlideIndex;
|
2196 |
+
}
|
2197 |
+
|
2198 |
+
function OnPark(slideIndex, prevIndex) {
|
2199 |
+
_DragOrientation = 0;
|
2200 |
+
|
2201 |
+
SetCurrentSlideIndex(slideIndex);
|
2202 |
+
|
2203 |
+
//Trigger EVT_PARK
|
2204 |
+
_SelfSlider.$TriggerEvent(JssorSlider.$EVT_PARK, GetRealIndex(slideIndex), prevIndex);
|
2205 |
+
}
|
2206 |
+
|
2207 |
+
function ResetNavigator(index, temp) {
|
2208 |
+
_TempSlideIndex = index;
|
2209 |
+
$Jssor$.$Each(_Navigators, function (navigator) {
|
2210 |
+
navigator.$SetCurrentIndex(GetRealIndex(index), index, temp);
|
2211 |
+
});
|
2212 |
+
}
|
2213 |
+
|
2214 |
+
function RegisterDrag() {
|
2215 |
+
var dragRegistry = JssorSlider.$DragRegistry || 0;
|
2216 |
+
var dragOrientation = _DragEnabled;
|
2217 |
+
if (_IsTouchDevice)
|
2218 |
+
(dragOrientation & 1) && (dragOrientation &= 1);
|
2219 |
+
JssorSlider.$DragRegistry |= dragOrientation;
|
2220 |
+
|
2221 |
+
return (_DragOrientationRegistered = dragOrientation & ~dragRegistry);
|
2222 |
+
}
|
2223 |
+
|
2224 |
+
function UnregisterDrag() {
|
2225 |
+
if (_DragOrientationRegistered) {
|
2226 |
+
JssorSlider.$DragRegistry &= ~_DragEnabled;
|
2227 |
+
_DragOrientationRegistered = 0;
|
2228 |
+
}
|
2229 |
+
}
|
2230 |
+
|
2231 |
+
function CreatePanel() {
|
2232 |
+
var div = $Jssor$.$CreateDiv();
|
2233 |
+
|
2234 |
+
$Jssor$.$SetStyles(div, _StyleDef);
|
2235 |
+
$Jssor$.$CssPosition(div, "absolute");
|
2236 |
+
|
2237 |
+
return div;
|
2238 |
+
}
|
2239 |
+
|
2240 |
+
function GetRealIndex(index) {
|
2241 |
+
return (index % _SlideCount + _SlideCount) % _SlideCount;
|
2242 |
+
}
|
2243 |
+
|
2244 |
+
function IsCurrentSlideIndex(index) {
|
2245 |
+
return GetRealIndex(index) == _CurrentSlideIndex;
|
2246 |
+
}
|
2247 |
+
|
2248 |
+
function IsPreviousSlideIndex(index) {
|
2249 |
+
return GetRealIndex(index) == _PreviousSlideIndex;
|
2250 |
+
}
|
2251 |
+
|
2252 |
+
//Navigation Request Handler
|
2253 |
+
function NavigationClickHandler(index, relative) {
|
2254 |
+
if (relative) {
|
2255 |
+
if (!_Loop) {
|
2256 |
+
//Stop at threshold
|
2257 |
+
index = Math.min(Math.max(index + _TempSlideIndex, 0), _SlideCount - _DisplayPieces);
|
2258 |
+
relative = false;
|
2259 |
+
}
|
2260 |
+
else if (_Loop & 2) {
|
2261 |
+
//Rewind
|
2262 |
+
index = GetRealIndex(index + _TempSlideIndex);
|
2263 |
+
relative = false;
|
2264 |
+
}
|
2265 |
+
}
|
2266 |
+
PlayTo(index, _Options.$SlideDuration, relative);
|
2267 |
+
}
|
2268 |
+
|
2269 |
+
function ShowNavigators() {
|
2270 |
+
$Jssor$.$Each(_Navigators, function (navigator) {
|
2271 |
+
navigator.$Show(navigator.$Options.$ChanceToShow <= _NotOnHover);
|
2272 |
+
});
|
2273 |
+
}
|
2274 |
+
|
2275 |
+
function MainContainerMouseLeaveEventHandler() {
|
2276 |
+
if (!_NotOnHover) {
|
2277 |
+
|
2278 |
+
//$JssorDebug$.$Log("mouseleave");
|
2279 |
+
|
2280 |
+
_NotOnHover = 1;
|
2281 |
+
|
2282 |
+
ShowNavigators();
|
2283 |
+
|
2284 |
+
if (!_IsDragging) {
|
2285 |
+
(_HoverToPause & 12) && Unfreeze();
|
2286 |
+
(_HoverToPause & 3) && _SlideItems[_CurrentSlideIndex].$TryActivate();
|
2287 |
+
}
|
2288 |
+
}
|
2289 |
+
}
|
2290 |
+
|
2291 |
+
function MainContainerMouseEnterEventHandler() {
|
2292 |
+
|
2293 |
+
if (_NotOnHover) {
|
2294 |
+
|
2295 |
+
//$JssorDebug$.$Log("mouseenter");
|
2296 |
+
|
2297 |
+
_NotOnHover = 0;
|
2298 |
+
|
2299 |
+
ShowNavigators();
|
2300 |
+
|
2301 |
+
_IsDragging || !(_HoverToPause & 12) || Freeze();
|
2302 |
+
}
|
2303 |
+
}
|
2304 |
+
|
2305 |
+
function AdjustSlidesContainerSize() {
|
2306 |
+
_StyleDef = { $Width: _SlideWidth, $Height: _SlideHeight, $Top: 0, $Left: 0 };
|
2307 |
+
|
2308 |
+
$Jssor$.$Each(_SlideElmts, function (slideElmt, i) {
|
2309 |
+
|
2310 |
+
$Jssor$.$SetStyles(slideElmt, _StyleDef);
|
2311 |
+
$Jssor$.$CssPosition(slideElmt, "absolute");
|
2312 |
+
$Jssor$.$CssOverflow(slideElmt, "hidden");
|
2313 |
+
|
2314 |
+
$Jssor$.$HideElement(slideElmt);
|
2315 |
+
});
|
2316 |
+
|
2317 |
+
$Jssor$.$SetStyles(_LoadingContainer, _StyleDef);
|
2318 |
+
}
|
2319 |
+
|
2320 |
+
function PlayToOffset(offset, slideDuration) {
|
2321 |
+
PlayTo(offset, slideDuration, true);
|
2322 |
+
}
|
2323 |
+
|
2324 |
+
function PlayTo(slideIndex, slideDuration, relative) {
|
2325 |
+
/// <summary>
|
2326 |
+
/// PlayTo( slideIndex [, slideDuration] ); //Play slider to position 'slideIndex' within a period calculated base on 'slideDuration'.
|
2327 |
+
/// </summary>
|
2328 |
+
/// <param name="slideIndex" type="Number">
|
2329 |
+
/// slide slideIndex or position will be playing to
|
2330 |
+
/// </param>
|
2331 |
+
/// <param name="slideDuration" type="Number" optional="true">
|
2332 |
+
/// base slide duration in milliseconds to calculate the whole duration to complete this play request.
|
2333 |
+
/// default value is '$SlideDuration' value which is specified when initialize the slider.
|
2334 |
+
/// </param>
|
2335 |
+
/// http://msdn.microsoft.com/en-us/library/vstudio/bb385682.aspx
|
2336 |
+
/// http://msdn.microsoft.com/en-us/library/vstudio/hh542720.aspx
|
2337 |
+
if (_CarouselEnabled && (!_IsDragging || _Options.$NaviQuitDrag)) {
|
2338 |
+
_IsSliding = true;
|
2339 |
+
_IsDragging = false;
|
2340 |
+
_CarouselPlayer.$Stop();
|
2341 |
+
|
2342 |
+
{
|
2343 |
+
//Slide Duration
|
2344 |
+
if (slideDuration == undefined)
|
2345 |
+
slideDuration = _SlideDuration;
|
2346 |
+
|
2347 |
+
var positionDisplay = _Carousel.$GetPosition_Display();
|
2348 |
+
var positionTo = slideIndex;
|
2349 |
+
if (relative) {
|
2350 |
+
positionTo = positionDisplay + slideIndex;
|
2351 |
+
if (slideIndex > 0)
|
2352 |
+
positionTo = Math.ceil(positionTo);
|
2353 |
+
else
|
2354 |
+
positionTo = Math.floor(positionTo);
|
2355 |
+
}
|
2356 |
+
|
2357 |
+
|
2358 |
+
if (!(_Loop & 1)) {
|
2359 |
+
positionTo = GetRealIndex(positionTo);
|
2360 |
+
positionTo = Math.max(0, Math.min(positionTo, _SlideCount - _DisplayPieces));
|
2361 |
+
}
|
2362 |
+
|
2363 |
+
var positionOffset = (positionTo - positionDisplay) % _SlideCount;
|
2364 |
+
positionTo = positionDisplay + positionOffset;
|
2365 |
+
|
2366 |
+
var duration = positionDisplay == positionTo ? 0 : slideDuration * Math.abs(positionOffset);
|
2367 |
+
duration = Math.min(duration, slideDuration * _DisplayPieces * 1.5);
|
2368 |
+
|
2369 |
+
_CarouselPlayer.$PlayCarousel(positionDisplay, positionTo, duration || 1);
|
2370 |
+
}
|
2371 |
+
}
|
2372 |
+
}
|
2373 |
+
|
2374 |
+
//private functions
|
2375 |
+
|
2376 |
+
//member functions
|
2377 |
+
|
2378 |
+
_SelfSlider.$PlayTo = PlayTo;
|
2379 |
+
|
2380 |
+
_SelfSlider.$GoTo = function (slideIndex) {
|
2381 |
+
/// <summary>
|
2382 |
+
/// instance.$GoTo( slideIndex ); //Go to the specifed slide immediately with no play.
|
2383 |
+
/// </summary>
|
2384 |
+
PlayTo(slideIndex, 1);
|
2385 |
+
};
|
2386 |
+
|
2387 |
+
_SelfSlider.$Next = function () {
|
2388 |
+
/// <summary>
|
2389 |
+
/// instance.$Next(); //Play the slider to next slide.
|
2390 |
+
/// </summary>
|
2391 |
+
PlayToOffset(1);
|
2392 |
+
};
|
2393 |
+
|
2394 |
+
_SelfSlider.$Prev = function () {
|
2395 |
+
/// <summary>
|
2396 |
+
/// instance.$Prev(); //Play the slider to previous slide.
|
2397 |
+
/// </summary>
|
2398 |
+
PlayToOffset(-1);
|
2399 |
+
};
|
2400 |
+
|
2401 |
+
_SelfSlider.$Pause = function () {
|
2402 |
+
/// <summary>
|
2403 |
+
/// instance.$Pause(); //Pause the slider, prevent it from auto playing.
|
2404 |
+
/// </summary>
|
2405 |
+
_AutoPlay = false;
|
2406 |
+
};
|
2407 |
+
|
2408 |
+
_SelfSlider.$Play = function () {
|
2409 |
+
/// <summary>
|
2410 |
+
/// instance.$Play(); //Start auto play if the slider is currently paused.
|
2411 |
+
/// </summary>
|
2412 |
+
if (!_AutoPlay) {
|
2413 |
+
_AutoPlay = true;
|
2414 |
+
_SlideItems[_CurrentSlideIndex] && _SlideItems[_CurrentSlideIndex].$TryActivate();
|
2415 |
+
}
|
2416 |
+
};
|
2417 |
+
|
2418 |
+
_SelfSlider.$SetSlideshowTransitions = function (transitions) {
|
2419 |
+
/// <summary>
|
2420 |
+
/// instance.$SetSlideshowTransitions( transitions ); //Reset slideshow transitions for the slider.
|
2421 |
+
/// </summary>
|
2422 |
+
$JssorDebug$.$Execute(function () {
|
2423 |
+
if (!transitions || !transitions.length) {
|
2424 |
+
$JssorDebug$.$Error("Can not set slideshow transitions, no transitions specified.");
|
2425 |
+
}
|
2426 |
+
});
|
2427 |
+
|
2428 |
+
$Jssor$.$TranslateTransitions(transitions); //for old transition compatibility
|
2429 |
+
_Options.$SlideshowOptions.$Transitions = transitions;
|
2430 |
+
};
|
2431 |
+
|
2432 |
+
_SelfSlider.$SetCaptionTransitions = function (transitions) {
|
2433 |
+
/// <summary>
|
2434 |
+
/// instance.$SetCaptionTransitions( transitions ); //Reset caption transitions for the slider.
|
2435 |
+
/// </summary>
|
2436 |
+
$JssorDebug$.$Execute(function () {
|
2437 |
+
if (!transitions || !transitions.length) {
|
2438 |
+
$JssorDebug$.$Error("Can not set caption transitions, no transitions specified");
|
2439 |
+
}
|
2440 |
+
});
|
2441 |
+
|
2442 |
+
$Jssor$.$TranslateTransitions(transitions); //for old transition compatibility
|
2443 |
+
_CaptionSliderOptions.$CaptionTransitions = transitions;
|
2444 |
+
_CaptionSliderOptions.$Version = $Jssor$.$GetNow();
|
2445 |
+
};
|
2446 |
+
|
2447 |
+
_SelfSlider.$SlidesCount = function () {
|
2448 |
+
/// <summary>
|
2449 |
+
/// instance.$SlidesCount(); //Retrieve slides count of the slider.
|
2450 |
+
/// </summary>
|
2451 |
+
return _SlideElmts.length;
|
2452 |
+
};
|
2453 |
+
|
2454 |
+
_SelfSlider.$CurrentIndex = function () {
|
2455 |
+
/// <summary>
|
2456 |
+
/// instance.$CurrentIndex(); //Retrieve current slide index of the slider.
|
2457 |
+
/// </summary>
|
2458 |
+
return _CurrentSlideIndex;
|
2459 |
+
};
|
2460 |
+
|
2461 |
+
_SelfSlider.$IsAutoPlaying = function () {
|
2462 |
+
/// <summary>
|
2463 |
+
/// instance.$IsAutoPlaying(); //Retrieve auto play status of the slider.
|
2464 |
+
/// </summary>
|
2465 |
+
return _AutoPlay;
|
2466 |
+
};
|
2467 |
+
|
2468 |
+
_SelfSlider.$IsDragging = function () {
|
2469 |
+
/// <summary>
|
2470 |
+
/// instance.$IsDragging(); //Retrieve drag status of the slider.
|
2471 |
+
/// </summary>
|
2472 |
+
return _IsDragging;
|
2473 |
+
};
|
2474 |
+
|
2475 |
+
_SelfSlider.$IsSliding = function () {
|
2476 |
+
/// <summary>
|
2477 |
+
/// instance.$IsSliding(); //Retrieve right<-->left sliding status of the slider.
|
2478 |
+
/// </summary>
|
2479 |
+
return _IsSliding;
|
2480 |
+
};
|
2481 |
+
|
2482 |
+
_SelfSlider.$IsMouseOver = function () {
|
2483 |
+
/// <summary>
|
2484 |
+
/// instance.$IsMouseOver(); //Retrieve mouse over status of the slider.
|
2485 |
+
/// </summary>
|
2486 |
+
return !_NotOnHover;
|
2487 |
+
};
|
2488 |
+
|
2489 |
+
_SelfSlider.$LastDragSucceded = function () {
|
2490 |
+
/// <summary>
|
2491 |
+
/// instance.$IsLastDragSucceded(); //Retrieve last drag succeded status, returns 0 if failed, returns drag offset if succeded
|
2492 |
+
/// </summary>
|
2493 |
+
return _LastDragSucceded;
|
2494 |
+
};
|
2495 |
+
|
2496 |
+
function OriginalWidth() {
|
2497 |
+
/// <summary>
|
2498 |
+
/// instance.$OriginalWidth(); //Retrieve original width of the slider.
|
2499 |
+
/// </summary>
|
2500 |
+
return $Jssor$.$CssWidth(_ScaleWrapper || elmt);
|
2501 |
+
}
|
2502 |
+
|
2503 |
+
function OriginalHeight() {
|
2504 |
+
/// <summary>
|
2505 |
+
/// instance.$OriginalHeight(); //Retrieve original height of the slider.
|
2506 |
+
/// </summary>
|
2507 |
+
return $Jssor$.$CssHeight(_ScaleWrapper || elmt);
|
2508 |
+
}
|
2509 |
+
|
2510 |
+
_SelfSlider.$OriginalWidth = _SelfSlider.$GetOriginalWidth = OriginalWidth;
|
2511 |
+
|
2512 |
+
_SelfSlider.$OriginalHeight = _SelfSlider.$GetOriginalHeight = OriginalHeight;
|
2513 |
+
|
2514 |
+
function Scale(dimension, isHeight) {
|
2515 |
+
/// <summary>
|
2516 |
+
/// instance.$ScaleWidth(); //Retrieve scaled dimension the slider currently displays.
|
2517 |
+
/// instance.$ScaleWidth( dimension ); //Scale the slider to new width and keep aspect ratio.
|
2518 |
+
/// </summary>
|
2519 |
+
|
2520 |
+
if (dimension == undefined)
|
2521 |
+
return $Jssor$.$CssWidth(elmt);
|
2522 |
+
|
2523 |
+
$JssorDebug$.$Execute(function () {
|
2524 |
+
if (!dimension || dimension < 0) {
|
2525 |
+
$JssorDebug$.$Fail("'$ScaleWidth' error, 'dimension' should be positive value.");
|
2526 |
+
}
|
2527 |
+
});
|
2528 |
+
|
2529 |
+
if (!_ScaleWrapper) {
|
2530 |
+
$JssorDebug$.$Execute(function () {
|
2531 |
+
var originalWidthStr = $Jssor$.$Css(elmt, "width");
|
2532 |
+
var originalHeightStr = $Jssor$.$Css(elmt, "height");
|
2533 |
+
var originalWidth = $Jssor$.$CssP(elmt, "width");
|
2534 |
+
var originalHeight = $Jssor$.$CssP(elmt, "height");
|
2535 |
+
|
2536 |
+
if (!originalWidthStr) {
|
2537 |
+
$JssorDebug$.$Fail("Cannot scale jssor slider, 'dimension' of 'outer container' not specified. Please specify 'dimension' in pixel. e.g. 'dimension: 600px;'");
|
2538 |
+
}
|
2539 |
+
|
2540 |
+
if (!originalHeightStr) {
|
2541 |
+
$JssorDebug$.$Fail("Cannot scale jssor slider, 'height' of 'outer container' not specified. Please specify 'height' in pixel. e.g. 'height: 300px;'");
|
2542 |
+
}
|
2543 |
+
|
2544 |
+
if (originalWidthStr.indexOf('%') != -1) {
|
2545 |
+
$JssorDebug$.$Fail("Cannot scale jssor slider, 'dimension' of 'outer container' not valid. Please specify 'dimension' in pixel. e.g. 'dimension: 600px;'");
|
2546 |
+
}
|
2547 |
+
|
2548 |
+
if (originalHeightStr.indexOf('%') != -1) {
|
2549 |
+
$JssorDebug$.$Fail("Cannot scale jssor slider, 'height' of 'outer container' not valid. Please specify 'height' in pixel. e.g. 'height: 300px;'");
|
2550 |
+
}
|
2551 |
+
|
2552 |
+
if (!originalWidth) {
|
2553 |
+
$JssorDebug$.$Fail("Cannot scale jssor slider, 'dimension' of 'outer container' not valid. 'dimension' of 'outer container' should be positive number. e.g. 'dimension: 600px;'");
|
2554 |
+
}
|
2555 |
+
|
2556 |
+
if (!originalHeight) {
|
2557 |
+
$JssorDebug$.$Fail("Cannot scale jssor slider, 'height' of 'outer container' not valid. 'height' of 'outer container' should be positive number. e.g. 'height: 300px;'");
|
2558 |
+
}
|
2559 |
+
});
|
2560 |
+
|
2561 |
+
var innerWrapper = $Jssor$.$CreateDiv(document);
|
2562 |
+
$Jssor$.$CssCssText(innerWrapper, $Jssor$.$CssCssText(elmt));
|
2563 |
+
$Jssor$.$ClassName(innerWrapper, $Jssor$.$ClassName(elmt));
|
2564 |
+
|
2565 |
+
$Jssor$.$CssPosition(innerWrapper, "relative");
|
2566 |
+
$Jssor$.$CssTop(innerWrapper, 0);
|
2567 |
+
$Jssor$.$CssLeft(innerWrapper, 0);
|
2568 |
+
$Jssor$.$CssOverflow(innerWrapper, "visible");
|
2569 |
+
|
2570 |
+
_ScaleWrapper = $Jssor$.$CreateDiv(document);
|
2571 |
+
|
2572 |
+
$Jssor$.$CssPosition(_ScaleWrapper, "absolute");
|
2573 |
+
$Jssor$.$CssTop(_ScaleWrapper, 0);
|
2574 |
+
$Jssor$.$CssLeft(_ScaleWrapper, 0);
|
2575 |
+
$Jssor$.$CssWidth(_ScaleWrapper, $Jssor$.$CssWidth(elmt));
|
2576 |
+
$Jssor$.$CssHeight(_ScaleWrapper, $Jssor$.$CssHeight(elmt));
|
2577 |
+
$Jssor$.$SetStyleTransformOrigin(_ScaleWrapper, "0 0");
|
2578 |
+
|
2579 |
+
$Jssor$.$AppendChild(_ScaleWrapper, innerWrapper);
|
2580 |
+
|
2581 |
+
var children = $Jssor$.$Children(elmt);
|
2582 |
+
$Jssor$.$AppendChild(elmt, _ScaleWrapper);
|
2583 |
+
|
2584 |
+
$Jssor$.$Css(elmt, "backgroundImage", "");
|
2585 |
+
|
2586 |
+
var noMoveElmts = {
|
2587 |
+
"navigator": _BulletNavigatorOptions && _BulletNavigatorOptions.$Scale == false,
|
2588 |
+
"arrowleft": _ArrowNavigatorOptions && _ArrowNavigatorOptions.$Scale == false,
|
2589 |
+
"arrowright": _ArrowNavigatorOptions && _ArrowNavigatorOptions.$Scale == false,
|
2590 |
+
"thumbnavigator": _ThumbnailNavigatorOptions && _ThumbnailNavigatorOptions.$Scale == false,
|
2591 |
+
"thumbwrapper": _ThumbnailNavigatorOptions && _ThumbnailNavigatorOptions.$Scale == false
|
2592 |
+
};
|
2593 |
+
|
2594 |
+
$Jssor$.$Each(children, function (child) {
|
2595 |
+
$Jssor$.$AppendChild(noMoveElmts[$Jssor$.$AttributeEx(child, "u")] ? elmt : innerWrapper, child);
|
2596 |
+
});
|
2597 |
+
|
2598 |
+
$Jssor$.$ShowElement(innerWrapper);
|
2599 |
+
$Jssor$.$ShowElement(_ScaleWrapper);
|
2600 |
+
}
|
2601 |
+
|
2602 |
+
$JssorDebug$.$Execute(function () {
|
2603 |
+
if (!_InitialScrollWidth) {
|
2604 |
+
_InitialScrollWidth = _SelfSlider.$Elmt.scrollWidth;
|
2605 |
+
}
|
2606 |
+
});
|
2607 |
+
|
2608 |
+
_ScaleRatio = dimension / (isHeight? $Jssor$.$CssHeight : $Jssor$.$CssWidth)(_ScaleWrapper);
|
2609 |
+
$Jssor$.$CssScale(_ScaleWrapper, _ScaleRatio);
|
2610 |
+
|
2611 |
+
var scaleWidth = isHeight ? (_ScaleRatio * OriginalWidth()) : dimension;
|
2612 |
+
var scaleHeight = isHeight ? dimension : (_ScaleRatio * OriginalHeight());
|
2613 |
+
|
2614 |
+
$Jssor$.$CssWidth(elmt, scaleWidth);
|
2615 |
+
$Jssor$.$CssHeight(elmt, scaleHeight);
|
2616 |
+
|
2617 |
+
$Jssor$.$Each(_Navigators, function (navigator) {
|
2618 |
+
navigator.$Relocate(scaleWidth, scaleHeight);
|
2619 |
+
});
|
2620 |
+
}
|
2621 |
+
|
2622 |
+
_SelfSlider.$ScaleHeight = _SelfSlider.$GetScaleHeight = function (height) {
|
2623 |
+
/// <summary>
|
2624 |
+
/// instance.$ScaleHeight(); //Retrieve scaled height the slider currently displays.
|
2625 |
+
/// instance.$ScaleHeight( dimension ); //Scale the slider to new height and keep aspect ratio.
|
2626 |
+
/// </summary>
|
2627 |
+
|
2628 |
+
if (height == undefined)
|
2629 |
+
return $Jssor$.$CssHeight(elmt);
|
2630 |
+
|
2631 |
+
Scale(height, true);
|
2632 |
+
};
|
2633 |
+
|
2634 |
+
_SelfSlider.$ScaleWidth = _SelfSlider.$SetScaleWidth = _SelfSlider.$GetScaleWidth = Scale;
|
2635 |
+
|
2636 |
+
_SelfSlider.$GetVirtualIndex = function (index) {
|
2637 |
+
var parkingIndex = Math.ceil(GetRealIndex(_ParkingPosition / _StepLength));
|
2638 |
+
var displayIndex = GetRealIndex(index - _CurrentSlideIndex + parkingIndex);
|
2639 |
+
|
2640 |
+
if (displayIndex > _DisplayPieces) {
|
2641 |
+
if (index - _CurrentSlideIndex > _SlideCount / 2)
|
2642 |
+
index -= _SlideCount;
|
2643 |
+
else if (index - _CurrentSlideIndex <= -_SlideCount / 2)
|
2644 |
+
index += _SlideCount;
|
2645 |
+
}
|
2646 |
+
else {
|
2647 |
+
index = _CurrentSlideIndex + displayIndex - parkingIndex;
|
2648 |
+
}
|
2649 |
+
|
2650 |
+
return index;
|
2651 |
+
};
|
2652 |
+
|
2653 |
+
//member functions
|
2654 |
+
|
2655 |
+
$JssorObject$.call(_SelfSlider);
|
2656 |
+
|
2657 |
+
$JssorDebug$.$Execute(function () {
|
2658 |
+
var outerContainerElmt = $Jssor$.$GetElement(elmt);
|
2659 |
+
if (!outerContainerElmt)
|
2660 |
+
$JssorDebug$.$Fail("Outer container '" + elmt + "' not found.");
|
2661 |
+
});
|
2662 |
+
|
2663 |
+
//initialize member variables
|
2664 |
+
_SelfSlider.$Elmt = elmt = $Jssor$.$GetElement(elmt);
|
2665 |
+
//initialize member variables
|
2666 |
+
|
2667 |
+
var _InitialScrollWidth; //for debug only
|
2668 |
+
var _CaptionSliderCount = 1; //for debug only
|
2669 |
+
|
2670 |
+
var _Options = $Jssor$.$Extend({
|
2671 |
+
$FillMode: 0, //[Optional] The way to fill image in slide, 0 stretch, 1 contain (keep aspect ratio and put all inside slide), 2 cover (keep aspect ratio and cover whole slide), 4 actual size, 5 contain for large image, actual size for small image, default value is 0
|
2672 |
+
$LazyLoading: 1, //[Optional] For image with lazy loading format (<IMG src2="url" .../>), by default it will be loaded only when the slide comes.
|
2673 |
+
//But an integer value (maybe 0, 1, 2 or 3) indicates that how far of nearby slides should be loaded immediately as well, default value is 1.
|
2674 |
+
$StartIndex: 0, //[Optional] Index of slide to display when initialize, default value is 0
|
2675 |
+
$AutoPlay: false, //[Optional] Whether to auto play, default value is false
|
2676 |
+
$Loop: 1, //[Optional] Enable loop(circular) of carousel or not, 0: stop, 1: loop, 2 rewind, default value is 1
|
2677 |
+
$HWA: true, //[Optional] Enable hardware acceleration or not, default value is true
|
2678 |
+
$NaviQuitDrag: true,
|
2679 |
+
$AutoPlaySteps: 1, //[Optional] Steps to go of every play (this options applys only when slideshow disabled), default value is 1
|
2680 |
+
$AutoPlayInterval: 3000, //[Optional] Interval to play next slide since the previous stopped if a slideshow is auto playing, default value is 3000
|
2681 |
+
$PauseOnHover: 1, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, 4 freeze for desktop, 8 freeze for touch device, 12 freeze for desktop and touch device, default value is 1
|
2682 |
+
|
2683 |
+
$SlideDuration: 500, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 400
|
2684 |
+
$SlideEasing: $JssorEasing$.$EaseOutQuad, //[Optional] Specifies easing for right to left animation, default value is $JssorEasing$.$EaseOutQuad
|
2685 |
+
$MinDragOffsetToSlide: 20, //[Optional] Minimum drag offset that trigger slide, default value is 20
|
2686 |
+
$SlideSpacing: 0, //[Optional] Space between each slide in pixels, default value is 0
|
2687 |
+
$DisplayPieces: 1, //[Optional] Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), default value is 1
|
2688 |
+
$ParkingPosition: 0, //[Optional] The offset position to park slide (this options applys only when slideshow disabled), default value is 0.
|
2689 |
+
$UISearchMode: 1, //[Optional] The way (0 parellel, 1 recursive, default value is recursive) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc.
|
2690 |
+
$PlayOrientation: 1, //[Optional] Orientation to play slide (for auto play, navigation), 1 horizental, 2 vertical, 5 horizental reverse, 6 vertical reverse, default value is 1
|
2691 |
+
$DragOrientation: 1 //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 both, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)
|
2692 |
+
|
2693 |
+
}, options);
|
2694 |
+
|
2695 |
+
//Sodo statement for development time intellisence only
|
2696 |
+
$JssorDebug$.$Execute(function () {
|
2697 |
+
_Options = $Jssor$.$Extend({
|
2698 |
+
$ArrowKeyNavigation: undefined,
|
2699 |
+
$SlideWidth: undefined,
|
2700 |
+
$SlideHeight: undefined,
|
2701 |
+
$SlideshowOptions: undefined,
|
2702 |
+
$CaptionSliderOptions: undefined,
|
2703 |
+
$BulletNavigatorOptions: undefined,
|
2704 |
+
$ArrowNavigatorOptions: undefined,
|
2705 |
+
$ThumbnailNavigatorOptions: undefined
|
2706 |
+
},
|
2707 |
+
_Options);
|
2708 |
+
});
|
2709 |
+
|
2710 |
+
var _PlayOrientation = _Options.$PlayOrientation & 3;
|
2711 |
+
var _PlayReverse = (_Options.$PlayOrientation & 4) / -4 || 1;
|
2712 |
+
|
2713 |
+
var _SlideshowOptions = _Options.$SlideshowOptions;
|
2714 |
+
var _CaptionSliderOptions = $Jssor$.$Extend({ $Class: $JssorCaptionSliderBase$, $PlayInMode: 1, $PlayOutMode: 1 }, _Options.$CaptionSliderOptions);
|
2715 |
+
$Jssor$.$TranslateTransitions(_CaptionSliderOptions.$CaptionTransitions); //for old transition compatibility
|
2716 |
+
var _BulletNavigatorOptions = _Options.$BulletNavigatorOptions;
|
2717 |
+
var _ArrowNavigatorOptions = _Options.$ArrowNavigatorOptions;
|
2718 |
+
var _ThumbnailNavigatorOptions = _Options.$ThumbnailNavigatorOptions;
|
2719 |
+
|
2720 |
+
$JssorDebug$.$Execute(function () {
|
2721 |
+
if (_SlideshowOptions && !_SlideshowOptions.$Class) {
|
2722 |
+
$JssorDebug$.$Fail("Option $SlideshowOptions error, class not specified.");
|
2723 |
+
}
|
2724 |
+
});
|
2725 |
+
|
2726 |
+
$JssorDebug$.$Execute(function () {
|
2727 |
+
if (_Options.$CaptionSliderOptions && !_Options.$CaptionSliderOptions.$Class) {
|
2728 |
+
$JssorDebug$.$Fail("Option $CaptionSliderOptions error, class not specified.");
|
2729 |
+
}
|
2730 |
+
});
|
2731 |
+
|
2732 |
+
$JssorDebug$.$Execute(function () {
|
2733 |
+
if (_BulletNavigatorOptions && !_BulletNavigatorOptions.$Class) {
|
2734 |
+
$JssorDebug$.$Fail("Option $BulletNavigatorOptions error, class not specified.");
|
2735 |
+
}
|
2736 |
+
});
|
2737 |
+
|
2738 |
+
$JssorDebug$.$Execute(function () {
|
2739 |
+
if (_ArrowNavigatorOptions && !_ArrowNavigatorOptions.$Class) {
|
2740 |
+
$JssorDebug$.$Fail("Option $ArrowNavigatorOptions error, class not specified.");
|
2741 |
+
}
|
2742 |
+
});
|
2743 |
+
|
2744 |
+
$JssorDebug$.$Execute(function () {
|
2745 |
+
if (_ThumbnailNavigatorOptions && !_ThumbnailNavigatorOptions.$Class) {
|
2746 |
+
$JssorDebug$.$Fail("Option $ThumbnailNavigatorOptions error, class not specified.");
|
2747 |
+
}
|
2748 |
+
});
|
2749 |
+
|
2750 |
+
var _UISearchNoDeep = !_Options.$UISearchMode;
|
2751 |
+
var _ScaleWrapper;
|
2752 |
+
var _SlidesContainer = $Jssor$.$FindChild(elmt, "slides", _UISearchNoDeep);
|
2753 |
+
var _LoadingContainer = $Jssor$.$FindChild(elmt, "loading", _UISearchNoDeep) || $Jssor$.$CreateDiv(document);
|
2754 |
+
|
2755 |
+
var _BulletNavigatorContainer = $Jssor$.$FindChild(elmt, "navigator", _UISearchNoDeep);
|
2756 |
+
|
2757 |
+
var _ArrowLeft = $Jssor$.$FindChild(elmt, "arrowleft", _UISearchNoDeep);
|
2758 |
+
var _ArrowRight = $Jssor$.$FindChild(elmt, "arrowright", _UISearchNoDeep);
|
2759 |
+
|
2760 |
+
var _ThumbnailNavigatorContainer = $Jssor$.$FindChild(elmt, "thumbnavigator", _UISearchNoDeep);
|
2761 |
+
|
2762 |
+
$JssorDebug$.$Execute(function () {
|
2763 |
+
//if (_BulletNavigatorOptions && !_BulletNavigatorContainer) {
|
2764 |
+
// throw new Error("$BulletNavigatorOptions specified but bullet navigator container (<div u=\"navigator\" ...) not defined.");
|
2765 |
+
//}
|
2766 |
+
if (_BulletNavigatorContainer && !_BulletNavigatorOptions) {
|
2767 |
+
throw new Error("Bullet navigator container defined but $BulletNavigatorOptions not specified.");
|
2768 |
+
}
|
2769 |
+
|
2770 |
+
//if (_ArrowNavigatorOptions) {
|
2771 |
+
// if (!_ArrowLeft) {
|
2772 |
+
// throw new Error("$ArrowNavigatorOptions specified, but arrowleft (<span u=\"arrowleft\" ...) not defined.");
|
2773 |
+
// }
|
2774 |
+
|
2775 |
+
// if (!_ArrowRight) {
|
2776 |
+
// throw new Error("$ArrowNavigatorOptions specified, but arrowright (<span u=\"arrowright\" ...) not defined.");
|
2777 |
+
// }
|
2778 |
+
//}
|
2779 |
+
|
2780 |
+
if ((_ArrowLeft || _ArrowRight) && !_ArrowNavigatorOptions) {
|
2781 |
+
throw new Error("arrowleft or arrowright defined, but $ArrowNavigatorOptions not specified.");
|
2782 |
+
}
|
2783 |
+
|
2784 |
+
//if (_ThumbnailNavigatorOptions && !_ThumbnailNavigatorContainer) {
|
2785 |
+
// throw new Error("$ThumbnailNavigatorOptions specified, but thumbnail navigator container (<div u=\"thumbnavigator\" ...) not defined.");
|
2786 |
+
//}
|
2787 |
+
|
2788 |
+
if (_ThumbnailNavigatorContainer && !_ThumbnailNavigatorOptions) {
|
2789 |
+
throw new Error("Thumbnail navigator container defined, but $ThumbnailNavigatorOptions not specified.");
|
2790 |
+
}
|
2791 |
+
});
|
2792 |
+
|
2793 |
+
var _SlidesContainerWidth = $Jssor$.$CssWidth(_SlidesContainer);
|
2794 |
+
var _SlidesContainerHeight = $Jssor$.$CssHeight(_SlidesContainer);
|
2795 |
+
|
2796 |
+
$JssorDebug$.$Execute(function () {
|
2797 |
+
if (isNaN(_SlidesContainerWidth))
|
2798 |
+
$JssorDebug$.$Fail("Width of slides container wrong specification, it should be specified in pixel (like style='width: 600px;').");
|
2799 |
+
|
2800 |
+
if (_SlidesContainerWidth == undefined)
|
2801 |
+
$JssorDebug$.$Fail("Width of slides container not specified, it should be specified in pixel (like style='width: 600px;').");
|
2802 |
+
|
2803 |
+
if (isNaN(_SlidesContainerHeight))
|
2804 |
+
$JssorDebug$.$Fail("Height of slides container wrong specification, it should be specified in pixel (like style='height: 300px;').");
|
2805 |
+
|
2806 |
+
if (_SlidesContainerHeight == undefined)
|
2807 |
+
$JssorDebug$.$Fail("Height of slides container not specified, it should be specified in pixel (like style='height: 300px;').");
|
2808 |
+
|
2809 |
+
var slidesContainerOverflow = $Jssor$.$CssOverflow(_SlidesContainer);
|
2810 |
+
var slidesContainerOverflowX = $Jssor$.$Css(_SlidesContainer, "overflowX");
|
2811 |
+
var slidesContainerOverflowY = $Jssor$.$Css(_SlidesContainer, "overflowY");
|
2812 |
+
if (slidesContainerOverflow != "hidden" && (slidesContainerOverflowX != "hidden" || slidesContainerOverflowY != "hidden"))
|
2813 |
+
$JssorDebug$.$Fail("Overflow of slides container wrong specification, it should be specified as 'hidden' (style='overflow:hidden;').");
|
2814 |
+
|
2815 |
+
//var slidesContainerTop = $Jssor$.$CssTop(_SlidesContainer);
|
2816 |
+
//var slidesContainerLeft = $Jssor$.$CssLeft(_SlidesContainer);
|
2817 |
+
|
2818 |
+
//if (isNaN(slidesContainerTop))
|
2819 |
+
// $JssorDebug$.$Fail("Top of slides container wrong specification, it should be specified in pixel (like style='top: 0px;').");
|
2820 |
+
|
2821 |
+
//if (slidesContainerTop == undefined)
|
2822 |
+
// $JssorDebug$.$Fail("Top of slides container not specified, it should be specified in pixel (like style='top: 0px;').");
|
2823 |
+
|
2824 |
+
//if (isNaN(slidesContainerLeft))
|
2825 |
+
// $JssorDebug$.$Fail("Left of slides container wrong specification, it should be specified in pixel (like style='left: 0px;').");
|
2826 |
+
|
2827 |
+
//if (slidesContainerLeft == undefined)
|
2828 |
+
// $JssorDebug$.$Fail("Left of slides container not specified, it should be specified in pixel (like style='left: 0px;').");
|
2829 |
+
});
|
2830 |
+
|
2831 |
+
$JssorDebug$.$Execute(function () {
|
2832 |
+
if (!$Jssor$.$IsNumeric(_Options.$DisplayPieces))
|
2833 |
+
$JssorDebug$.$Fail("Option $DisplayPieces error, it should be a numeric value and greater than or equal to 1.");
|
2834 |
+
|
2835 |
+
if (_Options.$DisplayPieces < 1)
|
2836 |
+
$JssorDebug$.$Fail("Option $DisplayPieces error, it should be greater than or equal to 1.");
|
2837 |
+
|
2838 |
+
if (_Options.$DisplayPieces > 1 && _Options.$DragOrientation && _Options.$DragOrientation != _PlayOrientation)
|
2839 |
+
$JssorDebug$.$Fail("Option $DragOrientation error, it should be 0 or the same of $PlayOrientation when $DisplayPieces is greater than 1.");
|
2840 |
+
|
2841 |
+
if (!$Jssor$.$IsNumeric(_Options.$ParkingPosition))
|
2842 |
+
$JssorDebug$.$Fail("Option $ParkingPosition error, it should be a numeric value.");
|
2843 |
+
|
2844 |
+
if (_Options.$ParkingPosition && _Options.$DragOrientation && _Options.$DragOrientation != _PlayOrientation)
|
2845 |
+
$JssorDebug$.$Fail("Option $DragOrientation error, it should be 0 or the same of $PlayOrientation when $ParkingPosition is not equal to 0.");
|
2846 |
+
});
|
2847 |
+
|
2848 |
+
var _StyleDef;
|
2849 |
+
|
2850 |
+
var _SlideElmts = [];
|
2851 |
+
|
2852 |
+
{
|
2853 |
+
var slideElmts = $Jssor$.$Children(_SlidesContainer);
|
2854 |
+
$Jssor$.$Each(slideElmts, function (slideElmt) {
|
2855 |
+
if (slideElmt.tagName == "DIV" && !$Jssor$.$AttributeEx(slideElmt, "u")) {
|
2856 |
+
_SlideElmts.push(slideElmt);
|
2857 |
+
}
|
2858 |
+
});
|
2859 |
+
}
|
2860 |
+
|
2861 |
+
$JssorDebug$.$Execute(function () {
|
2862 |
+
if (_SlideElmts.length < 1) {
|
2863 |
+
$JssorDebug$.$Error("Slides html code definition error, there must be at least 1 slide to initialize a slider.");
|
2864 |
+
}
|
2865 |
+
});
|
2866 |
+
|
2867 |
+
var _SlideItemCreatedCount = 0; //for debug only
|
2868 |
+
var _SlideItemReleasedCount = 0; //for debug only
|
2869 |
+
|
2870 |
+
var _PreviousSlideIndex;
|
2871 |
+
var _CurrentSlideIndex = -1;
|
2872 |
+
var _TempSlideIndex;
|
2873 |
+
var _PrevSlideItem;
|
2874 |
+
var _CurrentSlideItem;
|
2875 |
+
var _SlideCount = _SlideElmts.length;
|
2876 |
+
|
2877 |
+
var _SlideWidth = _Options.$SlideWidth || _SlidesContainerWidth;
|
2878 |
+
var _SlideHeight = _Options.$SlideHeight || _SlidesContainerHeight;
|
2879 |
+
|
2880 |
+
var _SlideSpacing = _Options.$SlideSpacing;
|
2881 |
+
var _StepLengthX = _SlideWidth + _SlideSpacing;
|
2882 |
+
var _StepLengthY = _SlideHeight + _SlideSpacing;
|
2883 |
+
var _StepLength = (_PlayOrientation & 1) ? _StepLengthX : _StepLengthY;
|
2884 |
+
var _DisplayPieces = Math.min(_Options.$DisplayPieces, _SlideCount);
|
2885 |
+
|
2886 |
+
var _SlideshowPanel;
|
2887 |
+
var _CurrentBoardIndex = 0;
|
2888 |
+
var _DragOrientation;
|
2889 |
+
var _DragOrientationRegistered;
|
2890 |
+
var _DragInvalid;
|
2891 |
+
|
2892 |
+
var _HandleTouchEventOnly;
|
2893 |
+
var _IsTouchDevice;
|
2894 |
+
|
2895 |
+
var _Navigators = [];
|
2896 |
+
var _BulletNavigator;
|
2897 |
+
var _ArrowNavigator;
|
2898 |
+
var _ThumbnailNavigator;
|
2899 |
+
|
2900 |
+
var _ShowLink;
|
2901 |
+
|
2902 |
+
var _Frozen;
|
2903 |
+
var _AutoPlay;
|
2904 |
+
var _AutoPlaySteps = _Options.$AutoPlaySteps;
|
2905 |
+
var _HoverToPause = _Options.$PauseOnHover;
|
2906 |
+
var _AutoPlayInterval = _Options.$AutoPlayInterval;
|
2907 |
+
var _SlideDuration = _Options.$SlideDuration;
|
2908 |
+
|
2909 |
+
var _SlideshowRunnerClass;
|
2910 |
+
var _TransitionsOrder;
|
2911 |
+
|
2912 |
+
var _SlideshowEnabled;
|
2913 |
+
var _ParkingPosition;
|
2914 |
+
var _CarouselEnabled = _DisplayPieces < _SlideCount;
|
2915 |
+
var _Loop = _CarouselEnabled ? _Options.$Loop : 0;
|
2916 |
+
|
2917 |
+
var _DragEnabled;
|
2918 |
+
var _LastDragSucceded;
|
2919 |
+
|
2920 |
+
var _NotOnHover = 1; //0 Hovering, 1 Not hovering
|
2921 |
+
|
2922 |
+
//Variable Definition
|
2923 |
+
var _IsSliding;
|
2924 |
+
var _IsDragging;
|
2925 |
+
var _LoadingTicket;
|
2926 |
+
|
2927 |
+
//The X position of mouse/touch when a drag start
|
2928 |
+
var _DragStartMouseX = 0;
|
2929 |
+
//The Y position of mouse/touch when a drag start
|
2930 |
+
var _DragStartMouseY = 0;
|
2931 |
+
var _DragOffsetTotal;
|
2932 |
+
var _DragOffsetLastTime;
|
2933 |
+
var _DragIndexAdjust;
|
2934 |
+
|
2935 |
+
var _Carousel;
|
2936 |
+
var _Conveyor;
|
2937 |
+
var _Slideshow;
|
2938 |
+
var _CarouselPlayer;
|
2939 |
+
var _SlideContainer = new SlideContainer();
|
2940 |
+
var _ScaleRatio;
|
2941 |
+
|
2942 |
+
//$JssorSlider$ Constructor
|
2943 |
+
{
|
2944 |
+
_AutoPlay = _Options.$AutoPlay;
|
2945 |
+
_SelfSlider.$Options = options;
|
2946 |
+
|
2947 |
+
AdjustSlidesContainerSize();
|
2948 |
+
|
2949 |
+
elmt["jssor-slider"] = true;
|
2950 |
+
|
2951 |
+
//_SlideshowPanel = CreatePanel();
|
2952 |
+
//$Jssor$.$CssZIndex(elmt, $Jssor$.$CssZIndex(elmt));
|
2953 |
+
//$Jssor$.$CssLeft(_SlideshowPanel, $Jssor$.$CssLeft(_SlidesContainer));
|
2954 |
+
//$Jssor$.$CssZIndex(_SlidesContainer, $Jssor$.$CssZIndex(_SlidesContainer));
|
2955 |
+
//$Jssor$.$CssTop(_SlideshowPanel, $Jssor$.$CssTop(_SlidesContainer));
|
2956 |
+
$Jssor$.$CssZIndex(_SlidesContainer, $Jssor$.$CssZIndex(_SlidesContainer) || 0);
|
2957 |
+
$Jssor$.$CssPosition(_SlidesContainer, "absolute");
|
2958 |
+
_SlideshowPanel = $Jssor$.$CloneNode(_SlidesContainer);
|
2959 |
+
$Jssor$.$InsertBefore($Jssor$.$ParentNode(_SlidesContainer), _SlideshowPanel, _SlidesContainer);
|
2960 |
+
|
2961 |
+
if (_SlideshowOptions) {
|
2962 |
+
_ShowLink = _SlideshowOptions.$ShowLink;
|
2963 |
+
_SlideshowRunnerClass = _SlideshowOptions.$Class;
|
2964 |
+
|
2965 |
+
$JssorDebug$.$Execute(function () {
|
2966 |
+
if (!_SlideshowOptions.$Transitions || !_SlideshowOptions.$Transitions.length) {
|
2967 |
+
$JssorDebug$.$Error("Invalid '$SlideshowOptions', no '$Transitions' specified.");
|
2968 |
+
}
|
2969 |
+
});
|
2970 |
+
|
2971 |
+
$Jssor$.$TranslateTransitions(_SlideshowOptions.$Transitions); //for old transition compatibility
|
2972 |
+
|
2973 |
+
_SlideshowEnabled = _DisplayPieces == 1 && _SlideCount > 1 && _SlideshowRunnerClass && (!$Jssor$.$IsBrowserIE() || $Jssor$.$BrowserVersion() >= 8);
|
2974 |
+
}
|
2975 |
+
|
2976 |
+
_ParkingPosition = (_SlideshowEnabled || _DisplayPieces >= _SlideCount || !(_Loop & 1)) ? 0 : _Options.$ParkingPosition;
|
2977 |
+
|
2978 |
+
_DragEnabled = ((_DisplayPieces > 1 || _ParkingPosition) ? _PlayOrientation : -1) & _Options.$DragOrientation;
|
2979 |
+
|
2980 |
+
//SlideBoard
|
2981 |
+
var _SlideboardElmt = _SlidesContainer;
|
2982 |
+
var _SlideItems = [];
|
2983 |
+
|
2984 |
+
var _SlideshowRunner;
|
2985 |
+
var _LinkContainer;
|
2986 |
+
|
2987 |
+
var _DownEvent = "mousedown";
|
2988 |
+
var _MoveEvent = "mousemove";
|
2989 |
+
var _UpEvent = "mouseup";
|
2990 |
+
var _CancelEvent;
|
2991 |
+
|
2992 |
+
var _LastTimeMoveByDrag;
|
2993 |
+
var _Position_OnFreeze;
|
2994 |
+
var _CarouselPlaying_OnFreeze;
|
2995 |
+
var _PlayToPosition_OnFreeze;
|
2996 |
+
var _PositionToGoByDrag;
|
2997 |
+
|
2998 |
+
//SlideBoard Constructor
|
2999 |
+
{
|
3000 |
+
var msPrefix;
|
3001 |
+
if (window.navigator.pointerEnabled || (msPrefix = window.navigator.msPointerEnabled)) {
|
3002 |
+
_IsTouchDevice = true;
|
3003 |
+
|
3004 |
+
_DownEvent = msPrefix ? "MSPointerDown" : "pointerdown";
|
3005 |
+
_MoveEvent = msPrefix ? "MSPointerMove" : "pointermove";
|
3006 |
+
_UpEvent = msPrefix ? "MSPointerUp" : "pointerup";
|
3007 |
+
_CancelEvent = msPrefix ? "MSPointerCancel" : "pointercancel";
|
3008 |
+
|
3009 |
+
if (_DragEnabled) {
|
3010 |
+
var touchAction = "auto";
|
3011 |
+
if (_DragEnabled == 2) {
|
3012 |
+
touchAction = "pan-x";
|
3013 |
+
}
|
3014 |
+
else if (_DragEnabled) {
|
3015 |
+
touchAction = "pan-y";
|
3016 |
+
}
|
3017 |
+
|
3018 |
+
$Jssor$.$Css(_SlideboardElmt, msPrefix ? "msTouchAction" : "touchAction", touchAction);
|
3019 |
+
}
|
3020 |
+
}
|
3021 |
+
else if ("ontouchstart" in window || "createTouch" in document) {
|
3022 |
+
_HandleTouchEventOnly = true;
|
3023 |
+
_IsTouchDevice = true;
|
3024 |
+
|
3025 |
+
_DownEvent = "touchstart";
|
3026 |
+
_MoveEvent = "touchmove";
|
3027 |
+
_UpEvent = "touchend";
|
3028 |
+
_CancelEvent = "touchcancel";
|
3029 |
+
}
|
3030 |
+
|
3031 |
+
_Slideshow = new Slideshow();
|
3032 |
+
|
3033 |
+
if (_SlideshowEnabled)
|
3034 |
+
_SlideshowRunner = new _SlideshowRunnerClass(_SlideContainer, _SlideWidth, _SlideHeight, _SlideshowOptions, _HandleTouchEventOnly);
|
3035 |
+
|
3036 |
+
$Jssor$.$AppendChild(_SlideshowPanel, _Slideshow.$Wrapper);
|
3037 |
+
$Jssor$.$CssOverflow(_SlidesContainer, "hidden");
|
3038 |
+
|
3039 |
+
//link container
|
3040 |
+
{
|
3041 |
+
_LinkContainer = CreatePanel();
|
3042 |
+
$Jssor$.$Css(_LinkContainer, "backgroundColor", "#000");
|
3043 |
+
$Jssor$.$CssOpacity(_LinkContainer, 0);
|
3044 |
+
$Jssor$.$InsertBefore(_SlideboardElmt, _LinkContainer, _SlideboardElmt.firstChild);
|
3045 |
+
}
|
3046 |
+
|
3047 |
+
for (var i = 0; i < _SlideElmts.length; i++) {
|
3048 |
+
var slideElmt = _SlideElmts[i];
|
3049 |
+
var slideItem = new SlideItem(slideElmt, i);
|
3050 |
+
_SlideItems.push(slideItem);
|
3051 |
+
}
|
3052 |
+
|
3053 |
+
$Jssor$.$HideElement(_LoadingContainer);
|
3054 |
+
|
3055 |
+
$JssorDebug$.$Execute(function () {
|
3056 |
+
$Jssor$.$Attribute(_LoadingContainer, "debug-id", "loading-container");
|
3057 |
+
});
|
3058 |
+
|
3059 |
+
_Carousel = new Carousel()
|
3060 |
+
_CarouselPlayer = new CarouselPlayer(_Carousel, _Slideshow);
|
3061 |
+
|
3062 |
+
$JssorDebug$.$Execute(function () {
|
3063 |
+
$Jssor$.$Attribute(_SlideboardElmt, "debug-id", "slide-board");
|
3064 |
+
});
|
3065 |
+
|
3066 |
+
if (_DragEnabled) {
|
3067 |
+
$Jssor$.$AddEvent(_SlidesContainer, _DownEvent, OnMouseDown);
|
3068 |
+
$Jssor$.$AddEvent(document, _UpEvent, OnDragEnd);
|
3069 |
+
_CancelEvent && $Jssor$.$AddEvent(document, _CancelEvent, OnDragEnd);
|
3070 |
+
}
|
3071 |
+
}
|
3072 |
+
//SlideBoard
|
3073 |
+
|
3074 |
+
_HoverToPause &= (_IsTouchDevice ? 10 : 5);
|
3075 |
+
|
3076 |
+
//Bullet Navigator
|
3077 |
+
if (_BulletNavigatorContainer && _BulletNavigatorOptions) {
|
3078 |
+
_BulletNavigator = new _BulletNavigatorOptions.$Class(_BulletNavigatorContainer, _BulletNavigatorOptions, OriginalWidth(), OriginalHeight());
|
3079 |
+
_Navigators.push(_BulletNavigator);
|
3080 |
+
}
|
3081 |
+
|
3082 |
+
//Arrow Navigator
|
3083 |
+
if (_ArrowNavigatorOptions && _ArrowLeft && _ArrowRight) {
|
3084 |
+
_ArrowNavigator = new _ArrowNavigatorOptions.$Class(_ArrowLeft, _ArrowRight, _ArrowNavigatorOptions, OriginalWidth(), OriginalHeight());
|
3085 |
+
_Navigators.push(_ArrowNavigator);
|
3086 |
+
}
|
3087 |
+
|
3088 |
+
//Thumbnail Navigator
|
3089 |
+
if (_ThumbnailNavigatorContainer && _ThumbnailNavigatorOptions) {
|
3090 |
+
_ThumbnailNavigatorOptions.$StartIndex = _Options.$StartIndex;
|
3091 |
+
_ThumbnailNavigator = new _ThumbnailNavigatorOptions.$Class(_ThumbnailNavigatorContainer, _ThumbnailNavigatorOptions);
|
3092 |
+
_Navigators.push(_ThumbnailNavigator);
|
3093 |
+
}
|
3094 |
+
|
3095 |
+
$Jssor$.$Each(_Navigators, function (navigator) {
|
3096 |
+
navigator.$Reset(_SlideCount, _SlideItems, _LoadingContainer);
|
3097 |
+
navigator.$On($JssorNavigatorEvents$.$NAVIGATIONREQUEST, NavigationClickHandler);
|
3098 |
+
});
|
3099 |
+
|
3100 |
+
Scale(OriginalWidth());
|
3101 |
+
|
3102 |
+
$Jssor$.$AddEvent(elmt, "mouseout", $Jssor$.$MouseOverOutFilter(MainContainerMouseLeaveEventHandler, elmt));
|
3103 |
+
$Jssor$.$AddEvent(elmt, "mouseover", $Jssor$.$MouseOverOutFilter(MainContainerMouseEnterEventHandler, elmt));
|
3104 |
+
|
3105 |
+
ShowNavigators();
|
3106 |
+
|
3107 |
+
//Keyboard Navigation
|
3108 |
+
if (_Options.$ArrowKeyNavigation) {
|
3109 |
+
$Jssor$.$AddEvent(document, "keydown", function (e) {
|
3110 |
+
if (e.keyCode == $JssorKeyCode$.$LEFT) {
|
3111 |
+
//Arrow Left
|
3112 |
+
PlayToOffset(-1);
|
3113 |
+
}
|
3114 |
+
else if (e.keyCode == $JssorKeyCode$.$RIGHT) {
|
3115 |
+
//Arrow Right
|
3116 |
+
PlayToOffset(1);
|
3117 |
+
}
|
3118 |
+
});
|
3119 |
+
}
|
3120 |
+
|
3121 |
+
var startPosition = _Options.$StartIndex;
|
3122 |
+
if (!(_Loop & 1)) {
|
3123 |
+
startPosition = Math.max(0, Math.min(startPosition, _SlideCount - _DisplayPieces));
|
3124 |
+
}
|
3125 |
+
_CarouselPlayer.$PlayCarousel(startPosition, startPosition, 0);
|
3126 |
+
}
|
3127 |
+
}
|
3128 |
+
//Jssor Slider
|
3129 |
+
|
3130 |
+
//JssorSlider.$ASSEMBLY_BOTTOM_LEFT = ASSEMBLY_BOTTOM_LEFT;
|
3131 |
+
//JssorSlider.$ASSEMBLY_BOTTOM_RIGHT = ASSEMBLY_BOTTOM_RIGHT;
|
3132 |
+
//JssorSlider.$ASSEMBLY_TOP_LEFT = ASSEMBLY_TOP_LEFT;
|
3133 |
+
//JssorSlider.$ASSEMBLY_TOP_RIGHT = ASSEMBLY_TOP_RIGHT;
|
3134 |
+
//JssorSlider.$ASSEMBLY_LEFT_TOP = ASSEMBLY_LEFT_TOP;
|
3135 |
+
//JssorSlider.$ASSEMBLY_LEFT_BOTTOM = ASSEMBLY_LEFT_BOTTOM;
|
3136 |
+
//JssorSlider.$ASSEMBLY_RIGHT_TOP = ASSEMBLY_RIGHT_TOP;
|
3137 |
+
//JssorSlider.$ASSEMBLY_RIGHT_BOTTOM = ASSEMBLY_RIGHT_BOTTOM;
|
3138 |
+
|
3139 |
+
JssorSlider.$EVT_CLICK = 21;
|
3140 |
+
JssorSlider.$EVT_DRAG_START = 22;
|
3141 |
+
JssorSlider.$EVT_DRAG_END = 23;
|
3142 |
+
JssorSlider.$EVT_SWIPE_START = 24;
|
3143 |
+
JssorSlider.$EVT_SWIPE_END = 25;
|
3144 |
+
|
3145 |
+
JssorSlider.$EVT_LOAD_START = 26;
|
3146 |
+
JssorSlider.$EVT_LOAD_END = 27;
|
3147 |
+
JssorSlider.$EVT_FREEZE = 28;
|
3148 |
+
|
3149 |
+
JssorSlider.$EVT_POSITION_CHANGE = 202;
|
3150 |
+
JssorSlider.$EVT_PARK = 203;
|
3151 |
+
|
3152 |
+
JssorSlider.$EVT_SLIDESHOW_START = 206;
|
3153 |
+
JssorSlider.$EVT_SLIDESHOW_END = 207;
|
3154 |
+
|
3155 |
+
JssorSlider.$EVT_PROGRESS_CHANGE = 208;
|
3156 |
+
JssorSlider.$EVT_STATE_CHANGE = 209;
|
3157 |
+
JssorSlider.$EVT_ROLLBACK_START = 210;
|
3158 |
+
JssorSlider.$EVT_ROLLBACK_END = 211;
|
3159 |
+
|
3160 |
+
window.$JssorSlider$ = $JssorSlider$ = JssorSlider;
|
3161 |
+
|
3162 |
+
//(function ($) {
|
3163 |
+
// jQuery.fn.jssorSlider = function (options) {
|
3164 |
+
// return this.each(function () {
|
3165 |
+
// return $(this).data('jssorSlider') || $(this).data('jssorSlider', new JssorSlider(this, options));
|
3166 |
+
// });
|
3167 |
+
// };
|
3168 |
+
//})(jQuery);
|
3169 |
+
|
3170 |
+
//window.jQuery && (jQuery.fn.jssorSlider = function (options) {
|
3171 |
+
// return this.each(function () {
|
3172 |
+
// return jQuery(this).data('jssorSlider') || jQuery(this).data('jssorSlider', new JssorSlider(this, options));
|
3173 |
+
// });
|
3174 |
+
//});
|
3175 |
+
};
|
3176 |
+
|
3177 |
+
//$JssorBulletNavigator$
|
3178 |
+
var $JssorNavigatorEvents$ = {
|
3179 |
+
$NAVIGATIONREQUEST: 1,
|
3180 |
+
$INDEXCHANGE: 2,
|
3181 |
+
$RESET: 3
|
3182 |
+
};
|
3183 |
+
|
3184 |
+
var $JssorBulletNavigator$ = window.$JssorBulletNavigator$ = function (elmt, options, containerWidth, containerHeight) {
|
3185 |
+
var self = this;
|
3186 |
+
$JssorObject$.call(self);
|
3187 |
+
|
3188 |
+
elmt = $Jssor$.$GetElement(elmt);
|
3189 |
+
|
3190 |
+
var _Count;
|
3191 |
+
var _Length;
|
3192 |
+
var _Width;
|
3193 |
+
var _Height;
|
3194 |
+
var _CurrentIndex;
|
3195 |
+
var _CurrentInnerIndex = 0;
|
3196 |
+
var _Options;
|
3197 |
+
var _Steps;
|
3198 |
+
var _Lanes;
|
3199 |
+
var _SpacingX;
|
3200 |
+
var _SpacingY;
|
3201 |
+
var _Orientation;
|
3202 |
+
var _ItemPrototype;
|
3203 |
+
var _PrototypeWidth;
|
3204 |
+
var _PrototypeHeight;
|
3205 |
+
|
3206 |
+
var _ButtonElements = [];
|
3207 |
+
var _Buttons = [];
|
3208 |
+
|
3209 |
+
function Highlight(index) {
|
3210 |
+
if (index != -1)
|
3211 |
+
_Buttons[index].$Activate(index == _CurrentInnerIndex);
|
3212 |
+
}
|
3213 |
+
|
3214 |
+
function OnNavigationRequest(index) {
|
3215 |
+
self.$TriggerEvent($JssorNavigatorEvents$.$NAVIGATIONREQUEST, index * _Steps);
|
3216 |
+
}
|
3217 |
+
|
3218 |
+
self.$Elmt = elmt;
|
3219 |
+
self.$GetCurrentIndex = function () {
|
3220 |
+
return _CurrentIndex;
|
3221 |
+
};
|
3222 |
+
|
3223 |
+
self.$SetCurrentIndex = function (index) {
|
3224 |
+
if (index != _CurrentIndex) {
|
3225 |
+
var lastInnerIndex = _CurrentInnerIndex;
|
3226 |
+
var innerIndex = Math.floor(index / _Steps);
|
3227 |
+
_CurrentInnerIndex = innerIndex;
|
3228 |
+
_CurrentIndex = index;
|
3229 |
+
|
3230 |
+
Highlight(lastInnerIndex);
|
3231 |
+
Highlight(innerIndex);
|
3232 |
+
|
3233 |
+
//self.$TriggerEvent($JssorNavigatorEvents$.$INDEXCHANGE, index);
|
3234 |
+
}
|
3235 |
+
};
|
3236 |
+
|
3237 |
+
self.$Show = function (hide) {
|
3238 |
+
$Jssor$.$ShowElement(elmt, hide);
|
3239 |
+
};
|
3240 |
+
|
3241 |
+
var _Located;
|
3242 |
+
self.$Relocate = function (containerWidth, containerHeight) {
|
3243 |
+
if (!_Located || _Options.$Scale == false) {
|
3244 |
+
if (_Options.$AutoCenter & 1) {
|
3245 |
+
$Jssor$.$CssLeft(elmt, (containerWidth - _Width) / 2);
|
3246 |
+
}
|
3247 |
+
if (_Options.$AutoCenter & 2) {
|
3248 |
+
$Jssor$.$CssTop(elmt, (containerHeight - _Height) / 2);
|
3249 |
+
}
|
3250 |
+
|
3251 |
+
_Located = true;
|
3252 |
+
}
|
3253 |
+
};
|
3254 |
+
|
3255 |
+
var _Initialized;
|
3256 |
+
self.$Reset = function (length) {
|
3257 |
+
if (!_Initialized) {
|
3258 |
+
_Length = length;
|
3259 |
+
_Count = Math.ceil(length / _Steps);
|
3260 |
+
_CurrentInnerIndex = 0;
|
3261 |
+
|
3262 |
+
var itemOffsetX = _PrototypeWidth + _SpacingX;
|
3263 |
+
var itemOffsetY = _PrototypeHeight + _SpacingY;
|
3264 |
+
|
3265 |
+
var maxIndex = Math.ceil(_Count / _Lanes) - 1;
|
3266 |
+
|
3267 |
+
_Width = _PrototypeWidth + itemOffsetX * (!_Orientation ? maxIndex : _Lanes - 1);
|
3268 |
+
_Height = _PrototypeHeight + itemOffsetY * (_Orientation ? maxIndex : _Lanes - 1);
|
3269 |
+
|
3270 |
+
$Jssor$.$CssWidth(elmt, _Width);
|
3271 |
+
$Jssor$.$CssHeight(elmt, _Height);
|
3272 |
+
|
3273 |
+
for (var buttonIndex = 0; buttonIndex < _Count; buttonIndex++) {
|
3274 |
+
|
3275 |
+
var numberDiv = $Jssor$.$CreateSpan();
|
3276 |
+
$Jssor$.$InnerText(numberDiv, buttonIndex + 1);
|
3277 |
+
|
3278 |
+
var div = $Jssor$.$BuildElement(_ItemPrototype, "numbertemplate", numberDiv, true);
|
3279 |
+
$Jssor$.$CssPosition(div, "absolute");
|
3280 |
+
|
3281 |
+
var columnIndex = buttonIndex % (maxIndex + 1);
|
3282 |
+
$Jssor$.$CssLeft(div, !_Orientation ? itemOffsetX * columnIndex : buttonIndex % _Lanes * itemOffsetX);
|
3283 |
+
$Jssor$.$CssTop(div, _Orientation ? itemOffsetY * columnIndex : Math.floor(buttonIndex / (maxIndex + 1)) * itemOffsetY);
|
3284 |
+
|
3285 |
+
$Jssor$.$AppendChild(elmt, div);
|
3286 |
+
_ButtonElements[buttonIndex] = div;
|
3287 |
+
|
3288 |
+
if (_Options.$ActionMode & 1)
|
3289 |
+
$Jssor$.$AddEvent(div, "click", $Jssor$.$CreateCallback(null, OnNavigationRequest, buttonIndex));
|
3290 |
+
|
3291 |
+
if (_Options.$ActionMode & 2)
|
3292 |
+
$Jssor$.$AddEvent(div, "mouseover", $Jssor$.$MouseOverOutFilter($Jssor$.$CreateCallback(null, OnNavigationRequest, buttonIndex), div));
|
3293 |
+
|
3294 |
+
_Buttons[buttonIndex] = $Jssor$.$Buttonize(div);
|
3295 |
+
}
|
3296 |
+
|
3297 |
+
//self.$TriggerEvent($JssorNavigatorEvents$.$RESET);
|
3298 |
+
_Initialized = true;
|
3299 |
+
}
|
3300 |
+
};
|
3301 |
+
|
3302 |
+
//JssorBulletNavigator Constructor
|
3303 |
+
{
|
3304 |
+
self.$Options = _Options = $Jssor$.$Extend({
|
3305 |
+
$SpacingX: 0,
|
3306 |
+
$SpacingY: 0,
|
3307 |
+
$Orientation: 1,
|
3308 |
+
$ActionMode: 1
|
3309 |
+
}, options);
|
3310 |
+
|
3311 |
+
//Sodo statement for development time intellisence only
|
3312 |
+
$JssorDebug$.$Execute(function () {
|
3313 |
+
_Options = $Jssor$.$Extend({
|
3314 |
+
$Steps: undefined,
|
3315 |
+
$Lanes: undefined
|
3316 |
+
}, _Options);
|
3317 |
+
});
|
3318 |
+
|
3319 |
+
_ItemPrototype = $Jssor$.$FindChild(elmt, "prototype");
|
3320 |
+
|
3321 |
+
$JssorDebug$.$Execute(function () {
|
3322 |
+
if (!_ItemPrototype)
|
3323 |
+
$JssorDebug$.$Fail("Navigator item prototype not defined.");
|
3324 |
+
|
3325 |
+
if (isNaN($Jssor$.$CssWidth(_ItemPrototype))) {
|
3326 |
+
$JssorDebug$.$Fail("Width of 'navigator item prototype' not specified.");
|
3327 |
+
}
|
3328 |
+
|
3329 |
+
if (isNaN($Jssor$.$CssHeight(_ItemPrototype))) {
|
3330 |
+
$JssorDebug$.$Fail("Height of 'navigator item prototype' not specified.");
|
3331 |
+
}
|
3332 |
+
});
|
3333 |
+
|
3334 |
+
_PrototypeWidth = $Jssor$.$CssWidth(_ItemPrototype);
|
3335 |
+
_PrototypeHeight = $Jssor$.$CssHeight(_ItemPrototype);
|
3336 |
+
|
3337 |
+
$Jssor$.$RemoveChild(elmt, _ItemPrototype);
|
3338 |
+
|
3339 |
+
_Steps = _Options.$Steps || 1;
|
3340 |
+
_Lanes = _Options.$Lanes || 1;
|
3341 |
+
_SpacingX = _Options.$SpacingX;
|
3342 |
+
_SpacingY = _Options.$SpacingY;
|
3343 |
+
_Orientation = _Options.$Orientation - 1;
|
3344 |
+
}
|
3345 |
+
};
|
3346 |
+
|
3347 |
+
var $JssorArrowNavigator$ = window.$JssorArrowNavigator$ = function (arrowLeft, arrowRight, options, containerWidth, containerHeight) {
|
3348 |
+
var self = this;
|
3349 |
+
$JssorObject$.call(self);
|
3350 |
+
|
3351 |
+
$JssorDebug$.$Execute(function () {
|
3352 |
+
|
3353 |
+
if (!arrowLeft)
|
3354 |
+
$JssorDebug$.$Fail("Option '$ArrowNavigatorOptions' spepcified, but UI 'arrowleft' not defined. Define 'arrowleft' to enable direct navigation, or remove option '$ArrowNavigatorOptions' to disable direct navigation.");
|
3355 |
+
|
3356 |
+
if (!arrowRight)
|
3357 |
+
$JssorDebug$.$Fail("Option '$ArrowNavigatorOptions' spepcified, but UI 'arrowright' not defined. Define 'arrowright' to enable direct navigation, or remove option '$ArrowNavigatorOptions' to disable direct navigation.");
|
3358 |
+
|
3359 |
+
if (isNaN($Jssor$.$CssWidth(arrowLeft))) {
|
3360 |
+
$JssorDebug$.$Fail("Width of 'arrow left' not specified.");
|
3361 |
+
}
|
3362 |
+
|
3363 |
+
if (isNaN($Jssor$.$CssWidth(arrowRight))) {
|
3364 |
+
$JssorDebug$.$Fail("Width of 'arrow right' not specified.");
|
3365 |
+
}
|
3366 |
+
|
3367 |
+
if (isNaN($Jssor$.$CssHeight(arrowLeft))) {
|
3368 |
+
$JssorDebug$.$Fail("Height of 'arrow left' not specified.");
|
3369 |
+
}
|
3370 |
+
|
3371 |
+
if (isNaN($Jssor$.$CssHeight(arrowRight))) {
|
3372 |
+
$JssorDebug$.$Fail("Height of 'arrow right' not specified.");
|
3373 |
+
}
|
3374 |
+
});
|
3375 |
+
|
3376 |
+
var _Length;
|
3377 |
+
var _CurrentIndex;
|
3378 |
+
var _Options;
|
3379 |
+
var _Steps;
|
3380 |
+
var _ArrowWidth = $Jssor$.$CssWidth(arrowLeft);
|
3381 |
+
var _ArrowHeight = $Jssor$.$CssHeight(arrowLeft);
|
3382 |
+
|
3383 |
+
function OnNavigationRequest(steps) {
|
3384 |
+
self.$TriggerEvent($JssorNavigatorEvents$.$NAVIGATIONREQUEST, steps, true);
|
3385 |
+
}
|
3386 |
+
|
3387 |
+
self.$GetCurrentIndex = function () {
|
3388 |
+
return _CurrentIndex;
|
3389 |
+
};
|
3390 |
+
|
3391 |
+
self.$SetCurrentIndex = function (index, virtualIndex, temp) {
|
3392 |
+
if (temp) {
|
3393 |
+
_CurrentIndex = virtualIndex;
|
3394 |
+
}
|
3395 |
+
else {
|
3396 |
+
_CurrentIndex = index;
|
3397 |
+
}
|
3398 |
+
//self.$TriggerEvent($JssorNavigatorEvents$.$INDEXCHANGE, index);
|
3399 |
+
};
|
3400 |
+
|
3401 |
+
self.$Show = function (hide) {
|
3402 |
+
$Jssor$.$ShowElement(arrowLeft, hide);
|
3403 |
+
$Jssor$.$ShowElement(arrowRight, hide);
|
3404 |
+
};
|
3405 |
+
|
3406 |
+
var _Located;
|
3407 |
+
self.$Relocate = function (conainerWidth, containerHeight) {
|
3408 |
+
if (!_Located || _Options.$Scale == false) {
|
3409 |
+
|
3410 |
+
if (_Options.$AutoCenter & 1) {
|
3411 |
+
$Jssor$.$CssLeft(arrowLeft, (containerWidth - _ArrowWidth) / 2);
|
3412 |
+
$Jssor$.$CssLeft(arrowRight, (containerWidth - _ArrowWidth) / 2);
|
3413 |
+
}
|
3414 |
+
|
3415 |
+
if (_Options.$AutoCenter & 2) {
|
3416 |
+
$Jssor$.$CssTop(arrowLeft, (containerHeight - _ArrowHeight) / 2);
|
3417 |
+
$Jssor$.$CssTop(arrowRight, (containerHeight - _ArrowHeight) / 2);
|
3418 |
+
}
|
3419 |
+
|
3420 |
+
_Located = true;
|
3421 |
+
}
|
3422 |
+
};
|
3423 |
+
|
3424 |
+
var _Initialized;
|
3425 |
+
self.$Reset = function (length) {
|
3426 |
+
_Length = length;
|
3427 |
+
_CurrentIndex = 0;
|
3428 |
+
|
3429 |
+
if (!_Initialized) {
|
3430 |
+
|
3431 |
+
$Jssor$.$AddEvent(arrowLeft, "click", $Jssor$.$CreateCallback(null, OnNavigationRequest, -_Steps));
|
3432 |
+
$Jssor$.$AddEvent(arrowRight, "click", $Jssor$.$CreateCallback(null, OnNavigationRequest, _Steps));
|
3433 |
+
|
3434 |
+
$Jssor$.$Buttonize(arrowLeft);
|
3435 |
+
$Jssor$.$Buttonize(arrowRight);
|
3436 |
+
|
3437 |
+
_Initialized = true;
|
3438 |
+
}
|
3439 |
+
|
3440 |
+
//self.$TriggerEvent($JssorNavigatorEvents$.$RESET);
|
3441 |
+
};
|
3442 |
+
|
3443 |
+
//JssorArrowNavigator Constructor
|
3444 |
+
{
|
3445 |
+
self.$Options = _Options = $Jssor$.$Extend({
|
3446 |
+
$Steps: 1
|
3447 |
+
}, options);
|
3448 |
+
|
3449 |
+
_Steps = _Options.$Steps;
|
3450 |
+
}
|
3451 |
+
};
|
3452 |
+
|
3453 |
+
//$JssorThumbnailNavigator$
|
3454 |
+
var $JssorThumbnailNavigator$ = window.$JssorThumbnailNavigator$ = function (elmt, options) {
|
3455 |
+
var _Self = this;
|
3456 |
+
var _Length;
|
3457 |
+
var _Count;
|
3458 |
+
var _CurrentIndex;
|
3459 |
+
var _Options;
|
3460 |
+
var _NavigationItems = [];
|
3461 |
+
|
3462 |
+
var _Width;
|
3463 |
+
var _Height;
|
3464 |
+
var _Lanes;
|
3465 |
+
var _SpacingX;
|
3466 |
+
var _SpacingY;
|
3467 |
+
var _PrototypeWidth;
|
3468 |
+
var _PrototypeHeight;
|
3469 |
+
var _DisplayPieces;
|
3470 |
+
|
3471 |
+
var _Slider;
|
3472 |
+
var _CurrentMouseOverIndex = -1;
|
3473 |
+
|
3474 |
+
var _SlidesContainer;
|
3475 |
+
var _ThumbnailPrototype;
|
3476 |
+
|
3477 |
+
$JssorObject$.call(_Self);
|
3478 |
+
elmt = $Jssor$.$GetElement(elmt);
|
3479 |
+
|
3480 |
+
function NavigationItem(item, index) {
|
3481 |
+
var self = this;
|
3482 |
+
var _Wrapper;
|
3483 |
+
var _Button;
|
3484 |
+
var _Thumbnail;
|
3485 |
+
|
3486 |
+
function Highlight(mouseStatus) {
|
3487 |
+
_Button.$Activate(_CurrentIndex == index);
|
3488 |
+
}
|
3489 |
+
|
3490 |
+
function OnNavigationRequest(event) {
|
3491 |
+
if (!_Slider.$LastDragSucceded()) {
|
3492 |
+
var tail = _Lanes - index % _Lanes;
|
3493 |
+
var slideVirtualIndex = _Slider.$GetVirtualIndex((index + tail) / _Lanes - 1);
|
3494 |
+
var itemVirtualIndex = slideVirtualIndex * _Lanes + _Lanes - tail;
|
3495 |
+
_Self.$TriggerEvent($JssorNavigatorEvents$.$NAVIGATIONREQUEST, itemVirtualIndex);
|
3496 |
+
}
|
3497 |
+
|
3498 |
+
//$JssorDebug$.$Log("navigation request");
|
3499 |
+
}
|
3500 |
+
|
3501 |
+
$JssorDebug$.$Execute(function () {
|
3502 |
+
self.$Wrapper = undefined;
|
3503 |
+
});
|
3504 |
+
|
3505 |
+
self.$Index = index;
|
3506 |
+
|
3507 |
+
self.$Highlight = Highlight;
|
3508 |
+
|
3509 |
+
//NavigationItem Constructor
|
3510 |
+
{
|
3511 |
+
_Thumbnail = item.$Thumb || item.$Image || $Jssor$.$CreateDiv();
|
3512 |
+
self.$Wrapper = _Wrapper = $Jssor$.$BuildElement(_ThumbnailPrototype, "thumbnailtemplate", _Thumbnail, true);
|
3513 |
+
|
3514 |
+
_Button = $Jssor$.$Buttonize(_Wrapper);
|
3515 |
+
if (_Options.$ActionMode & 1)
|
3516 |
+
$Jssor$.$AddEvent(_Wrapper, "click", OnNavigationRequest);
|
3517 |
+
if (_Options.$ActionMode & 2)
|
3518 |
+
$Jssor$.$AddEvent(_Wrapper, "mouseover", $Jssor$.$MouseOverOutFilter(OnNavigationRequest, _Wrapper));
|
3519 |
+
}
|
3520 |
+
}
|
3521 |
+
|
3522 |
+
_Self.$GetCurrentIndex = function () {
|
3523 |
+
return _CurrentIndex;
|
3524 |
+
};
|
3525 |
+
|
3526 |
+
_Self.$SetCurrentIndex = function (index, virtualIndex, temp) {
|
3527 |
+
var oldIndex = _CurrentIndex;
|
3528 |
+
_CurrentIndex = index;
|
3529 |
+
if (oldIndex != -1)
|
3530 |
+
_NavigationItems[oldIndex].$Highlight();
|
3531 |
+
_NavigationItems[index].$Highlight();
|
3532 |
+
|
3533 |
+
if (!temp) {
|
3534 |
+
_Slider.$PlayTo(_Slider.$GetVirtualIndex(Math.floor(virtualIndex / _Lanes)));
|
3535 |
+
}
|
3536 |
+
};
|
3537 |
+
|
3538 |
+
_Self.$Show = function (hide) {
|
3539 |
+
$Jssor$.$ShowElement(elmt, hide);
|
3540 |
+
};
|
3541 |
+
|
3542 |
+
_Self.$Relocate = $Jssor$.$EmptyFunction;
|
3543 |
+
|
3544 |
+
var _Initialized;
|
3545 |
+
_Self.$Reset = function (length, items, loadingContainer) {
|
3546 |
+
if (!_Initialized) {
|
3547 |
+
_Length = length;
|
3548 |
+
_Count = Math.ceil(_Length / _Lanes);
|
3549 |
+
_CurrentIndex = -1;
|
3550 |
+
_DisplayPieces = Math.min(_DisplayPieces, items.length);
|
3551 |
+
|
3552 |
+
var horizontal = _Options.$Orientation & 1;
|
3553 |
+
|
3554 |
+
var slideWidth = _PrototypeWidth + (_PrototypeWidth + _SpacingX) * (_Lanes - 1) * (1 - horizontal);
|
3555 |
+
var slideHeight = _PrototypeHeight + (_PrototypeHeight + _SpacingY) * (_Lanes - 1) * horizontal;
|
3556 |
+
|
3557 |
+
var slidesContainerWidth = slideWidth + (slideWidth + _SpacingX) * (_DisplayPieces - 1) * horizontal;
|
3558 |
+
var slidesContainerHeight = slideHeight + (slideHeight + _SpacingY) * (_DisplayPieces - 1) * (1 - horizontal);
|
3559 |
+
|
3560 |
+
$Jssor$.$CssPosition(_SlidesContainer, "absolute");
|
3561 |
+
$Jssor$.$CssOverflow(_SlidesContainer, "hidden");
|
3562 |
+
if (_Options.$AutoCenter & 1) {
|
3563 |
+
$Jssor$.$CssLeft(_SlidesContainer, (_Width - slidesContainerWidth) / 2);
|
3564 |
+
}
|
3565 |
+
if (_Options.$AutoCenter & 2) {
|
3566 |
+
$Jssor$.$CssTop(_SlidesContainer, (_Height - slidesContainerHeight) / 2);
|
3567 |
+
}
|
3568 |
+
//$JssorDebug$.$Execute(function () {
|
3569 |
+
// if (!_Options.$AutoCenter) {
|
3570 |
+
// var slidesContainerTop = $Jssor$.$CssTop(_SlidesContainer);
|
3571 |
+
// var slidesContainerLeft = $Jssor$.$CssLeft(_SlidesContainer);
|
3572 |
+
|
3573 |
+
// if (isNaN(slidesContainerTop)) {
|
3574 |
+
// $JssorDebug$.$Fail("Position 'top' wrong specification of thumbnail navigator slides container (<div u=\"thumbnavigator\">...<div u=\"slides\">), \r\nwhen option $ThumbnailNavigatorOptions.$AutoCenter set to 0, it should be specified in pixel (like <div u=\"slides\" style=\"top: 0px;\">)");
|
3575 |
+
// }
|
3576 |
+
|
3577 |
+
// if (isNaN(slidesContainerLeft)) {
|
3578 |
+
// $JssorDebug$.$Fail("Position 'left' wrong specification of thumbnail navigator slides container (<div u=\"thumbnavigator\">...<div u=\"slides\">), \r\nwhen option $ThumbnailNavigatorOptions.$AutoCenter set to 0, it should be specified in pixel (like <div u=\"slides\" style=\"left: 0px;\">)");
|
3579 |
+
// }
|
3580 |
+
// }
|
3581 |
+
//});
|
3582 |
+
$Jssor$.$CssWidth(_SlidesContainer, slidesContainerWidth);
|
3583 |
+
$Jssor$.$CssHeight(_SlidesContainer, slidesContainerHeight);
|
3584 |
+
|
3585 |
+
var slideItemElmts = [];
|
3586 |
+
$Jssor$.$Each(items, function (item, index) {
|
3587 |
+
var navigationItem = new NavigationItem(item, index);
|
3588 |
+
var navigationItemWrapper = navigationItem.$Wrapper;
|
3589 |
+
|
3590 |
+
var columnIndex = Math.floor(index / _Lanes);
|
3591 |
+
var laneIndex = index % _Lanes;
|
3592 |
+
|
3593 |
+
$Jssor$.$CssLeft(navigationItemWrapper, (_PrototypeWidth + _SpacingX) * laneIndex * (1 - horizontal));
|
3594 |
+
$Jssor$.$CssTop(navigationItemWrapper, (_PrototypeHeight + _SpacingY) * laneIndex * horizontal);
|
3595 |
+
|
3596 |
+
if (!slideItemElmts[columnIndex]) {
|
3597 |
+
slideItemElmts[columnIndex] = $Jssor$.$CreateDiv();
|
3598 |
+
$Jssor$.$AppendChild(_SlidesContainer, slideItemElmts[columnIndex]);
|
3599 |
+
}
|
3600 |
+
|
3601 |
+
$Jssor$.$AppendChild(slideItemElmts[columnIndex], navigationItemWrapper);
|
3602 |
+
|
3603 |
+
_NavigationItems.push(navigationItem);
|
3604 |
+
});
|
3605 |
+
|
3606 |
+
var thumbnailSliderOptions = $Jssor$.$Extend({
|
3607 |
+
$HWA: false,
|
3608 |
+
$AutoPlay: false,
|
3609 |
+
$NaviQuitDrag: false,
|
3610 |
+
$SlideWidth: slideWidth,
|
3611 |
+
$SlideHeight: slideHeight,
|
3612 |
+
$SlideSpacing: _SpacingX * horizontal + _SpacingY * (1 - horizontal),
|
3613 |
+
$MinDragOffsetToSlide: 12,
|
3614 |
+
$SlideDuration: 200,
|
3615 |
+
$PauseOnHover: 1,
|
3616 |
+
$PlayOrientation: _Options.$Orientation,
|
3617 |
+
$DragOrientation: _Options.$DisableDrag ? 0 : _Options.$Orientation
|
3618 |
+
}, _Options);
|
3619 |
+
|
3620 |
+
_Slider = new $JssorSlider$(elmt, thumbnailSliderOptions);
|
3621 |
+
|
3622 |
+
_Initialized = true;
|
3623 |
+
}
|
3624 |
+
|
3625 |
+
//_Self.$TriggerEvent($JssorNavigatorEvents$.$RESET);
|
3626 |
+
};
|
3627 |
+
|
3628 |
+
//JssorThumbnailNavigator Constructor
|
3629 |
+
{
|
3630 |
+
_Self.$Options = _Options = $Jssor$.$Extend({
|
3631 |
+
$SpacingX: 3,
|
3632 |
+
$SpacingY: 3,
|
3633 |
+
$DisplayPieces: 1,
|
3634 |
+
$Orientation: 1,
|
3635 |
+
$AutoCenter: 3,
|
3636 |
+
$ActionMode: 1
|
3637 |
+
}, options);
|
3638 |
+
|
3639 |
+
//Sodo statement for development time intellisence only
|
3640 |
+
$JssorDebug$.$Execute(function () {
|
3641 |
+
_Options = $Jssor$.$Extend({
|
3642 |
+
$Lanes: undefined,
|
3643 |
+
$Width: undefined,
|
3644 |
+
$Height: undefined
|
3645 |
+
}, _Options);
|
3646 |
+
});
|
3647 |
+
|
3648 |
+
_Width = $Jssor$.$CssWidth(elmt);
|
3649 |
+
_Height = $Jssor$.$CssHeight(elmt);
|
3650 |
+
|
3651 |
+
$JssorDebug$.$Execute(function () {
|
3652 |
+
if (!_Width)
|
3653 |
+
$JssorDebug$.$Fail("width of 'thumbnavigator' container not specified.");
|
3654 |
+
if (!_Height)
|
3655 |
+
$JssorDebug$.$Fail("height of 'thumbnavigator' container not specified.");
|
3656 |
+
});
|
3657 |
+
|
3658 |
+
_SlidesContainer = $Jssor$.$FindChild(elmt, "slides", true);
|
3659 |
+
_ThumbnailPrototype = $Jssor$.$FindChild(_SlidesContainer, "prototype");
|
3660 |
+
|
3661 |
+
$JssorDebug$.$Execute(function () {
|
3662 |
+
if (!_ThumbnailPrototype)
|
3663 |
+
$JssorDebug$.$Fail("prototype of 'thumbnavigator' not defined.");
|
3664 |
+
});
|
3665 |
+
|
3666 |
+
_PrototypeWidth = $Jssor$.$CssWidth(_ThumbnailPrototype);
|
3667 |
+
_PrototypeHeight = $Jssor$.$CssHeight(_ThumbnailPrototype);
|
3668 |
+
|
3669 |
+
$Jssor$.$RemoveChild(_SlidesContainer, _ThumbnailPrototype);
|
3670 |
+
|
3671 |
+
_Lanes = _Options.$Lanes || 1;
|
3672 |
+
_SpacingX = _Options.$SpacingX;
|
3673 |
+
_SpacingY = _Options.$SpacingY;
|
3674 |
+
_DisplayPieces = _Options.$DisplayPieces;
|
3675 |
+
}
|
3676 |
+
};
|
3677 |
+
|
3678 |
+
//$JssorCaptionSliderBase$
|
3679 |
+
function $JssorCaptionSliderBase$() {
|
3680 |
+
$JssorAnimator$.call(this, 0, 0);
|
3681 |
+
this.$Revert = $Jssor$.$EmptyFunction;
|
3682 |
+
}
|
3683 |
+
|
3684 |
+
var $JssorCaptionSlider$ = window.$JssorCaptionSlider$ = function (container, captionSlideOptions, playIn) {
|
3685 |
+
$JssorDebug$.$Execute(function () {
|
3686 |
+
if (!captionSlideOptions.$CaptionTransitions) {
|
3687 |
+
$JssorDebug$.$Error("'$CaptionSliderOptions' option error, '$CaptionSliderOptions.$CaptionTransitions' not specified.");
|
3688 |
+
}
|
3689 |
+
//else if (!$Jssor$.$IsArray(captionSlideOptions.$CaptionTransitions)) {
|
3690 |
+
// $JssorDebug$.$Error("'$CaptionSliderOptions' option error, '$CaptionSliderOptions.$CaptionTransitions' is not an array.");
|
3691 |
+
//}
|
3692 |
+
});
|
3693 |
+
|
3694 |
+
var _Self = this;
|
3695 |
+
var _ImmediateOutCaptionHanger;
|
3696 |
+
var _PlayMode = playIn ? captionSlideOptions.$PlayInMode : captionSlideOptions.$PlayOutMode;
|
3697 |
+
|
3698 |
+
var _CaptionTransitions = captionSlideOptions.$CaptionTransitions;
|
3699 |
+
var _CaptionTuningFetcher = { $Transition: "t", $Delay: "d", $Duration: "du", x: "x", y: "y", $Rotate: "r", $Zoom: "z", $Opacity: "f", $BeginTime: "b" };
|
3700 |
+
var _CaptionTuningTransfer = {
|
3701 |
+
$Default: function (value, tuningValue) {
|
3702 |
+
if (!isNaN(tuningValue.$Value))
|
3703 |
+
value = tuningValue.$Value;
|
3704 |
+
else
|
3705 |
+
value *= tuningValue.$Percent;
|
3706 |
+
|
3707 |
+
return value;
|
3708 |
+
},
|
3709 |
+
$Opacity: function (value, tuningValue) {
|
3710 |
+
return this.$Default(value - 1, tuningValue);
|
3711 |
+
}
|
3712 |
+
};
|
3713 |
+
_CaptionTuningTransfer.$Zoom = _CaptionTuningTransfer.$Opacity;
|
3714 |
+
|
3715 |
+
$JssorAnimator$.call(_Self, 0, 0);
|
3716 |
+
|
3717 |
+
function GetCaptionItems(element, level) {
|
3718 |
+
|
3719 |
+
var itemsToPlay = [];
|
3720 |
+
var lastTransitionName;
|
3721 |
+
var namedTransitions = [];
|
3722 |
+
var namedTransitionOrders = [];
|
3723 |
+
|
3724 |
+
//$JssorDebug$.$Execute(function () {
|
3725 |
+
|
3726 |
+
// var debugInfoElement = $Jssor$.$GetElement("debugInfo");
|
3727 |
+
|
3728 |
+
// if (debugInfoElement && playIn) {
|
3729 |
+
|
3730 |
+
// var text = $Jssor.$InnerHtml(debugInfoElement) + "<br>";
|
3731 |
+
|
3732 |
+
// $Jssor$.$InnerHtml(debugInfoElement, text);
|
3733 |
+
// }
|
3734 |
+
//});
|
3735 |
+
|
3736 |
+
function FetchRawTransition(captionElmt, index) {
|
3737 |
+
var rawTransition = {};
|
3738 |
+
|
3739 |
+
$Jssor$.$Each(_CaptionTuningFetcher, function (fetchAttribute, fetchProperty) {
|
3740 |
+
var attributeValue = $Jssor$.$AttributeEx(captionElmt, fetchAttribute + (index || ""));
|
3741 |
+
if (attributeValue) {
|
3742 |
+
var propertyValue = {};
|
3743 |
+
|
3744 |
+
if (fetchAttribute == "t") {
|
3745 |
+
//if (($Jssor$.$IsBrowserChrome() || $Jssor$.$IsBrowserSafari() || $Jssor$.$IsBrowserFireFox()) && attributeValue == "*") {
|
3746 |
+
// attributeValue = Math.floor(Math.random() * captionSlideOptions.$CaptionTransitions.length);
|
3747 |
+
// $Jssor$.$Attribute(captionElmt, fetchAttribute + (index || ""), attributeValue);
|
3748 |
+
//}
|
3749 |
+
|
3750 |
+
propertyValue.$Value = attributeValue;
|
3751 |
+
}
|
3752 |
+
else if (attributeValue.indexOf("%") + 1)
|
3753 |
+
propertyValue.$Percent = $Jssor$.$ParseFloat(attributeValue) / 100;
|
3754 |
+
else
|
3755 |
+
propertyValue.$Value = $Jssor$.$ParseFloat(attributeValue);
|
3756 |
+
|
3757 |
+
rawTransition[fetchProperty] = propertyValue;
|
3758 |
+
}
|
3759 |
+
});
|
3760 |
+
|
3761 |
+
return rawTransition;
|
3762 |
+
}
|
3763 |
+
|
3764 |
+
function GetRandomTransition() {
|
3765 |
+
return _CaptionTransitions[Math.floor(Math.random() * _CaptionTransitions.length)];
|
3766 |
+
}
|
3767 |
+
|
3768 |
+
function EvaluateCaptionTransition(transitionName) {
|
3769 |
+
|
3770 |
+
var transition;
|
3771 |
+
|
3772 |
+
if (transitionName == "*") {
|
3773 |
+
transition = GetRandomTransition();
|
3774 |
+
}
|
3775 |
+
else if (transitionName) {
|
3776 |
+
|
3777 |
+
//indexed transition allowed, just the same as named transition
|
3778 |
+
var tempTransition = _CaptionTransitions[$Jssor$.$ParseInt(transitionName)] || _CaptionTransitions[transitionName];
|
3779 |
+
|
3780 |
+
if ($Jssor$.$IsArray(tempTransition)) {
|
3781 |
+
if (transitionName != lastTransitionName) {
|
3782 |
+
lastTransitionName = transitionName;
|
3783 |
+
namedTransitionOrders[transitionName] = 0;
|
3784 |
+
|
3785 |
+
namedTransitions[transitionName] = tempTransition[Math.floor(Math.random() * tempTransition.length)];
|
3786 |
+
}
|
3787 |
+
else {
|
3788 |
+
namedTransitionOrders[transitionName]++;
|
3789 |
+
}
|
3790 |
+
|
3791 |
+
tempTransition = namedTransitions[transitionName];
|
3792 |
+
|
3793 |
+
if ($Jssor$.$IsArray(tempTransition)) {
|
3794 |
+
tempTransition = tempTransition.length && tempTransition[namedTransitionOrders[transitionName] % tempTransition.length];
|
3795 |
+
|
3796 |
+
if ($Jssor$.$IsArray(tempTransition)) {
|
3797 |
+
//got transition from array level 3, random for all captions
|
3798 |
+
tempTransition = tempTransition[Math.floor(Math.random() * tempTransition.length)];
|
3799 |
+
}
|
3800 |
+
//else {
|
3801 |
+
// //got transition from array level 2, in sequence for all adjacent captions with same name specified
|
3802 |
+
// transition = tempTransition;
|
3803 |
+
//}
|
3804 |
+
}
|
3805 |
+
//else {
|
3806 |
+
// //got transition from array level 1, random but same for all adjacent captions with same name specified
|
3807 |
+
// transition = tempTransition;
|
3808 |
+
//}
|
3809 |
+
}
|
3810 |
+
//else {
|
3811 |
+
// //got transition directly from a simple transition object
|
3812 |
+
// transition = tempTransition;
|
3813 |
+
//}
|
3814 |
+
|
3815 |
+
transition = tempTransition;
|
3816 |
+
|
3817 |
+
if ($Jssor$.$IsString(transition))
|
3818 |
+
transition = EvaluateCaptionTransition(transition);
|
3819 |
+
}
|
3820 |
+
|
3821 |
+
return transition;
|
3822 |
+
}
|
3823 |
+
|
3824 |
+
var captionElmts = $Jssor$.$Children(element);
|
3825 |
+
$Jssor$.$Each(captionElmts, function (captionElmt, i) {
|
3826 |
+
|
3827 |
+
var transitionsWithTuning = [];
|
3828 |
+
transitionsWithTuning.$Elmt = captionElmt;
|
3829 |
+
var isCaption = $Jssor$.$AttributeEx(captionElmt, "u") == "caption";
|
3830 |
+
|
3831 |
+
$Jssor$.$Each(playIn ? [0, 3] : [2], function (j, k) {
|
3832 |
+
|
3833 |
+
if (isCaption) {
|
3834 |
+
var transition;
|
3835 |
+
var rawTransition;
|
3836 |
+
|
3837 |
+
if (j != 2 || !$Jssor$.$AttributeEx(captionElmt, "t3")) {
|
3838 |
+
rawTransition = FetchRawTransition(captionElmt, j);
|
3839 |
+
|
3840 |
+
if (j == 2 && !rawTransition.$Transition) {
|
3841 |
+
rawTransition.$Delay = rawTransition.$Delay || { $Value: 0 };
|
3842 |
+
rawTransition = $Jssor$.$Extend(FetchRawTransition(captionElmt, 0), rawTransition);
|
3843 |
+
}
|
3844 |
+
}
|
3845 |
+
|
3846 |
+
if (rawTransition && rawTransition.$Transition) {
|
3847 |
+
|
3848 |
+
transition = EvaluateCaptionTransition(rawTransition.$Transition.$Value);
|
3849 |
+
|
3850 |
+
if (transition) {
|
3851 |
+
|
3852 |
+
//var transitionWithTuning = $Jssor$.$Extend({ $Delay: 0, $ScaleHorizontal: 1, $ScaleVertical: 1 }, transition);
|
3853 |
+
var transitionWithTuning = $Jssor$.$Extend({ $Delay: 0 }, transition);
|
3854 |
+
|
3855 |
+
$Jssor$.$Each(rawTransition, function (rawPropertyValue, propertyName) {
|
3856 |
+
var tuningPropertyValue = (_CaptionTuningTransfer[propertyName] || _CaptionTuningTransfer.$Default).apply(_CaptionTuningTransfer, [transitionWithTuning[propertyName], rawTransition[propertyName]]);
|
3857 |
+
if (!isNaN(tuningPropertyValue))
|
3858 |
+
transitionWithTuning[propertyName] = tuningPropertyValue;
|
3859 |
+
});
|
3860 |
+
|
3861 |
+
if (!k) {
|
3862 |
+
if (rawTransition.$BeginTime)
|
3863 |
+
transitionWithTuning.$BeginTime = rawTransition.$BeginTime.$Value || 0;
|
3864 |
+
else if ((_PlayMode) & 2)
|
3865 |
+
transitionWithTuning.$BeginTime = 0;
|
3866 |
+
}
|
3867 |
+
}
|
3868 |
+
}
|
3869 |
+
|
3870 |
+
transitionsWithTuning.push(transitionWithTuning);
|
3871 |
+
}
|
3872 |
+
|
3873 |
+
if ((level % 2) && !k) {
|
3874 |
+
//transitionsWithTuning.$Children = GetCaptionItems(captionElmt, lastTransitionName, [].concat(namedTransitions), [].concat(namedTransitionOrders), level + 1);
|
3875 |
+
transitionsWithTuning.$Children = GetCaptionItems(captionElmt, level + 1);
|
3876 |
+
}
|
3877 |
+
});
|
3878 |
+
|
3879 |
+
itemsToPlay.push(transitionsWithTuning);
|
3880 |
+
});
|
3881 |
+
|
3882 |
+
return itemsToPlay;
|
3883 |
+
}
|
3884 |
+
|
3885 |
+
function CreateAnimator(item, transition, immediateOut) {
|
3886 |
+
|
3887 |
+
var animatorOptions = {
|
3888 |
+
$Easing: transition.$Easing,
|
3889 |
+
$Round: transition.$Round,
|
3890 |
+
$During: transition.$During,
|
3891 |
+
$Reverse: playIn && !immediateOut,
|
3892 |
+
$Optimize: true
|
3893 |
+
};
|
3894 |
+
|
3895 |
+
$JssorDebug$.$Execute(function () {
|
3896 |
+
animatorOptions.$CaptionAnimator = true;
|
3897 |
+
});
|
3898 |
+
|
3899 |
+
var captionItem = item;
|
3900 |
+
var captionParent = $Jssor$.$ParentNode(item);
|
3901 |
+
|
3902 |
+
var captionItemWidth = $Jssor$.$CssWidth(captionItem);
|
3903 |
+
var captionItemHeight = $Jssor$.$CssHeight(captionItem);
|
3904 |
+
var captionParentWidth = $Jssor$.$CssWidth(captionParent);
|
3905 |
+
var captionParentHeight = $Jssor$.$CssHeight(captionParent);
|
3906 |
+
|
3907 |
+
var toStyles = {};
|
3908 |
+
var fromStyles = {};
|
3909 |
+
var scaleClip = transition.$ScaleClip || 1;
|
3910 |
+
|
3911 |
+
//Opacity
|
3912 |
+
if (transition.$Opacity) {
|
3913 |
+
toStyles.$Opacity = 2 - transition.$Opacity;
|
3914 |
+
}
|
3915 |
+
|
3916 |
+
animatorOptions.$OriginalWidth = captionItemWidth;
|
3917 |
+
animatorOptions.$OriginalHeight = captionItemHeight;
|
3918 |
+
|
3919 |
+
//Transform
|
3920 |
+
if (transition.$Zoom || transition.$Rotate) {
|
3921 |
+
toStyles.$Zoom = transition.$Zoom ? transition.$Zoom - 1 : 1;
|
3922 |
+
|
3923 |
+
if ($Jssor$.$IsBrowserIe9Earlier() || $Jssor$.$IsBrowserOpera())
|
3924 |
+
toStyles.$Zoom = Math.min(toStyles.$Zoom, 2);
|
3925 |
+
|
3926 |
+
fromStyles.$Zoom = 1;
|
3927 |
+
|
3928 |
+
var rotate = transition.$Rotate || 0;
|
3929 |
+
|
3930 |
+
toStyles.$Rotate = rotate * 360;
|
3931 |
+
fromStyles.$Rotate = 0;
|
3932 |
+
}
|
3933 |
+
//Clip
|
3934 |
+
else if (transition.$Clip) {
|
3935 |
+
var fromStyleClip = { $Top: 0, $Right: captionItemWidth, $Bottom: captionItemHeight, $Left: 0 };
|
3936 |
+
var toStyleClip = $Jssor$.$Extend({}, fromStyleClip);
|
3937 |
+
|
3938 |
+
var blockOffset = toStyleClip.$Offset = {};
|
3939 |
+
|
3940 |
+
var topBenchmark = transition.$Clip & 4;
|
3941 |
+
var bottomBenchmark = transition.$Clip & 8;
|
3942 |
+
var leftBenchmark = transition.$Clip & 1;
|
3943 |
+
var rightBenchmark = transition.$Clip & 2;
|
3944 |
+
|
3945 |
+
if (topBenchmark && bottomBenchmark) {
|
3946 |
+
blockOffset.$Top = captionItemHeight / 2 * scaleClip;
|
3947 |
+
blockOffset.$Bottom = -blockOffset.$Top;
|
3948 |
+
}
|
3949 |
+
else if (topBenchmark)
|
3950 |
+
blockOffset.$Bottom = -captionItemHeight * scaleClip;
|
3951 |
+
else if (bottomBenchmark)
|
3952 |
+
blockOffset.$Top = captionItemHeight * scaleClip;
|
3953 |
+
|
3954 |
+
if (leftBenchmark && rightBenchmark) {
|
3955 |
+
blockOffset.$Left = captionItemWidth / 2 * scaleClip;
|
3956 |
+
blockOffset.$Right = -blockOffset.$Left;
|
3957 |
+
}
|
3958 |
+
else if (leftBenchmark)
|
3959 |
+
blockOffset.$Right = -captionItemWidth * scaleClip;
|
3960 |
+
else if (rightBenchmark)
|
3961 |
+
blockOffset.$Left = captionItemWidth * scaleClip;
|
3962 |
+
|
3963 |
+
animatorOptions.$Move = transition.$Move;
|
3964 |
+
toStyles.$Clip = toStyleClip;
|
3965 |
+
fromStyles.$Clip = fromStyleClip;
|
3966 |
+
}
|
3967 |
+
|
3968 |
+
//Fly
|
3969 |
+
{
|
3970 |
+
var toLeft = 0;
|
3971 |
+
var toTop = 0;
|
3972 |
+
|
3973 |
+
if (transition.x)
|
3974 |
+
toLeft -= captionParentWidth * transition.x;
|
3975 |
+
|
3976 |
+
if (transition.y)
|
3977 |
+
toTop -= captionParentHeight * transition.y;
|
3978 |
+
|
3979 |
+
if (toLeft || toTop || animatorOptions.$Move) {
|
3980 |
+
toStyles.$Left = toLeft + $Jssor$.$CssLeft(captionItem);
|
3981 |
+
toStyles.$Top = toTop + $Jssor$.$CssTop(captionItem);
|
3982 |
+
}
|
3983 |
+
}
|
3984 |
+
|
3985 |
+
//duration
|
3986 |
+
var duration = transition.$Duration;
|
3987 |
+
|
3988 |
+
fromStyles = $Jssor$.$Extend(fromStyles, $Jssor$.$GetStyles(captionItem, toStyles));
|
3989 |
+
|
3990 |
+
animatorOptions.$Setter = $Jssor$.$StyleSetterEx();
|
3991 |
+
|
3992 |
+
return new $JssorAnimator$(transition.$Delay, duration, animatorOptions, captionItem, fromStyles, toStyles);
|
3993 |
+
}
|
3994 |
+
|
3995 |
+
function CreateAnimators(streamLineLength, captionItems) {
|
3996 |
+
|
3997 |
+
$Jssor$.$Each(captionItems, function (captionItem, i) {
|
3998 |
+
|
3999 |
+
$JssorDebug$.$Execute(function () {
|
4000 |
+
if (captionItem.length) {
|
4001 |
+
var top = $Jssor$.$CssTop(captionItem.$Elmt);
|
4002 |
+
var left = $Jssor$.$CssLeft(captionItem.$Elmt);
|
4003 |
+
var width = $Jssor$.$CssWidth(captionItem.$Elmt);
|
4004 |
+
var height = $Jssor$.$CssHeight(captionItem.$Elmt);
|
4005 |
+
|
4006 |
+
var error = null;
|
4007 |
+
|
4008 |
+
if (isNaN(top))
|
4009 |
+
error = "Style 'top' for caption not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.";
|
4010 |
+
else if (isNaN(left))
|
4011 |
+
error = "Style 'left' not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.";
|
4012 |
+
else if (isNaN(width))
|
4013 |
+
error = "Style 'width' not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.";
|
4014 |
+
else if (isNaN(height))
|
4015 |
+
error = "Style 'height' not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.";
|
4016 |
+
|
4017 |
+
if (error)
|
4018 |
+
$JssorDebug$.$Error("Caption " + (i + 1) + " definition error, \r\n" + error + "\r\n" + captionItem.$Elmt.outerHTML);
|
4019 |
+
}
|
4020 |
+
});
|
4021 |
+
|
4022 |
+
var animator;
|
4023 |
+
var captionElmt = captionItem.$Elmt;
|
4024 |
+
var transition = captionItem[0];
|
4025 |
+
var transition3 = captionItem[1];
|
4026 |
+
|
4027 |
+
if (transition) {
|
4028 |
+
|
4029 |
+
animator = CreateAnimator(captionElmt, transition);
|
4030 |
+
streamLineLength = animator.$Locate(transition.$BeginTime == undefined ? streamLineLength : transition.$BeginTime, 1);
|
4031 |
+
}
|
4032 |
+
|
4033 |
+
streamLineLength = CreateAnimators(streamLineLength, captionItem.$Children);
|
4034 |
+
|
4035 |
+
if (transition3) {
|
4036 |
+
var animator3 = CreateAnimator(captionElmt, transition3, 1);
|
4037 |
+
animator3.$Locate(streamLineLength, 1);
|
4038 |
+
_Self.$Combine(animator3);
|
4039 |
+
_ImmediateOutCaptionHanger.$Combine(animator3);
|
4040 |
+
}
|
4041 |
+
|
4042 |
+
if (animator)
|
4043 |
+
_Self.$Combine(animator);
|
4044 |
+
});
|
4045 |
+
|
4046 |
+
return streamLineLength;
|
4047 |
+
}
|
4048 |
+
|
4049 |
+
_Self.$Revert = function () {
|
4050 |
+
_Self.$GoToPosition(_Self.$GetPosition_OuterEnd() * (playIn || 0));
|
4051 |
+
_ImmediateOutCaptionHanger.$GoToBegin();
|
4052 |
+
};
|
4053 |
+
|
4054 |
+
//Constructor
|
4055 |
+
{
|
4056 |
+
_ImmediateOutCaptionHanger = new $JssorAnimator$(0, 0);
|
4057 |
+
|
4058 |
+
//var streamLineLength = 0;
|
4059 |
+
//var captionItems = GetCaptionItems(container, null, [], [], 1);
|
4060 |
+
|
4061 |
+
CreateAnimators(0, _PlayMode ? GetCaptionItems(container, 1) : []);
|
4062 |
+
}
|
4063 |
+
};
|
4064 |
+
|
4065 |
+
//Event Table
|
4066 |
+
|
4067 |
+
//$EVT_CLICK = 21; function(slideIndex[, event])
|
4068 |
+
//$EVT_DRAG_START = 22; function(position[, virtualPosition, event])
|
4069 |
+
//$EVT_DRAG_END = 23; function(position, startPosition[, virtualPosition, virtualStartPosition, event])
|
4070 |
+
//$EVT_SWIPE_START = 24; function(position[, virtualPosition])
|
4071 |
+
//$EVT_SWIPE_END = 25; function(position[, virtualPosition])
|
4072 |
+
|
4073 |
+
//$EVT_LOAD_START = 26; function(slideIndex)
|
4074 |
+
//$EVT_LOAD_END = 27; function(slideIndex)
|
4075 |
+
|
4076 |
+
//$EVT_POSITION_CHANGE = 202; function(position, fromPosition[, virtualPosition, virtualFromPosition])
|
4077 |
+
//$EVT_PARK = 203; function(slideIndex, fromIndex)
|
4078 |
+
|
4079 |
+
//$EVT_PROGRESS_CHANGE = 208; function(slideIndex, progress[, progressBegin, idleBegin, idleEnd, progressEnd])
|
4080 |
+
//$EVT_STATE_CHANGE = 209; function(slideIndex, progress[, progressBegin, idleBegin, idleEnd, progressEnd])
|
4081 |
+
|
4082 |
+
//$EVT_ROLLBACK_START = 210; function(slideIndex, progress[, progressBegin, idleBegin, idleEnd, progressEnd])
|
4083 |
+
//$EVT_ROLLBACK_END = 211; function(slideIndex, progress[, progressBegin, idleBegin, idleEnd, progressEnd])
|
4084 |
+
|
4085 |
+
//$EVT_SLIDESHOW_START = 206; function(slideIndex[, progressBegin, slideshowBegin, slideshowEnd, progressEnd])
|
4086 |
+
//$EVT_SLIDESHOW_END = 207; function(slideIndex[, progressBegin, slideshowBegin, slideshowEnd, progressEnd])
|
4087 |
+
|
4088 |
+
//http://www.jssor.com/development/reference-api.html
|
media/img/a11.png
ADDED
Binary file
|
media/img/b03.png
ADDED
Binary file
|
media/img/loading.gif
ADDED
Binary file
|
media/thumbnailslider/01.jpg
ADDED
Binary file
|
media/thumbnailslider/02.jpg
ADDED
Binary file
|
media/thumbnailslider/thumb-01.jpg
ADDED
Binary file
|
media/thumbnailslider/thumb-02.jpg
ADDED
Binary file
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Thumbnailslider</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>osl</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>this is awesome responsive thumbnail slider.</summary>
|
10 |
+
<description>This is beautiful responsive thumbnail slider for magento sites.Admin can manages any number of images into the thumbnail slider. Admin can add,edit and delete thumbnail slider images.</description>
|
11 |
+
<notes>This is beautiful responsive thumbnail slider for magento sites.Admin can manages any number of images into the thumbnail slider. Admin can add,edit and delete thumbnail slider images.</notes>
|
12 |
+
<authors><author><name>dataman</name><user>gauravmishra</user><email>webadmin@dataman.in</email></author></authors>
|
13 |
+
<date>2015-01-22</date>
|
14 |
+
<time>06:11:04</time>
|
15 |
+
<contents><target name="mage"><dir name="app"><dir name="code"><dir name="local"><dir name="Dataman"><dir name="Thumbnailslider"><dir name="Block"><dir name="Adminhtml"><dir name="Thumbnailslider"><dir name="Edit"><file name="Form.php" hash="5d7a0ea704fcb56b899b5a364649d4e3"/><dir name="Tab"><file name="Form.php" hash="a6a4004720d55ce8c5b76fe2d04358f8"/></dir><file name="Tabs.php" hash="23c71f48e35555a6681dabcf8db2160c"/></dir><file name="Edit.php" hash="30d3d219d03c2166dec0f804f692a3eb"/><file name="Grid.php" hash="2956d68922f7b7340be669077b287a9c"/></dir><file name="Thumbnailslider.php" hash="bbb321b72bba69e6b142ad1a9ec449e8"/></dir><file name="Thumbnailslider.php" hash="6307db95a0b1cfb46072f32a2c9bde60"/></dir><dir name="Helper"><file name="Data.php" hash="c42a44c3b490a2aa429efa2960de7404"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Thumbnailslider"><file name="Collection.php" hash="75f4440d10252be0b33e5f4e2f1e32a9"/></dir><file name="Thumbnailslider.php" hash="cd27cf2793370e658c35296c45658c66"/></dir><file name="Status.php" hash="161a3678a35ebe05016f422172700bf2"/><file name="Thumbnailslider.php" hash="105ddde0e9fcf0758b62f0c9e2e2fd2c"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ThumbnailsliderController.php" hash="71d23ccf432c428c9c94f8265e7f724c"/></dir><file name="IndexController.php" hash="ba26c6a5b4f91c16579acd5f17270580"/></dir><dir name="etc"><file name="config.xml" hash="19a4deafe3db44175212b92743e8903a"/></dir><dir name="sql"><dir name="thumbnailslider_setup"><file name="mysql4-install-0.1.0.php" hash="2b09537749b40a481376010b82da32b1"/></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="thumbnailslider.xml" hash="8047a888cfaa1f1fea39c687e219f6fd"/></dir><dir name="template"><dir name="thumbnailslider"><file name="thumbnailslider.phtml" hash="0634e40f2bb978b412d4222a2d193f4c"/><file name="thumbnailslider.phtml~" hash="60b3824ed6f34a2118ed55d00bae4941"/></dir></dir></dir></dir></dir></dir></dir><dir name="js"><dir name="thumbnailslider"><file name="jquery-1.9.1.min.js" hash="8cb6c28c541f888d6044bfeb8a34724e"/><file name="jssor.js" hash="89b0070495d48c05865e87ff94f92827"/><file name="jssor.slider.js" hash="f30912c714a482f6bb4eb8a7fd566d61"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="thumbnailslider.xml" hash="d5cee66a5f3c3011f80a35bf962e9954"/></dir></dir></dir></dir></target><target name="magemedia"><dir name="img"><file name="a11.png" hash="f7bcd8df5258346060276b9dbcb0c63a"/><file name="b03.png" hash="66ddc21fc1fad1a9fd04d042e7f442e8"/><file name="loading.gif" hash="dd78ac008009bd821d2bf2da98108854"/></dir><dir name="thumbnailslider"><file name="01.jpg" hash="1a7eddcc07ad3e9c4486329716ae6666"/><file name="02.jpg" hash="113c02330098f433f246c994cc677e67"/><file name="thumb-01.jpg" hash="b42bb7bce8344e46a7ffd00b10d4a86f"/><file name="thumb-02.jpg" hash="2a2c994818c1cad352b8c0468f4b22e2"/></dir></target><target name="mageetc"><dir name="modules"><file name="Dataman_Thumbnailslider.xml" hash="d8b12ca775cc990a1f21760e7196dbbe"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>magento_core_module</name><channel>community</channel><min>1.6</min><max>1.9</max></package></required></dependencies>
|
18 |
+
</package>
|