Version Notes
First Preview release
Download this release
Release Info
Developer | iMedia inc. |
Extension | IFPC_Slider |
Version | 1.0.0.1 |
Comparing to | |
See all releases |
Version 1.0.0.1
- app/code/community/Imedia/Countdown/Block/Adminhtml/Page.php +18 -0
- app/code/community/Imedia/Countdown/Block/Adminhtml/Page/Edit.php +28 -0
- app/code/community/Imedia/Countdown/Block/Adminhtml/Page/Edit/Form.php +98 -0
- app/code/community/Imedia/Countdown/Block/Adminhtml/Page/Edit/Tab.php +20 -0
- app/code/community/Imedia/Countdown/Block/Adminhtml/Page/Grid.php +128 -0
- app/code/community/Imedia/Countdown/Helper/Data.php +5 -0
- app/code/community/Imedia/Countdown/Model/Mysql4/Page.php +8 -0
- app/code/community/Imedia/Countdown/Model/Mysql4/Page/Collection.php +9 -0
- app/code/community/Imedia/Countdown/Model/Page.php +9 -0
- app/code/community/Imedia/Countdown/Model/Status.php +15 -0
- app/code/community/Imedia/Countdown/controllers/Adminhtml/PageController.php +175 -0
- app/code/community/Imedia/Countdown/etc/adminhtml.xml +34 -0
- app/code/community/Imedia/Countdown/etc/config.xml +94 -0
- app/code/community/Imedia/Countdown/sql/imedia_countdown_setup/mysql4-install-0.0.1.php +23 -0
- app/code/community/Imedia/FeaturedProduct/Block/Adminhtml/Featuredproduct.php +18 -0
- app/code/community/Imedia/FeaturedProduct/Block/Adminhtml/Featuredproduct/Grid.php +228 -0
- app/code/community/Imedia/FeaturedProduct/Block/Countdown/List.php +9 -0
- app/code/community/Imedia/FeaturedProduct/Helper/Data.php +8 -0
- app/code/community/Imedia/FeaturedProduct/Model/Adminhtml/System/Config/Source/Position.php +23 -0
- app/code/community/Imedia/FeaturedProduct/Model/Adminhtml/System/Config/Source/Sliderspeed.php +21 -0
- app/code/community/Imedia/FeaturedProduct/Model/Observer.php +70 -0
- app/code/community/Imedia/FeaturedProduct/Model/Resource/Setup.php +7 -0
- app/code/community/Imedia/FeaturedProduct/controllers/Adminhtml/FeaturedproductController.php +164 -0
- app/code/community/Imedia/FeaturedProduct/controllers/IndexController.php +12 -0
- app/code/community/Imedia/FeaturedProduct/etc/adminhtml.xml +50 -0
- app/code/community/Imedia/FeaturedProduct/etc/config.xml +121 -0
- app/code/community/Imedia/FeaturedProduct/etc/system.xml +113 -0
- app/code/community/Imedia/FeaturedProduct/sql/imedia_featuredproduct_setup/install-0.1.0.php +28 -0
- app/design/adminhtml/default/default/layout/imedia/countdown.xml +15 -0
- app/design/adminhtml/default/default/layout/imedia/imedia_featuredproduct.xml +9 -0
- app/design/frontend/base/default/layout/imedia/imedia_featuredproduct.xml +46 -0
- app/design/frontend/base/default/template/imedia/countdownslider.phtml +178 -0
- app/etc/modules/Imedia_Countdown.xml +9 -0
- app/etc/modules/Imedia_FeaturedProduct.xml +13 -0
- package.xml +18 -0
- skin/frontend/base/default/css/imedia_countdown/owl.carousel.css +118 -0
- skin/frontend/base/default/css/imedia_countdown/owl.theme.css +79 -0
- skin/frontend/base/default/js/imedia_countdown/AjaxLoader.gif +0 -0
- skin/frontend/base/default/js/imedia_countdown/countdown.js +199 -0
- skin/frontend/base/default/js/imedia_countdown/grabbing.png +0 -0
- skin/frontend/base/default/js/imedia_countdown/jquery-1.9.1.min.js +5 -0
- skin/frontend/base/default/js/imedia_countdown/owl.carousel.js +1512 -0
app/code/community/Imedia/Countdown/Block/Adminhtml/Page.php
ADDED
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Imedia_Countdown_Block_Adminhtml_Page extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_blockGroup='imedia_countdown';
|
7 |
+
$this->_controller='adminhtml_page';
|
8 |
+
$this->_headerText= Mage::helper('imedia_countdown')->__('Countdown');
|
9 |
+
$this->_addButton('module_controller', array(
|
10 |
+
'label' => $this->__('Manage Products'),
|
11 |
+
'onclick' => "setLocation('{$this->getUrl('*/featuredproduct/index')}')",
|
12 |
+
));
|
13 |
+
|
14 |
+
parent::__construct();
|
15 |
+
|
16 |
+
$this->_removeButton('add');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Imedia/Countdown/Block/Adminhtml/Page/Edit.php
ADDED
@@ -0,0 +1,28 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Imedia_Countdown_Block_Adminhtml_Page_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_blockGroup = 'imedia_countdown';
|
7 |
+
$this->_controller = 'adminhtml_page';
|
8 |
+
|
9 |
+
parent::__construct();
|
10 |
+
|
11 |
+
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Get Header text
|
16 |
+
*
|
17 |
+
* @return string
|
18 |
+
*/
|
19 |
+
public function getHeaderText()
|
20 |
+
{
|
21 |
+
if (Mage::registry('imedia_countdown')->getId()) {
|
22 |
+
return Mage::helper('imedia_countdown')->__('Edit Countdown');
|
23 |
+
}
|
24 |
+
else {
|
25 |
+
return Mage::helper('imedia_countdown')->__('New Countdown');
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|
app/code/community/Imedia/Countdown/Block/Adminhtml/Page/Edit/Form.php
ADDED
@@ -0,0 +1,98 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Imedia_Countdown_Block_Adminhtml_Page_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setId('imedia_countdown_page_form');
|
8 |
+
$this->setTitle(Mage::helper('imedia_countdown')->__('Countdown'));
|
9 |
+
}
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Setup form fields for inserts/updates
|
13 |
+
*
|
14 |
+
* return Mage_Adminhtml_Block_Widget_Form
|
15 |
+
*/
|
16 |
+
protected function _prepareForm()
|
17 |
+
{
|
18 |
+
$model = Mage::registry('imedia_countdown');
|
19 |
+
|
20 |
+
|
21 |
+
$inquiryCollections = Mage::getModel('imedia_countdown/page')->getCollection()
|
22 |
+
->addFieldToFilter('id', $model->getData('id'))
|
23 |
+
->getFirstItem();
|
24 |
+
|
25 |
+
$active = $inquiryCollections->getIsActive();
|
26 |
+
|
27 |
+
|
28 |
+
$form = new Varien_Data_Form(array(
|
29 |
+
'id' => 'edit_form',
|
30 |
+
'action' =>$this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
31 |
+
'method' => 'post'
|
32 |
+
));
|
33 |
+
|
34 |
+
$fieldset = $form->addFieldset('base_fieldset', array(
|
35 |
+
'legend' => Mage::helper('imedia_countdown')->__('Countdown'),
|
36 |
+
'class' => 'fieldset-wide',
|
37 |
+
));
|
38 |
+
if ($model->getId()) {
|
39 |
+
$fieldset->addField('id', 'hidden', array(
|
40 |
+
'name' => 'id',
|
41 |
+
));
|
42 |
+
}
|
43 |
+
$fieldset->addField('product_name', 'label', array(
|
44 |
+
'label' => 'Product Name',
|
45 |
+
'disabled' => true,
|
46 |
+
'readonly' => true,
|
47 |
+
'name' => 'product_name',
|
48 |
+
));
|
49 |
+
$fieldset->addField('sku', 'label', array(
|
50 |
+
'label' => 'Sku',
|
51 |
+
'disabled' => true,
|
52 |
+
'readonly' => true,
|
53 |
+
'name' => 'sku',
|
54 |
+
));
|
55 |
+
|
56 |
+
$fieldset->addField('start_time', 'date', array(
|
57 |
+
'name' => 'start_time',
|
58 |
+
'time' => true,
|
59 |
+
'class' => 'required-entry',
|
60 |
+
'required' => true,
|
61 |
+
'format' => Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
|
62 |
+
'label' => 'From:',
|
63 |
+
'image' => $this->getSkinUrl('images/grid-cal.gif')
|
64 |
+
));
|
65 |
+
|
66 |
+
$fieldset->addField('end_time', 'date', array(
|
67 |
+
'name' => 'end_time',
|
68 |
+
'time' => true,
|
69 |
+
'class' => 'required-entry',
|
70 |
+
'required' => true,
|
71 |
+
'format' => Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
|
72 |
+
'label' => 'To:',
|
73 |
+
'image' => $this->getSkinUrl('images/grid-cal.gif')
|
74 |
+
));
|
75 |
+
|
76 |
+
$fieldset->addField('status', 'select', array(
|
77 |
+
'label' => 'Status',
|
78 |
+
'name' => 'status',
|
79 |
+
'values' => array(
|
80 |
+
array(
|
81 |
+
'value' => 1,
|
82 |
+
'label' => 'Enabled',
|
83 |
+
),
|
84 |
+
|
85 |
+
array(
|
86 |
+
'value' => 2,
|
87 |
+
'label' => 'Disabled',
|
88 |
+
),
|
89 |
+
),
|
90 |
+
));
|
91 |
+
$form_data = $model->getData();
|
92 |
+
$form->setValues($form_data);
|
93 |
+
$form->setUseContainer(true);
|
94 |
+
$this->setForm($form);
|
95 |
+
|
96 |
+
return parent::_prepareForm();
|
97 |
+
}
|
98 |
+
}
|
app/code/community/Imedia/Countdown/Block/Adminhtml/Page/Edit/Tab.php
ADDED
@@ -0,0 +1,20 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Imedia_Countdown_Block_Adminhtml_Page_Edit_Tab extends Mage_Adminhtml_Block_Widget_Tabs
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setId('form_tabs');
|
8 |
+
$this->setDestElementId('edit_form');
|
9 |
+
$this->setTitle(Mage::helper('imedia_countdown')->__('Countdown'));
|
10 |
+
}
|
11 |
+
protected function _beforeToHtml()
|
12 |
+
{
|
13 |
+
$this->addTab('form_section', array(
|
14 |
+
'label' => Mage::helper('imedia_countdown')->__('Countdown'),
|
15 |
+
'title' => Mage::helper('imedia_countdown')->__('Countdown'),
|
16 |
+
));
|
17 |
+
|
18 |
+
return parent::_beforeToHtml();
|
19 |
+
}
|
20 |
+
}
|
app/code/community/Imedia/Countdown/Block/Adminhtml/Page/Grid.php
ADDED
@@ -0,0 +1,128 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Imedia_Countdown_Block_Adminhtml_Page_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
|
8 |
+
$this->setDefaultSort('id');
|
9 |
+
$this->setId('imedia_countdown_page_grid');
|
10 |
+
$this->setDefaultDir('asc');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _getCollectionClass()
|
15 |
+
{
|
16 |
+
return 'imedia_countdown/page_collection';
|
17 |
+
}
|
18 |
+
|
19 |
+
protected function _prepareCollection()
|
20 |
+
{
|
21 |
+
|
22 |
+
$collection = Mage::getResourceModel($this->_getCollectionClass());
|
23 |
+
$this->setCollection($collection);
|
24 |
+
return parent::_prepareCollection();
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
protected function _prepareColumns()
|
29 |
+
{
|
30 |
+
|
31 |
+
$this->addColumn('id',array(
|
32 |
+
'header'=> Mage::helper('imedia_countdown')->__('ID'),
|
33 |
+
'align' =>'right',
|
34 |
+
'width' => '50px',
|
35 |
+
'index' => 'id'
|
36 |
+
)
|
37 |
+
);
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
$this->addColumn('product_name', array(
|
42 |
+
'header' => Mage::helper('imedia_countdown')->__('Product Name'),
|
43 |
+
'align' =>'left',
|
44 |
+
'index' => 'product_name',
|
45 |
+
));
|
46 |
+
|
47 |
+
$this->addColumn('sku', array(
|
48 |
+
'header' => Mage::helper('imedia_countdown')->__('Sku'),
|
49 |
+
'align' =>'left',
|
50 |
+
'index' => 'sku',
|
51 |
+
));
|
52 |
+
|
53 |
+
$this->addColumn('start_time', array(
|
54 |
+
'header' => Mage::helper('imedia_countdown')->__('Start Time'),
|
55 |
+
'align' =>'left',
|
56 |
+
'index' => 'start_time',
|
57 |
+
));
|
58 |
+
|
59 |
+
$this->addColumn('end_time', array(
|
60 |
+
'header' => Mage::helper('imedia_countdown')->__('End Time'),
|
61 |
+
'align' =>'left',
|
62 |
+
'index' => 'end_time',
|
63 |
+
));
|
64 |
+
|
65 |
+
|
66 |
+
$this->addColumn('status', array(
|
67 |
+
'header' => Mage::helper('imedia_countdown')->__('Status'),
|
68 |
+
'align' => 'left',
|
69 |
+
'width' => '80px',
|
70 |
+
'index' => 'status',
|
71 |
+
'type' => 'options',
|
72 |
+
'options' => array(
|
73 |
+
1 => 'Enabled',
|
74 |
+
2 => 'Disabled',
|
75 |
+
),
|
76 |
+
));
|
77 |
+
|
78 |
+
$this->addColumn('action',
|
79 |
+
array(
|
80 |
+
'header' => Mage::helper('imedia_countdown')->__('Action'),
|
81 |
+
'width' => '50px',
|
82 |
+
'type' => 'action',
|
83 |
+
'getter' => 'getId',
|
84 |
+
'actions' => array(
|
85 |
+
array(
|
86 |
+
'caption' => Mage::helper('imedia_countdown')->__('View'),
|
87 |
+
'url' => array(
|
88 |
+
'base'=>'*/*/edit',
|
89 |
+
'params'=>array('store'=>$this->getRequest()->getParam('store'))
|
90 |
+
),
|
91 |
+
'field' => 'id'
|
92 |
+
)
|
93 |
+
),
|
94 |
+
'filter' => false,
|
95 |
+
'sortable' => false,
|
96 |
+
'index' => 'stores',
|
97 |
+
));
|
98 |
+
|
99 |
+
return parent::_prepareColumns();
|
100 |
+
}
|
101 |
+
protected function _prepareMassAction()
|
102 |
+
{
|
103 |
+
$this->setMassactionIdField('id');
|
104 |
+
$this->getMassactionBlock()->setFormFieldName('id');
|
105 |
+
$statuses = Mage::getSingleton('imedia_countdown/status')->getOptionArray();
|
106 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
107 |
+
$this->getMassactionBlock()->addItem('status', array(
|
108 |
+
'label'=> Mage::helper('imedia_countdown')->__('Change status'),
|
109 |
+
'url' => $this->getUrl('*/*/massStatus',
|
110 |
+
array('_current'=>true)),
|
111 |
+
'additional' => array(
|
112 |
+
'visibility' => array(
|
113 |
+
'name' => 'status',
|
114 |
+
'type' => 'select',
|
115 |
+
'class' => 'required-entry',
|
116 |
+
'label' => Mage::helper('imedia_countdown')->__('Status'),
|
117 |
+
'values'=> $statuses
|
118 |
+
))
|
119 |
+
));
|
120 |
+
|
121 |
+
return $this;
|
122 |
+
}
|
123 |
+
public function getRowUrl($row)
|
124 |
+
{
|
125 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
126 |
+
}
|
127 |
+
|
128 |
+
}
|
app/code/community/Imedia/Countdown/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Imedia_Countdown_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
app/code/community/Imedia/Countdown/Model/Mysql4/Page.php
ADDED
@@ -0,0 +1,8 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Imedia_Countdown_Model_Mysql4_Page extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('imedia_countdown/page', 'id');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Imedia/Countdown/Model/Mysql4/Page/Collection.php
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Imedia_Countdown_Model_Mysql4_Page_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->_init('imedia_countdown/page');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Imedia/Countdown/Model/Page.php
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Imedia_Countdown_Model_Page extends Mage_Core_Model_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->_init('imedia_countdown/page');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Imedia/Countdown/Model/Status.php
ADDED
@@ -0,0 +1,15 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Imedia_Countdown_Model_Status extends Varien_Object
|
3 |
+
{
|
4 |
+
const STATUS_ENABLED = 1;
|
5 |
+
const STATUS_DISABLED = 2;
|
6 |
+
|
7 |
+
static public function getOptionArray()
|
8 |
+
{
|
9 |
+
return array(
|
10 |
+
self::STATUS_ENABLED => Mage::helper('imedia_countdown')->__('Enabled'),
|
11 |
+
self::STATUS_DISABLED => Mage::helper('imedia_countdown')->__('Disabled')
|
12 |
+
);
|
13 |
+
}
|
14 |
+
}
|
15 |
+
?>
|
app/code/community/Imedia/Countdown/controllers/Adminhtml/PageController.php
ADDED
@@ -0,0 +1,175 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Imedia_Countdown_Adminhtml_PageController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
$this->_initAction()->renderLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Initialize action
|
12 |
+
* @return Mage_Adminhtml_Controller_Action
|
13 |
+
*/
|
14 |
+
protected function _initAction()
|
15 |
+
{
|
16 |
+
$this->loadLayout()
|
17 |
+
->_setActiveMenu('imedia_countdown_page')
|
18 |
+
->_title(Mage::helper('imedia_countdown')->__('Countdown'))
|
19 |
+
->_addBreadcrumb(Mage::helper('imedia_countdown')->__('Countdown'))
|
20 |
+
->_addBreadcrumb(Mage::helper('imedia_countdown')->__('Countdown'));
|
21 |
+
|
22 |
+
return $this;
|
23 |
+
}
|
24 |
+
public function newAction()
|
25 |
+
{
|
26 |
+
$this->_forward('edit');
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
public function gridAction()
|
31 |
+
{
|
32 |
+
$this->loadLayout()
|
33 |
+
->_setActiveMenu('catalog/featured_product')
|
34 |
+
->_addBreadcrumb('Featured Product','Featured Product');;
|
35 |
+
$this->getResponse()->setBody(
|
36 |
+
$this->getLayout()->createBlock('imedia_countdown/adminhtml_featuredproduct_grid')->toHtml()
|
37 |
+
);
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
public function editAction()
|
42 |
+
{
|
43 |
+
$this->_initAction();
|
44 |
+
|
45 |
+
$id = $this->getRequest()->getParam('id');
|
46 |
+
$model = Mage::getModel('imedia_countdown/page');
|
47 |
+
|
48 |
+
if ($id) {
|
49 |
+
// Load record
|
50 |
+
$model->load($id);
|
51 |
+
|
52 |
+
if (!$model->getId()) {
|
53 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('imedia_countdown')->__('This Countdown no longer exists.'));
|
54 |
+
$this->_redirect('*/*/');
|
55 |
+
|
56 |
+
return;
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
$data = Mage::getSingleton('adminhtml/session')->getMenuData(true);
|
61 |
+
if (!empty($data)) {
|
62 |
+
$model->setData($data);
|
63 |
+
}
|
64 |
+
|
65 |
+
Mage::register('imedia_countdown', $model);
|
66 |
+
|
67 |
+
$this->_initAction()
|
68 |
+
->_addContent($this->getLayout()->createBlock('imedia_countdown/adminhtml_page_edit')->setData('action', $this->getUrl('*/*/save')))
|
69 |
+
->_addLeft($this->getLayout()->createBlock('imedia_countdown/adminhtml_page_edit_tab'))
|
70 |
+
->renderLayout();
|
71 |
+
}
|
72 |
+
public function deleteAction()
|
73 |
+
{
|
74 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
75 |
+
try {
|
76 |
+
$model = Mage::getModel('imedia_countdown/page');
|
77 |
+
$model->setId($this->getRequest()->getParam('id'))->delete();
|
78 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('imedia_countdown')->__('Countdown was successfully deleted'));
|
79 |
+
$this->_redirect('*/*/');
|
80 |
+
} catch (Exception $e) {
|
81 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
82 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
83 |
+
}
|
84 |
+
}
|
85 |
+
$this->_redirect('*/*/');
|
86 |
+
}
|
87 |
+
public function saveAction()
|
88 |
+
{
|
89 |
+
if ($postData = $this->getRequest()->getPost()) {
|
90 |
+
|
91 |
+
$model = Mage::getSingleton('imedia_countdown/page');
|
92 |
+
|
93 |
+
try {
|
94 |
+
$model->setData($postData);
|
95 |
+
$model->save();
|
96 |
+
|
97 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('imedia_countdown')->__('The Status has been saved.'));
|
98 |
+
$this->_redirect('*/*/');
|
99 |
+
|
100 |
+
return;
|
101 |
+
}
|
102 |
+
catch (Mage_Core_Exception $e) {
|
103 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
104 |
+
}
|
105 |
+
catch (Exception $e) {
|
106 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('imedia_countdown')->__('An error occurred while saving this status.'));
|
107 |
+
}
|
108 |
+
|
109 |
+
Mage::getSingleton('adminhtml/session')->setEnquiryData($postData);
|
110 |
+
$this->_redirectReferer();
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
public function massDeleteAction()
|
115 |
+
{
|
116 |
+
$adListingIds = $this->getRequest()->getParam('id');
|
117 |
+
if(!is_array($adListingIds)) {
|
118 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('imedia_countdown')->__('Please select Any Listing(s).'));
|
119 |
+
} else {
|
120 |
+
try {
|
121 |
+
$model = Mage::getSingleton('imedia_countdown/page');
|
122 |
+
|
123 |
+
foreach ($adListingIds as $adId) {
|
124 |
+
|
125 |
+
$model->load($adId)->delete();
|
126 |
+
|
127 |
+
}
|
128 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('imedia_countdown')->__('Total of %d record(s) were deleted.', count($adListingIds)));
|
129 |
+
} catch (Exception $e) {
|
130 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
131 |
+
}
|
132 |
+
}
|
133 |
+
$this->_redirect('*/*/');
|
134 |
+
}
|
135 |
+
|
136 |
+
public function messageAction()
|
137 |
+
{
|
138 |
+
$data = Mage::getModel('imedia_countdown/page')->load($this->getRequest()->getParam('id'));
|
139 |
+
echo $data->getContent();
|
140 |
+
}
|
141 |
+
|
142 |
+
|
143 |
+
public function massStatusAction()
|
144 |
+
{
|
145 |
+
$productcountdownIds = $this->getRequest()->getParam('id');
|
146 |
+
if(!is_array($productcountdownIds)) {
|
147 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
148 |
+
} else {
|
149 |
+
try {
|
150 |
+
foreach ($productcountdownIds as $productcountdownId) {
|
151 |
+
$productcountdown = Mage::getSingleton('imedia_countdown/page')
|
152 |
+
->load($productcountdownId)
|
153 |
+
->setStatus($this->getRequest()->getParam('status'))
|
154 |
+
->setIsMassupdate(true)
|
155 |
+
->save();
|
156 |
+
}
|
157 |
+
$this->_getSession()->addSuccess(
|
158 |
+
$this->__('Total of %d record(s) were successfully updated', count($productcountdownIds))
|
159 |
+
);
|
160 |
+
} catch (Exception $e) {
|
161 |
+
$this->_getSession()->addError($e->getMessage());
|
162 |
+
}
|
163 |
+
}
|
164 |
+
$this->_redirect('*/*/index');
|
165 |
+
}
|
166 |
+
|
167 |
+
|
168 |
+
|
169 |
+
|
170 |
+
protected function _isAllowed()
|
171 |
+
{
|
172 |
+
return Mage::getSingleton('admin/session')->isAllowed('imedia_countdown_page');
|
173 |
+
}
|
174 |
+
|
175 |
+
}
|
app/code/community/Imedia/Countdown/etc/adminhtml.xml
ADDED
@@ -0,0 +1,34 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<imedia_countdown_page translate="title" module="imedia_countdown">
|
5 |
+
<title>Featured Product Countdown Slider</title>
|
6 |
+
<sort_order>9990</sort_order>
|
7 |
+
<children>
|
8 |
+
<adminhtml_page translate="title">
|
9 |
+
<title>Countdown</title>
|
10 |
+
<sort_order>1</sort_order>
|
11 |
+
<action>adminhtml/page</action>
|
12 |
+
</adminhtml_page>
|
13 |
+
</children>
|
14 |
+
</imedia_countdown_page>
|
15 |
+
</menu>
|
16 |
+
<acl>
|
17 |
+
<resources>
|
18 |
+
<admin>
|
19 |
+
<children>
|
20 |
+
<imedia_countdown_page translate="title" module="imedia_countdown">
|
21 |
+
<title>Countdown</title>
|
22 |
+
<sort_order>9990</sort_order>
|
23 |
+
<children>
|
24 |
+
<adminhtml_page translate="title">
|
25 |
+
<title>Countdown</title>
|
26 |
+
<sort_order>1</sort_order>
|
27 |
+
</adminhtml_page>
|
28 |
+
</children>
|
29 |
+
</imedia_countdown_page>
|
30 |
+
</children>
|
31 |
+
</admin>
|
32 |
+
</resources>
|
33 |
+
</acl>
|
34 |
+
</config>
|
app/code/community/Imedia/Countdown/etc/config.xml
ADDED
@@ -0,0 +1,94 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Imedia_Countdown>
|
5 |
+
<version>0.0.1</version>
|
6 |
+
</Imedia_Countdown>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<imedia_countdown>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Imedia_Countdown</module>
|
14 |
+
<frontName>page</frontName>
|
15 |
+
</args>
|
16 |
+
</imedia_countdown>
|
17 |
+
</routers>
|
18 |
+
</frontend>
|
19 |
+
|
20 |
+
<admin>
|
21 |
+
<routers>
|
22 |
+
<adminhtml>
|
23 |
+
<args>
|
24 |
+
<modules>
|
25 |
+
<Imedia_Countdown before="Mage_Adminhtml">Imedia_Countdown_Adminhtml</Imedia_Countdown>
|
26 |
+
</modules>
|
27 |
+
</args>
|
28 |
+
</adminhtml>
|
29 |
+
</routers>
|
30 |
+
</admin>
|
31 |
+
<adminhtml>
|
32 |
+
<layout>
|
33 |
+
<updates>
|
34 |
+
<imedia_countdown>
|
35 |
+
<file>imedia/countdown.xml</file>
|
36 |
+
</imedia_countdown>
|
37 |
+
</updates>
|
38 |
+
</layout>
|
39 |
+
</adminhtml>
|
40 |
+
|
41 |
+
<global>
|
42 |
+
|
43 |
+
<blocks>
|
44 |
+
<imedia_countdown>
|
45 |
+
<class>Imedia_Countdown_Block</class>
|
46 |
+
</imedia_countdown>
|
47 |
+
</blocks>
|
48 |
+
|
49 |
+
<models>
|
50 |
+
<imedia_countdown>
|
51 |
+
<class>Imedia_Countdown_Model</class>
|
52 |
+
<resourceModel>imedia_countdown_mysql4</resourceModel>
|
53 |
+
</imedia_countdown>
|
54 |
+
<imedia_countdown_mysql4>
|
55 |
+
<class>Imedia_Countdown_Model_Mysql4</class>
|
56 |
+
<entities>
|
57 |
+
<page>
|
58 |
+
<table>countdown_page</table>
|
59 |
+
</page>
|
60 |
+
</entities>
|
61 |
+
</imedia_countdown_mysql4>
|
62 |
+
</models>
|
63 |
+
|
64 |
+
<resources>
|
65 |
+
<imedia_countdown_setup>
|
66 |
+
<setup>
|
67 |
+
<module>Imedia_Countdown</module>
|
68 |
+
</setup>
|
69 |
+
<connection>
|
70 |
+
<use>core_setup</use>
|
71 |
+
</connection>
|
72 |
+
</imedia_countdown_setup>
|
73 |
+
<imedia_countdown_write>
|
74 |
+
<connection>
|
75 |
+
<use>core_write</use>
|
76 |
+
</connection>
|
77 |
+
</imedia_countdown_write>
|
78 |
+
<imedia_countdown_read>
|
79 |
+
<connection>
|
80 |
+
<use>core_read</use>
|
81 |
+
</connection>
|
82 |
+
</imedia_countdown_read>
|
83 |
+
</resources>
|
84 |
+
|
85 |
+
<helpers>
|
86 |
+
<imedia_countdown>
|
87 |
+
<class>Imedia_Countdown_Helper</class>
|
88 |
+
</imedia_countdown>
|
89 |
+
</helpers>
|
90 |
+
|
91 |
+
</global>
|
92 |
+
|
93 |
+
|
94 |
+
</config>
|
app/code/community/Imedia/Countdown/sql/imedia_countdown_setup/mysql4-install-0.0.1.php
ADDED
@@ -0,0 +1,23 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
|
8 |
+
$installer->run("
|
9 |
+
|
10 |
+
-- DROP TABLE IF EXISTS {$this->getTable('countdown_page')};
|
11 |
+
CREATE TABLE {$this->getTable('countdown_page')} (
|
12 |
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
13 |
+
`product_name` varchar(255) NOT NULL DEFAULT '',
|
14 |
+
`sku` varchar(100) NOT NULL,
|
15 |
+
`start_time` datetime DEFAULT NULL,
|
16 |
+
`end_time` datetime DEFAULT NULL,
|
17 |
+
`status` tinyint(1) NOT NULL,
|
18 |
+
PRIMARY KEY (`id`)
|
19 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
20 |
+
|
21 |
+
");
|
22 |
+
|
23 |
+
$installer->endSetup();
|
app/code/community/Imedia/FeaturedProduct/Block/Adminhtml/Featuredproduct.php
ADDED
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Grid container block
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
class Imedia_FeaturedProduct_Block_Adminhtml_Featuredproduct extends Mage_Adminhtml_Block_Widget_Grid_Container
|
7 |
+
{
|
8 |
+
public function __construct()
|
9 |
+
{
|
10 |
+
$this->_controller = 'adminhtml_featuredproduct';
|
11 |
+
$this->_blockGroup = 'imedia_featuredproduct';
|
12 |
+
$this->_headerText = Mage::helper('imedia_featuredproduct')->__('Manage Featured Products');
|
13 |
+
|
14 |
+
parent::__construct();
|
15 |
+
|
16 |
+
$this->_removeButton('add');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Imedia/FeaturedProduct/Block/Adminhtml/Featuredproduct/Grid.php
ADDED
@@ -0,0 +1,228 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Manage featured product grid block
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
class Imedia_FeaturedProduct_Block_Adminhtml_Featuredproduct_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
7 |
+
{
|
8 |
+
public function __construct()
|
9 |
+
{
|
10 |
+
parent::__construct();
|
11 |
+
$this->setId('featuredproductGrid');
|
12 |
+
$this->setDefaultSort('entity_id');
|
13 |
+
$this->setDefaultDir('DESC');
|
14 |
+
$this->setSaveParametersInSession(true);
|
15 |
+
$this->setUseAjax(true);
|
16 |
+
$this->setVarNameFilter('product_filter');
|
17 |
+
|
18 |
+
}
|
19 |
+
|
20 |
+
protected function _getStore()
|
21 |
+
{
|
22 |
+
$storeId = (int) $this->getRequest()->getParam('store', 0);
|
23 |
+
return Mage::app()->getStore($storeId);
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Prepare featuredproduct grid collection object
|
28 |
+
*
|
29 |
+
* @return Imedia_FeaturedProduct_Block_Adminhtml_Featuredproduct_Grid
|
30 |
+
*/
|
31 |
+
protected function _prepareCollection()
|
32 |
+
{
|
33 |
+
$store = $this->_getStore();
|
34 |
+
$collection = Mage::getModel('catalog/product')->getCollection()
|
35 |
+
->addAttributeToSelect('sku')
|
36 |
+
->addAttributeToSelect('name')
|
37 |
+
->addAttributeToSelect('attribute_set_id')
|
38 |
+
->addAttributeToSelect('type_id');
|
39 |
+
|
40 |
+
if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) {
|
41 |
+
$collection->joinField('qty',
|
42 |
+
'cataloginventory/stock_item',
|
43 |
+
'qty',
|
44 |
+
'product_id=entity_id',
|
45 |
+
'{{table}}.stock_id=1',
|
46 |
+
'left');
|
47 |
+
}
|
48 |
+
if ($store->getId()) {
|
49 |
+
//$collection->setStoreId($store->getId());
|
50 |
+
$adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;
|
51 |
+
$collection->addStoreFilter($store);
|
52 |
+
$collection->joinAttribute(
|
53 |
+
'name',
|
54 |
+
'catalog_product/name',
|
55 |
+
'entity_id',
|
56 |
+
null,
|
57 |
+
'inner',
|
58 |
+
$adminStore
|
59 |
+
);
|
60 |
+
$collection->joinAttribute(
|
61 |
+
'custom_name',
|
62 |
+
'catalog_product/name',
|
63 |
+
'entity_id',
|
64 |
+
null,
|
65 |
+
'inner',
|
66 |
+
$store->getId()
|
67 |
+
);
|
68 |
+
$collection->joinAttribute(
|
69 |
+
'status',
|
70 |
+
'catalog_product/status',
|
71 |
+
'entity_id',
|
72 |
+
null,
|
73 |
+
'inner',
|
74 |
+
$store->getId()
|
75 |
+
);
|
76 |
+
}
|
77 |
+
else {
|
78 |
+
$collection->addAttributeToSelect('price');
|
79 |
+
$collection->addAttributeToSelect('is_featured_product');
|
80 |
+
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
|
81 |
+
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
|
82 |
+
}
|
83 |
+
|
84 |
+
$this->setCollection($collection);
|
85 |
+
|
86 |
+
parent::_prepareCollection();
|
87 |
+
$this->getCollection()->addWebsiteNamesToResult();
|
88 |
+
return $this;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Prepare default grid column
|
93 |
+
*
|
94 |
+
* @return Imedia_FeaturedProduct_Block_Adminhtml_Featuredproduct_Grid
|
95 |
+
*/
|
96 |
+
protected function _prepareColumns()
|
97 |
+
{
|
98 |
+
$this->addColumn('entity_id',
|
99 |
+
array(
|
100 |
+
'header'=> Mage::helper('imedia_featuredproduct')->__('ID'),
|
101 |
+
'width' => '50px',
|
102 |
+
'type' => 'number',
|
103 |
+
'index' => 'entity_id',
|
104 |
+
));
|
105 |
+
$this->addColumn('imedia_featuredproduct',
|
106 |
+
array(
|
107 |
+
'header'=> Mage::helper('imedia_featuredproduct')->__('Featured'),
|
108 |
+
'width' => '50px',
|
109 |
+
'type' => 'options',
|
110 |
+
'index' => 'is_featured_product',
|
111 |
+
'options' => array(
|
112 |
+
0 => 'No',
|
113 |
+
1 => 'Yes')
|
114 |
+
));
|
115 |
+
$this->addColumn('name',
|
116 |
+
array(
|
117 |
+
'header'=> Mage::helper('imedia_featuredproduct')->__('Name'),
|
118 |
+
'index' => 'name',
|
119 |
+
));
|
120 |
+
|
121 |
+
$store = $this->_getStore();
|
122 |
+
if ($store->getId()) {
|
123 |
+
$this->addColumn('custom_name',
|
124 |
+
array(
|
125 |
+
'header'=> Mage::helper('imedia_featuredProduct')->__('Name in %s', $store->getName()),
|
126 |
+
'index' => 'custom_name',
|
127 |
+
));
|
128 |
+
}
|
129 |
+
|
130 |
+
$this->addColumn('type',
|
131 |
+
array(
|
132 |
+
'header'=> Mage::helper('imedia_featuredproduct')->__('Type'),
|
133 |
+
'width' => '60px',
|
134 |
+
'index' => 'type_id',
|
135 |
+
'type' => 'options',
|
136 |
+
'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),
|
137 |
+
));
|
138 |
+
|
139 |
+
$sets = Mage::getResourceModel('eav/entity_attribute_set_collection')
|
140 |
+
->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())
|
141 |
+
->load()
|
142 |
+
->toOptionHash();
|
143 |
+
|
144 |
+
/* $this->addColumn('set_name',
|
145 |
+
array(
|
146 |
+
'header'=> Mage::helper('imedia_featuredproduct')->__('Attrib. Set Name'),
|
147 |
+
'width' => '100px',
|
148 |
+
'index' => 'attribute_set_id',
|
149 |
+
'type' => 'options',
|
150 |
+
'options' => $sets,
|
151 |
+
));*/
|
152 |
+
|
153 |
+
$this->addColumn('sku',
|
154 |
+
array(
|
155 |
+
'header'=> Mage::helper('imedia_featuredproduct')->__('SKU'),
|
156 |
+
'width' => '80px',
|
157 |
+
'index' => 'sku',
|
158 |
+
));
|
159 |
+
|
160 |
+
$this->addColumn('status',
|
161 |
+
array(
|
162 |
+
'header'=> Mage::helper('imedia_featuredproduct')->__('Status'),
|
163 |
+
'width' => '70px',
|
164 |
+
'index' => 'status',
|
165 |
+
'type' => 'options',
|
166 |
+
'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
|
167 |
+
));
|
168 |
+
|
169 |
+
if (!Mage::app()->isSingleStoreMode()) {
|
170 |
+
$this->addColumn('websites',
|
171 |
+
array(
|
172 |
+
'header'=> Mage::helper('imedia_featuredproduct')->__('Websites'),
|
173 |
+
'width' => '100px',
|
174 |
+
'sortable' => false,
|
175 |
+
'index' => 'websites',
|
176 |
+
'type' => 'options',
|
177 |
+
'options' => Mage::getModel('core/website')->getCollection()->toOptionHash(),
|
178 |
+
));
|
179 |
+
}
|
180 |
+
return parent::_prepareColumns();
|
181 |
+
}
|
182 |
+
|
183 |
+
protected function _prepareMassaction()
|
184 |
+
{
|
185 |
+
$this->setMassactionIdField('entity_id');
|
186 |
+
$this->getMassactionBlock()->setFormFieldName('product');
|
187 |
+
|
188 |
+
$this->getMassactionBlock()->addItem('unset_featured', array(
|
189 |
+
'label'=> Mage::helper('imedia_featuredproduct')->__('Unset Featured'),
|
190 |
+
'url' => $this->getUrl('*/*/massUnsetFeatured', array('_current'=>true)),
|
191 |
+
));
|
192 |
+
|
193 |
+
$this->getMassactionBlock()->addItem('set_featured', array(
|
194 |
+
'label'=> Mage::helper('imedia_featuredproduct')->__('Set Featured'),
|
195 |
+
'url' => $this->getUrl('*/*/massSetFeatured', array('_current'=>true)),
|
196 |
+
));
|
197 |
+
return $this;
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Used for Ajax Based Grid
|
202 |
+
*
|
203 |
+
* URL which is called in the Ajax Request, to the get
|
204 |
+
* the content of the grid. _current Uses the current module, controller,
|
205 |
+
* action and parameters.
|
206 |
+
*
|
207 |
+
*/
|
208 |
+
public function getGridUrl()
|
209 |
+
{
|
210 |
+
return $this->getUrl('*/*/grid', array('_current'=>true));
|
211 |
+
}
|
212 |
+
|
213 |
+
protected function _addColumnFilterToCollection($column)
|
214 |
+
{
|
215 |
+
if ($this->getCollection()) {
|
216 |
+
if ($column->getId() == 'websites') {
|
217 |
+
$this->getCollection()->joinField('websites',
|
218 |
+
'catalog/product_website',
|
219 |
+
'website_id',
|
220 |
+
'product_id=entity_id',
|
221 |
+
null,
|
222 |
+
'left');
|
223 |
+
}
|
224 |
+
}
|
225 |
+
return parent::_addColumnFilterToCollection($column);
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
app/code/community/Imedia/FeaturedProduct/Block/Countdown/List.php
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Featured Product List block
|
4 |
+
*/
|
5 |
+
class Imedia_FeaturedProduct_Block_Countdown_List extends Mage_Core_Block_Template
|
6 |
+
{
|
7 |
+
|
8 |
+
}
|
9 |
+
|
app/code/community/Imedia/FeaturedProduct/Helper/Data.php
ADDED
@@ -0,0 +1,8 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Featured Product data helper
|
4 |
+
*/
|
5 |
+
class Imedia_FeaturedProduct_Helper_Data extends Mage_Core_Helper_Abstract
|
6 |
+
{
|
7 |
+
|
8 |
+
}
|
app/code/community/Imedia/FeaturedProduct/Model/Adminhtml/System/Config/Source/Position.php
ADDED
@@ -0,0 +1,23 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Featured products position source model
|
4 |
+
*/
|
5 |
+
class Imedia_FeaturedProduct_Model_Adminhtml_System_Config_Source_Position
|
6 |
+
{
|
7 |
+
public function toOptionArray($isMultiselect = false)
|
8 |
+
{
|
9 |
+
$options = array(
|
10 |
+
array('value'=>'home_page', 'label'=>Mage::helper('imedia_featuredproduct')->__('Home Page')),
|
11 |
+
array('value'=>'left_sidebar', 'label'=>Mage::helper('imedia_featuredproduct')->__('Left Sidebar')),
|
12 |
+
array('value'=>'right_sidebar', 'label'=>Mage::helper('imedia_featuredproduct')->__('Right Sidebar')),
|
13 |
+
array('value'=>'category_page', 'label'=>Mage::helper('imedia_featuredproduct')->__('Category Page')),
|
14 |
+
);
|
15 |
+
|
16 |
+
if(!$isMultiselect){
|
17 |
+
|
18 |
+
array_unshift($options, array('value'=>'', 'label'=>Mage::helper('imedia_featuredproduct')->__('--Please Select--')));
|
19 |
+
|
20 |
+
}
|
21 |
+
return $options;
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Imedia/FeaturedProduct/Model/Adminhtml/System/Config/Source/Sliderspeed.php
ADDED
@@ -0,0 +1,21 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Featured products position source model
|
4 |
+
*/
|
5 |
+
class Imedia_FeaturedProduct_Model_Adminhtml_System_Config_Source_sliderspeed
|
6 |
+
{
|
7 |
+
public function toOptionArray($isMultiselect = false)
|
8 |
+
{
|
9 |
+
$options = array(
|
10 |
+
array('value'=>'home_page', 'label'=>Mage::helper('imedia_featuredproduct')->__('true')),
|
11 |
+
array('value'=>'left_sidebar', 'label'=>Mage::helper('imedia_featuredproduct')->__('false')),
|
12 |
+
);
|
13 |
+
|
14 |
+
if(!$isMultiselect){
|
15 |
+
|
16 |
+
array_unshift($options, array('value'=>'', 'label'=>Mage::helper('imedia_featuredproduct')->__('--Please Select--')));
|
17 |
+
|
18 |
+
}
|
19 |
+
return $options;
|
20 |
+
}
|
21 |
+
}
|
app/code/community/Imedia/FeaturedProduct/Model/Observer.php
ADDED
@@ -0,0 +1,70 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Featured Product Observer
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
class Imedia_FeaturedProduct_Model_Observer
|
7 |
+
{
|
8 |
+
/**
|
9 |
+
* Stop default redirect and redirect to current url
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
public function stopRedirect(Varien_Event_Observer $observer){
|
13 |
+
//get the real referrer from server var
|
14 |
+
$referrer = Mage::app()->getRequest()->getServer('HTTP_REFERER');
|
15 |
+
if ($referrer){
|
16 |
+
//set your new redirect
|
17 |
+
Mage::app()->getResponse()->setRedirect($referrer);
|
18 |
+
}
|
19 |
+
return $this;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function catalog_product_save_after($observer)
|
23 |
+
{
|
24 |
+
$product = $observer->getProduct();
|
25 |
+
$name = $product->getName();
|
26 |
+
$sku = $product->getSku();
|
27 |
+
$featured = $product->getIsFeaturedProduct();
|
28 |
+
$collection2 = Mage::getModel('imedia_countdown/page');
|
29 |
+
if($featured==1 && $sku){
|
30 |
+
$collection123 = Mage::getModel('imedia_countdown/page')->getCollection();
|
31 |
+
$collection123->addFieldToFilter('sku',$sku);
|
32 |
+
$checksku = $collection123->getSize();
|
33 |
+
if($checksku == 0)
|
34 |
+
{
|
35 |
+
$data = array('product_name'=>$name,'sku'=>$sku);
|
36 |
+
$collection2->setData($data);
|
37 |
+
$collection2->save();
|
38 |
+
}
|
39 |
+
}
|
40 |
+
else{
|
41 |
+
$collection3 = Mage::getModel('imedia_countdown/page')->getCollection();
|
42 |
+
$collection3->addFieldToFilter('sku',$sku);
|
43 |
+
foreach ($collection3 as $productd)
|
44 |
+
{
|
45 |
+
$delid= $productd->getId().'</br>';
|
46 |
+
$collection2->setId($delid)->delete();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
public function catalog_product_delete_before($observer)
|
52 |
+
{
|
53 |
+
$product = $observer->getProduct();
|
54 |
+
$name = $product->getName();
|
55 |
+
$sku = $product->getSku();
|
56 |
+
$featured = $product->getIsFeaturedProduct();
|
57 |
+
$collection2 = Mage::getModel('imedia_countdown/page');
|
58 |
+
|
59 |
+
$collection3 = Mage::getModel('imedia_countdown/page')->getCollection();
|
60 |
+
$collection3->addFieldToFilter('sku',$sku);
|
61 |
+
foreach ($collection3 as $productd)
|
62 |
+
{
|
63 |
+
$delid= $productd->getId().'</br>';
|
64 |
+
$collection2->setId($delid)->delete();
|
65 |
+
}
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
}
|
app/code/community/Imedia/FeaturedProduct/Model/Resource/Setup.php
ADDED
@@ -0,0 +1,7 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FeaturedProduct Setup Resource class
|
4 |
+
*/
|
5 |
+
class Imedia_FeaturedProduct_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup
|
6 |
+
{
|
7 |
+
}
|
app/code/community/Imedia/FeaturedProduct/controllers/Adminhtml/FeaturedproductController.php
ADDED
@@ -0,0 +1,164 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin manage featured product controller
|
4 |
+
*/
|
5 |
+
class Imedia_FeaturedProduct_Adminhtml_FeaturedproductController extends Mage_Adminhtml_Controller_Action
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Init actions
|
9 |
+
*
|
10 |
+
*/
|
11 |
+
protected function _initAction()
|
12 |
+
{
|
13 |
+
// load layout, set active menu and breadcrumbs
|
14 |
+
$this->_title($this->__('Featured Product'));
|
15 |
+
|
16 |
+
$this->loadLayout()
|
17 |
+
->_setActiveMenu('catalog/featured_product')
|
18 |
+
->_addBreadcrumb(Mage::helper('imedia_featuredproduct')->__('Featured Product')
|
19 |
+
, Mage::helper('imedia_featuredproduct')->__('Featured Product'));
|
20 |
+
return $this;
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Index action method
|
25 |
+
*/
|
26 |
+
public function indexAction()
|
27 |
+
{
|
28 |
+
$this->_initAction();
|
29 |
+
$this->renderLayout();
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Used for Ajax Based Grid
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
public function gridAction()
|
37 |
+
{
|
38 |
+
$this->loadLayout();
|
39 |
+
$this->getResponse()->setBody(
|
40 |
+
$this->getLayout()->createBlock('imedia_featuredproduct/adminhtml_featuredproduct_grid')->toHtml()
|
41 |
+
);
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Unset featured product
|
46 |
+
*
|
47 |
+
*/
|
48 |
+
public function massUnsetFeaturedAction()
|
49 |
+
{
|
50 |
+
//get selected store ids
|
51 |
+
$productIds = (array)$this->getRequest()->getParam('product');
|
52 |
+
$storeId = (int)$this->getRequest()->getParam('store', 0);
|
53 |
+
|
54 |
+
$collectiontodel = Mage::getModel('imedia_countdown/page');
|
55 |
+
foreach($productIds as $product_current){
|
56 |
+
$collection1 = Mage::getModel('catalog/product')->load($product_current);
|
57 |
+
$sku = $collection1->getSku();
|
58 |
+
|
59 |
+
$collection3 = Mage::getModel('imedia_countdown/page')->getCollection();
|
60 |
+
$collection3->addFieldToFilter('sku',$sku);
|
61 |
+
foreach ($collection3 as $productd)
|
62 |
+
{
|
63 |
+
$delid= $productd->getId().'</br>';
|
64 |
+
$collectiontodel->setId($delid)->delete();
|
65 |
+
}
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
71 |
+
try {
|
72 |
+
$model = Mage::getModel('imedia_countdown/page');
|
73 |
+
$model->setId($this->getRequest()->getParam('id'))->delete();
|
74 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('imedia_countdown')->__('Countdown was successfully deleted'));
|
75 |
+
$this->_redirect('*/*/');
|
76 |
+
} catch (Exception $e) {
|
77 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
78 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
if (!is_array($productIds)) {
|
84 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select product(s)'));
|
85 |
+
} else{
|
86 |
+
try {
|
87 |
+
//$this->_validateMassStatus($productIds, $status);
|
88 |
+
Mage::getSingleton('catalog/product_action')
|
89 |
+
->updateAttributes($productIds, array('is_featured_product' => $isFeaturedProduct), $storeId);
|
90 |
+
|
91 |
+
$this->_getSession()->addSuccess(
|
92 |
+
$this->__('Total of %d record(s) have been updated.', count($productIds))
|
93 |
+
);
|
94 |
+
}
|
95 |
+
catch (Mage_Core_Model_Exception $e) {
|
96 |
+
$this->_getSession()->addError($e->getMessage());
|
97 |
+
} catch (Mage_Core_Exception $e) {
|
98 |
+
$this->_getSession()->addError($e->getMessage());
|
99 |
+
} catch (Exception $e) {
|
100 |
+
$this->_getSession()
|
101 |
+
->addException($e, $this->__('An error occurred while unmarking featued product(s).'));
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
$this->_redirect('*/page/index', array('store'=> $storeId));
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Set featured product
|
111 |
+
*
|
112 |
+
*/
|
113 |
+
public function massSetFeaturedAction()
|
114 |
+
{
|
115 |
+
//get selected store ids
|
116 |
+
$productIds = (array)$this->getRequest()->getParam('product');
|
117 |
+
$storeId = (int)$this->getRequest()->getParam('store', 0);
|
118 |
+
$collection2 = Mage::getModel('imedia_countdown/page');
|
119 |
+
|
120 |
+
|
121 |
+
foreach($productIds as $product_current){
|
122 |
+
|
123 |
+
$collection1 = Mage::getModel('catalog/product')->load($product_current);
|
124 |
+
$name = $collection1->getName();
|
125 |
+
$sku = $collection1->getSku();
|
126 |
+
|
127 |
+
$collection123 = Mage::getModel('imedia_countdown/page')->getCollection();
|
128 |
+
$collection123->addFieldToFilter('sku',$sku);
|
129 |
+
$checksku = $collection123->getSize();
|
130 |
+
if($checksku == 0)
|
131 |
+
{
|
132 |
+
$data = array('product_name'=>$name,'sku'=>$sku);
|
133 |
+
$collection2->setData($data);
|
134 |
+
$collection2->save();
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
|
139 |
+
$isFeaturedProduct = 1;
|
140 |
+
|
141 |
+
if (!is_array($productIds)) {
|
142 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select product(s)'));
|
143 |
+
} else{
|
144 |
+
try {
|
145 |
+
//$this->_validateMassStatus($productIds, $status);
|
146 |
+
Mage::getSingleton('catalog/product_action')
|
147 |
+
->updateAttributes($productIds, array('is_featured_product' => $isFeaturedProduct), $storeId);
|
148 |
+
|
149 |
+
$this->_getSession()->addSuccess(
|
150 |
+
$this->__('Total of %d record(s) have been updated.', count($productIds))
|
151 |
+
);
|
152 |
+
}
|
153 |
+
catch (Mage_Core_Model_Exception $e) {
|
154 |
+
$this->_getSession()->addError($e->getMessage());
|
155 |
+
} catch (Mage_Core_Exception $e) {
|
156 |
+
$this->_getSession()->addError($e->getMessage());
|
157 |
+
} catch (Exception $e) {
|
158 |
+
$this->_getSession()
|
159 |
+
->addException($e, $this->__('An error occurred while unmarking featured product(s).'));
|
160 |
+
}
|
161 |
+
}
|
162 |
+
$this->_redirect('*/page/index', array('store'=> $storeId));
|
163 |
+
}
|
164 |
+
}
|
app/code/community/Imedia/FeaturedProduct/controllers/IndexController.php
ADDED
@@ -0,0 +1,12 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Imedia_FeaturedProduct_IndexController extends Mage_Core_Controller_Front_Action
|
4 |
+
{
|
5 |
+
function indexAction()
|
6 |
+
{
|
7 |
+
$this->loadLayout();
|
8 |
+
$this->renderLayout();
|
9 |
+
}
|
10 |
+
|
11 |
+
|
12 |
+
}
|
app/code/community/Imedia/FeaturedProduct/etc/adminhtml.xml
ADDED
@@ -0,0 +1,50 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<imedia_countdown_page>
|
5 |
+
<title>IFPC Slider</title>
|
6 |
+
<sort_order>9999</sort_order>
|
7 |
+
<children>
|
8 |
+
<featured_product translate="title" module="imedia_featuredproduct">
|
9 |
+
<title>Manage Featured Products</title>
|
10 |
+
<sort_order>200</sort_order>
|
11 |
+
<action>adminhtml/featuredproduct</action>
|
12 |
+
</featured_product>
|
13 |
+
</children>
|
14 |
+
</imedia_countdown_page>
|
15 |
+
</menu>
|
16 |
+
|
17 |
+
<!-- Access permissions -->
|
18 |
+
<acl>
|
19 |
+
<resources>
|
20 |
+
<all>
|
21 |
+
<title>Allow Everything</title>
|
22 |
+
</all>
|
23 |
+
<admin>
|
24 |
+
<children>
|
25 |
+
<catalog>
|
26 |
+
<children>
|
27 |
+
<featured_product translate="title" module="imedia_featuredproduct">
|
28 |
+
<title>Manage Featured Products</title>
|
29 |
+
<sort_order>31</sort_order>
|
30 |
+
</featured_product>
|
31 |
+
</children>
|
32 |
+
</catalog>
|
33 |
+
|
34 |
+
<system>
|
35 |
+
<children>
|
36 |
+
<config>
|
37 |
+
<children>
|
38 |
+
<featuredproduct translate="title" module="imedia_featuredproduct">
|
39 |
+
<title>Featured Product</title>
|
40 |
+
</featuredproduct>
|
41 |
+
</children>
|
42 |
+
</config>
|
43 |
+
</children>
|
44 |
+
</system>
|
45 |
+
|
46 |
+
</children>
|
47 |
+
</admin>
|
48 |
+
</resources>
|
49 |
+
</acl>
|
50 |
+
</config>
|
app/code/community/Imedia/FeaturedProduct/etc/config.xml
ADDED
@@ -0,0 +1,121 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Imedia_FeaturedProduct>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Imedia_FeaturedProduct>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<default>
|
10 |
+
<featuredproduct>
|
11 |
+
<display>
|
12 |
+
<jquery>1</jquery>
|
13 |
+
</display>
|
14 |
+
</featuredproduct>
|
15 |
+
</default>
|
16 |
+
|
17 |
+
<frontend>
|
18 |
+
<routers>
|
19 |
+
<imedia_featuredproduct>
|
20 |
+
<use>standard</use>
|
21 |
+
<args>
|
22 |
+
<module>Imedia_FeaturedProduct</module>
|
23 |
+
<frontName>featuredproduct</frontName>
|
24 |
+
</args>
|
25 |
+
</imedia_featuredproduct>
|
26 |
+
</routers>
|
27 |
+
<!-- set frontend layout file-->
|
28 |
+
<layout>
|
29 |
+
<updates>
|
30 |
+
<imedia_featuredproduct>
|
31 |
+
<file>imedia/imedia_featuredproduct.xml</file>
|
32 |
+
</imedia_featuredproduct>
|
33 |
+
</updates>
|
34 |
+
</layout>
|
35 |
+
</frontend>
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
<global>
|
40 |
+
|
41 |
+
<!--set events-->
|
42 |
+
<events>
|
43 |
+
<catalog_product_save_after>
|
44 |
+
<observers>
|
45 |
+
<imedia_featuredproduct_model_observer>
|
46 |
+
<type>singleton</type>
|
47 |
+
<class>imedia_featuredproduct/observer</class>
|
48 |
+
<method>catalog_product_save_after</method>
|
49 |
+
</imedia_featuredproduct_model_observer>
|
50 |
+
</observers>
|
51 |
+
</catalog_product_save_after>
|
52 |
+
|
53 |
+
<catalog_product_delete_before>
|
54 |
+
<observers>
|
55 |
+
<imedia_featuredproduct_model_observer>
|
56 |
+
<type>singleton</type>
|
57 |
+
<class>imedia_featuredproduct/observer</class>
|
58 |
+
<method>catalog_product_delete_before</method>
|
59 |
+
</imedia_featuredproduct_model_observer>
|
60 |
+
</observers>
|
61 |
+
</catalog_product_delete_before>
|
62 |
+
|
63 |
+
</events>
|
64 |
+
|
65 |
+
<models>
|
66 |
+
<imedia_featuredproduct>
|
67 |
+
<class>Imedia_FeaturedProduct_Model</class>
|
68 |
+
<resourceModel>featuredproduct_resource</resourceModel>
|
69 |
+
</imedia_featuredproduct>
|
70 |
+
<featuredproduct_resource>
|
71 |
+
<class>Imedia_FeaturedProduct_Model_Resource</class>
|
72 |
+
</featuredproduct_resource>
|
73 |
+
</models>
|
74 |
+
|
75 |
+
<helpers>
|
76 |
+
<imedia_featuredproduct>
|
77 |
+
<class>Imedia_FeaturedProduct_Helper</class>
|
78 |
+
</imedia_featuredproduct>
|
79 |
+
</helpers>
|
80 |
+
|
81 |
+
<blocks>
|
82 |
+
<imedia_featuredproduct>
|
83 |
+
<class>Imedia_FeaturedProduct_Block</class>
|
84 |
+
</imedia_featuredproduct>
|
85 |
+
</blocks>
|
86 |
+
<!-- Setup Resource -->
|
87 |
+
<resources>
|
88 |
+
<imedia_featuredproduct_setup>
|
89 |
+
<setup>
|
90 |
+
<module>Imedia_FeaturedProduct</module>
|
91 |
+
<class>Imedia_FeaturedProduct_Model_Resource_Setup</class>
|
92 |
+
</setup>
|
93 |
+
</imedia_featuredproduct_setup>
|
94 |
+
</resources>
|
95 |
+
|
96 |
+
</global>
|
97 |
+
|
98 |
+
<!-- Adminhtml layout xml configuration -->
|
99 |
+
<adminhtml>
|
100 |
+
<layout>
|
101 |
+
<updates>
|
102 |
+
<imedia_featuredproduct>
|
103 |
+
<file>imedia/imedia_featuredproduct.xml</file>
|
104 |
+
</imedia_featuredproduct>
|
105 |
+
</updates>
|
106 |
+
</layout>
|
107 |
+
</adminhtml>
|
108 |
+
|
109 |
+
<!-- Admin router configuration-->
|
110 |
+
<admin>
|
111 |
+
<routers>
|
112 |
+
<adminhtml>
|
113 |
+
<args>
|
114 |
+
<modules>
|
115 |
+
<Imedia_FeaturedProduct after="Mage_Adminhtml">Imedia_FeaturedProduct_Adminhtml</Imedia_FeaturedProduct>
|
116 |
+
</modules>
|
117 |
+
</args>
|
118 |
+
</adminhtml>
|
119 |
+
</routers>
|
120 |
+
</admin>
|
121 |
+
</config>
|
app/code/community/Imedia/FeaturedProduct/etc/system.xml
ADDED
@@ -0,0 +1,113 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" ?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* System configuration file
|
5 |
+
*/
|
6 |
+
-->
|
7 |
+
<config>
|
8 |
+
|
9 |
+
<tabs>
|
10 |
+
<imedia translate="label" module="imedia_featuredproduct">
|
11 |
+
<label>iMedia</label>
|
12 |
+
<sort_order>10</sort_order>
|
13 |
+
</imedia>
|
14 |
+
</tabs>
|
15 |
+
|
16 |
+
|
17 |
+
<sections>
|
18 |
+
<featuredproduct translate="label" module="imedia_featuredproduct">
|
19 |
+
<class>separator-top</class>
|
20 |
+
<label>Featured Product</label>
|
21 |
+
<tab>imedia</tab>
|
22 |
+
<frontend_type>text</frontend_type>
|
23 |
+
<sort_order>12</sort_order>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>1</show_in_website>
|
26 |
+
<show_in_store>1</show_in_store>
|
27 |
+
|
28 |
+
<groups>
|
29 |
+
<featuredproduct translate="label">
|
30 |
+
<label>Featured Product</label>
|
31 |
+
<frontend_type>text</frontend_type>
|
32 |
+
<sort_order>1</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
<fields>
|
37 |
+
<enabled translate="label">
|
38 |
+
<label>Enable Featured Product</label>
|
39 |
+
<frontend_type>select</frontend_type>
|
40 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
41 |
+
<sort_order>1</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>1</show_in_store>
|
45 |
+
</enabled>
|
46 |
+
</fields>
|
47 |
+
</featuredproduct>
|
48 |
+
<display translate="label">
|
49 |
+
<label>Display Options</label>
|
50 |
+
<frontend_type>text</frontend_type>
|
51 |
+
<sort_order>2</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>1</show_in_store>
|
55 |
+
<fields>
|
56 |
+
<jquery translate="label">
|
57 |
+
<label>Include jQuery</label>
|
58 |
+
<frontend_type>select</frontend_type>
|
59 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
60 |
+
<sort_order>1</sort_order>
|
61 |
+
<comment>set no if jquery already included</comment>
|
62 |
+
<show_in_default>1</show_in_default>
|
63 |
+
<show_in_website>1</show_in_website>
|
64 |
+
<show_in_store>1</show_in_store>
|
65 |
+
</jquery>
|
66 |
+
<title translate="label">
|
67 |
+
<label>Block Title</label>
|
68 |
+
<frontend_type>text</frontend_type>
|
69 |
+
<validate>required-entry</validate>
|
70 |
+
<sort_order>2</sort_order>
|
71 |
+
<show_in_default>1</show_in_default>
|
72 |
+
<show_in_website>1</show_in_website>
|
73 |
+
<show_in_store>1</show_in_store>
|
74 |
+
</title>
|
75 |
+
<number_of_products_slide translate="label">
|
76 |
+
<label>Number of Products to show in slider</label>
|
77 |
+
<frontend_type>text</frontend_type>
|
78 |
+
<validate>required-entry validate-digits</validate>
|
79 |
+
<sort_order>3</sort_order>
|
80 |
+
<show_in_default>1</show_in_default>
|
81 |
+
<show_in_website>1</show_in_website>
|
82 |
+
<show_in_store>1</show_in_store>
|
83 |
+
<comment>Empty value is the same as default 4.</comment>
|
84 |
+
</number_of_products_slide>
|
85 |
+
|
86 |
+
<slider_autoplay translate="label">
|
87 |
+
<label>Auto Play Slider</label>
|
88 |
+
<frontend_type>select</frontend_type>
|
89 |
+
<source_model>imedia_featuredproduct/adminhtml_system_config_source_sliderspeed</source_model>
|
90 |
+
<validate>validate-select</validate>
|
91 |
+
<sort_order>4</sort_order>
|
92 |
+
<show_in_default>1</show_in_default>
|
93 |
+
<show_in_website>1</show_in_website>
|
94 |
+
<show_in_store>1</show_in_store>
|
95 |
+
</slider_autoplay>
|
96 |
+
|
97 |
+
<slider_speed translate="label">
|
98 |
+
<label>Slide Speed</label>
|
99 |
+
<frontend_type>text</frontend_type>
|
100 |
+
<validate>required-entry validate-digits</validate>
|
101 |
+
<sort_order>5</sort_order>
|
102 |
+
<show_in_default>1</show_in_default>
|
103 |
+
<show_in_website>1</show_in_website>
|
104 |
+
<show_in_store>1</show_in_store>
|
105 |
+
<comment>Milli-seconds</comment>
|
106 |
+
</slider_speed>
|
107 |
+
</fields>
|
108 |
+
</display>
|
109 |
+
</groups>
|
110 |
+
|
111 |
+
</featuredproduct>
|
112 |
+
</sections>
|
113 |
+
</config>
|
app/code/community/Imedia/FeaturedProduct/sql/imedia_featuredproduct_setup/install-0.1.0.php
ADDED
@@ -0,0 +1,28 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FeaturedProduct Setup class
|
4 |
+
*/
|
5 |
+
$installer = $this;
|
6 |
+
/* @var $installer Imedia_FeaturedProduct_Model_Resource_Setup */
|
7 |
+
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'is_featured_product', array(
|
8 |
+
'group' => 'General',
|
9 |
+
'type' => 'int',
|
10 |
+
'backend' => '',
|
11 |
+
'frontend' => '',
|
12 |
+
'label' => 'Is Featured Product',
|
13 |
+
'input' => 'boolean',
|
14 |
+
'class' => '',
|
15 |
+
'source' => '',
|
16 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
17 |
+
'visible' => true,
|
18 |
+
'required' => false,
|
19 |
+
'default' => 0,
|
20 |
+
'user_defined' => true,
|
21 |
+
'searchable' => false,
|
22 |
+
'filterable' => false,
|
23 |
+
'comparable' => false,
|
24 |
+
'visible_on_front' => false,
|
25 |
+
'unique' => false,
|
26 |
+
'apply_to' => 0, //0 For All Product Types
|
27 |
+
'is_configurable' => false,
|
28 |
+
));
|
app/design/adminhtml/default/default/layout/imedia/countdown.xml
ADDED
@@ -0,0 +1,15 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" ?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<adminhtml_page_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="imedia_countdown/adminhtml_page" name="imedia_countdown_page" />
|
6 |
+
</reference>
|
7 |
+
</adminhtml_page_index>
|
8 |
+
|
9 |
+
<adminhtml_featuredproduct_index>
|
10 |
+
<reference name="content">
|
11 |
+
<block type="imedia_countdown/adminhtml_featuredproduct" name="imedia_countdown_featuredproduct" />
|
12 |
+
</reference>
|
13 |
+
</adminhtml_featuredproduct_index>
|
14 |
+
|
15 |
+
</layout>
|
app/design/adminhtml/default/default/layout/imedia/imedia_featuredproduct.xml
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" ?>
|
2 |
+
|
3 |
+
<layout version="0.1.0">
|
4 |
+
<adminhtml_featuredproduct_index>
|
5 |
+
<reference name="content">
|
6 |
+
<block type="imedia_featuredproduct/adminhtml_featuredproduct" name="featuredproductr.grid.container" />
|
7 |
+
</reference>
|
8 |
+
</adminhtml_featuredproduct_index>
|
9 |
+
</layout>
|
app/design/frontend/base/default/layout/imedia/imedia_featuredproduct.xml
ADDED
@@ -0,0 +1,46 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Featured product frontend layout file
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
-->
|
8 |
+
<layout version="0.1.0">
|
9 |
+
<!-- <default>
|
10 |
+
<reference name="head">
|
11 |
+
<action method="addCss"><stylesheet>css/imedia_countdown/flexisel-style.css</stylesheet></action>
|
12 |
+
<action method="addCss"><stylesheet>css/imedia_countdown/owl.carousel.css</stylesheet></action>
|
13 |
+
<action method="addCss"><stylesheet>css/imedia_countdown/owl.theme.css</stylesheet></action>
|
14 |
+
|
15 |
+
<action method="addItem" ifconfig="featuredproduct/display/jquery" ><type>skin_js</type><name>js/imedia_countdown/jquery-1.9.1.min.js</name></action>
|
16 |
+
<action method="addItem"><type>skin_js</type><name>js/imedia_countdown/owl.carousel.js</name></action>
|
17 |
+
<action method="addItem"><type>skin_js</type><name>js/imedia_countdown/countdown.js</name></action>
|
18 |
+
</reference>
|
19 |
+
|
20 |
+
</default> -->
|
21 |
+
<!-- stand alone -->
|
22 |
+
<imedia_featuredproduct_index_index>
|
23 |
+
<reference name="content">
|
24 |
+
<block type="imedia_featuredproduct/countdown_list" name="imediafeatured" template="imedia/countdownslider.phtml" />
|
25 |
+
</reference>
|
26 |
+
</imedia_featuredproduct_index_index>
|
27 |
+
<!-- stand alone -->
|
28 |
+
|
29 |
+
<!-- <cms_index_index>
|
30 |
+
<reference name="head">
|
31 |
+
<action method="addCss"><stylesheet>css/imedia_countdown/flexisel-style.css</stylesheet></action>
|
32 |
+
<action method="addCss"><stylesheet>css/imedia_countdown/owl.carousel.css</stylesheet></action>
|
33 |
+
<action method="addCss"><stylesheet>css/imedia_countdown/owl.theme.css</stylesheet></action>
|
34 |
+
|
35 |
+
<action method="addItem" ifconfig="featuredproduct/display/jquery" ><type>skin_js</type><name>js/imedia_countdown/jquery-1.9.1.min.js</name></action>
|
36 |
+
<action method="addItem"><type>skin_js</type><name>js/imedia_countdown/owl.carousel.js</name></action>
|
37 |
+
<action method="addItem"><type>skin_js</type><name>js/imedia_countdown/countdown.js</name></action>
|
38 |
+
</reference>
|
39 |
+
|
40 |
+
<reference name="content">
|
41 |
+
<block type="imedia_featuredproduct/countdown_list" name="imediafeatured" template="imedia/countdownslider.phtml" />
|
42 |
+
</reference>
|
43 |
+
</cms_index_index> -->
|
44 |
+
|
45 |
+
</layout>
|
46 |
+
|
app/design/frontend/base/default/template/imedia/countdownslider.phtml
ADDED
@@ -0,0 +1,178 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php
|
29 |
+
$title = Mage::getStoreConfig('featuredproduct/display/title');
|
30 |
+
$no_product_slide = Mage::getStoreConfig('featuredproduct/display/number_of_products_slide');
|
31 |
+
$slidespeed = Mage::getStoreConfig('featuredproduct/display/slider_speed');
|
32 |
+
?>
|
33 |
+
|
34 |
+
<?php
|
35 |
+
$include_jquery = Mage::getStoreConfig('featuredproduct/display/jquery');
|
36 |
+
|
37 |
+
?>
|
38 |
+
<link rel="stylesheet" href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>frontend/base/default/css/imedia_countdown/owl.carousel.css" type="text/css" />
|
39 |
+
|
40 |
+
<link rel="stylesheet" href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>frontend/base/default/css/imedia_countdown/owl.theme.css" type="text/css" />
|
41 |
+
|
42 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>frontend/base/default/js/imedia_countdown/jquery-1.9.1.min.js"></script>
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>frontend/base/default/js/imedia_countdown/owl.carousel.js"></script>
|
47 |
+
|
48 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>frontend/base/default/js/imedia_countdown/countdown.js"></script>
|
49 |
+
<script>jQuery.noConflict();</script>
|
50 |
+
|
51 |
+
<script>
|
52 |
+
jQuery(document).ready(function($) {
|
53 |
+
$("#owl-demo").owlCarousel({
|
54 |
+
|
55 |
+
autoPlay: <?php echo $slidespeed; ?>, //Set AutoPlay to 3 seconds
|
56 |
+
items : <?php echo $no_product_slide; ?>,
|
57 |
+
itemsDesktop : [1199,3],
|
58 |
+
itemsDesktopSmall : [979,3],
|
59 |
+
navigation : true,
|
60 |
+
navigationText : ["<",">"],
|
61 |
+
pagination :false,
|
62 |
+
stopOnHover : true
|
63 |
+
});
|
64 |
+
|
65 |
+
});
|
66 |
+
</script>
|
67 |
+
|
68 |
+
<?php
|
69 |
+
$current_time = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time()));
|
70 |
+
?>
|
71 |
+
|
72 |
+
|
73 |
+
<?php
|
74 |
+
$collection1 = Mage::getModel('imedia_countdown/page')->getCollection()
|
75 |
+
->addfieldtofilter('start_time',
|
76 |
+
array(
|
77 |
+
array('to' => $current_time),
|
78 |
+
array($current_time)))
|
79 |
+
->addfieldtofilter('end_time',
|
80 |
+
array(
|
81 |
+
array('gteq' => $current_time),
|
82 |
+
array($current_time))
|
83 |
+
);
|
84 |
+
|
85 |
+
//echo $collection1->getSelect();
|
86 |
+
|
87 |
+
?>
|
88 |
+
<?php
|
89 |
+
if(count($collection1)):
|
90 |
+
?>
|
91 |
+
<div class="product-carozal">
|
92 |
+
<div class="product-carozal-head"><?php echo $title; ?></div>
|
93 |
+
<div id="owl-demo">
|
94 |
+
|
95 |
+
<?php
|
96 |
+
$i = 0;
|
97 |
+
foreach($collection1 as $product_catalog){
|
98 |
+
$sku = $product_catalog->getSku();
|
99 |
+
$start = $product_catalog->getStart_time();
|
100 |
+
$end_time = $product_catalog->getEnd_time();
|
101 |
+
$status = $product_catalog->getStatus();
|
102 |
+
$date = strtotime($end_time);
|
103 |
+
if($status == 1){
|
104 |
+
|
105 |
+
$collection = Mage::getResourceModel('catalog/product_collection')->addFieldToFilter('sku',$sku)->addAttributeToSelect('*');
|
106 |
+
?>
|
107 |
+
|
108 |
+
<?php foreach($collection as $_item) { ?>
|
109 |
+
|
110 |
+
<div class="item count_<?php echo $sku; ?>">
|
111 |
+
|
112 |
+
<?php
|
113 |
+
$v=$date- strtotime($current_time);
|
114 |
+
?>
|
115 |
+
|
116 |
+
<script type="application/javascript">
|
117 |
+
function count_<?php echo $i; ?>(result) {
|
118 |
+
//alert('<?php echo $i; ?>');
|
119 |
+
location.reload();
|
120 |
+
}
|
121 |
+
</script>
|
122 |
+
|
123 |
+
<div class="product-main-carozal">
|
124 |
+
<div class="pro-img-con"><a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_item, 'small_image'), null, true) ?>"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->keepFrame(true)->resize(200) ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_item, 'small_image'), null, true) ?>" /></a></div>
|
125 |
+
<div class="abuot-pro-con"><a href="javascript:void(0);"><?php echo $this->htmlEscape( $_item->getName() ); ?></a><span>SkU: <?php echo $sku; ?><span></div>
|
126 |
+
<div class="mycount"><script>
|
127 |
+
|
128 |
+
var test_<?php echo $i; ?> = new Countdown({
|
129 |
+
time:<?php echo $v; ?>,
|
130 |
+
//year : <?php echo date('Y', $date); ?>,
|
131 |
+
//month : <?php echo date('m', $date); ?>,
|
132 |
+
//day : <?php echo date('d', $date); ?>,
|
133 |
+
//hour : <?php echo date('H', $date); ?>,
|
134 |
+
//ampm : "am",
|
135 |
+
//minute : <?php echo date('i', $date); ?>,
|
136 |
+
//second : <?php echo date('s', $date); ?>,
|
137 |
+
rangeHi : "day",
|
138 |
+
onComplete : count_<?php echo $i; ?>,
|
139 |
+
width : 70,
|
140 |
+
height : 45,
|
141 |
+
hideLine : true,
|
142 |
+
padding : 0.4,
|
143 |
+
hideLabels : true,
|
144 |
+
numbers : {
|
145 |
+
font : "Arial",
|
146 |
+
color : "#ffffff",
|
147 |
+
bkgd : "#000000",
|
148 |
+
rounded : 0.15, // percentage of size
|
149 |
+
shadow : {
|
150 |
+
x : 0, // x offset (in pixels)
|
151 |
+
y : 0, // y offset (in pixels)
|
152 |
+
s : 0, // spread
|
153 |
+
c : "#ffffff", // color
|
154 |
+
a : 0 // alpha // <- no comma on last item!
|
155 |
+
}
|
156 |
+
},
|
157 |
+
labels : {
|
158 |
+
textScale : 0.8,
|
159 |
+
offset : 5
|
160 |
+
} // <- no comma on last item!
|
161 |
+
});
|
162 |
+
|
163 |
+
|
164 |
+
</script></div>
|
165 |
+
<div class="clear"></div>
|
166 |
+
</div>
|
167 |
+
</div>
|
168 |
+
<?php } } ?>
|
169 |
+
<?php $i = $i + 1; ?>
|
170 |
+
<?php } ?>
|
171 |
+
</div>
|
172 |
+
</div>
|
173 |
+
<?php endif;?>
|
174 |
+
|
175 |
+
|
176 |
+
|
177 |
+
|
178 |
+
|
app/etc/modules/Imedia_Countdown.xml
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Imedia_Countdown>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Imedia_Countdown>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/etc/modules/Imedia_FeaturedProduct.xml
ADDED
@@ -0,0 +1,13 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<modules>
|
5 |
+
<Imedia_FeaturedProduct>
|
6 |
+
<active>true</active>
|
7 |
+
<codePool>community</codePool>
|
8 |
+
<!-- <depends>
|
9 |
+
<Mage_Catalog/>
|
10 |
+
</depends> -->
|
11 |
+
</Imedia_FeaturedProduct>
|
12 |
+
</modules>
|
13 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>IFPC_Slider</name>
|
4 |
+
<version>1.0.0.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSLv3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>iMedia Featured Product Countdown Slider</summary>
|
10 |
+
<description>Product countdown with timer, Product automatically removes from slider after time ups.</description>
|
11 |
+
<notes>First Preview release</notes>
|
12 |
+
<authors><author><name>iMedia inc.</name><user>imedia</user><email>sachin@imediadesigns.org</email></author></authors>
|
13 |
+
<date>2015-07-07</date>
|
14 |
+
<time>06:38:13</time>
|
15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Imedia_Countdown.xml" hash="a855c8d5c06c71c3e1076969a008d537"/><file name="Imedia_FeaturedProduct.xml" hash="dc161bf23a3109cd242160d33c2be7da"/></dir></target><target name="magecommunity"><dir name="Imedia"><dir name="Countdown"><dir name="Block"><dir name="Adminhtml"><dir name="Page"><dir name="Edit"><file name="Form.php" hash="6f164615f578ef9d531ddfed4f12229a"/><file name="Tab.php" hash="a48f5e51ce49a56ce1513fffea3c6137"/></dir><file name="Edit.php" hash="84ee62871943a1ea922b5c067eb2d3b1"/><file name="Grid.php" hash="5bf0a5b544c77fcbf548e8781f117597"/></dir><file name="Page.php" hash="ff42d0d017a6951218fe760b2eaa39c4"/></dir></dir><dir name="Helper"><file name="Data.php" hash="e2172b71c0828258058a0372a418a529"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Page"><file name="Collection.php" hash="e65239cbd03c4e816c45fdb04ce55a29"/></dir><file name="Page.php" hash="a883c323cd7fec32d08de02af9354028"/></dir><file name="Page.php" hash="2cce87c4fb30f2a4226fdbfe23fe768f"/><file name="Status.php" hash="481558029d19ec0c0dfad9bbf15eb1f7"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PageController.php" hash="9314318c8ef4c1a05204546054aa4829"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="07a43d36cc8aa60b18276a53c0f4c9b4"/><file name="config.xml" hash="71bdf16530c4c629ba0f6cfba1d8de67"/></dir><dir name="sql"><dir name="imedia_countdown_setup"><file name="mysql4-install-0.0.1.php" hash="b4c18116b04ce52b21f5612231a4f108"/></dir></dir></dir><dir name="FeaturedProduct"><dir name="Block"><dir name="Adminhtml"><dir name="Featuredproduct"><file name="Grid.php" hash="3130e8c65e472cad44436a8f142735d3"/></dir><file name="Featuredproduct.php" hash="1a743cdc647a89328a4889b0fcb2d494"/></dir><dir name="Countdown"><file name="List.php" hash="f8ca080ec023f23cc4fe14ec6c4f7141"/></dir></dir><dir name="Helper"><file name="Data.php" hash="fc47529ed44bdd678d273e78b1e70ba7"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Position.php" hash="f0ec72919d61f09646d2b188d1778895"/><file name="Sliderspeed.php" hash="7404780fe02264115093ff3228d4d72a"/></dir></dir></dir></dir><file name="Observer.php" hash="e6eb62c588a9e0116b1b1e1655966eb0"/><dir name="Resource"><file name="Setup.php" hash="5e491380cdfe5929ce2cfece7d79fe95"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="FeaturedproductController.php" hash="a555cc5db262af33eabb9dde27288bf4"/></dir><file name="IndexController.php" hash="44e93c4a1d76a687f5f1ed0b9089c0f6"/></dir><dir name="etc"><file name="adminhtml.xml" hash="cbc23ed6fa4bc921db33e12936e30730"/><file name="config.xml" hash="5d2e2298b4d2a75888e56405ffc15be4"/><file name="system.xml" hash="a445e06581f3a59484cba5167c809b9a"/></dir><dir name="sql"><dir name="imedia_featuredproduct_setup"><file name="install-0.1.0.php" hash="05c8e3e0ea09338e619341a4352be31e"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="imedia"><file name="imedia_featuredproduct.xml" hash="d30f1c6b37f16e2bb9f14ef1a3e6273b"/></dir></dir><dir name="template"><dir name="imedia"><file name="countdownslider.phtml" hash="97e04cbe7ba7b5626227b27e66c722c6"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="imedia"><file name="countdown.xml" hash="9e17478e9be99b321b28e5ce8d422ed9"/><file name="imedia_featuredproduct.xml" hash="9111eaf901b86886ff0ba6151534a98a"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="imedia_countdown"><file name="owl.carousel.css" hash="e01dd65db1c0325862aeff8c0b497a86"/><file name="owl.theme.css" hash="f23cf727e4fcca9a5470658da5e755c9"/></dir></dir><dir name="js"><dir name="imedia_countdown"><file name="AjaxLoader.gif" hash="5b8b06c052cac80413d62e5c45f9f37b"/><file name="countdown.js" hash="f59007044d48531ed1ecf468d1fc5266"/><file name="grabbing.png" hash="d817e1dba5bd5d891d0504bf1715807b"/><file name="jquery-1.9.1.min.js" hash="397754ba49e9e0cf4e7c190da78dda05"/><file name="owl.carousel.js" hash="a5f96c62d75be144282ef6cc429a6259"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/frontend/base/default/css/imedia_countdown/owl.carousel.css
ADDED
@@ -0,0 +1,118 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* Core Owl Carousel CSS File
|
3 |
+
* v1.3.3
|
4 |
+
*/
|
5 |
+
|
6 |
+
/* clearfix */
|
7 |
+
.owl-carousel .owl-wrapper:after {
|
8 |
+
content: ".";
|
9 |
+
display: block;
|
10 |
+
clear: both;
|
11 |
+
visibility: hidden;
|
12 |
+
line-height: 0;
|
13 |
+
height: 0;
|
14 |
+
}
|
15 |
+
/* display none until init */
|
16 |
+
.owl-carousel{
|
17 |
+
display: none;
|
18 |
+
position: relative;
|
19 |
+
width: 100%;
|
20 |
+
-ms-touch-action: pan-y;
|
21 |
+
}
|
22 |
+
.owl-carousel .owl-wrapper{
|
23 |
+
display: none;
|
24 |
+
position: relative;
|
25 |
+
-webkit-transform: translate3d(0px, 0px, 0px);
|
26 |
+
}
|
27 |
+
.owl-carousel .owl-wrapper-outer{
|
28 |
+
overflow: hidden;
|
29 |
+
position: relative;
|
30 |
+
width: 100%;
|
31 |
+
}
|
32 |
+
.owl-carousel .owl-wrapper-outer.autoHeight{
|
33 |
+
-webkit-transition: height 500ms ease-in-out;
|
34 |
+
-moz-transition: height 500ms ease-in-out;
|
35 |
+
-ms-transition: height 500ms ease-in-out;
|
36 |
+
-o-transition: height 500ms ease-in-out;
|
37 |
+
transition: height 500ms ease-in-out;
|
38 |
+
}
|
39 |
+
|
40 |
+
.owl-carousel .owl-item{
|
41 |
+
float: left;
|
42 |
+
}
|
43 |
+
.owl-controls .owl-page,
|
44 |
+
.owl-controls .owl-buttons div{
|
45 |
+
cursor: pointer;
|
46 |
+
}
|
47 |
+
.owl-controls {
|
48 |
+
-webkit-user-select: none;
|
49 |
+
-khtml-user-select: none;
|
50 |
+
-moz-user-select: none;
|
51 |
+
-ms-user-select: none;
|
52 |
+
user-select: none;
|
53 |
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
54 |
+
}
|
55 |
+
|
56 |
+
/* mouse grab icon */
|
57 |
+
.grabbing {
|
58 |
+
cursor:url(grabbing.png) 8 8, move;
|
59 |
+
}
|
60 |
+
|
61 |
+
/* fix */
|
62 |
+
.owl-carousel .owl-wrapper,
|
63 |
+
.owl-carousel .owl-item{
|
64 |
+
-webkit-backface-visibility: hidden;
|
65 |
+
-moz-backface-visibility: hidden;
|
66 |
+
-ms-backface-visibility: hidden;
|
67 |
+
-webkit-transform: translate3d(0,0,0);
|
68 |
+
-moz-transform: translate3d(0,0,0);
|
69 |
+
-ms-transform: translate3d(0,0,0);
|
70 |
+
}
|
71 |
+
|
72 |
+
/* custom*/
|
73 |
+
|
74 |
+
#owl-demo .item{
|
75 |
+
margin: 3px;
|
76 |
+
}
|
77 |
+
#owl-demo .item img{
|
78 |
+
display: block;
|
79 |
+
width: 100%;
|
80 |
+
height: auto;
|
81 |
+
}
|
82 |
+
.owl-theme .owl-controls{position: absolute;
|
83 |
+
top: 134px;
|
84 |
+
width: 100%;}
|
85 |
+
.owl-theme .owl-controls .owl-buttons .owl-prev { float:left;}
|
86 |
+
.owl-theme .owl-controls .owl-buttons .owl-next { float:right;}
|
87 |
+
.mycount{}
|
88 |
+
|
89 |
+
|
90 |
+
.product-carozal{ clear:both; margin:40px 0px 20px; padding:0px;}
|
91 |
+
.product-carozal li{list-style:none;}
|
92 |
+
.product-carozal-head{clear:both; margin:0px 0 20px; padding:0px; font-size:14px; color:#555; text-transform:uppercase; text-align:center; font-weight:bold;}
|
93 |
+
|
94 |
+
.oneFifth{width:20%; float:left; margin:0px; padding:0px 0px;}
|
95 |
+
.carousel-control.left {
|
96 |
+
background-image:none;
|
97 |
+
background-repeat: repeat-x;
|
98 |
+
}
|
99 |
+
.carousel-control.right {
|
100 |
+
background-image:none;
|
101 |
+
background-repeat: repeat-x;
|
102 |
+
}
|
103 |
+
|
104 |
+
.product-main-carozal{ clear:both; margin:0px; padding:0px;}
|
105 |
+
.product-main-carozal .pro-img-con{ clear:both; text-align:center; margin:0px 0px 10px; padding:0px; /*border:1px solid #c9c9c9;*/}
|
106 |
+
.product-main-carozal .pro-img-con img{ width:100%; margin:0px; padding:0px; transition: all 1s ease 0s;}
|
107 |
+
.product-main-carozal .pro-img-con img:hover{ opacity:0.8;}
|
108 |
+
.product-main-carozal .abuot-pro-con{ clear:both; height:50px; line-height:16px; margin:0px 15px 3px; padding:9px 0 0; /*border-bottom:1px solid #bfbfbf;*/ text-align:center; border-top:1px solid #bfbfbf;}
|
109 |
+
.product-main-carozal .abuot-pro-con a{display:block; margin:0px; padding:0px 0px 0px; font-size:12px; color:#000; font-weight:600; text-decoration:none; text-transform:uppercase;}
|
110 |
+
.product-main-carozal .abuot-pro-con a:hover{color:#999; text-decoration:none;}
|
111 |
+
.product-main-carozal .abuot-pro-con span{ display:block; text-align:center; line-height:14px; margin:0px; font-weight:600; padding:0px; font-size:8px; color:#000; text-transform:uppercase;}
|
112 |
+
.product-main-carozal .pro-price-con{clear:both; height:50px; margin:0px; line-height:16px; padding:0px; font-size:18px; color:#000; font-weight:700; text-decoration:none; text-align:center;}
|
113 |
+
.product-main-carozal .pro-price-con span{ display:block; text-align:center; margin:0px; font-weight:600; padding:0px; font-size:12px; color:#000; text-transform:lowercase;}
|
114 |
+
.product-main-carozal .pro-price-con .price-box span{ display:block; text-align:center; margin:0px; font-weight:bold; padding:0px; font-size:15px; color:#000; text-transform:lowercase;}
|
115 |
+
|
116 |
+
.mycount{padding-left:13%;}
|
117 |
+
/* end custom */
|
118 |
+
|
skin/frontend/base/default/css/imedia_countdown/owl.theme.css
ADDED
@@ -0,0 +1,79 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* Owl Carousel Owl Demo Theme
|
3 |
+
* v1.3.3
|
4 |
+
*/
|
5 |
+
|
6 |
+
.owl-theme .owl-controls{
|
7 |
+
margin-top: 10px;
|
8 |
+
text-align: center;
|
9 |
+
}
|
10 |
+
|
11 |
+
/* Styling Next and Prev buttons */
|
12 |
+
|
13 |
+
.owl-theme .owl-controls .owl-buttons div{
|
14 |
+
color: #FFF;
|
15 |
+
display: inline-block;
|
16 |
+
zoom: 1;
|
17 |
+
*display: inline;/*IE7 life-saver */
|
18 |
+
margin: 5px;
|
19 |
+
padding: 3px 10px;
|
20 |
+
font-size: 12px;
|
21 |
+
-webkit-border-radius: 30px;
|
22 |
+
-moz-border-radius: 30px;
|
23 |
+
border-radius: 30px;
|
24 |
+
background: #869791;
|
25 |
+
filter: Alpha(Opacity=50);/*IE7 fix*/
|
26 |
+
opacity: 0.5;
|
27 |
+
}
|
28 |
+
/* Clickable class fix problem with hover on touch devices */
|
29 |
+
/* Use it for non-touch hover action */
|
30 |
+
.owl-theme .owl-controls.clickable .owl-buttons div:hover{
|
31 |
+
filter: Alpha(Opacity=100);/*IE7 fix*/
|
32 |
+
opacity: 1;
|
33 |
+
text-decoration: none;
|
34 |
+
}
|
35 |
+
|
36 |
+
/* Styling Pagination*/
|
37 |
+
|
38 |
+
.owl-theme .owl-controls .owl-page{
|
39 |
+
display: inline-block;
|
40 |
+
zoom: 1;
|
41 |
+
*display: inline;/*IE7 life-saver */
|
42 |
+
}
|
43 |
+
.owl-theme .owl-controls .owl-page span{
|
44 |
+
display: block;
|
45 |
+
width: 12px;
|
46 |
+
height: 12px;
|
47 |
+
margin: 5px 7px;
|
48 |
+
filter: Alpha(Opacity=50);/*IE7 fix*/
|
49 |
+
opacity: 0.5;
|
50 |
+
-webkit-border-radius: 20px;
|
51 |
+
-moz-border-radius: 20px;
|
52 |
+
border-radius: 20px;
|
53 |
+
background: #869791;
|
54 |
+
}
|
55 |
+
|
56 |
+
.owl-theme .owl-controls .owl-page.active span,
|
57 |
+
.owl-theme .owl-controls.clickable .owl-page:hover span{
|
58 |
+
filter: Alpha(Opacity=100);/*IE7 fix*/
|
59 |
+
opacity: 1;
|
60 |
+
}
|
61 |
+
|
62 |
+
/* If PaginationNumbers is true */
|
63 |
+
|
64 |
+
.owl-theme .owl-controls .owl-page span.owl-numbers{
|
65 |
+
height: auto;
|
66 |
+
width: auto;
|
67 |
+
color: #FFF;
|
68 |
+
padding: 2px 10px;
|
69 |
+
font-size: 12px;
|
70 |
+
-webkit-border-radius: 30px;
|
71 |
+
-moz-border-radius: 30px;
|
72 |
+
border-radius: 30px;
|
73 |
+
}
|
74 |
+
|
75 |
+
/* preloading images */
|
76 |
+
.owl-item.loading{
|
77 |
+
min-height: 150px;
|
78 |
+
background: url(AjaxLoader.gif) no-repeat center center
|
79 |
+
}
|
skin/frontend/base/default/js/imedia_countdown/AjaxLoader.gif
ADDED
Binary file
|
skin/frontend/base/default/js/imedia_countdown/countdown.js
ADDED
@@ -0,0 +1,199 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
////////////////////////////////////////////
|
2 |
+
//
|
3 |
+
// Countdown
|
4 |
+
// v5.0
|
5 |
+
// Sept. 3, 2014
|
6 |
+
// www.gieson.com
|
7 |
+
// Copyright Mike Gieson
|
8 |
+
//
|
9 |
+
//////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
//
|
11 |
+
// The MIT License (MIT)
|
12 |
+
//
|
13 |
+
//////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
//
|
15 |
+
// Copyright (c) 2014 Mike Gieson www.gieson.com
|
16 |
+
//
|
17 |
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
18 |
+
// of this software and associated documentation files (the "Software"), to deal
|
19 |
+
// in the Software without restriction, including without limitation the rights
|
20 |
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
21 |
+
// copies of the Software, and to permit persons to whom the Software is
|
22 |
+
// furnished to do so, subject to the following conditions:
|
23 |
+
//
|
24 |
+
// The above copyright notice and this permission notice shall be included in all
|
25 |
+
// copies or substantial portions of the Software.
|
26 |
+
//
|
27 |
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
28 |
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
29 |
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
30 |
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
31 |
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
32 |
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
33 |
+
// SOFTWARE.
|
34 |
+
//
|
35 |
+
//////////////////////////////////////////////////////////////////////////////////////
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
// -----------------------------------------
|
41 |
+
//
|
42 |
+
// Usage:
|
43 |
+
// var test = new Countdown({time:15});
|
44 |
+
//
|
45 |
+
// -----------------------------------------
|
46 |
+
|
47 |
+
var CountdownImageFolder = "images/"; // Should have trailing slash.
|
48 |
+
// NOTE: The countdown script assumes the folder is relative to the countdown.js script file.
|
49 |
+
// When CountdownImageFolder starts with a slash "/", or "http" the script will not assume the
|
50 |
+
// folder is relative to the script and you can hard-code another folder on your site.
|
51 |
+
// Examples:
|
52 |
+
// var CountdownImageFolder = "/path/to/images/"; // Starts with a slash ( / ) as a shortcut to the root of your site.
|
53 |
+
// var CountdownImageFolder = "http://www.yoursite.com/path/to/images/";
|
54 |
+
var CountdownImageBasename = "flipper";
|
55 |
+
var CountdownImageExt = "png";
|
56 |
+
var CountdownImagePhysicalWidth = 150;
|
57 |
+
var CountdownImagePhysicalHeight = 150;
|
58 |
+
|
59 |
+
var CountdownWidth = 10;
|
60 |
+
var CountdownHeight = 30;
|
61 |
+
|
62 |
+
var CountdownLabels = {
|
63 |
+
second : "s",
|
64 |
+
minute : "m",
|
65 |
+
hour : "H",
|
66 |
+
day : "DD",
|
67 |
+
month : "MM",
|
68 |
+
year : "YYSS"
|
69 |
+
};
|
70 |
+
|
71 |
+
var CountdownInterval = 76;
|
72 |
+
|
73 |
+
|
74 |
+
////////////////////////////////////////////
|
75 |
+
// //
|
76 |
+
// jbeeb //
|
77 |
+
// version 0.0.0.3 alpha //
|
78 |
+
// www.jbeeb.com //
|
79 |
+
// Copyright Mike Gieson //
|
80 |
+
// //
|
81 |
+
////////////////////////////////////////////
|
82 |
+
|
83 |
+
if(!Array.prototype.indexOf)Array.prototype.indexOf=function(c){if(this==null)throw new TypeError;var b=Object(this),a=b.length>>>0;if(a===0)return-1;var h=0;arguments.length>1&&(h=Number(arguments[1]),h!=h?h=0:h!=0&&h!=Infinity&&h!=-Infinity&&(h=(h>0||-1)*Math.floor(Math.abs(h))));if(h>=a)return-1;for(h=h>=0?h:Math.max(a-Math.abs(h),0);h<a;h++)if(h in b&&b[h]===c)return h;return-1};
|
84 |
+
if(!Function.prototype.bind)Function.prototype.bind=function(c){if(typeof this!=="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),a=this,h=function(){},e=function(){return a.apply(this instanceof h&&c?this:c,b.concat(Array.prototype.slice.call(arguments)))};h.prototype=this.prototype;e.prototype=new h;return e};this.jbeeb=this.jbeeb||{};
|
85 |
+
(function(){var c=function(){},b=Object.prototype.toString,a=String.prototype.trim;c.link=function(a,b,d){var d=d||{},b=b||"_blank",f=[],c;for(c in d)c=c.toLowerCase(),c=="width"||c=="height"||c=="left"?f.push(c+"="+d[c]):(c=="location"||c=="menubar"||c=="resizable"||c=="scrollbars"||c=="status"||c=="titlebar"||c=="toolbar")&&f.push(c+"=1");d=null;f.length>0&&(d=f.join(","));window.open(a,b,d)};c.isArray=function(a){return Array.isArray?Array.isArray(a):b.call(a)==="[object Array]"};c.isEmpty=function(a){var b=
|
86 |
+
typeof a;if(b=="undefined")return true;if(a===null)return true;else if(b=="object"){if(a=={}||a==[])return true;var b=true,d;for(d in a)if(!c.isEmpty(a[d])){b=false;break}return b}else return b=="string"&&a==""?true:false};c.isNumber=function(a){return b.call(a)==="[object Number]"&&isFinite(a)};c.isInteger=function(a){return parseFloat(a)==parseInt(a)&&!isNaN(a)&&isFinite(a)};c.isString=function(a){return b.call(a)==="[object String]"};c.isNull=function(a){return a===""||a===null||a===void 0||typeof a==
|
87 |
+
"undefined"||a=="undefined"||a=="null"?true:false};c.clone=function(a){if(a===null||typeof a!="object")return a;if(a.init)return a;else{var b=a.constructor;if(b){var d=new b,f;for(f in a)d[f]=c.clone(a[f])}}return d};c.sortOn=function(a,b){if(!b||!a)return a;a.sort(function(a,h){return a[b]<h[b]?-1:a[b]>h[b]?1:0})};c.arrayShuffle=function(a){if(a){for(var b=a.length,d,f;b;)f=Math.floor(Math.random()*b--),d=a[b],a[b]=a[f],a[f]=d;return a}else return[]};c.arrayMove=function(a,b,d){a.splice(d,0,a.splice(b,
|
88 |
+
1)[0])};c.arrayInsertAt=function(a,b,d){Array.prototype.splice.apply(a,[b,0].concat(d));return a};c.rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;c.trim=a&&!a.call("\ufeff\u00a0")?function(h){return h==null?"":a.call(h)}:function(a){return a==null?"":(a+"").replace(c.rtrim,"")};c.alphanumeric=function(a,b){return b?a.replace(/[^A-Za-z0-9]/g,""):a.replace(/[^A-Za-z0-9_\-\.]/g,"")};c.parseJSON=function(a){if(typeof a!="string")return null;try{return JSON.parse(a)}catch(b){return a||null}};c.hexToRgb=function(a){return!a?
|
89 |
+
"":(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]:[0,0,0]};c.makeColor=function(a,b){if(!a)return"";var d=c.hexToRgb(a);return c.isNumber(b)&&jbeeb.Browser.rgba?(b>1&&(b/=100),"rgba("+d.join(",")+(","+b)+")"):a};c.getXYWH=function(a){var b=0,d=0,f=0,c=0;if(a){for(var f=a.offsetWidth,c=a.offsetHeight,g=jbeeb.Browser.touch;a&&!isNaN(a.offsetLeft)&&!isNaN(a.offsetTop);)g?(b+=(a.offsetLeft||0)-(a.scrollLeft||0),d+=(a.offsetTop||0)-(a.scrollTop||
|
90 |
+
0)):(b+=a.offsetLeft||0,d+=a.offsetTop||0),a=a.offsetParent;g&&(a=window.scrollY!=null?window.scrollY:window.pageYOffset,b+=window.scrollX!=null?window.scrollX:window.pageXOffset,d+=a)}return{x:b,y:d,w:f,h:c,xMax:b+f,yMax:d+c}};c.getWindowSize=function(){var a=window,b=document,d=b.documentElement,b=b.getElementsByTagName("body")[0];return{w:a.innerWidth||d.clientWidth||b.clientWidth,h:a.innerHeight||d.clientHeight||b.clientHeight}};c.contains=function(a,b){var d={},f={x:a.x,y:a.y,w:a.width,h:a.height},
|
91 |
+
c={x:b.x,y:b.y,w:b.width,h:b.height};f.xMax=f.x+f.w;f.yMax=f.y+f.h;c.xMax=c.x+c.w;c.yMax=c.y+c.h;for(var g in f)d[g]=f[g]>=c[g]?true:false;return!d.x&&!d.y&&d.xMax&&d.yMax?true:false};c.getTimestamp=function(){var a=new Date;return Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()).valueOf()};c.bindEvent=function(a,b,d){a.attachEvent?a.attachEvent("on"+b,d):a.addEventListener&&a.addEventListener(b,d,false)};c.unbindEvent=function(a,b,
|
92 |
+
d){a.attachEvent?a.detachEvent("on"+b,d):a.addEventListener&&a.removeEventListener(b,d,false)};c.getAttributes=function(a){var b={};if(a=a.attributes){for(var d=a.length,f=0;f<d;f++)jbeeb.Browser.ie?a[f].specified&&(b[a[f].nodeName]=a[f].nodeValue.toString()):b[a[f].nodeName]=a[f].value?a[f].value.toString():a[f].nodeValue.toString();return b}else return{}};jbeeb.Utils=c})();this.jbeeb=this.jbeeb||{};
|
93 |
+
(function(){var c=function(){this.initialize()},b=c.prototype;c.initialize=function(a){a.addEventListener=b.addEventListener;a.removeEventListener=b.removeEventListener;a.removeAllEventListeners=b.removeAllEventListeners;a.hasEventListener=b.hasEventListener;a.dispatchEvent=b.dispatchEvent};b._listeners=null;b.initialize=function(){};b.addEventListener=function(a,b,e,d){var f=this._listeners;f?this.removeEventListener(a,b,e):f=this._listeners={};var c=f[a];c||(c=f[a]=[]);c.push({fn:b,arg:d,scope:e});
|
94 |
+
return b};b.removeEventListener=function(a,b,e){var d=this._listeners;if(d&&(a=d[a]))for(d=a.length;d--;){var c=a[d];c.scope==e&&c.fn==b&&a.splice(d,1)}};b.removeAllEventListeners=function(a){a?this._listeners&&delete this._listeners[a]:this._listeners=null};b.dispatchEvent=function(a){var b=this._listeners;if(a&&b&&(b=b[a])){var e=[].slice.call(arguments);e.splice(0,1);for(var d=0;d<b.length;d++){var c=b[d];if(c.fn){var i=e,g=c.arg;typeof g!=="undefined"&&i.push(g);i.length?c.scope?c.fn.apply(c.scope,
|
95 |
+
i):c.fn.apply(null,i):c.scope?c.fn.call(c.scope):c.fn()}}}};b.hasEventListener=function(a){var b=this._listeners;return!(!b||!b[a])};b.toString=function(){return"[EventDispatcher]"};if(!jbeeb.EventDispatcher)jbeeb.EventDispatcher=c})();this.jbeeb=this.jbeeb||{};
|
96 |
+
(function(){var c;if(!jbeeb.ready)jbeeb.ready=function(){var b,a,h=[],e,d=document,c=d.documentElement,i=c.doScroll,g=(i?/^loaded|^c/:/^loaded|c/).test(d.readyState);a=function(b){try{b=d.getElementsByTagName("body")[0].appendChild(d.createElement("span")),b.parentNode.removeChild(b)}catch(e){return setTimeout(function(){a()},50)}for(g=1;b=h.shift();)b()};d.addEventListener&&(e=function(){d.removeEventListener("DOMContentLoaded",e,false);a()},d.addEventListener("DOMContentLoaded",e,false),b=function(a){g?
|
97 |
+
a():h.push(a)});i&&(e=function(){/^c/.test(d.readyState)&&(d.detachEvent("onreadystatechange",e),a())},d.attachEvent("onreadystatechange",e),b=function(a){if(self!=top)g?a():h.push(a);else{try{c.doScroll("left")}catch(e){return setTimeout(function(){b(a)},50)}a()}});return b}()})();this.jbeeb=this.jbeeb||{};
|
98 |
+
(function(){function c(){return a&&a.call(performance)||(new Date).getTime()}var b=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame,a=window.performance&&(performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow),h=function(a){this.init(a);return this},e=h.prototype;e.addEventListener=null;e.removeEventListener=null;e.removeAllEventListeners=null;e.dispatchEvent=
|
99 |
+
null;e.hasEventListener=null;jbeeb.EventDispatcher.initialize(e);e._interval=50;e._lastTime=0;e._times=null;e._active=null;e._loopHandler=null;e._useRAF=false;e.state=0;e.init=function(a){a.fps?(this._useRAF=a.animation&&b||false,this._interval=1E3/(a.fps||60)):this._interval=a.interval||50;a.startNow&&this.start()};e.stop=function(){this.state=0;this._setLoopHandler(this._handleStop)};e.getInterval=function(){return this._interval};e.setInterval=function(a){this._interval=a};e.start=function(){if(!this.state)this.state=
|
100 |
+
1,this._times=[],this._times.push(this._lastTime=c()),this._useRAF?this._setLoopHandler(this._handleRAF):this._setLoopHandler(this._handleTimeout),this._loop()};e.getFPS=function(){var a=this._times.length-1;return a<2?this._interval:1E3/((this._times[0]-this._times[a])/a)};e._handleRAF=function(){this._active=null;this._loop();c()-this._lastTime>=(this._interval-1)*0.97&&this._tick()};e._handleTimeout=function(){this._active=null;this._loop();this._tick()};e._handleStop=function(){this._active=null};
|
101 |
+
e._loop=function(){if(this._active==null)this._useRAF?(b(this._loopHandler),this._active=true):(this._active&&clearTimeout(this._active),this._active=setTimeout(this._loopHandler,this._interval))};e._setLoopHandler=function(a){this._loopHandler=a.bind(this)};e._tick=function(){var a=c(),b=a-this._lastTime;this._lastTime=a;this.dispatchEvent("tick",{delta:b,time:a});for(this._times.unshift(a);this._times.length>100;)this._times.pop()};e.toString=function(){return"[Ticker]"};if(!jbeeb.Ticker)jbeeb.Ticker=
|
102 |
+
h})();this.jbeeb=this.jbeeb||{};
|
103 |
+
(function(){var c,b;if(!jbeeb.Browser){var a={ie:null,ios:null,mac:null,webkit:null,oldWebkit:false,flash:0,touch:false};c=navigator.userAgent;c=c.toLowerCase();b=/(chrome)[ \/]([\w.]+)/.exec(c)||/(webkit)[ \/]([\w.]+)/.exec(c)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(c)||/(msie) ([\w.]+)/.exec(c)||c.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(c)||[];c=b[1]||"";b=b[2]||"0";a.version=parseFloat(b);a.agent=c;b=false;c=="chrome"?b=true:c=="webkit"&&(b=true);a.webkit=b;a.chrome=/chrome/.test(c)||
|
104 |
+
/chromium/.test(c);a.moz=/mozilla/.test(c);a.opera=/opera/.test(c);a.safari=/webkit/.test(c);a.ie=/msie/.test(c)&&!/opera/.test(c);a.android=/android/.test(c);b=navigator.platform.toLowerCase();a.platform=b;a.ios=/iphone/.test(b)||/ipod/.test(b)||/ipad/.test(b);a.win=a.windows=b?/win/.test(b):/win/.test(c);a.mac=b?/mac/.test(b):/mac/.test(c);a.cssPrefix="";if(a.chrome||a.safari)if(a.cssPrefix="webkit",a.chrome&&a.version<10)a.oldWebkit=true;else{if(a.safari&&a.version<5.1)a.oldWebkit=true}else if(a.opera)a.cssPrefix=
|
105 |
+
"o";else if(a.moz)a.cssPrefix="moz";else if(a.ie&&a.version>8)a.cssPrefix="ms";if(a.chrome||a.ios||a.android)a.flash=0;c=false;b="Webkit Moz O ms Khtml".split(" ");var h="",h=document.createElement("div");h.style.animationName&&(c=true);if(c===false)for(var e=0;e<b.length;e++)if(h.style[b[e]+"AnimationName"]!==void 0){h=b[e];h.toLowerCase();c=true;break}a.animation=c;a.modern=false;if(a.moz&&a.version>3)a.modern=true;if(a.opera&&a.version>9)a.modern=true;if(a.ie&&a.version>9)a.modern=true;if(a.chrome||
|
106 |
+
a.safari||a.ios||a.android)a.modern=true;a.rgba=true;a.quirks=document.compatMode=="CSS1Compat"?false:true;if(a.ie)if(a.version<9)a.rgba=false;else{if(a.quirks)a.rgba=false,a.version=8,a.modern=false}else if(a.moz&&a.version<3)a.rgba=false;else if(a.safari&&a.version<3)a.rgba=false;else if(a.opera&&a.version<10)a.rgba=false;a.touch=typeof window.ontouchstart==="undefined"?false:true;jbeeb.Browser=a}})();this.jbeeb=this.jbeeb||{};
|
107 |
+
(function(){jbeeb.PathInfo=function(){function c(a,b){var h,k,o,p,v,z,n,m,q,s,r,w,t,y,a=a||"";k=a.replace(/\\/g,"/");k.match(/:\//)||(m="",m=b?d:f,m=c(m,false),k.substr(0,1)=="/"?k=m.host+(e?"":"/")+k:k.substr(0,3)=="../"?(m=m.parenturl.split("/"),k=k.split("../"),o=k.pop(),m.splice(m.length-k.length,k.length,o),k=m.join("/")):k=m.pathurl+(e?"":"/")+k);k.substr(-1)=="/"&&(k=k.substr(0,k.length-1));h=k.split("://");k=h.shift();m=(h.shift()||"").replace("//","/");m=m.split("/");o=m.shift()||"";o.indexOf("@")>
|
108 |
+
-1&&(h=o.split("@"),t=h[0].split(":"),w=t[0],t=t[1],o=h[1]);o.indexOf(":")>-1&&(h=o.split(":"),p=h[1],o=h[0]);m=m.join("/");m.indexOf("#")!=-1&&(h=m.split("#"),r=h[1],m=h[0]);m.indexOf("?")!=-1&&(h=m.split("?"),s=h[1],m=h[0]);h=m.split("/");n=h.pop();m=h.join("/");n==".."&&(n="");h=n.split(".");h.length>1&&(z=h.pop().toLowerCase(),v=h.join("."));y=k+"://"+o+(p?":"+p:"");m="/"+m+(m.length>0?"/":"");q=y+m;h=y+m+n+(s?"?"+s:"")+(r?"#"+r:"");var l=m,u=q;z?(m+=n,q+=n):(m+=n+(n!=""?"/":""),q+=n+(n!=""?"/":
|
109 |
+
""),v=n,!s&&!r&&h.substr(-1)!="/"&&(h+="/"));e===false&&(l.substr(-1)=="/"&&(l=l.substr(0,l.length-1)),u.substr(-1)=="/"&&(u=u.substr(0,u.length-1)),z||(m.substr(-1)=="/"&&(m=m.substr(0,m.length-1)),q.substr(-1)=="/"&&(q=q.substr(0,q.length-1)),h.substr(-1)=="/"&&(h=h.substr(0,h.length-1))));return{source:a||null,url:h||null,protocol:k||null,domain:o||null,port:p||null,basename:v||null,ext:z||null,filename:n||null,path:m||null,pathurl:q||null,parent:l||null,parenturl:u||null,query:s||null,fragment:r||
|
110 |
+
null,username:w||null,password:t||null,host:y||null}}function b(a){return(a||"").split("?")[0].split("/").pop()}function a(a){a=a.split("/");a.pop();return a.join("/").toString()+(a.length>0?"/":"")}function h(b){var h=document.getElementsByTagName("script");return(h=h[h.length-1].getAttribute("src"))?b?h.split("?")[0]:a(h.split("?")[0]):""}var e=true,d=h(),f=a(window.location.href);return{parse:c,filename:b,basename:function(a){a=b(a).split(".");a.pop();return a.join(".")},basepath:a,scriptPath:d,
|
111 |
+
getScriptPath:h,pagePath:f,ext:function(a){return(a||"").split("?")[0].split("/").pop().split(".").pop().toLowerCase()}}}()})();this.jbeeb=this.jbeeb||{};
|
112 |
+
(function(){if(!jbeeb.Base)jbeeb.amReady=false,jbeeb.ticker=null,jbeeb.tickerInterval=80,jbeeb.scriptPath=null,jbeeb.pagePath="",jbeeb.assetsBasePath="",jbeeb.focus=null,jbeeb.binit=0;jbeeb.unfocus=function(){if(jbeeb.focus){var b=jbeeb.focus;b.element&&b.element.blur();jbeeb.focus=null}};var c=function(){};c._nextUID=0;c._stages=[];c._readyList=[];c.scriptPath=null;c._getUID=function(){return"jbeeb_"+c._nextUID++};c._register=function(b){c._readyList.push(b);jbeeb.amReady&&c._readyListRun()};c._readyListRun=
|
113 |
+
function(){var b=c._readyList.length;if(b>0)for(;b--;){var a=c._readyList.splice(b,1)[0];a&&a.init&&a.init.call(a)}};c.init=function(){if(!jbeeb.amReady){jbeeb.ticker=new jbeeb.Ticker({interval:jbeeb.tickerInterval,startNow:1});if(!jbeeb.assetsBasePath)jbeeb.assetsBasePath="";if(window.location.href.substr(0,4)!="http"){if(!jbeeb.pagePath)jbeeb.pagePath="";if(!jbeeb.scriptPath)jbeeb.scriptPath=""}else{if(!jbeeb.pagePath)jbeeb.pagePath=jbeeb.PathInfo.pagePath;if(!jbeeb.scriptPath)jbeeb.scriptPath=
|
114 |
+
jbeeb.PathInfo.scriptPath}jbeeb.FlashDetect&&jbeeb.FlashDetect.run();jbeeb.amReady=true;c._readyListRun()}};if(!jbeeb.Base)jbeeb.Base=c,jbeeb.register=c._register,jbeeb.getUID=c._getUID})();if(!jbeeb.binit)jbeeb.binit=1,jbeeb.ready(function(){jbeeb.Base.init()});this.jbeeb=this.jbeeb||{};
|
115 |
+
(function(){var c=function(a){this.init(a)},b=c.prototype;b.addEventListener=null;b.removeEventListener=null;b.removeAllEventListeners=null;b.dispatchEvent=null;b.hasEventListener=null;jbeeb.EventDispatcher.initialize(b);b.amStage=null;b.element=null;b.style=null;b._cssStore=null;b.alpha=1;b.id=null;b.name=null;b.parent=null;b.stage=null;b.rotation=0;b.scale=1;b.scaleX=1;b.scaleY=1;b.stretchX=1;b.stretchY=1;b.skewX=0;b.skewY=0;b.origin=null;b.originX=0;b.originY=0;b.originType="px";b.shadow=null;
|
116 |
+
b.bevel=null;b.outline=null;b.inset=null;b.visible=true;b.overflow="visible";b.autoCenter=null;b.x=0;b.y=0;b.width=0;b.height=0;b.flex="wh";b._flexW=1;b._flexH=1;b.pin=null;b._pinX=null;b._pinY=null;b.z=0;b.temp=null;b.rounded=null;b.fill=null;b.stroke=null;b.image=null;b.gradient=null;b._blockDisplay=null;b.init=function(a){this.temp={};this.style=null;this.alpha=1;this.parent=this.name=this.id=null;this.rotation=0;this.scaleY=this.scaleX=this.scale=1;this.skewY=this.skewX=0;this.visible=true;this.overflow=
|
117 |
+
"visible";this.height=this.width=this.y=this.x=0;this.flex="wh";this._flexH=this._flexW=1;this._pinY=this._pinX=this.pin=null;this.z=0;this.autoCenter=null;this.stroke={};this.fill={};this.inset=this.shadow=null;this.gradient={};this.rounded=null;this._cssStore=jbeeb.storeCSS?{}:null;var a=a||{},b=jbeeb.getUID();this.id=b;if(a.element)this.element=a.element;else if(this.element=document.createElement("div"),this.element.id=b,this.element.style.position="absolute",this.element.style.overflow="visible",
|
118 |
+
this._cssStore)this._cssStore.position="absolute",this._cssStore.overflow="visible";if(a.standalone)this.amStage=1;this._blockDisplay=a.inline?"inline-block":"block";if(a.name)this.name=a.name;this.element.id=this.type+"_"+this.element.id;b=this.style=this.element.style;b.padding="0px";b.margin="0px";b.border="0px";b.fontSize="100%";b.verticalAlign="baseline";b.outline="0px";b.background="transparent";b.WebkitTextSizeAdjust="100%";b.msTextSizeAdjust="100%";b.WebkitBoxSizing=b.MozBoxSizing=b.boxSizing=
|
119 |
+
"padding-box";b.backgroundClip="padding-box";if(this._cssStore)b=this._cssStore,b.padding="0px",b.margin="0px",b.border="0px",b.fontSize="100%",b.verticalAlign="baseline",b.outline="0px",b.background="transparent",b.WebkitTextSizeAdjust="100%",b.msTextSizeAdjust="100%",b.boxSizing="padding-box",b.backgroundClip="padding-box";a.editable||this.setSelectable(false);this.setCursor("inherit");if(a)this.autoCenter=a.center,typeof a.flex!="undefined"&&this.setFlex(a.flex),typeof a.pin!="undefined"&&this.setPin(a.pin),
|
120 |
+
typeof a.overflow!="undefined"&&this.setOverflow(a.pin);this.setOrigin(0,0,"px");this.applySkin(a,false)};b.setSelectable=function(a){var b=this.style,e="none",d="-moz-none";a&&(d=e="text");b.userSelect=b.WebkitUserSelect=b.MozUserSelect=b.OUserSelect=e;b.MozUserSelect=d;if(this._cssStore)this._cssStore.userSelect=e,this._cssStore.MozUserSelect=d};b.setBorderRender=function(a){var b=this.style,a=a=="outside"?"content-box":"border-box";b.WebkitBoxSizing=b.MozBoxSizing=b.boxSizing=a;if(this._cssStore)this._cssStore.boxSizing=
|
121 |
+
a};b.applySkin=function(a,b){this.stroke={};this.fill={};this.gradient=null;this.rounded=0;this.inset=this.outline=this.bevel=this.shadow=this.image=null;if(!(b==true&&b)){var e=jbeeb.Utils.isNumber(a.x)?a.x:0,d=jbeeb.Utils.isNumber(a.y)?a.y:0;this.setXY(e,d);a.height&&this.setHeight(a.height);a.width&&this.setWidth(a.width);a.h&&this.setHeight(a.h);a.w&&this.setWidth(a.w)}this.setRounded(a.rounded);var e=a.fill,c,i;if(e)typeof e=="string"?(c=e,i=1):(c=e.color,i=e.alpha);this.setFill(c,i);var e=a.stroke,
|
122 |
+
g=d=i=c=null;e&&(typeof e=="string"?(c=e,d=i=1,g="solid"):e.color!=null&&(c=e.color||"#000000",i=jbeeb.Utils.isNumber(e.alpha)?e.alpha:1,d=e.weight||1,g=e.style||"solid"));this.setStroke(d,c,i,g);this.setStrokeStyle(g);var e=a.image,j,k;if(a.image)typeof e=="string"?(j=e,k=null):(j=e.url,k=e.mode);this.setImage(j,k);this.setShadow(a.shadow);this.setBevel(a.bevel);this.setOutline(a.outline);this.setInset(a.inset)};b._applyBkgd=function(){var a=this.style;if(a){var b="",e="",d="",c="",i="",g=0,j=this.fill;
|
123 |
+
j&&(jbeeb.Utils.isArray(j.color)?g=1:j.color&&(e=jbeeb.Utils.makeColor(j.color,j.alpha)));if(this.image&&this.image.url){b='url("'+this.image.url+'")';g=this.image.mode||"center";if(g!="pattern"){if(g=="fit")d="100% 100%";else if(g=="contain"||g=="cover")d="contain";c="no-repeat";i="center center"}g=0}if(g){g=j.color;if(this._cssStore)this._cssStore.gradient=1;for(var j=j.alpha||"v",k=jbeeb.Browser,o=[],p=[],v=g.length,z=k.oldWebkit,n=0;n<v;n+=3){var m=jbeeb.Utils.makeColor(g[n],g[n+1]),q=g[n+2];
|
124 |
+
q>100?q=100:q<0&&(q=0);z?p.push("color-stop("+q+"%, "+m+")"):o.push(m+" "+q+"%")}if(k.modern)b=k.cssPrefix,b==""?(b="linear-",j=(j=="v"?"to bottom, ":"to right, ")+o.join(",")):b=="webkit"&&z?(g=p.join(","),b="-webkit-",j=j=="v"?"linear, left top, left bottom, "+g:"linear, left top, right top, "+g):(b="-"+b+"-linear-",j=(j=="v"?"top, ":"left, ")+o.join(",")),b=b+"gradient("+j+")";else if(k.ie&&k.version<9){if(j="progid:DXImageTransform.Microsoft.gradient( gradientType="+(j=="v"?"0":"1")+", startColorstr='"+
|
125 |
+
g[0]+"', endColorstr='"+g[g.length-3]+"')",this.style.filter=j,this.style.msFilter='"'+j+'"',this._cssStore)g=this._cssStore,g.filter=j,g.msFilter='"'+j+'"'}else{b="";for(n=0;n<v;n+=3)jbeeb.Utils.makeColor(g[n],g[n+1]),b+='<stop offset="'+g[n+2]+'%" stop-color="'+g[n]+'" stop-opacity="'+g[n+1]+'"/>';g="0";o="100";j=="h"&&(g="100",o="0");j="jbeeb-grad-"+this.id;p="";p+='<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">';p+=' <linearGradient id="'+
|
126 |
+
j+'" gradientUnits="userSpaceOnUse" x1="0%" y1="0%" x2="'+g+'%" y2="'+o+'%">';p+=b;p+=" </linearGradient>";p+=' <rect x="0" y="0" width="1" height="1" fill="url(#'+j+')" />';p+="</svg>";b='url("data:image/svg+xml;base64,'+jbeeb.Base64.encode(p)+'")'}}else if(this._cssStore)this._cssStore.gradient=0;a.backgroundColor=e||"";a.backgroundImage=b||"none";a.backgroundSize=d||"";a.backgroundRepeat=c||"";a.backgroundPosition=i||"";if(this._cssStore)g=this._cssStore,g.backgroundColor=e||"",g.backgroundImage=
|
127 |
+
b||"none",g.backgroundSize=d||"",g.backgroundRepeat=c||"",g.backgroundPosition=i||""}};b.setFill=function(a,b){if(!this.fill)this.fill={};this.fill.color=a;this.fill.alpha=b;this._applyBkgd()};b.setImage=function(a,b){if(a){if(!this.image)this.image={};this.image.url=a;this.image.mode=b}else this.image=null;this._applyBkgd()};b.setImageSizing=function(a){if(this.image)this.image.mode=a,this._applyBkgd()};b.setStroke=function(a,b,e,d){if(!this.stroke)this.stroke={};typeof a=="string"&&(b=a,a=1);a>
|
128 |
+
0&&(a=Math.round(a));var c=e||1,d=d||"solid";b==null&&(d=c=a=null);e=this.stroke;e.weight=a;e.color=b;e.alpha=c;e.style=d;var i=this.style;a?(e=a+"px",b=jbeeb.Utils.makeColor(b,c),c=-a+"px",a=-a+"px"):a=c=b=e=d="";i.borderStyle=d;i.borderWidth=e;i.borderColor=b;i.marginLeft=c;i.marginTop=a;if(this._cssStore)i=this._cssStore,i.borderStyle=d,i.borderWidth=e,i.borderColor=b,i.marginLeft=c,i.marginTop=a;this._applyRounded()};b.setStrokeStyle=function(a){a=a||"";this.style.borderStyle=a;if(this._cssStore)this._cssStore.borderStyle=
|
129 |
+
a};b.setCursor=function(a){this.style.cursor=a;if(this._cssStore)this._cssStore.cursor=a};b.setWidth=function(a){var b=this.style;if(b&&a>0&&(this.width=a,b.width=a+"px",this.autoCenter&&this.center(this.autoCenter),this.rounded&&this._applyRounded(),this._cssStore))this._cssStore.width=a+"px"};b.setHeight=function(a){var b=this.style;if(b&&a>0&&(this.height=a,b.height=a+"px",this.autoCenter&&this.center(this.autoCenter),this.rounded&&this._applyRounded(),this._cssStore))this._cssStore.height=a+"px"};
|
130 |
+
b.measure=function(){var a=this.element,b=a.clientWidth,a=a.clientHeight;this.width=b;this.height=a;return[b,a]};b.setSize=function(a,b){var e=this.style;if(e&&a>0&&b>0&&(this.width=a,this.height=b,e.width=a+"px",e.height=b+"px",this.autoCenter&&this.center(this.autoCenter),this.rounded&&this._applyRounded(),this._cssStore))this._cssStore.width=a+"px",this._cssStore.height=b+"px"};b.setXY=function(a,b){this.x=a;this.y=b;var e=this.style;e.left=a+"px";e.top=b+"px";if(this._cssStore)this._cssStore.left=
|
131 |
+
a+"px",this._cssStore.top=b+"px"};b.setBaseXY=function(a,b){this.setXY(a,b);this._baseX=a;this._baseY=b};b.setXYWH=function(a,b,e,d){this.width=e;this.height=d;this.x=a;this.y=b;var c=this.style;c.width=(e||0)+"px";c.height=(d||0)+"px";c.left=(a||0)+"px";c.top=(b||0)+"px";if(this._cssStore)c=this._cssStore,c.width=(e||0)+"px",c.height=(d||0)+"px",c.left=(a||0)+"px",c.top=(b||0)+"px"};b.setX=function(a){this.x=a;this.style.left=(a||0)+"px";if(this._cssStore)this._cssStore.left=(a||0)+"px"};b.setY=
|
132 |
+
function(a){this.y=a;this.style.top=(a||0)+"px";if(this._cssStore)this._cssStore.top=(a||0)+"px"};b.setTop=function(a){this.y=a;this.style.top=a+"px";if(this._cssStore)this._cssStore.top=(a||0)+"px"};b.setBottom=function(a){this.y=a-this.height;this.style.bottom=a+"px";if(this._cssStore)this._cssStore.bottom=(a||0)+"px"};b.setLeft=function(a){this.x=a;this.style.left=(a||0)+"px";if(this._cssStore)this._cssStore.left=(a||0)+"px"};b.setRight=function(a){this.x=a=(a||0)-this.width;this.style.right=a+
|
133 |
+
"px";if(this._cssStore)this._cssStore.right=a+"px"};b.setZ=function(a){a<0&&(a=0);this.z=a;var b=this.style;if(!b)this.style=b=this.element.style;b.zIndex=a;if(this._cssStore)this._cssStore.zIndex=a};b.setScale=function(a){this.scaleY=this.scaleX=this.scale=a;this._doTransform("scale("+a+","+a+")")};b.setScaleX=function(a){this.scaleX=a;this._doTransform("scale("+this.scaleX+","+a+")")};b.setScaleY=function(a){this.scaleY=a;this._doTransform("scale("+a+","+this.scaleY+")")};b.stretch=function(a,b){this.stretchX=
|
134 |
+
a;this.stretchY=b;if(a>0&&b>0){this._flexW&&this.setWidth(this.width*a);this._flexH&&this.setHeight(this.height*b);var e=this.x,d=this.y;if(this._pinX){if(this._pinX=="r"&&this.parent){if(this._pinRightFirst==null)this._pinRightFirst=this.parent.width-this.x;e=this.parent.width-this._pinRightFirst;this.setX(e)}}else if(this.originX){var c=this.originX;this.setX(c+(e-c)*a)}else this.setX(e*a);if(this._pinY){if(this._pinY=="b"&&this.parent){if(this._pinBottomFirst==null)this._pinBottomFirst=this.parent.height-
|
135 |
+
this.y;e=this.parent.height-this._pinBottomFirst;this.setY(e)}}else this.originY?(c=this.originY,this.setY(c+(d-c)*b)):this.setY(d*b)}this.dispatchEvent("stretch",this.width,this.height)};b._pinRightFirst=null;b._pinBottomFirst=null;b.setPin=function(a){this.pin=a;this._pinY=this._pinX=0;if(a){a=a.toLowerCase();if(a.match(/r/))this._pinX="r";if(a.match(/l/))this._pinX="l";if(a.match(/t/))this._pinY="t";if(a.match(/b/))this._pinY="b";if(a.match(/s/))this._pinY=this._pinX="s"}};b.setFlex=function(a){this._flexH=
|
136 |
+
this._flexW=0;if(a)a.toLowerCase(),this._flexW=a.match(/w/)?1:0,this._flexH=a.match(/h/)?1:0;this.flex=a};b.setRotation=function(a){this.rotation=a;this._doTransform("rotate("+a+"deg)")};b.setSkew=function(a,b){this.skewX=a;this.skewY=b;this._doTransform("skew("+a+"deg,"+b+"deg)")};b.setOrigin=function(a,b,e){this.originX=a;this.originY=b;e=(this.originType=e)?e:"px";a=a+e+" "+b+e;b=this.style;b.transformOrigin=b.WebkitTransformOrigin=b.msTransformOrigin=b.MozTransformOrigin=b.OTransformOrigin=a;
|
137 |
+
if(this._cssStore)this._cssStore.transformOrigin=a};b._doTransform=function(a){var b=this.style;b.transform=b.transform=b.msTransform=b.WebkitTransform=b.MozTransform=a;if(this._cssStore)this._cssStore.transform=a};b.center=function(a){if((this.parent||this.amStage)&&this.width&&this.height){var b=this.x,e=this.y,d,c;this.amStage?(d=jbeeb.Utils.getXYWH(this.element.parentNode),c=d.w*0.5,d=d.h*0.5):(d=this.parent,d.width||d.measure(),c=d.width*0.5,d=d.height*0.5);var i=this.width*0.5,g=this.height*
|
138 |
+
0.5;a=="v"?e=d-g:a=="h"?b=c-i:(b=c-i,e=d-g);this.setXY(b,e)}};b.setOverflow=function(a){this.overflow=a;var b="",e="";if(a=="x"||a=="y"||!a)a=="x"?(b="auto",e="hidden"):a=="y"&&(b="hidden",e="auto",jbeeb.Browser.ie&&this.setWidth(this.width+20)),this.style.overflowX=b,this.style.overflowY=e;this.style.overflow=a;if(this._cssStore){var c=this._cssStore;c.overflow=a;c.overflowX=b;c.overflowY=e}};b.setVisible=function(a){this.visible=a;var b=this.style,a=a?this._blockDisplay:"none";b.display=a;if(this._cssStore)this._cssStore.display=
|
139 |
+
a};b.show=function(){this.setVisible(true)};b.hide=function(){this.setVisible(false)};b.setAlpha=function(a){this.alpha=a;if(a!==null)this.style.opacity=""+a;if(this._cssStore)this._cssStore.opacity=""+a};b.setRounded=function(a){this.rounded=a;this._applyRounded()};b._applyRounded=function(){var a="",b=this.rounded;if(b){var e=this.width,c=this.height,f=0,i=this.stroke;if(i)i=i.weight,jbeeb.Utils.isNumber(i)&&(f=i*2);e=((e<c?e:c)+f)*0.5;jbeeb.Utils.isNumber(b)?a=e*b+"px":b&&typeof b=="object"&&(a+=
|
140 |
+
(e*b.tl||0)+"px "+(e*b.tr||0)+"px "+(e*b.br||0)+"px "+(e*b.bl||0)+"px")}b=this.style;b.borderRadius=b.MozBorderRadius=b.WebkitBorderRadius=b.OBorderRadius=b.msBorderRadius=a;if(this._cssStore)this._cssStore.borderRadius=a};b.onAdded=function(){this.autoCenter&&this.center(this.autoCenter);this.dispatchEvent("added",this)};b.toFront=function(){this.parent&&this.parent.toFront(this)};b.toBack=function(){this.parent&&this.parent.toBack(this)};b._updateShadow=function(){var a=this.style,b=this._makeShadow(),
|
141 |
+
e=this._makeBevel(),c=this._makeOutline(),f=this._makeInset(),i="none";if(!(b==[]&&e==[]&&c==[]&&f==[])){for(var b=e.concat(c,f,b),e=b.length,c=[],f=[],g=0,j=0;j<e;j++)g==0?b[j]==1&&f.push("inset"):g<4?f.push(b[j]+"px"):(f.push(jbeeb.Utils.makeColor(b[j],b[j+1])),c.push(f.join(" ")),f=[],++j,g=-1),g++;c.length>0&&(i=c.join(","))}a.boxShadow=a.MozBoxShadow=a.WebkitBoxShadow=a.OBoxShadow=a.msBoxShadow=i;if(this._cssStore)this._cssStore.boxShadow=i};b._makeShadow=function(){var a=this.shadow;return a?
|
142 |
+
[0,a.x||0,a.y||0,a.s,a.c||"#000000",a.a||0.4]:[]};b.setShadow=function(a){this.shadow=a;this._updateShadow()};b._makeInset=function(){var a=this.inset;return a?[1,a.x||0,a.y||0,a.s,a.c||"#000000",a.a||0.4]:[]};b.setInset=function(a){this.inset=a;this._updateShadow()};b._makeBevel=function(){var a=this.bevel;return a?[1,-a.x,-a.y,a.s1,a.c1||"#FFFFFF",a.a1,1,a.x,a.y,a.s2,a.c2||"#000000",a.a2]:[]};b.setBevel=function(a){if(a)jbeeb.Utils.isNumber(a)?a={x:-a,y:-a,s1:0,s2:0,c1:"#FFFFFF",c2:"#000000",a1:1,
|
143 |
+
a2:1}:(a.c1=a.c1||"#FFFFFF",a.c2=a.c2||"#000000");this.bevel=a;this._updateShadow()};b._makeOutline=function(){if(this.outline){var a=this.outline;return[0,-a.weight,-a.weight,a.spread||0,a.color||"#000000",a.alpha||1,0,a.weight,-a.weight,a.spread||0,a.color||"#000000",a.alpha||1,0,-a.weight,a.weight,a.spread||0,a.color||"#000000",a.alpha||1,0,a.weight,a.weight,a.spread||0,a.color||"#000000",a.alpha||1]}else return[]};b.setOutline=function(a){this.outline=a;this._updateShadow()};b.setMouseEnabled=
|
144 |
+
function(a){a=a===0||a===false?"none":"auto";this.style.pointerEvents=a;if(this._cssStore)this._cssStore.pointerEvents=a};b._MEL=null;b.MELbubble=false;b.addMEL=function(a,b,e,c,f){this.MELbubble=c;if(!this._MEL)this._MEL=new jbeeb.MouseEventListener(this);(a=="mouseOver"||a=="mouseOut"||a=="mouseMove")&&this._MEL.enableMouseOver(1);this.addEventListener(a,b,e,f)};b.removeMEL=function(a,b){this.removeEventListener(a,b);a=="mouseOver"&&this._MEL.enableMouseOver(0)};b.setFloat=function(a){this.style.position=
|
145 |
+
"relative";this.style.left="";this.style.top="";this.style.cssFloat=a;this.style.display="inline-block";if(this._cssStore)this._cssStore.position="relative",this._cssStore.left=null,this._cssStore.top=null,this._cssStore.cssFloat=a,this._cssStore.display="inline-block"};b.destroy=function(){this.removeAllEventListeners();if(this._MEL)this._MEL.destroy(),this._MEL=null;if(this.element&&this.element.parentNode)this.element.parentNode.removeChild(this.element),this.element=null;if(this.parent)this.parent.removeChild(this),
|
146 |
+
this.parent=null;this._cssStore=this.element=this.image=this.inset=this.shadow=this.outline=this.bevel=this.gradient=this.fill=this.stroke=this.temp=null};b.getCSS=function(){return this._cssStore};b.toString=function(){return"[Box (name="+this.name+")]"};b.type="Box";jbeeb.Box=c})();this.jbeeb=this.jbeeb||{};
|
147 |
+
(function(){var c=function(a){this.init(a)},b=c.prototype=new jbeeb.Box(null);b.textFit=null;b.text="";b._previuosText="";b.textSize=null;b.textColor=null;b.shadowText=null;b.bevelText=null;b.outlineText=null;b.insetText=null;b.font=null;b.align=null;b.textScale=null;b.selectable=null;b.bold=null;b.padding=null;b.editable=null;b._canEdit=null;b.multiline=null;b.baselineShift=null;b._BLScomp=null;b._keyboardHandler=null;b._suspendUpdate=false;b._TextBox_init=b.init;b.init=function(a){if(a){if(a.editable){var b;
|
148 |
+
b=a.multiline?document.createElement("textarea"):document.createElement("input");this._canEdit=1;b.id=jbeeb.getUID();b.style.position="absolute";b.style.overflow="visible";if(this._cssStore)this._cssStore.position="absolute",this._cssStore.overflow="visible";if(!a.multiline)b.type="text";a.element=b}this._TextBox_init(a);a.element=null;b=this.style;b.textDecoration="none";b.zoom=1;b.size=a.h;this.text=a.text||"";if(this._cssStore)b=this._cssStore,b.fontSmooth="always",b.WebkitFontSmoothing="antialiased",
|
149 |
+
b.textDecoration="none",b.zoom=1,b.size=a.h;this.applySkin(a,true)}};b._TextBox_applySkin=b.applySkin;b.applySkin=function(a,b){this._suspendUpdate=true;if(a.editable){var e=null;a.fill&&(e=typeof a.fill=="object"?a.fill.color:a.fill);a.stroke=a.stroke||e||{weight:1,color:"#000000",alpha:1}}this._TextBox_applySkin(a,b);this.textFit=a.textFit||null;this.font=a.font||"Arial, Helvetica, sans-serif";this.align=a.align||"left";this.textScale=a.textScale||1;this.bold=a.bold||0;this.selectable=a.selectable||
|
150 |
+
0;this.editable=a.editable||0;this.multiline=a.multiline||0;this.baselineShift=a.baselineShift||0;if(!b)this.text=a.text||"";this._previuosText="";this.textColor={};if(a.textSize)this.textSize=a.textSize;a.editable==1&&this.setEditable(1);this.setMultiline(this.multiline,true);this.setText(this.text);if(a.textColor){var e=a.textColor,c={};if(typeof e=="string")c={color:e,alpha:1};else if(c=e,!c.color)c.color=null,c.alpha=null;this.setTextColor(c.color||"#000000",c.alpha||1)}if(a.shadowText)this.shadowText=
|
151 |
+
a.shadowText;if(a.insetText)this.insetText=a.insetText;if(a.bevelText)this.bevelText=a.bevelText;if(a.outlineText)this.outlineText=a.outlineText;if(a.shadow)this.shadow=a.shadow;if(a.inset)this.insetText=a.inset;if(a.bevel)this.bevel=a.bevel;if(a.outline)this.outline=a.outline;a.padding&&this.setPadding(a.padding);if(a.alphaNumeric)this.alphaNumeric=1;if(a.numeric)this.numeric=1;this.setBaselineShift(this.baselineShift);this._suspendUpdate=false;this._update();this._updateShadowText()};b.setMultiline=
|
152 |
+
function(a){this.multiline=a;var b=this.style;if(a){if(!this.textSize)this.textSize=12;a="normal"}else a="nowrap";b.whiteSpace=a;if(this._cssStore)this._cssStore.whiteSpace=a;this._fit()};b._canEdit=0;b.setEditable=function(a){a===1?(this.amSM||this.setCursor("text"),this._keyboardHandler?this._keyboardHandler.removeAllEventListeners():this._keyboardHandler=new jbeeb.Keyboard(this.element),this._keyboardHandler.addEventListener("keydown",this.keyHandler,this),this._keyboardHandler.addEventListener("keyup",
|
153 |
+
this.keyHandler,this),this.setOverflow("hidden"),jbeeb.Utils.bindEvent(this.element,"focus",this.setFocus.bind(this)),jbeeb.Utils.bindEvent(this.element,"blur",this._updateChange.bind(this)),this.addMEL("mouseUp",this.setFocus,this)):(this.amSM||this.setCursor("default"),this._keyboardHandler&&this._keyboardHandler.removeAllEventListeners(),jbeeb.Utils.unbindEvent(this.element,"focus",this.setFocus.bind(this)));this.editable=a};b.numeric=null;b.alphaNumeric=null;b.keyHandler=function(a,b,c){var d=
|
154 |
+
true;this.alphaNumeric?d=this._keyboardHandler.alphaNumeric(b):this.numeric&&(d=this._keyboardHandler.numeric(b));if(this.multiline==0&&(b==108||b==13))d=false,c=="keyup"&&this.dispatchEvent("enter",this,this.text);b==9&&(d=false,c=="keyup"&&this.dispatchEvent("tab",this,this.text));d?(this.text=this._canEdit&&!this.multiline?this.element.value:this._textNode.text,c=="keyup"&&this.dispatchEvent("change",this,this.text)):this._keyboardHandler.block(a)};b._updateChange=function(){this.dispatchEvent("change",
|
155 |
+
this,this.text)};b.setPadding=function(a){this.padding=a;var b;b=this._textNode?this._textNode.style:this.style;var c="",d="",f="",i="";this.multiline?(c=a+"px",d=a+"px",f=a+"px",i=a+"px"):this.align=="left"?a&&(c=a+"px"):this.align=="right"&&a&&(d=a+"px");b.paddingLeft=c;b.paddingRight=d;b.paddingTop=f;b.paddingBottom=i;if(this._cssStore)a=this._cssStore,a.paddingLeft=c,a.paddingRight=d,a.paddingTop=f,a.paddingBottom=i};b._format=function(){var a=this.font,b=this.textColor||{},b=jbeeb.Utils.makeColor(b.color,
|
156 |
+
b.alpha),c=this.bold?"bold":"normal",d=this.style;d.fontFamily=a;d.color=b;d.textAlign=this.align;d.fontWeight=c;if(this._cssStore)d=this._cssStore,d.fontFamily=a,d.color=b,d.textAlign=this.align,d.fontWeight=c};b.setFont=function(a){this.font=a;this.style.fontFamily=a;if(this._textNode)this._textNode.style.fontFamily=this.font;if(this._cssStore)this._cssStore.fontFamily=a;this._update()};b.setAlign=function(a){this.align=a;this.style.textAlign=a;a=="center"&&this.setPadding(0);if(this._cssStore)this._cssStore.textAlign=
|
157 |
+
a};b.setBold=function(a){this.bold=a?"bold":"";this.style.fontWeight=this.bold;if(this._cssStore)this._cssStore.fontWeight=this.bold;this._update()};b.setBaselineShift=function(a){(this.baselineShift=a)?a>1?a=1:a<-1&&(a=-1):a=0;a*=-1;this._BLScomp=1+a;this._update()};b.measureText=function(a){if(this.text||a){var b=document.createElement("div");document.body.appendChild(b);var c=b.style;c.fontSize=this.height*this.textScale+"px";c.fontFamily=this.font;c.fontWeight=this.bold?"bold":"normal";c.position=
|
158 |
+
"absolute";c.left=-1E3;c.top=-1E3;b.innerHTML=a||this.text;a={w:b.clientWidth,h:b.clientHeight};document.body.removeChild(b);return a}else return 0};b.setTextColor=function(a,b){if(!this.textColor)this.textColor={};this.textColor.color=a;this.textColor.alpha=b;var c=jbeeb.Utils.makeColor(a,b);this.style.color=c;if(this._cssStore)this._cssStore.color=c};b.setText=function(a){if(this.element){this.text=a=a==""||!a?"":String(a);if(this._canEdit&&!this.multiline)this.element.value=a;else{if(!this._textNode){var b=
|
159 |
+
document.createElement("span");b.style.fontFamily=this.font;this.element.appendChild(b);this._textNode=b}this._textNode.innerHTML=a}this._previuosText!=a&&this._update();this._previuosText=a}};b.selectAll=function(){if(this._canEdit)jbeeb.focus=this,this.element.focus(),this.element.select()};b._TextBox_setWidth=b.setWidth;b.setWidth=function(a){a!=this.width&&(this._TextBox_setWidth(a),this._fit())};b._TextBox_setHeight=b.setHeight;b.setHeight=function(a){a!=this.height&&(this._TextBox_setHeight(a),
|
160 |
+
this._fit())};b._TextBox_setSize=b.setSize;b.setSize=function(a,b){if(a!=this.width||b!=this.height)this._TextBox_setSize(a,b),this._fit()};b.setTextScale=function(a){this.textScale=a||1;this._fit()};b.setTextSize=function(a){this.textSize=a;this._fit()};b.setTextFit=function(a){this.textFit=a;this._fit()};b._TextBox_onAdded=b.onAdded;b.onAdded=function(){this._TextBox_onAdded();this._update()};b.setFocus=function(){jbeeb.focus=this;this.element.focus()};b._fit=function(){if(this.text!=""){var a=
|
161 |
+
null,b=null,c=null;if(this.textSize)a=this.textSize,b="1em",c=a+"px";else{var d=this.width,f=this.height;if(d>0&&f>0)if(this.textFit=="wh")a=d<f?d:f,a=this.textScale>0?a*this.textScale:a;else if(this.textFit=="w"){if(d=this.width/this.measureText().w/2,jbeeb.Utils.isNumber(d)&&d>0)this.textScale=d,a=f*d}else a=f*this.textScale;else a=0}a&&(b=this.height*this._BLScomp/a+"em",c=a+"px");a=this.style;a.lineHeight=b;a.fontSize=c;if(this._cssStore)this._cssStore.lineHeight=b,this._cssStore.fontSize=c}};
|
162 |
+
b.getTextSize=function(){return this.style.fontSize||null};b._update=function(){this._suspendUpdate||(this._fit(),this._format())};b._updateShadowText=function(){var a=this._makeShadowText(),b=this._makeBevelText(),c=this._makeOutlineText(),d=this._makeInsetText(),f="none";if(!(a==[]&&b==[]&&c==[]&&d==[])){for(var a=b.concat(c,a,d),b=a.length,c=[],d=[],i=0,g=0;g<b;g++)i==0?a[g]==1&&d.push("inset"):i<4?d.push(a[g]+"px"):(d.push(jbeeb.Utils.makeColor(a[g],a[g+1])),c.push(d.join(" ")),d=[],++g,i=-1),
|
163 |
+
i++;c.length>0&&(f=c.join(","))}a=this.style;a.textShadow=a.MozTextShadow=a.WebkitTextShadow=a.OTextShadow=a.msTextShadow=f;if(this._cssStore)this._cssStore.textShadow=f};b._makeShadowText=function(){var a=this.shadowText;return a?[0,a.x,a.y,a.s,a.c,a.a]:[]};b.setShadowText=function(a){this.shadowText=a;this._updateShadowText()};b._makeInsetText=function(){var a=this.insetText;return a?[1,a.x,a.y,a.s,a.c,a.a]:[]};b.setInsetText=function(a){this.insetText=a;this._updateShadowText()};b._makeBevelText=
|
164 |
+
function(){if(this.bevelText){var a=this.bevelText,b=[];a.c1&&a.a1>0&&(b=[0,-a.x,-a.y,a.s1,a.c1||"#000000",a.a1]);a.c2&&a.a2>0&&(b=b.concat([0,a.x,a.y,a.s2,a.c2||"#FFFFFF",a.a2]));return b}else return[]};b.setBevelText=function(a){this.bevelText=a;this._updateShadowText()};b._makeOutlineText=function(){if(this.outlineText){var a=this.outlineText;return[0,-a.weight,-a.weight,a.spread||0,a.color||"#000000",a.alpha,0,a.weight,-a.weight,a.spread||0,a.color||"#000000",a.alpha,0,-a.weight,a.weight,a.spread||
|
165 |
+
0,a.color||"#000000",a.alpha,0,a.weight,a.weight,a.spread||0,a.color||"#000000",a.alpha]}else return[]};b.setOutlineText=function(a){this.outlineText=a;this._updateShadowText()};b.toString=function(){return"[TextBox (name="+this.name+")]"};b.type="TextBox";jbeeb.TextBox=c})();this.jbeeb=this.jbeeb||{};
|
166 |
+
(function(){var c=function(a){this.init(a)},b=c.prototype=new jbeeb.Box(null);b._children=[];b.addChild=function(a){if(a==null)return a;var b=arguments.length;if(b>0)for(var c=0;c<b;c++){var d=arguments[c];d.parent&&d.parent.removeChild(d);d.parent=this;d.stage=this.amStage==1?this:this.stage;d.setZ(this._children.length);this.element.appendChild(d.element);d.onAdded&&d.onAdded.call(d);this._children.push(d)}};b.removeChild=function(a){var b=arguments.length;if(b>1){for(var c=true;b--;)c=c&&this.removeChild(arguments[b]);
|
167 |
+
return c}return this.removeChildAt(this._children.indexOf(a))};b.removeChildAt=function(a){var b=arguments.length;if(b>1){for(var c=[],d=0;d<b;d++)c[d]=arguments[d];c.sort(function(a,b){return b-a});for(var f=true,d=0;d<b;d++)f=f&&this.removeChildAt(c[d]);return f}if(a<0||a>this._children.length-1)return false;if(b=this._children[a])b.element&&b.element.parentNode&&b.element.parentNode.removeChild(b.element),b.parent=null;this._children.splice(a,1);this._consolidateZ();return true};b.removeAllChildren=
|
168 |
+
function(){for(var a=this._children;a.length;)this.removeChildAt(0)};b._consolidateZ=function(){for(var a=this._children.length,b=0;b<a;b++){var c=this._children[b];c&&c.setZ(b+1)}};b.toFront=function(a){if(a){for(var b=this._children.length,c=0,d=b;d--;)if(this._children[d]==a){c=d;break}jbeeb.Utils.arrayMove(this._children,c,b-1);this._consolidateZ()}else this.parent&&this.parent.toFront(this)};b.toBack=function(a){if(a){for(var b=0,c=this._children.length;c--;)if(this._children[c]==a){b=c;break}jbeeb.Utils.arrayMove(this._children,
|
169 |
+
b,0);this._consolidateZ()}else this.parent&&this.parent.toBack(this)};b._Container_init=b.init;b.init=function(a){this._Container_init(a);if(a)this.stage=this.amStage==1?this:this.stage,this._children=[]};b._Container_stretch=b.stretch;b.stretch=function(a,b){var c=a,d=b,f=this.flex;f&&(f.match(/w/)||(c=1),f.match(/h/)||(d=1));for(f=this._children.length;f--;){var i=this._children[f];i&&i.stretch(c,d)}this._Container_stretch(a,b)};b._Container_setFlex=b.setFlex;b.setFlex=function(a){for(var b=this._children.length;b--;)this._children[b].setFlex(a);
|
170 |
+
this._Container_setFlex(a)};b._Container_destroy=b.destroy;b.destroy=function(){if(this._children)for(var a=this._children.length;a--;)this._children[a]&&(this._children[a].destroy(),this.removeChild(this._children[a]),this._children[a]=null);this._children=null;this._Container_destroy()};b.destroyChildren=function(){if(this._children)for(var a=this._children.length;a--;)this._children[a]&&(this._children[a].destroy(),this.removeChild(this._children[a]),this._children[a]=null);this._children.length=
|
171 |
+
0;this._children=null;this._children=[]};b.getChildren=function(){return this._children};b.toString=function(){return"[Container (name="+this.name+")]"};b.type="Container";jbeeb.Container=c})();this.jbeeb=this.jbeeb||{};
|
172 |
+
(function(){var c=function(a){this._configure(a);return this},b=c.prototype=new jbeeb.Container;b.amReady=null;b._readyList=null;b._configure=function(a){if(a){this.amReady=0;if(a.onReady)this._readyList=[],this._readyList.push(a.onReady);this.id=jbeeb.getUID();if(a.stage)this.amStage=0,this._Stage_init(a);else{this.amStage=1;this.parent=this;this.stage=this;var b=a.target,c=null,d=0;if(b)(c=typeof b=="string"?document.getElementById(b):b)?c.nodeType===1?(this.element=document.createElement("div"),this.element.id=
|
173 |
+
this.id,c.appendChild(this.element)):d=1:d=1;if(!b||d)document.write('<div id="'+this.id+'"></div>'),this.element=document.getElementById(this.id);a.element=this.element;this._Stage_init(a);this.style=this.element.style;this.style.position="relative";this.style.display=a.inline===true||a.inline=="true"||a.inline===1?"inline-block":"block";this.style.verticalAlign="top";this.style.clear="both";this.style.zoom=1;this.setSize(this.width||a.w||1,this.height||a.h||1);this.setOverflow(a.overflow||"visible");
|
174 |
+
this.setCursor("default")}jbeeb.register(this)}};b._Stage_init=b.init;b.init=function(){var a=jbeeb.Utils.getXYWH(this.element);this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;setTimeout(this._doReady.bind(this),50)};b._doReady=function(){this.amReady=1;if(this._readyList)for(var a=0;a<this._readyList.length;a++)this._readyList.pop()()};b.onReady=function(a){if(this.amReady)a();else{if(!this._readyList)this._readyList=[];this._readyList.push(a)}};b.toString=function(){return"[Stage (name="+
|
175 |
+
this.name+")]"};b.type="Stage";jbeeb.Stage=c})();this.jbeeb=this.jbeeb||{};
|
176 |
+
(function(){var c=function(a){a=a||{};this._onComplete=a.onComplete;this._userTimezoneOffset=a.timezoneOffset||0;this._digits=a.digits||2;this._truncate=a.truncate||0;this._rangeHi=c._kRange[a.rangeHi]?c._kRange[a.rangeHi]:c._kYear;this._rangeLo=c._kRange[a.rangeLo]?c._kRange[a.rangeLo]:c._kSecond;a.end&&this._setTimeEnd(a.end);return this};c._MS_HOUR=36E5;c._MS_DAY=864E5;c._kMs=0;c._kSecond=1;c._kMinute=2;c._kHour=3;c._kDay=4;c._kMonth=5;c._kYear=6;c._kRange={ms:c._kMs,second:c._kSecond,minute:c._kMinute,
|
177 |
+
hour:c._kHour,day:c._kDay,month:c._kMonth,year:c._kYear};var b=c.prototype;b._done=false;b._doneFired=false;b._onComplete=null;b._timeEnd=null;b._userTimezoneOffset=0;b._digits=0;b._rangeHi=c._kYear;b._rangeLo=c._kMs;b._truncate=0;b._setTimeEnd=function(a){var b=new Date;if(a instanceof Date)a=new Date(a.getTime());else if(typeof a=="object"){var b=a.year?parseInt(a.year):b.getFullYear(),e=a.month?parseInt(a.month)-1:0,d=a.day?parseInt(a.day):0,f=a.hour?parseInt(a.hour):0,i=a.minute?parseInt(a.minute):
|
178 |
+
0,g=a.second?parseInt(a.second):0,a=(a.ampm?a.ampm:"am").toLowerCase();f<12&&/p/.test(a)&&(f+=12);a=new Date(b,e,d,f,i,g)}else a=new Date(b.getTime()+(parseInt(a)+1)*1E3);b=0;this._userTimezoneOffset!=0&&(b+=this._userTimezoneOffset*c._MS_HOUR);b!=0&&(a=a.getTime()+b,a=new Date(a));this._timeEnd=a;this._doneFired=this._done=false};b.update=function(){return this._calc(new Date)};b.diff=function(a,b){b&&this._setTimeEnd(b);return this._calc(a)};b._calc=function(a){var b=0,e=0,d=0,f=0,i=0,g=0,j=0,k=
|
179 |
+
this._timeEnd,o=k.getTime()-a.getTime(),p=Math.floor,v=false;if(o>0){var z=c._MS_HOUR,n=this._rangeLo,m=this._rangeHi;this._truncate&&(n=-1,m=10);var q=c._kMs,s=c._kSecond,r=c._kMinute,w=c._kHour,t=c._kDay,y=c._kMonth,l=o/1E3,u=l/60,x=u/60,B=x/24;n<t&&(m>=q&&(b=p(m==q?o:o%1E3)),m>=s&&(e=p(m==s?l:l%60)),m>=r&&(d=p(m==r?u:u%60)),m>=w&&(f=p(m==w?x:x%24)));o=a.getUTCFullYear();n=a.getUTCMonth();l=a.getUTCDate();q=k.getUTCFullYear();s=k.getUTCMonth();r=k.getUTCDate();w=l;u=0;if(m>=t)if(m==t)i=p(B);else{var i=
|
180 |
+
a.getUTCHours(),t=a.getUTCMinutes(),a=a.getUTCSeconds(),B=k.getUTCHours(),u=k.getUTCMinutes(),A=k.getUTCSeconds(),k=s+(s==n?0:-1);k<0&&(k+=12);x=c.getMonthDays(k,q);x=x<l?c.getMonthDays(k-1,q):x;x=x<r?r:x;k=0;r>l?k=r-l-1:r<l&&(k=l-r-1);u=(c._MS_DAY-(a+t*60+i*3600)*1E3+(A+u*60+B*3600)*1E3)/z;u<24&&l++;l+=k;i=p((x-l+r+k)%x)}m>=y&&(j=0,g=(q-o)*12,g<0||o==q&&n==s?g=0:(n++,s++,k=0,s==n?w<=r&&k--:s>n?k=s-n-1:s<n&&(k=12-n+s,j--),u<24&&w++,n>=s&&w>r?k--:s>=n&&w<=r&&k++,g+=k,g<0&&(g=0),g>11&&(j+=p(g/12),g%=
|
181 |
+
12),m==y&&(g+=j*12,j=0)))}else v=true;b={ms:b,second:e,minute:d,hour:f,day:i,month:g,year:j};c.pad(b,this._digits);if(v&&!this._doneFired&&this._onComplete)this._doneFired=this._done=true,this._onComplete(this._timeEnd);return b};c._daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];c.getMonthDays=function(a,b){return a==1?b%400==0||b%4==0&&b%100!=0?29:28:c._daysInMonth[a]};c.pad=function(a,b){if(b)for(var c in a){for(var d=String(a[c]),f=c=="ms"?3:b;d.length<f;)d="0"+d;a[c]=d}};Object.defineProperty(b,
|
182 |
+
"rangeHi",{get:function(){return this._rangeHi},set:function(a){this._rangeHi=c._kRange[a]?c._kRange[a]:c._kYear}});Object.defineProperty(b,"rangeLo",{get:function(){return this._rangeLo},set:function(a){this._rangeLo=c._kRange[a]?c._kRange[a]:c._kSecond}});jbeeb.TimeDiff=c})();var EXTRACT_START=1,CountdownImageFolder="images/",CountdownImageBasename="flipper",CountdownImageExt="png",CountdownImagePhysicalWidth=41,CountdownImagePhysicalHeight=60,CountdownWidth=400,CountdownHeight=60,CountdownLabels={ms:"MS",second:"SECONDS",minute:"MINUTES",hour:"HOURS",day:"DAYS",month:"MONTHS",year:"YEARS"},CountdownInterval=76,EXTRACT_END=1;
|
183 |
+
(function(){var c=function(a){this.imageFolder=CountdownImageFolder;this.imageBasename=CountdownImageBasename;this.imageExt=CountdownImageExt;this.imagePhysicalWidth=CountdownImagePhysicalWidth;this.imagePhysicalHeight=CountdownImagePhysicalHeight;this.totalFlipDigits=2;this._params=a||{};var b,c,d,f;if(a.bkgd){var i=a.bkgd;if(i.color)b=i.color;i.stroke&&i.strokeColor&&(c={weight:i.stroke||1,color:i.strokeColor,alpha:i.strokeAlpha});if(i.shadow)d=i.shadow;if(i.rounded)f=i.rounded}this._stage=new jbeeb.Stage({target:a.target,
|
184 |
+
inline:a.inline||false,w:a.w||a.width||CountdownWidth,h:a.h||a.height||CountdownHeight,rounded:f||null,fill:b||null,stroke:c||null,shadow:d||null});jbeeb.register(this)},b=c.prototype;b._params=null;b._stage=null;b._done=false;b._onComplete=null;b.id=null;b._initDone=false;b._style=null;b.totalFlipDigits=null;b.imageFolder=null;b.imageBasename="flipper";b.imageExt="png";b._blocks=null;b._store=null;b._maxDisplayName="second";b._hideLabels=false;b._labelText=null;b._hideLine=false;b._defaultBlockWidth=
|
185 |
+
0;b._digitWidth=0;b._blockSpacing=0;b._doublePadding=0;b._orderedBlockList=[];b._previousSizes={};b._interval=0;b._intervalCounter=0;b._timeRunnerNow=null;b.init=function(){this.id=jbeeb.getUID();var a=this._params;this._initDone=this._done=false;this._style=a.style||"boring";this.width=a.w||a.width||CountdownWidth;this.height=a.h||a.height||CountdownHeight;this._onComplete=a.onComplete;this._hideLabels=a.hideLabels;this._hideLine=a.hideLine;this._labelText=a.labelText||CountdownLabels;this._interval=
|
186 |
+
a.interval||CountdownInterval;this._intervalCounter=0;this._timeRunnerNow={year:0,month:0,day:0,hour:0,minute:0,second:0,ms:0};var b="";if(this._style=="flip"){b="";if(this.imageFolder.substr(1)!="/"&&this.imageFolder.substr(4)!="http")b=jbeeb.scriptPath,b!=""&&b.substr(4)=="http"&&b.substr(-1)!="/"&&(b+="/");this.imageFolder.substr(-1)!="/"&&(this.imageFolder+="/");b=b+this.imageFolder+this.imageBasename}this._store={ms:{use:false,prev:[null,null],ani:[null,null],aniCount:[null,null]},second:{use:false,
|
187 |
+
prev:[null,null],ani:[null,null],aniCount:[null,null]},minute:{use:false,prev:[null,null],ani:[null,null],aniCount:[null,null]},hour:{use:false,prev:[null,null],ani:[null,null],aniCount:[null,null]},day:{use:false,prev:[null,null],ani:[null,null],aniCount:[null,null]},month:{use:false,prev:[null,null],ani:[null,null],aniCount:[null,null]},year:{use:false,prev:[null,null],ani:[null,null],aniCount:[null,null]}};for(var c="ms,second,minute,hour,day,month,year".split(","),d=a.rangeLo?a.rangeLo:"second",
|
188 |
+
f=a.rangeHi?a.rangeHi:"year",d=d!="ms"&&d.substr(-1)=="s"?d.substr(0,d.length-1):d,f=f!="ms"&&f.substr(-1)=="s"?f.substr(0,f.length-1):f,i=d,g=f,j=0;j<c.length;j++){var k=c[j];k==d&&(d=j);k==f&&(f=j)}for(j=0;j<c.length;j++)if(j>=d&&j<=f)k=c[j],this._store[k].use=true,this._maxDisplayName=k;k=a.padding===0?0:a.padding?a.padding:this._style=="flip"?0:0.8;this._style=="flip"&&(k/=2);var o=this.height,d=this.width/(f-d+1),f=this._hideLabels?0:d*0.25,p=d*0.1,v=d-p,z=o-f,n=v*k;this._style=="flip"&&(n=v*
|
189 |
+
(k/this.totalFlipDigits));var m=v-n,q=this.height-f*2;this._digitWidth=v/this.totalFlipDigits;this._blockSpacing=p;var s=0;this._style=="flip"&&(q=this.height-f,s=o*0.03);this._defaultBlockWidth=v;this._digitWidth=m*this.totalFlipDigits;this._blockSpacing=p;this._doublePadding=n/2/this.totalFlipDigits/2;var r={font:"Arial, _sans",color:"#FFFFFF",weight:"normal",bkgd:this._style=="flip"?null:{color:["#000000",1,0,"#686868",1,50,"#000000",1,50,"#535050",1,100],alpha:"v"},rounded:this._style=="flip"?
|
190 |
+
null:0.18,shadow:null},w={font:"Arial, _sans",color:"#303030",weight:"bold",textScale:1,offset:0};if(a.numbers)for(var t in r)a.numbers[t]&&(r[t]=a.numbers[t]);if(a.labels)for(t in w)a.labels[t]&&(w[t]=a.labels[t]);c.reverse();this._blocks={};this._orderedBlockList=[];for(j=t=0;j<c.length;j++){var y=c[j];if(this._store[y].use){this._blocks[y]=new jbeeb.Container({x:t+p/2,y:0,w:v,h:z,rounded:r.rounded||null,fill:jbeeb.Utils.clone(r.bkgd)||null,shadow:r.shadow||null});var l=this._blocks[y];l.store=
|
191 |
+
{name:y};this._previousSizes[y]=v;if(this._style=="flip"){var u=this.imagePhysicalWidth*((m-s*2-n*2)/this.totalFlipDigits/this.imagePhysicalWidth),x=this.imagePhysicalHeight*(q/this.imagePhysicalHeight);l.time=new jbeeb.Container({x:0,y:0,w:u*this.totalFlipDigits,h:x});for(var B=[],A=0;A<this.totalFlipDigits;A++){for(var C=new jbeeb.Container({x:u*A+s*A,y:0,w:u,h:x}),G=[],D=0;D<10;D++){for(var E=new jbeeb.Container({x:0,y:0,w:u,h:x}),H=[],F=0;F<3;F++){var I=new jbeeb.Box({x:0,y:0,w:u,h:x,image:{url:b+
|
192 |
+
(""+D+""+F)+"."+this.imageExt,mode:"fit"}});H[F]=I;E.addChild(I)}E.img=H;G[D]=E;C.addChild(E)}C.num=G;B[A]=C;l.time.addChild(C)}l.time.slot=B;l.addChild(l.time)}else if(l.time=new jbeeb.TextBox({x:0,y:0,w:v,h:z,text:"00",textScale:k,font:r.font,textColor:r.color,align:"center"}),l.addChild(l.time),!this._hideLine)l.line=new jbeeb.Box({x:0,y:0,w:v,h:o*0.03,fill:"#000000"}),l.addChild(l.line),l.line.center();this._stage.addChild(l);if(!this._hideLabels)l.labels=new jbeeb.TextBox({x:t,y:o-f*0.7+w.offset,
|
193 |
+
w:d,h:f*0.7,font:w.font,textScale:w.textScale,textColor:w.color,bold:1,align:"center",text:this._labelText[y]}),this._stage.addChild(l.labels);this._orderedBlockList.push(l);l.time.center();a.numberMarginTop&&l.time.setY(a.numberMarginTop);t+=d}}l=this._blocks;this._style=="flip"?(l.year&&this._flipRunner("year","00"),l.month&&this._flipRunner("month","00"),l.day&&this._flipRunner("day","00"),l.hour&&this._flipRunner("hour","00"),l.minute&&this._flipRunner("minute","00"),l.second&&this._flipRunner("second",
|
194 |
+
"00"),l.ms&&this._flipRunner("ms","000")):(l.year&&l.year.time.setText("00"),l.month&&l.month.time.setText("00"),l.day&&l.day.time.setText("00"),l.hour&&l.hour.time.setText("00"),l.minute&&l.minute.time.setText("00"),l.second&&l.second.time.setText("00"),l.ms&&l.ms.time.setText("000"),this._reformat());this._timediff=new jbeeb.TimeDiff({end:a.time?a.time:{year:a.year||a.years,month:a.month||a.months,day:a.day||a.days,hour:a.hour||a.hours,minute:a.minute||a.minutes,second:a.second||a.seconds,ms:a.second||
|
195 |
+
a.ms,ampm:a.ampm||""},rangeHi:g,rangeLo:i,timezoneOffset:a.offset||0,onComplete:this._doWhenDone.bind(this),truncate:a.truncate||0});this._initDone=true;jbeeb.ticker.addEventListener("tick",this.tick,this)};b.tick=function(){this._initDone===true&&this._timeRunner()};b._doWhenDone=function(a){this._onComplete&&this._onComplete(a)};b._calcSize=function(a){return a.toString().length*this._digitWidth};b._reformat=function(){for(var a=false,b=0;b<this._orderedBlockList.length;b++){var c=this._orderedBlockList[b],
|
196 |
+
d=c.store.name,f=c.time.text,f=this._calcSize(f);f>=this._defaultBlockWidth&&f!=this._previousSizes[d]&&(c.setWidth(f+this._doublePadding),this._previousSizes[d]=f+this._doublePadding,a=true)}if(a)for(b=a=0;b<this._orderedBlockList.length;b++)c=this._orderedBlockList[b],f=c.time.text,this._calcSize(f),c.setX(a),c.time.setWidth(c.width),c.time.center(),c.labels&&(c.labels.setX(a),c.labels.setWidth(c.width)),c.line&&(c.line.setWidth(c.width),c.line.center()),a+=c.width+this._blockSpacing};b._timeRunner=
|
197 |
+
function(){this._intervalCounter+=jbeeb.ticker.getInterval();if(this._intervalCounter>this._interval)this._timeRunnerNow=this._timediff.update(),this._intervalCounter=0;var a=this._blocks,b=this._timeRunnerNow;this._style=="flip"?(a.year&&this._flipRunner("year",b.year),a.month&&this._flipRunner("month",b.month),a.day&&this._flipRunner("day",b.day),a.hour&&this._flipRunner("hour",b.hour),a.minute&&this._flipRunner("minute",b.minute),a.second&&this._flipRunner("second",b.second),a.ms&&this._flipRunner("ms",
|
198 |
+
b.ms)):(a.year&&a.year.time.setText(b.year),a.month&&a.month.time.setText(b.month),a.day&&a.day.time.setText(b.day),a.hour&&a.hour.time.setText(b.hour),a.minute&&a.minute.time.setText(b.minute),a.second&&a.second.time.setText(b.second),a.ms&&a.ms.time.setText(b.ms),this._reformat())};b._flipRunner=function(a,b){for(var c=0;c<this.totalFlipDigits;c++){var d=this._blocks[a].time.slot[c],f=this._store[a],i=String(b).substr(c,1),g=d.num[i];if(g){if(f.prev[c]!=i){for(var j=0;j<10;j++)d.num[j].hide();g.show();
|
199 |
+
f.ani[c]=true;f.aniCount[c]=0}if(f.ani[c]){for(j=0;j<3;j++)g.img[j].hide();this._done?g.img[2].show():(g.img[f.aniCount[c]].show(),f.aniCount[c]++,f.aniCount[c]>2&&(f.ani[c]=false))}f.prev[c]=i}}};window.Countdown=c})();
|
skin/frontend/base/default/js/imedia_countdown/grabbing.png
ADDED
Binary file
|
skin/frontend/base/default/js/imedia_countdown/jquery-1.9.1.min.js
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
|
2 |
+
//@ sourceMappingURL=jquery.min.map
|
3 |
+
*/(function(e,t){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){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;
|
4 |
+
return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),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&>(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){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)){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){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)
|
5 |
+
}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}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},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))}}});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})})(window);
|
skin/frontend/base/default/js/imedia_countdown/owl.carousel.js
ADDED
@@ -0,0 +1,1512 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* jQuery OwlCarousel v1.3.3
|
3 |
+
*
|
4 |
+
* Copyright (c) 2013 Bartosz Wojciechowski
|
5 |
+
* http://www.owlgraphic.com/owlcarousel/
|
6 |
+
*
|
7 |
+
* Licensed under MIT
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
|
11 |
+
/*JS Lint helpers: */
|
12 |
+
/*global dragMove: false, dragEnd: false, $, jQuery, alert, window, document */
|
13 |
+
/*jslint nomen: true, continue:true */
|
14 |
+
|
15 |
+
if (typeof Object.create !== "function") {
|
16 |
+
Object.create = function (obj) {
|
17 |
+
function F() {}
|
18 |
+
F.prototype = obj;
|
19 |
+
return new F();
|
20 |
+
};
|
21 |
+
}
|
22 |
+
(function ($, window, document) {
|
23 |
+
|
24 |
+
var Carousel = {
|
25 |
+
init : function (options, el) {
|
26 |
+
var base = this;
|
27 |
+
|
28 |
+
base.$elem = $(el);
|
29 |
+
base.options = $.extend({}, $.fn.owlCarousel.options, base.$elem.data(), options);
|
30 |
+
|
31 |
+
base.userOptions = options;
|
32 |
+
base.loadContent();
|
33 |
+
},
|
34 |
+
|
35 |
+
loadContent : function () {
|
36 |
+
var base = this, url;
|
37 |
+
|
38 |
+
function getData(data) {
|
39 |
+
var i, content = "";
|
40 |
+
if (typeof base.options.jsonSuccess === "function") {
|
41 |
+
base.options.jsonSuccess.apply(this, [data]);
|
42 |
+
} else {
|
43 |
+
for (i in data.owl) {
|
44 |
+
if (data.owl.hasOwnProperty(i)) {
|
45 |
+
content += data.owl[i].item;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
base.$elem.html(content);
|
49 |
+
}
|
50 |
+
base.logIn();
|
51 |
+
}
|
52 |
+
|
53 |
+
if (typeof base.options.beforeInit === "function") {
|
54 |
+
base.options.beforeInit.apply(this, [base.$elem]);
|
55 |
+
}
|
56 |
+
|
57 |
+
if (typeof base.options.jsonPath === "string") {
|
58 |
+
url = base.options.jsonPath;
|
59 |
+
$.getJSON(url, getData);
|
60 |
+
} else {
|
61 |
+
base.logIn();
|
62 |
+
}
|
63 |
+
},
|
64 |
+
|
65 |
+
logIn : function () {
|
66 |
+
var base = this;
|
67 |
+
|
68 |
+
base.$elem.data("owl-originalStyles", base.$elem.attr("style"));
|
69 |
+
base.$elem.data("owl-originalClasses", base.$elem.attr("class"));
|
70 |
+
|
71 |
+
base.$elem.css({opacity: 0});
|
72 |
+
base.orignalItems = base.options.items;
|
73 |
+
base.checkBrowser();
|
74 |
+
base.wrapperWidth = 0;
|
75 |
+
base.checkVisible = null;
|
76 |
+
base.setVars();
|
77 |
+
},
|
78 |
+
|
79 |
+
setVars : function () {
|
80 |
+
var base = this;
|
81 |
+
if (base.$elem.children().length === 0) {return false; }
|
82 |
+
base.baseClass();
|
83 |
+
base.eventTypes();
|
84 |
+
base.$userItems = base.$elem.children();
|
85 |
+
base.itemsAmount = base.$userItems.length;
|
86 |
+
base.wrapItems();
|
87 |
+
base.$owlItems = base.$elem.find(".owl-item");
|
88 |
+
base.$owlWrapper = base.$elem.find(".owl-wrapper");
|
89 |
+
base.playDirection = "next";
|
90 |
+
base.prevItem = 0;
|
91 |
+
base.prevArr = [0];
|
92 |
+
base.currentItem = 0;
|
93 |
+
base.customEvents();
|
94 |
+
base.onStartup();
|
95 |
+
},
|
96 |
+
|
97 |
+
onStartup : function () {
|
98 |
+
var base = this;
|
99 |
+
base.updateItems();
|
100 |
+
base.calculateAll();
|
101 |
+
base.buildControls();
|
102 |
+
base.updateControls();
|
103 |
+
base.response();
|
104 |
+
base.moveEvents();
|
105 |
+
base.stopOnHover();
|
106 |
+
base.owlStatus();
|
107 |
+
|
108 |
+
if (base.options.transitionStyle !== false) {
|
109 |
+
base.transitionTypes(base.options.transitionStyle);
|
110 |
+
}
|
111 |
+
if (base.options.autoPlay === true) {
|
112 |
+
base.options.autoPlay = 5000;
|
113 |
+
}
|
114 |
+
base.play();
|
115 |
+
|
116 |
+
base.$elem.find(".owl-wrapper").css("display", "block");
|
117 |
+
|
118 |
+
if (!base.$elem.is(":visible")) {
|
119 |
+
base.watchVisibility();
|
120 |
+
} else {
|
121 |
+
base.$elem.css("opacity", 1);
|
122 |
+
}
|
123 |
+
base.onstartup = false;
|
124 |
+
base.eachMoveUpdate();
|
125 |
+
if (typeof base.options.afterInit === "function") {
|
126 |
+
base.options.afterInit.apply(this, [base.$elem]);
|
127 |
+
}
|
128 |
+
},
|
129 |
+
|
130 |
+
eachMoveUpdate : function () {
|
131 |
+
var base = this;
|
132 |
+
|
133 |
+
if (base.options.lazyLoad === true) {
|
134 |
+
base.lazyLoad();
|
135 |
+
}
|
136 |
+
if (base.options.autoHeight === true) {
|
137 |
+
base.autoHeight();
|
138 |
+
}
|
139 |
+
base.onVisibleItems();
|
140 |
+
|
141 |
+
if (typeof base.options.afterAction === "function") {
|
142 |
+
base.options.afterAction.apply(this, [base.$elem]);
|
143 |
+
}
|
144 |
+
},
|
145 |
+
|
146 |
+
updateVars : function () {
|
147 |
+
var base = this;
|
148 |
+
if (typeof base.options.beforeUpdate === "function") {
|
149 |
+
base.options.beforeUpdate.apply(this, [base.$elem]);
|
150 |
+
}
|
151 |
+
base.watchVisibility();
|
152 |
+
base.updateItems();
|
153 |
+
base.calculateAll();
|
154 |
+
base.updatePosition();
|
155 |
+
base.updateControls();
|
156 |
+
base.eachMoveUpdate();
|
157 |
+
if (typeof base.options.afterUpdate === "function") {
|
158 |
+
base.options.afterUpdate.apply(this, [base.$elem]);
|
159 |
+
}
|
160 |
+
},
|
161 |
+
|
162 |
+
reload : function () {
|
163 |
+
var base = this;
|
164 |
+
window.setTimeout(function () {
|
165 |
+
base.updateVars();
|
166 |
+
}, 0);
|
167 |
+
},
|
168 |
+
|
169 |
+
watchVisibility : function () {
|
170 |
+
var base = this;
|
171 |
+
|
172 |
+
if (base.$elem.is(":visible") === false) {
|
173 |
+
base.$elem.css({opacity: 0});
|
174 |
+
window.clearInterval(base.autoPlayInterval);
|
175 |
+
window.clearInterval(base.checkVisible);
|
176 |
+
} else {
|
177 |
+
return false;
|
178 |
+
}
|
179 |
+
base.checkVisible = window.setInterval(function () {
|
180 |
+
if (base.$elem.is(":visible")) {
|
181 |
+
base.reload();
|
182 |
+
base.$elem.animate({opacity: 1}, 200);
|
183 |
+
window.clearInterval(base.checkVisible);
|
184 |
+
}
|
185 |
+
}, 500);
|
186 |
+
},
|
187 |
+
|
188 |
+
wrapItems : function () {
|
189 |
+
var base = this;
|
190 |
+
base.$userItems.wrapAll("<div class=\"owl-wrapper\">").wrap("<div class=\"owl-item\"></div>");
|
191 |
+
base.$elem.find(".owl-wrapper").wrap("<div class=\"owl-wrapper-outer\">");
|
192 |
+
base.wrapperOuter = base.$elem.find(".owl-wrapper-outer");
|
193 |
+
base.$elem.css("display", "block");
|
194 |
+
},
|
195 |
+
|
196 |
+
baseClass : function () {
|
197 |
+
var base = this,
|
198 |
+
hasBaseClass = base.$elem.hasClass(base.options.baseClass),
|
199 |
+
hasThemeClass = base.$elem.hasClass(base.options.theme);
|
200 |
+
|
201 |
+
if (!hasBaseClass) {
|
202 |
+
base.$elem.addClass(base.options.baseClass);
|
203 |
+
}
|
204 |
+
|
205 |
+
if (!hasThemeClass) {
|
206 |
+
base.$elem.addClass(base.options.theme);
|
207 |
+
}
|
208 |
+
},
|
209 |
+
|
210 |
+
updateItems : function () {
|
211 |
+
var base = this, width, i;
|
212 |
+
|
213 |
+
if (base.options.responsive === false) {
|
214 |
+
return false;
|
215 |
+
}
|
216 |
+
if (base.options.singleItem === true) {
|
217 |
+
base.options.items = base.orignalItems = 1;
|
218 |
+
base.options.itemsCustom = false;
|
219 |
+
base.options.itemsDesktop = false;
|
220 |
+
base.options.itemsDesktopSmall = false;
|
221 |
+
base.options.itemsTablet = false;
|
222 |
+
base.options.itemsTabletSmall = false;
|
223 |
+
base.options.itemsMobile = false;
|
224 |
+
return false;
|
225 |
+
}
|
226 |
+
|
227 |
+
width = $(base.options.responsiveBaseWidth).width();
|
228 |
+
|
229 |
+
if (width > (base.options.itemsDesktop[0] || base.orignalItems)) {
|
230 |
+
base.options.items = base.orignalItems;
|
231 |
+
}
|
232 |
+
if (base.options.itemsCustom !== false) {
|
233 |
+
//Reorder array by screen size
|
234 |
+
base.options.itemsCustom.sort(function (a, b) {return a[0] - b[0]; });
|
235 |
+
|
236 |
+
for (i = 0; i < base.options.itemsCustom.length; i += 1) {
|
237 |
+
if (base.options.itemsCustom[i][0] <= width) {
|
238 |
+
base.options.items = base.options.itemsCustom[i][1];
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
} else {
|
243 |
+
|
244 |
+
if (width <= base.options.itemsDesktop[0] && base.options.itemsDesktop !== false) {
|
245 |
+
base.options.items = base.options.itemsDesktop[1];
|
246 |
+
}
|
247 |
+
|
248 |
+
if (width <= base.options.itemsDesktopSmall[0] && base.options.itemsDesktopSmall !== false) {
|
249 |
+
base.options.items = base.options.itemsDesktopSmall[1];
|
250 |
+
}
|
251 |
+
|
252 |
+
if (width <= base.options.itemsTablet[0] && base.options.itemsTablet !== false) {
|
253 |
+
base.options.items = base.options.itemsTablet[1];
|
254 |
+
}
|
255 |
+
|
256 |
+
if (width <= base.options.itemsTabletSmall[0] && base.options.itemsTabletSmall !== false) {
|
257 |
+
base.options.items = base.options.itemsTabletSmall[1];
|
258 |
+
}
|
259 |
+
|
260 |
+
if (width <= base.options.itemsMobile[0] && base.options.itemsMobile !== false) {
|
261 |
+
base.options.items = base.options.itemsMobile[1];
|
262 |
+
}
|
263 |
+
}
|
264 |
+
|
265 |
+
//if number of items is less than declared
|
266 |
+
if (base.options.items > base.itemsAmount && base.options.itemsScaleUp === true) {
|
267 |
+
base.options.items = base.itemsAmount;
|
268 |
+
}
|
269 |
+
},
|
270 |
+
|
271 |
+
response : function () {
|
272 |
+
var base = this,
|
273 |
+
smallDelay,
|
274 |
+
lastWindowWidth;
|
275 |
+
|
276 |
+
if (base.options.responsive !== true) {
|
277 |
+
return false;
|
278 |
+
}
|
279 |
+
lastWindowWidth = $(window).width();
|
280 |
+
|
281 |
+
base.resizer = function () {
|
282 |
+
if ($(window).width() !== lastWindowWidth) {
|
283 |
+
if (base.options.autoPlay !== false) {
|
284 |
+
window.clearInterval(base.autoPlayInterval);
|
285 |
+
}
|
286 |
+
window.clearTimeout(smallDelay);
|
287 |
+
smallDelay = window.setTimeout(function () {
|
288 |
+
lastWindowWidth = $(window).width();
|
289 |
+
base.updateVars();
|
290 |
+
}, base.options.responsiveRefreshRate);
|
291 |
+
}
|
292 |
+
};
|
293 |
+
$(window).resize(base.resizer);
|
294 |
+
},
|
295 |
+
|
296 |
+
updatePosition : function () {
|
297 |
+
var base = this;
|
298 |
+
base.jumpTo(base.currentItem);
|
299 |
+
if (base.options.autoPlay !== false) {
|
300 |
+
base.checkAp();
|
301 |
+
}
|
302 |
+
},
|
303 |
+
|
304 |
+
appendItemsSizes : function () {
|
305 |
+
var base = this,
|
306 |
+
roundPages = 0,
|
307 |
+
lastItem = base.itemsAmount - base.options.items;
|
308 |
+
|
309 |
+
base.$owlItems.each(function (index) {
|
310 |
+
var $this = $(this);
|
311 |
+
$this
|
312 |
+
.css({"width": base.itemWidth})
|
313 |
+
.data("owl-item", Number(index));
|
314 |
+
|
315 |
+
if (index % base.options.items === 0 || index === lastItem) {
|
316 |
+
if (!(index > lastItem)) {
|
317 |
+
roundPages += 1;
|
318 |
+
}
|
319 |
+
}
|
320 |
+
$this.data("owl-roundPages", roundPages);
|
321 |
+
});
|
322 |
+
},
|
323 |
+
|
324 |
+
appendWrapperSizes : function () {
|
325 |
+
var base = this,
|
326 |
+
width = base.$owlItems.length * base.itemWidth;
|
327 |
+
|
328 |
+
base.$owlWrapper.css({
|
329 |
+
"width": width * 2,
|
330 |
+
"left": 0
|
331 |
+
});
|
332 |
+
base.appendItemsSizes();
|
333 |
+
},
|
334 |
+
|
335 |
+
calculateAll : function () {
|
336 |
+
var base = this;
|
337 |
+
base.calculateWidth();
|
338 |
+
base.appendWrapperSizes();
|
339 |
+
base.loops();
|
340 |
+
base.max();
|
341 |
+
},
|
342 |
+
|
343 |
+
calculateWidth : function () {
|
344 |
+
var base = this;
|
345 |
+
base.itemWidth = Math.round(base.$elem.width() / base.options.items);
|
346 |
+
},
|
347 |
+
|
348 |
+
max : function () {
|
349 |
+
var base = this,
|
350 |
+
maximum = ((base.itemsAmount * base.itemWidth) - base.options.items * base.itemWidth) * -1;
|
351 |
+
if (base.options.items > base.itemsAmount) {
|
352 |
+
base.maximumItem = 0;
|
353 |
+
maximum = 0;
|
354 |
+
base.maximumPixels = 0;
|
355 |
+
} else {
|
356 |
+
base.maximumItem = base.itemsAmount - base.options.items;
|
357 |
+
base.maximumPixels = maximum;
|
358 |
+
}
|
359 |
+
return maximum;
|
360 |
+
},
|
361 |
+
|
362 |
+
min : function () {
|
363 |
+
return 0;
|
364 |
+
},
|
365 |
+
|
366 |
+
loops : function () {
|
367 |
+
var base = this,
|
368 |
+
prev = 0,
|
369 |
+
elWidth = 0,
|
370 |
+
i,
|
371 |
+
item,
|
372 |
+
roundPageNum;
|
373 |
+
|
374 |
+
base.positionsInArray = [0];
|
375 |
+
base.pagesInArray = [];
|
376 |
+
|
377 |
+
for (i = 0; i < base.itemsAmount; i += 1) {
|
378 |
+
elWidth += base.itemWidth;
|
379 |
+
base.positionsInArray.push(-elWidth);
|
380 |
+
|
381 |
+
if (base.options.scrollPerPage === true) {
|
382 |
+
item = $(base.$owlItems[i]);
|
383 |
+
roundPageNum = item.data("owl-roundPages");
|
384 |
+
if (roundPageNum !== prev) {
|
385 |
+
base.pagesInArray[prev] = base.positionsInArray[i];
|
386 |
+
prev = roundPageNum;
|
387 |
+
}
|
388 |
+
}
|
389 |
+
}
|
390 |
+
},
|
391 |
+
|
392 |
+
buildControls : function () {
|
393 |
+
var base = this;
|
394 |
+
if (base.options.navigation === true || base.options.pagination === true) {
|
395 |
+
base.owlControls = $("<div class=\"owl-controls\"/>").toggleClass("clickable", !base.browser.isTouch).appendTo(base.$elem);
|
396 |
+
}
|
397 |
+
if (base.options.pagination === true) {
|
398 |
+
base.buildPagination();
|
399 |
+
}
|
400 |
+
if (base.options.navigation === true) {
|
401 |
+
base.buildButtons();
|
402 |
+
}
|
403 |
+
},
|
404 |
+
|
405 |
+
buildButtons : function () {
|
406 |
+
var base = this,
|
407 |
+
buttonsWrapper = $("<div class=\"owl-buttons\"/>");
|
408 |
+
base.owlControls.append(buttonsWrapper);
|
409 |
+
|
410 |
+
base.buttonPrev = $("<div/>", {
|
411 |
+
"class" : "owl-prev",
|
412 |
+
"html" : base.options.navigationText[0] || ""
|
413 |
+
});
|
414 |
+
|
415 |
+
base.buttonNext = $("<div/>", {
|
416 |
+
"class" : "owl-next",
|
417 |
+
"html" : base.options.navigationText[1] || ""
|
418 |
+
});
|
419 |
+
|
420 |
+
buttonsWrapper
|
421 |
+
.append(base.buttonPrev)
|
422 |
+
.append(base.buttonNext);
|
423 |
+
|
424 |
+
buttonsWrapper.on("touchstart.owlControls mousedown.owlControls", "div[class^=\"owl\"]", function (event) {
|
425 |
+
event.preventDefault();
|
426 |
+
});
|
427 |
+
|
428 |
+
buttonsWrapper.on("touchend.owlControls mouseup.owlControls", "div[class^=\"owl\"]", function (event) {
|
429 |
+
event.preventDefault();
|
430 |
+
if ($(this).hasClass("owl-next")) {
|
431 |
+
base.next();
|
432 |
+
} else {
|
433 |
+
base.prev();
|
434 |
+
}
|
435 |
+
});
|
436 |
+
},
|
437 |
+
|
438 |
+
buildPagination : function () {
|
439 |
+
var base = this;
|
440 |
+
|
441 |
+
base.paginationWrapper = $("<div class=\"owl-pagination\"/>");
|
442 |
+
base.owlControls.append(base.paginationWrapper);
|
443 |
+
|
444 |
+
base.paginationWrapper.on("touchend.owlControls mouseup.owlControls", ".owl-page", function (event) {
|
445 |
+
event.preventDefault();
|
446 |
+
if (Number($(this).data("owl-page")) !== base.currentItem) {
|
447 |
+
base.goTo(Number($(this).data("owl-page")), true);
|
448 |
+
}
|
449 |
+
});
|
450 |
+
},
|
451 |
+
|
452 |
+
updatePagination : function () {
|
453 |
+
var base = this,
|
454 |
+
counter,
|
455 |
+
lastPage,
|
456 |
+
lastItem,
|
457 |
+
i,
|
458 |
+
paginationButton,
|
459 |
+
paginationButtonInner;
|
460 |
+
|
461 |
+
if (base.options.pagination === false) {
|
462 |
+
return false;
|
463 |
+
}
|
464 |
+
|
465 |
+
base.paginationWrapper.html("");
|
466 |
+
|
467 |
+
counter = 0;
|
468 |
+
lastPage = base.itemsAmount - base.itemsAmount % base.options.items;
|
469 |
+
|
470 |
+
for (i = 0; i < base.itemsAmount; i += 1) {
|
471 |
+
if (i % base.options.items === 0) {
|
472 |
+
counter += 1;
|
473 |
+
if (lastPage === i) {
|
474 |
+
lastItem = base.itemsAmount - base.options.items;
|
475 |
+
}
|
476 |
+
paginationButton = $("<div/>", {
|
477 |
+
"class" : "owl-page"
|
478 |
+
});
|
479 |
+
paginationButtonInner = $("<span></span>", {
|
480 |
+
"text": base.options.paginationNumbers === true ? counter : "",
|
481 |
+
"class": base.options.paginationNumbers === true ? "owl-numbers" : ""
|
482 |
+
});
|
483 |
+
paginationButton.append(paginationButtonInner);
|
484 |
+
|
485 |
+
paginationButton.data("owl-page", lastPage === i ? lastItem : i);
|
486 |
+
paginationButton.data("owl-roundPages", counter);
|
487 |
+
|
488 |
+
base.paginationWrapper.append(paginationButton);
|
489 |
+
}
|
490 |
+
}
|
491 |
+
base.checkPagination();
|
492 |
+
},
|
493 |
+
checkPagination : function () {
|
494 |
+
var base = this;
|
495 |
+
if (base.options.pagination === false) {
|
496 |
+
return false;
|
497 |
+
}
|
498 |
+
base.paginationWrapper.find(".owl-page").each(function () {
|
499 |
+
if ($(this).data("owl-roundPages") === $(base.$owlItems[base.currentItem]).data("owl-roundPages")) {
|
500 |
+
base.paginationWrapper
|
501 |
+
.find(".owl-page")
|
502 |
+
.removeClass("active");
|
503 |
+
$(this).addClass("active");
|
504 |
+
}
|
505 |
+
});
|
506 |
+
},
|
507 |
+
|
508 |
+
checkNavigation : function () {
|
509 |
+
var base = this;
|
510 |
+
|
511 |
+
if (base.options.navigation === false) {
|
512 |
+
return false;
|
513 |
+
}
|
514 |
+
if (base.options.rewindNav === false) {
|
515 |
+
if (base.currentItem === 0 && base.maximumItem === 0) {
|
516 |
+
base.buttonPrev.addClass("disabled");
|
517 |
+
base.buttonNext.addClass("disabled");
|
518 |
+
} else if (base.currentItem === 0 && base.maximumItem !== 0) {
|
519 |
+
base.buttonPrev.addClass("disabled");
|
520 |
+
base.buttonNext.removeClass("disabled");
|
521 |
+
} else if (base.currentItem === base.maximumItem) {
|
522 |
+
base.buttonPrev.removeClass("disabled");
|
523 |
+
base.buttonNext.addClass("disabled");
|
524 |
+
} else if (base.currentItem !== 0 && base.currentItem !== base.maximumItem) {
|
525 |
+
base.buttonPrev.removeClass("disabled");
|
526 |
+
base.buttonNext.removeClass("disabled");
|
527 |
+
}
|
528 |
+
}
|
529 |
+
},
|
530 |
+
|
531 |
+
updateControls : function () {
|
532 |
+
var base = this;
|
533 |
+
base.updatePagination();
|
534 |
+
base.checkNavigation();
|
535 |
+
if (base.owlControls) {
|
536 |
+
if (base.options.items >= base.itemsAmount) {
|
537 |
+
base.owlControls.hide();
|
538 |
+
} else {
|
539 |
+
base.owlControls.show();
|
540 |
+
}
|
541 |
+
}
|
542 |
+
},
|
543 |
+
|
544 |
+
destroyControls : function () {
|
545 |
+
var base = this;
|
546 |
+
if (base.owlControls) {
|
547 |
+
base.owlControls.remove();
|
548 |
+
}
|
549 |
+
},
|
550 |
+
|
551 |
+
next : function (speed) {
|
552 |
+
var base = this;
|
553 |
+
|
554 |
+
if (base.isTransition) {
|
555 |
+
return false;
|
556 |
+
}
|
557 |
+
|
558 |
+
base.currentItem += base.options.scrollPerPage === true ? base.options.items : 1;
|
559 |
+
if (base.currentItem > base.maximumItem + (base.options.scrollPerPage === true ? (base.options.items - 1) : 0)) {
|
560 |
+
if (base.options.rewindNav === true) {
|
561 |
+
base.currentItem = 0;
|
562 |
+
speed = "rewind";
|
563 |
+
} else {
|
564 |
+
base.currentItem = base.maximumItem;
|
565 |
+
return false;
|
566 |
+
}
|
567 |
+
}
|
568 |
+
base.goTo(base.currentItem, speed);
|
569 |
+
},
|
570 |
+
|
571 |
+
prev : function (speed) {
|
572 |
+
var base = this;
|
573 |
+
|
574 |
+
if (base.isTransition) {
|
575 |
+
return false;
|
576 |
+
}
|
577 |
+
|
578 |
+
if (base.options.scrollPerPage === true && base.currentItem > 0 && base.currentItem < base.options.items) {
|
579 |
+
base.currentItem = 0;
|
580 |
+
} else {
|
581 |
+
base.currentItem -= base.options.scrollPerPage === true ? base.options.items : 1;
|
582 |
+
}
|
583 |
+
if (base.currentItem < 0) {
|
584 |
+
if (base.options.rewindNav === true) {
|
585 |
+
base.currentItem = base.maximumItem;
|
586 |
+
speed = "rewind";
|
587 |
+
} else {
|
588 |
+
base.currentItem = 0;
|
589 |
+
return false;
|
590 |
+
}
|
591 |
+
}
|
592 |
+
base.goTo(base.currentItem, speed);
|
593 |
+
},
|
594 |
+
|
595 |
+
goTo : function (position, speed, drag) {
|
596 |
+
var base = this,
|
597 |
+
goToPixel;
|
598 |
+
|
599 |
+
if (base.isTransition) {
|
600 |
+
return false;
|
601 |
+
}
|
602 |
+
if (typeof base.options.beforeMove === "function") {
|
603 |
+
base.options.beforeMove.apply(this, [base.$elem]);
|
604 |
+
}
|
605 |
+
if (position >= base.maximumItem) {
|
606 |
+
position = base.maximumItem;
|
607 |
+
} else if (position <= 0) {
|
608 |
+
position = 0;
|
609 |
+
}
|
610 |
+
|
611 |
+
base.currentItem = base.owl.currentItem = position;
|
612 |
+
if (base.options.transitionStyle !== false && drag !== "drag" && base.options.items === 1 && base.browser.support3d === true) {
|
613 |
+
base.swapSpeed(0);
|
614 |
+
if (base.browser.support3d === true) {
|
615 |
+
base.transition3d(base.positionsInArray[position]);
|
616 |
+
} else {
|
617 |
+
base.css2slide(base.positionsInArray[position], 1);
|
618 |
+
}
|
619 |
+
base.afterGo();
|
620 |
+
base.singleItemTransition();
|
621 |
+
return false;
|
622 |
+
}
|
623 |
+
goToPixel = base.positionsInArray[position];
|
624 |
+
|
625 |
+
if (base.browser.support3d === true) {
|
626 |
+
base.isCss3Finish = false;
|
627 |
+
|
628 |
+
if (speed === true) {
|
629 |
+
base.swapSpeed("paginationSpeed");
|
630 |
+
window.setTimeout(function () {
|
631 |
+
base.isCss3Finish = true;
|
632 |
+
}, base.options.paginationSpeed);
|
633 |
+
|
634 |
+
} else if (speed === "rewind") {
|
635 |
+
base.swapSpeed(base.options.rewindSpeed);
|
636 |
+
window.setTimeout(function () {
|
637 |
+
base.isCss3Finish = true;
|
638 |
+
}, base.options.rewindSpeed);
|
639 |
+
|
640 |
+
} else {
|
641 |
+
base.swapSpeed("slideSpeed");
|
642 |
+
window.setTimeout(function () {
|
643 |
+
base.isCss3Finish = true;
|
644 |
+
}, base.options.slideSpeed);
|
645 |
+
}
|
646 |
+
base.transition3d(goToPixel);
|
647 |
+
} else {
|
648 |
+
if (speed === true) {
|
649 |
+
base.css2slide(goToPixel, base.options.paginationSpeed);
|
650 |
+
} else if (speed === "rewind") {
|
651 |
+
base.css2slide(goToPixel, base.options.rewindSpeed);
|
652 |
+
} else {
|
653 |
+
base.css2slide(goToPixel, base.options.slideSpeed);
|
654 |
+
}
|
655 |
+
}
|
656 |
+
base.afterGo();
|
657 |
+
},
|
658 |
+
|
659 |
+
jumpTo : function (position) {
|
660 |
+
var base = this;
|
661 |
+
if (typeof base.options.beforeMove === "function") {
|
662 |
+
base.options.beforeMove.apply(this, [base.$elem]);
|
663 |
+
}
|
664 |
+
if (position >= base.maximumItem || position === -1) {
|
665 |
+
position = base.maximumItem;
|
666 |
+
} else if (position <= 0) {
|
667 |
+
position = 0;
|
668 |
+
}
|
669 |
+
base.swapSpeed(0);
|
670 |
+
if (base.browser.support3d === true) {
|
671 |
+
base.transition3d(base.positionsInArray[position]);
|
672 |
+
} else {
|
673 |
+
base.css2slide(base.positionsInArray[position], 1);
|
674 |
+
}
|
675 |
+
base.currentItem = base.owl.currentItem = position;
|
676 |
+
base.afterGo();
|
677 |
+
},
|
678 |
+
|
679 |
+
afterGo : function () {
|
680 |
+
var base = this;
|
681 |
+
|
682 |
+
base.prevArr.push(base.currentItem);
|
683 |
+
base.prevItem = base.owl.prevItem = base.prevArr[base.prevArr.length - 2];
|
684 |
+
base.prevArr.shift(0);
|
685 |
+
|
686 |
+
if (base.prevItem !== base.currentItem) {
|
687 |
+
base.checkPagination();
|
688 |
+
base.checkNavigation();
|
689 |
+
base.eachMoveUpdate();
|
690 |
+
|
691 |
+
if (base.options.autoPlay !== false) {
|
692 |
+
base.checkAp();
|
693 |
+
}
|
694 |
+
}
|
695 |
+
if (typeof base.options.afterMove === "function" && base.prevItem !== base.currentItem) {
|
696 |
+
base.options.afterMove.apply(this, [base.$elem]);
|
697 |
+
}
|
698 |
+
},
|
699 |
+
|
700 |
+
stop : function () {
|
701 |
+
var base = this;
|
702 |
+
base.apStatus = "stop";
|
703 |
+
window.clearInterval(base.autoPlayInterval);
|
704 |
+
},
|
705 |
+
|
706 |
+
checkAp : function () {
|
707 |
+
var base = this;
|
708 |
+
if (base.apStatus !== "stop") {
|
709 |
+
base.play();
|
710 |
+
}
|
711 |
+
},
|
712 |
+
|
713 |
+
play : function () {
|
714 |
+
var base = this;
|
715 |
+
base.apStatus = "play";
|
716 |
+
if (base.options.autoPlay === false) {
|
717 |
+
return false;
|
718 |
+
}
|
719 |
+
window.clearInterval(base.autoPlayInterval);
|
720 |
+
base.autoPlayInterval = window.setInterval(function () {
|
721 |
+
base.next(true);
|
722 |
+
}, base.options.autoPlay);
|
723 |
+
},
|
724 |
+
|
725 |
+
swapSpeed : function (action) {
|
726 |
+
var base = this;
|
727 |
+
if (action === "slideSpeed") {
|
728 |
+
base.$owlWrapper.css(base.addCssSpeed(base.options.slideSpeed));
|
729 |
+
} else if (action === "paginationSpeed") {
|
730 |
+
base.$owlWrapper.css(base.addCssSpeed(base.options.paginationSpeed));
|
731 |
+
} else if (typeof action !== "string") {
|
732 |
+
base.$owlWrapper.css(base.addCssSpeed(action));
|
733 |
+
}
|
734 |
+
},
|
735 |
+
|
736 |
+
addCssSpeed : function (speed) {
|
737 |
+
return {
|
738 |
+
"-webkit-transition": "all " + speed + "ms ease",
|
739 |
+
"-moz-transition": "all " + speed + "ms ease",
|
740 |
+
"-o-transition": "all " + speed + "ms ease",
|
741 |
+
"transition": "all " + speed + "ms ease"
|
742 |
+
};
|
743 |
+
},
|
744 |
+
|
745 |
+
removeTransition : function () {
|
746 |
+
return {
|
747 |
+
"-webkit-transition": "",
|
748 |
+
"-moz-transition": "",
|
749 |
+
"-o-transition": "",
|
750 |
+
"transition": ""
|
751 |
+
};
|
752 |
+
},
|
753 |
+
|
754 |
+
doTranslate : function (pixels) {
|
755 |
+
return {
|
756 |
+
"-webkit-transform": "translate3d(" + pixels + "px, 0px, 0px)",
|
757 |
+
"-moz-transform": "translate3d(" + pixels + "px, 0px, 0px)",
|
758 |
+
"-o-transform": "translate3d(" + pixels + "px, 0px, 0px)",
|
759 |
+
"-ms-transform": "translate3d(" + pixels + "px, 0px, 0px)",
|
760 |
+
"transform": "translate3d(" + pixels + "px, 0px,0px)"
|
761 |
+
};
|
762 |
+
},
|
763 |
+
|
764 |
+
transition3d : function (value) {
|
765 |
+
var base = this;
|
766 |
+
base.$owlWrapper.css(base.doTranslate(value));
|
767 |
+
},
|
768 |
+
|
769 |
+
css2move : function (value) {
|
770 |
+
var base = this;
|
771 |
+
base.$owlWrapper.css({"left" : value});
|
772 |
+
},
|
773 |
+
|
774 |
+
css2slide : function (value, speed) {
|
775 |
+
var base = this;
|
776 |
+
|
777 |
+
base.isCssFinish = false;
|
778 |
+
base.$owlWrapper.stop(true, true).animate({
|
779 |
+
"left" : value
|
780 |
+
}, {
|
781 |
+
duration : speed || base.options.slideSpeed,
|
782 |
+
complete : function () {
|
783 |
+
base.isCssFinish = true;
|
784 |
+
}
|
785 |
+
});
|
786 |
+
},
|
787 |
+
|
788 |
+
checkBrowser : function () {
|
789 |
+
var base = this,
|
790 |
+
translate3D = "translate3d(0px, 0px, 0px)",
|
791 |
+
tempElem = document.createElement("div"),
|
792 |
+
regex,
|
793 |
+
asSupport,
|
794 |
+
support3d,
|
795 |
+
isTouch;
|
796 |
+
|
797 |
+
tempElem.style.cssText = " -moz-transform:" + translate3D +
|
798 |
+
"; -ms-transform:" + translate3D +
|
799 |
+
"; -o-transform:" + translate3D +
|
800 |
+
"; -webkit-transform:" + translate3D +
|
801 |
+
"; transform:" + translate3D;
|
802 |
+
regex = /translate3d\(0px, 0px, 0px\)/g;
|
803 |
+
asSupport = tempElem.style.cssText.match(regex);
|
804 |
+
support3d = (asSupport !== null && asSupport.length === 1);
|
805 |
+
|
806 |
+
isTouch = "ontouchstart" in window || window.navigator.msMaxTouchPoints;
|
807 |
+
|
808 |
+
base.browser = {
|
809 |
+
"support3d" : support3d,
|
810 |
+
"isTouch" : isTouch
|
811 |
+
};
|
812 |
+
},
|
813 |
+
|
814 |
+
moveEvents : function () {
|
815 |
+
var base = this;
|
816 |
+
if (base.options.mouseDrag !== false || base.options.touchDrag !== false) {
|
817 |
+
base.gestures();
|
818 |
+
base.disabledEvents();
|
819 |
+
}
|
820 |
+
},
|
821 |
+
|
822 |
+
eventTypes : function () {
|
823 |
+
var base = this,
|
824 |
+
types = ["s", "e", "x"];
|
825 |
+
|
826 |
+
base.ev_types = {};
|
827 |
+
|
828 |
+
if (base.options.mouseDrag === true && base.options.touchDrag === true) {
|
829 |
+
types = [
|
830 |
+
"touchstart.owl mousedown.owl",
|
831 |
+
"touchmove.owl mousemove.owl",
|
832 |
+
"touchend.owl touchcancel.owl mouseup.owl"
|
833 |
+
];
|
834 |
+
} else if (base.options.mouseDrag === false && base.options.touchDrag === true) {
|
835 |
+
types = [
|
836 |
+
"touchstart.owl",
|
837 |
+
"touchmove.owl",
|
838 |
+
"touchend.owl touchcancel.owl"
|
839 |
+
];
|
840 |
+
} else if (base.options.mouseDrag === true && base.options.touchDrag === false) {
|
841 |
+
types = [
|
842 |
+
"mousedown.owl",
|
843 |
+
"mousemove.owl",
|
844 |
+
"mouseup.owl"
|
845 |
+
];
|
846 |
+
}
|
847 |
+
|
848 |
+
base.ev_types.start = types[0];
|
849 |
+
base.ev_types.move = types[1];
|
850 |
+
base.ev_types.end = types[2];
|
851 |
+
},
|
852 |
+
|
853 |
+
disabledEvents : function () {
|
854 |
+
var base = this;
|
855 |
+
base.$elem.on("dragstart.owl", function (event) { event.preventDefault(); });
|
856 |
+
base.$elem.on("mousedown.disableTextSelect", function (e) {
|
857 |
+
return $(e.target).is('input, textarea, select, option');
|
858 |
+
});
|
859 |
+
},
|
860 |
+
|
861 |
+
gestures : function () {
|
862 |
+
/*jslint unparam: true*/
|
863 |
+
var base = this,
|
864 |
+
locals = {
|
865 |
+
offsetX : 0,
|
866 |
+
offsetY : 0,
|
867 |
+
baseElWidth : 0,
|
868 |
+
relativePos : 0,
|
869 |
+
position: null,
|
870 |
+
minSwipe : null,
|
871 |
+
maxSwipe: null,
|
872 |
+
sliding : null,
|
873 |
+
dargging: null,
|
874 |
+
targetElement : null
|
875 |
+
};
|
876 |
+
|
877 |
+
base.isCssFinish = true;
|
878 |
+
|
879 |
+
function getTouches(event) {
|
880 |
+
if (event.touches !== undefined) {
|
881 |
+
return {
|
882 |
+
x : event.touches[0].pageX,
|
883 |
+
y : event.touches[0].pageY
|
884 |
+
};
|
885 |
+
}
|
886 |
+
|
887 |
+
if (event.touches === undefined) {
|
888 |
+
if (event.pageX !== undefined) {
|
889 |
+
return {
|
890 |
+
x : event.pageX,
|
891 |
+
y : event.pageY
|
892 |
+
};
|
893 |
+
}
|
894 |
+
if (event.pageX === undefined) {
|
895 |
+
return {
|
896 |
+
x : event.clientX,
|
897 |
+
y : event.clientY
|
898 |
+
};
|
899 |
+
}
|
900 |
+
}
|
901 |
+
}
|
902 |
+
|
903 |
+
function swapEvents(type) {
|
904 |
+
if (type === "on") {
|
905 |
+
$(document).on(base.ev_types.move, dragMove);
|
906 |
+
$(document).on(base.ev_types.end, dragEnd);
|
907 |
+
} else if (type === "off") {
|
908 |
+
$(document).off(base.ev_types.move);
|
909 |
+
$(document).off(base.ev_types.end);
|
910 |
+
}
|
911 |
+
}
|
912 |
+
|
913 |
+
function dragStart(event) {
|
914 |
+
var ev = event.originalEvent || event || window.event,
|
915 |
+
position;
|
916 |
+
|
917 |
+
if (ev.which === 3) {
|
918 |
+
return false;
|
919 |
+
}
|
920 |
+
if (base.itemsAmount <= base.options.items) {
|
921 |
+
return;
|
922 |
+
}
|
923 |
+
if (base.isCssFinish === false && !base.options.dragBeforeAnimFinish) {
|
924 |
+
return false;
|
925 |
+
}
|
926 |
+
if (base.isCss3Finish === false && !base.options.dragBeforeAnimFinish) {
|
927 |
+
return false;
|
928 |
+
}
|
929 |
+
|
930 |
+
if (base.options.autoPlay !== false) {
|
931 |
+
window.clearInterval(base.autoPlayInterval);
|
932 |
+
}
|
933 |
+
|
934 |
+
if (base.browser.isTouch !== true && !base.$owlWrapper.hasClass("grabbing")) {
|
935 |
+
base.$owlWrapper.addClass("grabbing");
|
936 |
+
}
|
937 |
+
|
938 |
+
base.newPosX = 0;
|
939 |
+
base.newRelativeX = 0;
|
940 |
+
|
941 |
+
$(this).css(base.removeTransition());
|
942 |
+
|
943 |
+
position = $(this).position();
|
944 |
+
locals.relativePos = position.left;
|
945 |
+
|
946 |
+
locals.offsetX = getTouches(ev).x - position.left;
|
947 |
+
locals.offsetY = getTouches(ev).y - position.top;
|
948 |
+
|
949 |
+
swapEvents("on");
|
950 |
+
|
951 |
+
locals.sliding = false;
|
952 |
+
locals.targetElement = ev.target || ev.srcElement;
|
953 |
+
}
|
954 |
+
|
955 |
+
function dragMove(event) {
|
956 |
+
var ev = event.originalEvent || event || window.event,
|
957 |
+
minSwipe,
|
958 |
+
maxSwipe;
|
959 |
+
|
960 |
+
base.newPosX = getTouches(ev).x - locals.offsetX;
|
961 |
+
base.newPosY = getTouches(ev).y - locals.offsetY;
|
962 |
+
base.newRelativeX = base.newPosX - locals.relativePos;
|
963 |
+
|
964 |
+
if (typeof base.options.startDragging === "function" && locals.dragging !== true && base.newRelativeX !== 0) {
|
965 |
+
locals.dragging = true;
|
966 |
+
base.options.startDragging.apply(base, [base.$elem]);
|
967 |
+
}
|
968 |
+
|
969 |
+
if ((base.newRelativeX > 8 || base.newRelativeX < -8) && (base.browser.isTouch === true)) {
|
970 |
+
if (ev.preventDefault !== undefined) {
|
971 |
+
ev.preventDefault();
|
972 |
+
} else {
|
973 |
+
ev.returnValue = false;
|
974 |
+
}
|
975 |
+
locals.sliding = true;
|
976 |
+
}
|
977 |
+
|
978 |
+
if ((base.newPosY > 10 || base.newPosY < -10) && locals.sliding === false) {
|
979 |
+
$(document).off("touchmove.owl");
|
980 |
+
}
|
981 |
+
|
982 |
+
minSwipe = function () {
|
983 |
+
return base.newRelativeX / 5;
|
984 |
+
};
|
985 |
+
|
986 |
+
maxSwipe = function () {
|
987 |
+
return base.maximumPixels + base.newRelativeX / 5;
|
988 |
+
};
|
989 |
+
|
990 |
+
base.newPosX = Math.max(Math.min(base.newPosX, minSwipe()), maxSwipe());
|
991 |
+
if (base.browser.support3d === true) {
|
992 |
+
base.transition3d(base.newPosX);
|
993 |
+
} else {
|
994 |
+
base.css2move(base.newPosX);
|
995 |
+
}
|
996 |
+
}
|
997 |
+
|
998 |
+
function dragEnd(event) {
|
999 |
+
var ev = event.originalEvent || event || window.event,
|
1000 |
+
newPosition,
|
1001 |
+
handlers,
|
1002 |
+
owlStopEvent;
|
1003 |
+
|
1004 |
+
ev.target = ev.target || ev.srcElement;
|
1005 |
+
|
1006 |
+
locals.dragging = false;
|
1007 |
+
|
1008 |
+
if (base.browser.isTouch !== true) {
|
1009 |
+
base.$owlWrapper.removeClass("grabbing");
|
1010 |
+
}
|
1011 |
+
|
1012 |
+
if (base.newRelativeX < 0) {
|
1013 |
+
base.dragDirection = base.owl.dragDirection = "left";
|
1014 |
+
} else {
|
1015 |
+
base.dragDirection = base.owl.dragDirection = "right";
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
if (base.newRelativeX !== 0) {
|
1019 |
+
newPosition = base.getNewPosition();
|
1020 |
+
base.goTo(newPosition, false, "drag");
|
1021 |
+
if (locals.targetElement === ev.target && base.browser.isTouch !== true) {
|
1022 |
+
$(ev.target).on("click.disable", function (ev) {
|
1023 |
+
ev.stopImmediatePropagation();
|
1024 |
+
ev.stopPropagation();
|
1025 |
+
ev.preventDefault();
|
1026 |
+
$(ev.target).off("click.disable");
|
1027 |
+
});
|
1028 |
+
handlers = $._data(ev.target, "events").click;
|
1029 |
+
owlStopEvent = handlers.pop();
|
1030 |
+
handlers.splice(0, 0, owlStopEvent);
|
1031 |
+
}
|
1032 |
+
}
|
1033 |
+
swapEvents("off");
|
1034 |
+
}
|
1035 |
+
base.$elem.on(base.ev_types.start, ".owl-wrapper", dragStart);
|
1036 |
+
},
|
1037 |
+
|
1038 |
+
getNewPosition : function () {
|
1039 |
+
var base = this,
|
1040 |
+
newPosition = base.closestItem();
|
1041 |
+
|
1042 |
+
if (newPosition > base.maximumItem) {
|
1043 |
+
base.currentItem = base.maximumItem;
|
1044 |
+
newPosition = base.maximumItem;
|
1045 |
+
} else if (base.newPosX >= 0) {
|
1046 |
+
newPosition = 0;
|
1047 |
+
base.currentItem = 0;
|
1048 |
+
}
|
1049 |
+
return newPosition;
|
1050 |
+
},
|
1051 |
+
closestItem : function () {
|
1052 |
+
var base = this,
|
1053 |
+
array = base.options.scrollPerPage === true ? base.pagesInArray : base.positionsInArray,
|
1054 |
+
goal = base.newPosX,
|
1055 |
+
closest = null;
|
1056 |
+
|
1057 |
+
$.each(array, function (i, v) {
|
1058 |
+
if (goal - (base.itemWidth / 20) > array[i + 1] && goal - (base.itemWidth / 20) < v && base.moveDirection() === "left") {
|
1059 |
+
closest = v;
|
1060 |
+
if (base.options.scrollPerPage === true) {
|
1061 |
+
base.currentItem = $.inArray(closest, base.positionsInArray);
|
1062 |
+
} else {
|
1063 |
+
base.currentItem = i;
|
1064 |
+
}
|
1065 |
+
} else if (goal + (base.itemWidth / 20) < v && goal + (base.itemWidth / 20) > (array[i + 1] || array[i] - base.itemWidth) && base.moveDirection() === "right") {
|
1066 |
+
if (base.options.scrollPerPage === true) {
|
1067 |
+
closest = array[i + 1] || array[array.length - 1];
|
1068 |
+
base.currentItem = $.inArray(closest, base.positionsInArray);
|
1069 |
+
} else {
|
1070 |
+
closest = array[i + 1];
|
1071 |
+
base.currentItem = i + 1;
|
1072 |
+
}
|
1073 |
+
}
|
1074 |
+
});
|
1075 |
+
return base.currentItem;
|
1076 |
+
},
|
1077 |
+
|
1078 |
+
moveDirection : function () {
|
1079 |
+
var base = this,
|
1080 |
+
direction;
|
1081 |
+
if (base.newRelativeX < 0) {
|
1082 |
+
direction = "right";
|
1083 |
+
base.playDirection = "next";
|
1084 |
+
} else {
|
1085 |
+
direction = "left";
|
1086 |
+
base.playDirection = "prev";
|
1087 |
+
}
|
1088 |
+
return direction;
|
1089 |
+
},
|
1090 |
+
|
1091 |
+
customEvents : function () {
|
1092 |
+
/*jslint unparam: true*/
|
1093 |
+
var base = this;
|
1094 |
+
base.$elem.on("owl.next", function () {
|
1095 |
+
base.next();
|
1096 |
+
});
|
1097 |
+
base.$elem.on("owl.prev", function () {
|
1098 |
+
base.prev();
|
1099 |
+
});
|
1100 |
+
base.$elem.on("owl.play", function (event, speed) {
|
1101 |
+
base.options.autoPlay = speed;
|
1102 |
+
base.play();
|
1103 |
+
base.hoverStatus = "play";
|
1104 |
+
});
|
1105 |
+
base.$elem.on("owl.stop", function () {
|
1106 |
+
base.stop();
|
1107 |
+
base.hoverStatus = "stop";
|
1108 |
+
});
|
1109 |
+
base.$elem.on("owl.goTo", function (event, item) {
|
1110 |
+
base.goTo(item);
|
1111 |
+
});
|
1112 |
+
base.$elem.on("owl.jumpTo", function (event, item) {
|
1113 |
+
base.jumpTo(item);
|
1114 |
+
});
|
1115 |
+
},
|
1116 |
+
|
1117 |
+
stopOnHover : function () {
|
1118 |
+
var base = this;
|
1119 |
+
if (base.options.stopOnHover === true && base.browser.isTouch !== true && base.options.autoPlay !== false) {
|
1120 |
+
base.$elem.on("mouseover", function () {
|
1121 |
+
base.stop();
|
1122 |
+
});
|
1123 |
+
base.$elem.on("mouseout", function () {
|
1124 |
+
if (base.hoverStatus !== "stop") {
|
1125 |
+
base.play();
|
1126 |
+
}
|
1127 |
+
});
|
1128 |
+
}
|
1129 |
+
},
|
1130 |
+
|
1131 |
+
lazyLoad : function () {
|
1132 |
+
var base = this,
|
1133 |
+
i,
|
1134 |
+
$item,
|
1135 |
+
itemNumber,
|
1136 |
+
$lazyImg,
|
1137 |
+
follow;
|
1138 |
+
|
1139 |
+
if (base.options.lazyLoad === false) {
|
1140 |
+
return false;
|
1141 |
+
}
|
1142 |
+
for (i = 0; i < base.itemsAmount; i += 1) {
|
1143 |
+
$item = $(base.$owlItems[i]);
|
1144 |
+
|
1145 |
+
if ($item.data("owl-loaded") === "loaded") {
|
1146 |
+
continue;
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
itemNumber = $item.data("owl-item");
|
1150 |
+
$lazyImg = $item.find(".lazyOwl");
|
1151 |
+
|
1152 |
+
if (typeof $lazyImg.data("src") !== "string") {
|
1153 |
+
$item.data("owl-loaded", "loaded");
|
1154 |
+
continue;
|
1155 |
+
}
|
1156 |
+
if ($item.data("owl-loaded") === undefined) {
|
1157 |
+
$lazyImg.hide();
|
1158 |
+
$item.addClass("loading").data("owl-loaded", "checked");
|
1159 |
+
}
|
1160 |
+
if (base.options.lazyFollow === true) {
|
1161 |
+
follow = itemNumber >= base.currentItem;
|
1162 |
+
} else {
|
1163 |
+
follow = true;
|
1164 |
+
}
|
1165 |
+
if (follow && itemNumber < base.currentItem + base.options.items && $lazyImg.length) {
|
1166 |
+
base.lazyPreload($item, $lazyImg);
|
1167 |
+
}
|
1168 |
+
}
|
1169 |
+
},
|
1170 |
+
|
1171 |
+
lazyPreload : function ($item, $lazyImg) {
|
1172 |
+
var base = this,
|
1173 |
+
iterations = 0,
|
1174 |
+
isBackgroundImg;
|
1175 |
+
|
1176 |
+
if ($lazyImg.prop("tagName") === "DIV") {
|
1177 |
+
$lazyImg.css("background-image", "url(" + $lazyImg.data("src") + ")");
|
1178 |
+
isBackgroundImg = true;
|
1179 |
+
} else {
|
1180 |
+
$lazyImg[0].src = $lazyImg.data("src");
|
1181 |
+
}
|
1182 |
+
|
1183 |
+
function showImage() {
|
1184 |
+
$item.data("owl-loaded", "loaded").removeClass("loading");
|
1185 |
+
$lazyImg.removeAttr("data-src");
|
1186 |
+
if (base.options.lazyEffect === "fade") {
|
1187 |
+
$lazyImg.fadeIn(400);
|
1188 |
+
} else {
|
1189 |
+
$lazyImg.show();
|
1190 |
+
}
|
1191 |
+
if (typeof base.options.afterLazyLoad === "function") {
|
1192 |
+
base.options.afterLazyLoad.apply(this, [base.$elem]);
|
1193 |
+
}
|
1194 |
+
}
|
1195 |
+
|
1196 |
+
function checkLazyImage() {
|
1197 |
+
iterations += 1;
|
1198 |
+
if (base.completeImg($lazyImg.get(0)) || isBackgroundImg === true) {
|
1199 |
+
showImage();
|
1200 |
+
} else if (iterations <= 100) {//if image loads in less than 10 seconds
|
1201 |
+
window.setTimeout(checkLazyImage, 100);
|
1202 |
+
} else {
|
1203 |
+
showImage();
|
1204 |
+
}
|
1205 |
+
}
|
1206 |
+
|
1207 |
+
checkLazyImage();
|
1208 |
+
},
|
1209 |
+
|
1210 |
+
autoHeight : function () {
|
1211 |
+
var base = this,
|
1212 |
+
$currentimg = $(base.$owlItems[base.currentItem]).find("img"),
|
1213 |
+
iterations;
|
1214 |
+
|
1215 |
+
function addHeight() {
|
1216 |
+
var $currentItem = $(base.$owlItems[base.currentItem]).height();
|
1217 |
+
base.wrapperOuter.css("height", $currentItem + "px");
|
1218 |
+
if (!base.wrapperOuter.hasClass("autoHeight")) {
|
1219 |
+
window.setTimeout(function () {
|
1220 |
+
base.wrapperOuter.addClass("autoHeight");
|
1221 |
+
}, 0);
|
1222 |
+
}
|
1223 |
+
}
|
1224 |
+
|
1225 |
+
function checkImage() {
|
1226 |
+
iterations += 1;
|
1227 |
+
if (base.completeImg($currentimg.get(0))) {
|
1228 |
+
addHeight();
|
1229 |
+
} else if (iterations <= 100) { //if image loads in less than 10 seconds
|
1230 |
+
window.setTimeout(checkImage, 100);
|
1231 |
+
} else {
|
1232 |
+
base.wrapperOuter.css("height", ""); //Else remove height attribute
|
1233 |
+
}
|
1234 |
+
}
|
1235 |
+
|
1236 |
+
if ($currentimg.get(0) !== undefined) {
|
1237 |
+
iterations = 0;
|
1238 |
+
checkImage();
|
1239 |
+
} else {
|
1240 |
+
addHeight();
|
1241 |
+
}
|
1242 |
+
},
|
1243 |
+
|
1244 |
+
completeImg : function (img) {
|
1245 |
+
var naturalWidthType;
|
1246 |
+
|
1247 |
+
if (!img.complete) {
|
1248 |
+
return false;
|
1249 |
+
}
|
1250 |
+
naturalWidthType = typeof img.naturalWidth;
|
1251 |
+
if (naturalWidthType !== "undefined" && img.naturalWidth === 0) {
|
1252 |
+
return false;
|
1253 |
+
}
|
1254 |
+
return true;
|
1255 |
+
},
|
1256 |
+
|
1257 |
+
onVisibleItems : function () {
|
1258 |
+
var base = this,
|
1259 |
+
i;
|
1260 |
+
|
1261 |
+
if (base.options.addClassActive === true) {
|
1262 |
+
base.$owlItems.removeClass("active");
|
1263 |
+
}
|
1264 |
+
base.visibleItems = [];
|
1265 |
+
for (i = base.currentItem; i < base.currentItem + base.options.items; i += 1) {
|
1266 |
+
base.visibleItems.push(i);
|
1267 |
+
|
1268 |
+
if (base.options.addClassActive === true) {
|
1269 |
+
$(base.$owlItems[i]).addClass("active");
|
1270 |
+
}
|
1271 |
+
}
|
1272 |
+
base.owl.visibleItems = base.visibleItems;
|
1273 |
+
},
|
1274 |
+
|
1275 |
+
transitionTypes : function (className) {
|
1276 |
+
var base = this;
|
1277 |
+
//Currently available: "fade", "backSlide", "goDown", "fadeUp"
|
1278 |
+
base.outClass = "owl-" + className + "-out";
|
1279 |
+
base.inClass = "owl-" + className + "-in";
|
1280 |
+
},
|
1281 |
+
|
1282 |
+
singleItemTransition : function () {
|
1283 |
+
var base = this,
|
1284 |
+
outClass = base.outClass,
|
1285 |
+
inClass = base.inClass,
|
1286 |
+
$currentItem = base.$owlItems.eq(base.currentItem),
|
1287 |
+
$prevItem = base.$owlItems.eq(base.prevItem),
|
1288 |
+
prevPos = Math.abs(base.positionsInArray[base.currentItem]) + base.positionsInArray[base.prevItem],
|
1289 |
+
origin = Math.abs(base.positionsInArray[base.currentItem]) + base.itemWidth / 2,
|
1290 |
+
animEnd = 'webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend';
|
1291 |
+
|
1292 |
+
base.isTransition = true;
|
1293 |
+
|
1294 |
+
base.$owlWrapper
|
1295 |
+
.addClass('owl-origin')
|
1296 |
+
.css({
|
1297 |
+
"-webkit-transform-origin" : origin + "px",
|
1298 |
+
"-moz-perspective-origin" : origin + "px",
|
1299 |
+
"perspective-origin" : origin + "px"
|
1300 |
+
});
|
1301 |
+
function transStyles(prevPos) {
|
1302 |
+
return {
|
1303 |
+
"position" : "relative",
|
1304 |
+
"left" : prevPos + "px"
|
1305 |
+
};
|
1306 |
+
}
|
1307 |
+
|
1308 |
+
$prevItem
|
1309 |
+
.css(transStyles(prevPos, 10))
|
1310 |
+
.addClass(outClass)
|
1311 |
+
.on(animEnd, function () {
|
1312 |
+
base.endPrev = true;
|
1313 |
+
$prevItem.off(animEnd);
|
1314 |
+
base.clearTransStyle($prevItem, outClass);
|
1315 |
+
});
|
1316 |
+
|
1317 |
+
$currentItem
|
1318 |
+
.addClass(inClass)
|
1319 |
+
.on(animEnd, function () {
|
1320 |
+
base.endCurrent = true;
|
1321 |
+
$currentItem.off(animEnd);
|
1322 |
+
base.clearTransStyle($currentItem, inClass);
|
1323 |
+
});
|
1324 |
+
},
|
1325 |
+
|
1326 |
+
clearTransStyle : function (item, classToRemove) {
|
1327 |
+
var base = this;
|
1328 |
+
item.css({
|
1329 |
+
"position" : "",
|
1330 |
+
"left" : ""
|
1331 |
+
}).removeClass(classToRemove);
|
1332 |
+
|
1333 |
+
if (base.endPrev && base.endCurrent) {
|
1334 |
+
base.$owlWrapper.removeClass('owl-origin');
|
1335 |
+
base.endPrev = false;
|
1336 |
+
base.endCurrent = false;
|
1337 |
+
base.isTransition = false;
|
1338 |
+
}
|
1339 |
+
},
|
1340 |
+
|
1341 |
+
owlStatus : function () {
|
1342 |
+
var base = this;
|
1343 |
+
base.owl = {
|
1344 |
+
"userOptions" : base.userOptions,
|
1345 |
+
"baseElement" : base.$elem,
|
1346 |
+
"userItems" : base.$userItems,
|
1347 |
+
"owlItems" : base.$owlItems,
|
1348 |
+
"currentItem" : base.currentItem,
|
1349 |
+
"prevItem" : base.prevItem,
|
1350 |
+
"visibleItems" : base.visibleItems,
|
1351 |
+
"isTouch" : base.browser.isTouch,
|
1352 |
+
"browser" : base.browser,
|
1353 |
+
"dragDirection" : base.dragDirection
|
1354 |
+
};
|
1355 |
+
},
|
1356 |
+
|
1357 |
+
clearEvents : function () {
|
1358 |
+
var base = this;
|
1359 |
+
base.$elem.off(".owl owl mousedown.disableTextSelect");
|
1360 |
+
$(document).off(".owl owl");
|
1361 |
+
$(window).off("resize", base.resizer);
|
1362 |
+
},
|
1363 |
+
|
1364 |
+
unWrap : function () {
|
1365 |
+
var base = this;
|
1366 |
+
if (base.$elem.children().length !== 0) {
|
1367 |
+
base.$owlWrapper.unwrap();
|
1368 |
+
base.$userItems.unwrap().unwrap();
|
1369 |
+
if (base.owlControls) {
|
1370 |
+
base.owlControls.remove();
|
1371 |
+
}
|
1372 |
+
}
|
1373 |
+
base.clearEvents();
|
1374 |
+
base.$elem
|
1375 |
+
.attr("style", base.$elem.data("owl-originalStyles") || "")
|
1376 |
+
.attr("class", base.$elem.data("owl-originalClasses"));
|
1377 |
+
},
|
1378 |
+
|
1379 |
+
destroy : function () {
|
1380 |
+
var base = this;
|
1381 |
+
base.stop();
|
1382 |
+
window.clearInterval(base.checkVisible);
|
1383 |
+
base.unWrap();
|
1384 |
+
base.$elem.removeData();
|
1385 |
+
},
|
1386 |
+
|
1387 |
+
reinit : function (newOptions) {
|
1388 |
+
var base = this,
|
1389 |
+
options = $.extend({}, base.userOptions, newOptions);
|
1390 |
+
base.unWrap();
|
1391 |
+
base.init(options, base.$elem);
|
1392 |
+
},
|
1393 |
+
|
1394 |
+
addItem : function (htmlString, targetPosition) {
|
1395 |
+
var base = this,
|
1396 |
+
position;
|
1397 |
+
|
1398 |
+
if (!htmlString) {return false; }
|
1399 |
+
|
1400 |
+
if (base.$elem.children().length === 0) {
|
1401 |
+
base.$elem.append(htmlString);
|
1402 |
+
base.setVars();
|
1403 |
+
return false;
|
1404 |
+
}
|
1405 |
+
base.unWrap();
|
1406 |
+
if (targetPosition === undefined || targetPosition === -1) {
|
1407 |
+
position = -1;
|
1408 |
+
} else {
|
1409 |
+
position = targetPosition;
|
1410 |
+
}
|
1411 |
+
if (position >= base.$userItems.length || position === -1) {
|
1412 |
+
base.$userItems.eq(-1).after(htmlString);
|
1413 |
+
} else {
|
1414 |
+
base.$userItems.eq(position).before(htmlString);
|
1415 |
+
}
|
1416 |
+
|
1417 |
+
base.setVars();
|
1418 |
+
},
|
1419 |
+
|
1420 |
+
removeItem : function (targetPosition) {
|
1421 |
+
var base = this,
|
1422 |
+
position;
|
1423 |
+
|
1424 |
+
if (base.$elem.children().length === 0) {
|
1425 |
+
return false;
|
1426 |
+
}
|
1427 |
+
if (targetPosition === undefined || targetPosition === -1) {
|
1428 |
+
position = -1;
|
1429 |
+
} else {
|
1430 |
+
position = targetPosition;
|
1431 |
+
}
|
1432 |
+
|
1433 |
+
base.unWrap();
|
1434 |
+
base.$userItems.eq(position).remove();
|
1435 |
+
base.setVars();
|
1436 |
+
}
|
1437 |
+
|
1438 |
+
};
|
1439 |
+
|
1440 |
+
$.fn.owlCarousel = function (options) {
|
1441 |
+
return this.each(function () {
|
1442 |
+
if ($(this).data("owl-init") === true) {
|
1443 |
+
return false;
|
1444 |
+
}
|
1445 |
+
$(this).data("owl-init", true);
|
1446 |
+
var carousel = Object.create(Carousel);
|
1447 |
+
carousel.init(options, this);
|
1448 |
+
$.data(this, "owlCarousel", carousel);
|
1449 |
+
});
|
1450 |
+
};
|
1451 |
+
|
1452 |
+
$.fn.owlCarousel.options = {
|
1453 |
+
|
1454 |
+
items : 5,
|
1455 |
+
itemsCustom : false,
|
1456 |
+
itemsDesktop : [1199, 4],
|
1457 |
+
itemsDesktopSmall : [979, 3],
|
1458 |
+
itemsTablet : [768, 2],
|
1459 |
+
itemsTabletSmall : false,
|
1460 |
+
itemsMobile : [479, 1],
|
1461 |
+
singleItem : false,
|
1462 |
+
itemsScaleUp : false,
|
1463 |
+
|
1464 |
+
slideSpeed : 200,
|
1465 |
+
paginationSpeed : 800,
|
1466 |
+
rewindSpeed : 1000,
|
1467 |
+
|
1468 |
+
autoPlay : false,
|
1469 |
+
stopOnHover : false,
|
1470 |
+
|
1471 |
+
navigation : false,
|
1472 |
+
navigationText : ["prev", "next"],
|
1473 |
+
rewindNav : true,
|
1474 |
+
scrollPerPage : false,
|
1475 |
+
|
1476 |
+
pagination : true,
|
1477 |
+
paginationNumbers : false,
|
1478 |
+
|
1479 |
+
responsive : true,
|
1480 |
+
responsiveRefreshRate : 200,
|
1481 |
+
responsiveBaseWidth : window,
|
1482 |
+
|
1483 |
+
baseClass : "owl-carousel",
|
1484 |
+
theme : "owl-theme",
|
1485 |
+
|
1486 |
+
lazyLoad : false,
|
1487 |
+
lazyFollow : true,
|
1488 |
+
lazyEffect : "fade",
|
1489 |
+
|
1490 |
+
autoHeight : false,
|
1491 |
+
|
1492 |
+
jsonPath : false,
|
1493 |
+
jsonSuccess : false,
|
1494 |
+
|
1495 |
+
dragBeforeAnimFinish : true,
|
1496 |
+
mouseDrag : true,
|
1497 |
+
touchDrag : true,
|
1498 |
+
|
1499 |
+
addClassActive : false,
|
1500 |
+
transitionStyle : false,
|
1501 |
+
|
1502 |
+
beforeUpdate : false,
|
1503 |
+
afterUpdate : false,
|
1504 |
+
beforeInit : false,
|
1505 |
+
afterInit : false,
|
1506 |
+
beforeMove : false,
|
1507 |
+
afterMove : false,
|
1508 |
+
afterAction : false,
|
1509 |
+
startDragging : false,
|
1510 |
+
afterLazyLoad: false
|
1511 |
+
};
|
1512 |
+
}(jQuery, window, document));
|