Version Notes
Ktree Brand Extension. By this we can enable shopping based on brands
Download this release
Release Info
Developer | KTree |
Extension | Ktree_Brand |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/Ktree/Brand/Block/Adminhtml/Brand.php +14 -0
- app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Edit.php +44 -0
- app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Edit/Form.php +20 -0
- app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Edit/Tab/Form.php +87 -0
- app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Edit/Tabs.php +23 -0
- app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Grid.php +141 -0
- app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Grid/Renderer/Arrange.php +12 -0
- app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Grid/Renderer/Image.php +40 -0
- app/code/local/Ktree/Brand/Block/Adminhtml/Tab/Brand.php +145 -0
- app/code/local/Ktree/Brand/Block/Adminhtml/Tab/Brand/Renderer/Checkbox.php +8 -0
- app/code/local/Ktree/Brand/Block/Adminhtml/Tabs.php +182 -0
- app/code/local/Ktree/Brand/Block/Brand.php +204 -0
- app/code/local/Ktree/Brand/Block/Brandcategories.php +56 -0
- app/code/local/Ktree/Brand/Block/Brandinfo.php +38 -0
- app/code/local/Ktree/Brand/Block/Category.php +20 -0
- app/code/local/Ktree/Brand/Block/Onbrand.php +56 -0
- app/code/local/Ktree/Brand/Block/Onbrandcategory.php +58 -0
- app/code/local/Ktree/Brand/Block/Onbrandcategoryproduct.php +58 -0
- app/code/local/Ktree/Brand/Helper/Data.php +185 -0
- app/code/local/Ktree/Brand/Model/Adminhtml/System/Config/Backend/Brand/Branddata.php +37 -0
- app/code/local/Ktree/Brand/Model/Adminhtml/System/Config/Source/Brand/Brand.php +42 -0
- app/code/local/Ktree/Brand/Model/Brand.php +19 -0
- app/code/local/Ktree/Brand/Model/Category.php +20 -0
- app/code/local/Ktree/Brand/Model/Categoryname.php +17 -0
- app/code/local/Ktree/Brand/Model/Mysql4/Brand.php +202 -0
- app/code/local/Ktree/Brand/Model/Mysql4/Brand/Collection.php +39 -0
- app/code/local/Ktree/Brand/Model/Mysql4/Category.php +19 -0
- app/code/local/Ktree/Brand/Model/Mysql4/Category/Collection.php +18 -0
- app/code/local/Ktree/Brand/Model/Mysql4/Setup.php +12 -0
- app/code/local/Ktree/Brand/Model/Observer.php +47 -0
- app/code/local/Ktree/Brand/Model/Resizeimage.php +216 -0
- app/code/local/Ktree/Brand/Model/Status.php +23 -0
- app/code/local/Ktree/Brand/controllers/Adminhtml/BrandController.php +350 -0
- app/code/local/Ktree/Brand/controllers/Catalog/CategoryController.php +112 -0
- app/code/local/Ktree/Brand/controllers/CatalogSearch/ResultController.php +112 -0
- app/code/local/Ktree/Brand/controllers/CategoryController.php +20 -0
- app/code/local/Ktree/Brand/controllers/IndexController.php +152 -0
- app/code/local/Ktree/Brand/etc/adminhtml.xml +26 -0
- app/code/local/Ktree/Brand/etc/config.xml +161 -0
- app/code/local/Ktree/Brand/etc/system.xml +178 -0
- app/code/local/Ktree/Brand/sql/brand_setup/mysql4-install-0.1.0.php +67 -0
- app/code/local/Ktree/Brand/sql/brand_setup/mysql4-upgrade-0.1.0-1.0.0.php +19 -0
- app/design/adminhtml/default/default/layout/brand.xml +8 -0
- app/design/frontend/base/default/layout/brand.xml +134 -0
- app/design/frontend/base/default/template/brand/brand_categories.phtml +52 -0
- app/design/frontend/base/default/template/brand/brand_info.phtml +31 -0
- app/design/frontend/base/default/template/brand/brands.phtml +175 -0
- app/design/frontend/base/default/template/brand/categorybrand.phtml +49 -0
- app/design/frontend/base/default/template/brand/featured.phtml +20 -0
- app/design/frontend/base/default/template/brand/featuredbrands.phtml +276 -0
- app/etc/modules/Ktree_Brand.xml +9 -0
- js/brand/brand.js +484 -0
- js/brand/jquery-1.7.2.min.js +4 -0
- js/brand/jquery.contentcarousel.js +257 -0
- js/brand/jquery.easing.1.3.js +205 -0
- js/brand/jquery.mousewheel.js +78 -0
- js/brand/noconflict.js +1 -0
- js/brand/smoothdivscroll/jquery-ui-1.8.23.custom.min.js +9 -0
- js/brand/smoothdivscroll/jquery.kinetic.js +388 -0
- js/brand/smoothdivscroll/jquery.mousewheel.min.js +12 -0
- js/brand/smoothdivscroll/jquery.smoothDivScroll-1.3.js +1298 -0
- js/brand/smoothdivscroll/jquery.smoothdivscroll-1.3-min.js +1 -0
- package.xml +18 -0
- skin/frontend/base/default/css/images/ajax_loader.gif +0 -0
- skin/frontend/base/default/css/images/no_image_available.jpg +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/arrow_left.gif +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/arrow_left.png +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/arrow_right.gif +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/arrow_right.png +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/bg_direction_left_ar.png +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/bg_direction_right_arr.png +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/big_transparent.gif +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/cursor_arrow_left.png +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/cursor_arrow_right.png +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_left.cur +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_left.gif +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_left.png +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_right.cur +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_right.gif +0 -0
- skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_right.png +0 -0
- skin/frontend/base/default/css/ktree/smoothDivScroll.css +96 -0
- skin/frontend/base/default/css/ktree/style.css +22 -0
- skin/frontend/base/default/css/ktree/style1234.css +1 -0
app/code/local/Ktree/Brand/Block/Adminhtml/Brand.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Block_Adminhtml_Brand extends Mage_Adminhtml_Block_Widget_Grid_Container
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
$this->_controller = 'adminhtml_brand';
|
9 |
+
$this->_blockGroup = 'brand';
|
10 |
+
$this->_headerText = Mage::helper('brand')->__('Brand Name Manager');
|
11 |
+
parent::__construct();
|
12 |
+
}
|
13 |
+
|
14 |
+
}
|
app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Edit.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Block_Adminhtml_Brand_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
|
9 |
+
$this->_objectId = 'id';
|
10 |
+
$this->_blockGroup = 'brand';
|
11 |
+
$this->_controller = 'adminhtml_brand';
|
12 |
+
|
13 |
+
$this->_updateButton('save', 'label', Mage::helper('brand')->__('Save Item'));
|
14 |
+
$this->_updateButton('delete', 'label', Mage::helper('brand')->__('Delete Item'));
|
15 |
+
|
16 |
+
/*$this->_addButton('saveandcontinue', array(
|
17 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
+
'onclick' => 'saveAndContinueEdit()',
|
19 |
+
'class' => 'save',
|
20 |
+
), -100);*/
|
21 |
+
$this->_formScripts[] = "
|
22 |
+
function toggleEditor() {
|
23 |
+
if (tinyMCE.getInstanceById('brand_content') == null) {
|
24 |
+
tinyMCE.execCommand('mceAddControl', false, 'brand_content');
|
25 |
+
} else {
|
26 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'brand_content');
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
function saveAndContinueEdit(){
|
31 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
32 |
+
}
|
33 |
+
";
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getHeaderText()
|
37 |
+
{
|
38 |
+
if (Mage::registry('brand_data') && Mage::registry('brand_data')->getId()) {
|
39 |
+
return Mage::helper('brand')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('brand_data')->getTitle()));
|
40 |
+
} else {
|
41 |
+
return Mage::helper('brand')->__('Add Item');
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Edit/Form.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Block_Adminhtml_Brand_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$id = $this->getRequest()->getParam('brand_option_id');
|
8 |
+
$model = Mage::getModel('brand/brand')->load($id,'brand_option_id');
|
9 |
+
$form = new Varien_Data_Form(array(
|
10 |
+
'id' => 'edit_form',
|
11 |
+
'action' => $this->getUrl('*/*/save', array('id' => $model->getId())),
|
12 |
+
'method' => 'post',
|
13 |
+
'enctype' => 'multipart/form-data'
|
14 |
+
)
|
15 |
+
);
|
16 |
+
$form->setUseContainer(true);
|
17 |
+
$this->setForm($form);
|
18 |
+
return parent::_prepareForm();
|
19 |
+
}
|
20 |
+
}
|
app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Block_Adminhtml_Brand_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$fieldset = $form->addFieldset('brand_form', array('legend' => Mage::helper('brand')->__('Item information')));
|
10 |
+
|
11 |
+
$fieldset->addField('title', 'text', array(
|
12 |
+
'label' => Mage::helper('brand')->__('Title'),
|
13 |
+
'class' => 'required-entry',
|
14 |
+
'required' => true,
|
15 |
+
'name' => 'title',
|
16 |
+
));
|
17 |
+
$fieldset->addField('brand_option_id', 'hidden', array(
|
18 |
+
'label' => Mage::helper('brand')->__('Brand Name ID'),
|
19 |
+
'required' => false,
|
20 |
+
'note' => Mage::helper('brand')->__('Do not fill up anything in this box'),
|
21 |
+
'name' => 'brand_option_id',
|
22 |
+
));
|
23 |
+
$fieldset->addField('filename', 'image', array(
|
24 |
+
'label' => Mage::helper('brand')->__('Logo'),
|
25 |
+
'required' => false,
|
26 |
+
'name' => 'filename',
|
27 |
+
));
|
28 |
+
$fieldset->addField('status', 'select', array(
|
29 |
+
'label' => Mage::helper('brand')->__('Featured'),
|
30 |
+
'name' => 'status',
|
31 |
+
'values' => array(
|
32 |
+
array(
|
33 |
+
'value' => 1,
|
34 |
+
'label' => Mage::helper('brand')->__('Enabled'),
|
35 |
+
),
|
36 |
+
array(
|
37 |
+
'value' => 2,
|
38 |
+
'label' => Mage::helper('brand')->__('Disabled'),
|
39 |
+
),
|
40 |
+
),
|
41 |
+
));
|
42 |
+
$fieldset->addField('is_sale', 'select', array(
|
43 |
+
'label' => Mage::helper('brand')->__('Is Sale'),
|
44 |
+
'name' => 'is_sale',
|
45 |
+
'values' => array(
|
46 |
+
array(
|
47 |
+
'value' => 0,
|
48 |
+
'label' => Mage::helper('brand')->__('No'),
|
49 |
+
),
|
50 |
+
array(
|
51 |
+
'value' => 1,
|
52 |
+
'label' => Mage::helper('brand')->__('Yes'),
|
53 |
+
),
|
54 |
+
),
|
55 |
+
|
56 |
+
));
|
57 |
+
$fieldset->addField('store_id', 'multiselect', array(
|
58 |
+
'name' => 'stores[]',
|
59 |
+
'label' => Mage::helper('cms')->__('Store View'),
|
60 |
+
'title' => Mage::helper('cms')->__('Store View'),
|
61 |
+
'required' => true,
|
62 |
+
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
|
63 |
+
));
|
64 |
+
$fieldset->addField('sale_label', 'text', array(
|
65 |
+
'label' => Mage::helper('brand')->__('Sales Label'),
|
66 |
+
'required' => false,
|
67 |
+
'name' => 'sale_label',
|
68 |
+
));
|
69 |
+
$fieldset->addField('content', 'editor', array(
|
70 |
+
'name' => 'content',
|
71 |
+
'label' => Mage::helper('brand')->__('Content'),
|
72 |
+
'title' => Mage::helper('brand')->__('Content'),
|
73 |
+
'style' => 'width:700px; height:500px;',
|
74 |
+
'wysiwyg' => false,
|
75 |
+
'required' => true,
|
76 |
+
));
|
77 |
+
if (Mage::getSingleton('adminhtml/session')->getBrandData()) {
|
78 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getBrandData());
|
79 |
+
Mage::getSingleton('adminhtml/session')->setBrandData(null);
|
80 |
+
} elseif (Mage::registry('brand_data')) {
|
81 |
+
$form->setValues(Mage::registry('brand_data')->getData());
|
82 |
+
}
|
83 |
+
$p = $form->getElement('filename')->getValue();
|
84 |
+
$form->getElement('filename')->setValue('brand/' . $p);
|
85 |
+
return parent::_prepareForm();
|
86 |
+
}
|
87 |
+
}
|
app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Edit/Tabs.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Block_Adminhtml_Brand_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('brand_tabs');
|
9 |
+
$this->setDestElementId('edit_form');
|
10 |
+
$this->setTitle(Mage::helper('brand')->__('Brand Information'));
|
11 |
+
}
|
12 |
+
protected function _beforeToHtml()
|
13 |
+
{
|
14 |
+
$this->addTab('form_section', array(
|
15 |
+
'label' => Mage::helper('brand')->__('Brand Information'),
|
16 |
+
'title' => Mage::helper('brand')->__('Brand Information'),
|
17 |
+
'content' => $this->getLayout()->createBlock('brand/adminhtml_brand_edit_tab_form')->toHtml(),
|
18 |
+
));
|
19 |
+
|
20 |
+
|
21 |
+
return parent::_beforeToHtml();
|
22 |
+
}
|
23 |
+
}
|
app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Grid.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Block_Adminhtml_Brand_Grid extends Mage_Adminhtml_Block_Widget_Grid {
|
4 |
+
|
5 |
+
public $itemCount = 1;
|
6 |
+
public function __construct() {
|
7 |
+
$this->setId('newsGrid');
|
8 |
+
$this->setDefaultSort('status');
|
9 |
+
$this->setDefaultDir('ASC');
|
10 |
+
$this->setSaveParametersInSession(true);
|
11 |
+
parent::__construct();
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _prepareCollection() {
|
15 |
+
|
16 |
+
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
|
17 |
+
->setCodeFilter('brand')->getFirstItem();
|
18 |
+
$collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
19 |
+
->setPositionOrder('asc')
|
20 |
+
->setAttributeFilter($attributeInfo->getAttributeId())
|
21 |
+
->setStoreFilter(Mage::app()->getStore()->getId());
|
22 |
+
/* $collection = Mage::getModel('brand/brand')->getCollection(); */
|
23 |
+
$collection->getSelect()->joinLeft(
|
24 |
+
array('brand' => $collection->getTable('brand/brand')),
|
25 |
+
'brand.brand_option_id = main_table.option_id',
|
26 |
+
array('brand.status as brand_status', 'brand.filename as logo', 'brand.content as brand_content')
|
27 |
+
);
|
28 |
+
$this->setCollection($collection);
|
29 |
+
return parent::_prepareCollection();
|
30 |
+
}
|
31 |
+
|
32 |
+
protected function _prepareColumns() {
|
33 |
+
$this->addColumn('option_id', array(
|
34 |
+
'header' => Mage::helper('brand')->__('ID'),
|
35 |
+
'align' => 'right',
|
36 |
+
'width' => '50px',
|
37 |
+
'index' => 'option_id'
|
38 |
+
));
|
39 |
+
$this->addColumn('title', array(
|
40 |
+
'header' => Mage::helper('brand')->__('Title'),
|
41 |
+
'align' => 'left',
|
42 |
+
'index' => 'value'
|
43 |
+
));
|
44 |
+
$this->addColumn('brand_content', array(
|
45 |
+
'header' => Mage::helper('brand')->__('Content'),
|
46 |
+
'align' => 'left',
|
47 |
+
'index' => 'brand_content',
|
48 |
+
));
|
49 |
+
$this->addColumn('logo', array(
|
50 |
+
'header' => Mage::helper('brand')->__('Logo'),
|
51 |
+
'align' => 'left',
|
52 |
+
'index' => 'logo',
|
53 |
+
'renderer' =>'Ktree_Brand_Block_Adminhtml_Brand_Grid_Renderer_Image',
|
54 |
+
));
|
55 |
+
$this->addColumn('status', array(
|
56 |
+
'header' => Mage::helper('brand')->__('Featured'),
|
57 |
+
'align' => 'left',
|
58 |
+
'width' => '80px',
|
59 |
+
'index' => 'brand_status',
|
60 |
+
'type' => 'options',
|
61 |
+
'options' => array(
|
62 |
+
1 => 'Enabled',
|
63 |
+
2 => 'Disabled',
|
64 |
+
),
|
65 |
+
));
|
66 |
+
|
67 |
+
$this->addColumn('action',
|
68 |
+
array(
|
69 |
+
'header' => Mage::helper('brand')->__('Action'),
|
70 |
+
'width' => '100',
|
71 |
+
'type' => 'action',
|
72 |
+
'getter' => 'getId',
|
73 |
+
'actions' => array(
|
74 |
+
array(
|
75 |
+
'caption' => Mage::helper('brand')->__('Delete'),
|
76 |
+
'url' => array('base'=> '*/*/delete'),
|
77 |
+
'field' => 'brand_option_id',
|
78 |
+
'confirm' => Mage::helper('brand')->__('Are you sure?')
|
79 |
+
)
|
80 |
+
),
|
81 |
+
'filter' => false,
|
82 |
+
'sortable' => false,
|
83 |
+
'index' => 'stores',
|
84 |
+
'is_system' => true,
|
85 |
+
));
|
86 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('brand')->__('CSV'));
|
87 |
+
$this->addExportType('*/*/exportXml', Mage::helper('brand')->__('XML'));
|
88 |
+
|
89 |
+
return parent::_prepareColumns();
|
90 |
+
}
|
91 |
+
|
92 |
+
public function getRowUrl($row) {
|
93 |
+
return $this->getUrl('*/*/edit', array('brand_option_id' => $row->getID()));
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
protected function _prepareMassaction()
|
98 |
+
{
|
99 |
+
$this->setMassactionIdField('brand_id');
|
100 |
+
$this->getMassactionBlock()->setFormFieldName('brand');
|
101 |
+
|
102 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
103 |
+
'label' => Mage::helper('brand')->__('Delete'),
|
104 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
105 |
+
'confirm' => Mage::helper('brand')->__('Are you sure?')
|
106 |
+
));
|
107 |
+
|
108 |
+
$statuses = Mage::getSingleton('brand/status')->getOptionArray();
|
109 |
+
|
110 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
111 |
+
$this->getMassactionBlock()->addItem('status', array(
|
112 |
+
'label'=> Mage::helper('brand')->__('Change status'),
|
113 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
114 |
+
'additional' => array(
|
115 |
+
'visibility' => array(
|
116 |
+
'name' => 'status',
|
117 |
+
'type' => 'select',
|
118 |
+
'class' => 'required-entry',
|
119 |
+
'label' => Mage::helper('brand')->__('Status'),
|
120 |
+
'values' => $statuses
|
121 |
+
)
|
122 |
+
)
|
123 |
+
));
|
124 |
+
$categories = Mage::getSingleton('brand/categoryname')->getOptionArray();
|
125 |
+
array_unshift($categories, array('label'=>'', 'value'=>''));
|
126 |
+
$this->getMassactionBlock()->addItem('categoryname', array(
|
127 |
+
'label'=> Mage::helper('brand')->__('Attache Categories'),
|
128 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
129 |
+
'additional' => array(
|
130 |
+
'visibility' => array(
|
131 |
+
'name' => 'categoryname',
|
132 |
+
'type' => 'select',
|
133 |
+
'class' => 'required-entry',
|
134 |
+
'label' => Mage::helper('brand')->__('Category List'),
|
135 |
+
'values' => $categories
|
136 |
+
)
|
137 |
+
)
|
138 |
+
));
|
139 |
+
return $this;
|
140 |
+
}
|
141 |
+
}
|
app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Grid/Renderer/Arrange.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ktree_Brand_Block_Adminhtml_Brand_Grid_Renderer_Arrange extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
3 |
+
{
|
4 |
+
public $currentItem = 0;
|
5 |
+
|
6 |
+
public function render(Varien_Object $row)
|
7 |
+
{
|
8 |
+
$this->currentItem++;
|
9 |
+
return $this->currentItem;
|
10 |
+
}
|
11 |
+
|
12 |
+
}
|
app/code/local/Ktree/Brand/Block/Adminhtml/Brand/Grid/Renderer/Image.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ktree_Brand_Block_Adminhtml_Brand_Grid_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
3 |
+
{
|
4 |
+
/*public $currentItem = 0;
|
5 |
+
|
6 |
+
public function render(Varien_Object $row)
|
7 |
+
{
|
8 |
+
return '<img width="32" src="'.str_replace("index.php","", Mage::getBaseUrl()).'media/brand/'.$row->getData($this->getColumn()->getIndex()).'"/>';
|
9 |
+
|
10 |
+
}*/
|
11 |
+
|
12 |
+
protected static $img = "";
|
13 |
+
protected static $html = "";
|
14 |
+
protected static $imgPath = "";
|
15 |
+
|
16 |
+
|
17 |
+
public function render(Varien_Object $row)
|
18 |
+
{
|
19 |
+
return $this->_getValue($row);
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _getValue(Varien_Object $row)
|
23 |
+
{
|
24 |
+
$id = $row->getData("option_id");
|
25 |
+
|
26 |
+
try {
|
27 |
+
$collection =Mage::getModel('brand/brand')->load($id, 'brand_option_id');
|
28 |
+
$img = $collection["filename"];
|
29 |
+
$imgPath = Mage::helper('brand')->Brand_Image($img, 'small') ;
|
30 |
+
|
31 |
+
$html = "<img src='".$imgPath."' border=0 />";
|
32 |
+
|
33 |
+
} catch(Exception $e){}
|
34 |
+
|
35 |
+
return $collection;
|
36 |
+
}
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
}
|
app/code/local/Ktree/Brand/Block/Adminhtml/Tab/Brand.php
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento Commercial Edition
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Magento Commercial Edition License
|
9 |
+
* that is available at: http://www.magentocommerce.com/license/commercial-edition
|
10 |
+
* If you did not receive a copy of the license and are unable to
|
11 |
+
* obtain it through the world-wide-web, please send an email
|
12 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
13 |
+
*
|
14 |
+
* DISCLAIMER
|
15 |
+
*
|
16 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
17 |
+
* versions in the future. If you wish to customize Magento for your
|
18 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
19 |
+
*
|
20 |
+
* @category Mage
|
21 |
+
* @package Mage_Adminhtml
|
22 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
23 |
+
* @license http://www.magentocommerce.com/license/commercial-edition
|
24 |
+
*/
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Product in category grid
|
28 |
+
*
|
29 |
+
* @category Mage
|
30 |
+
* @package Mage_Adminhtml
|
31 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
32 |
+
*/
|
33 |
+
class Ktree_Brand_Block_Adminhtml_Tab_Brand extends Mage_Adminhtml_Block_Widget_Grid {
|
34 |
+
|
35 |
+
public function __construct() {
|
36 |
+
parent::__construct();
|
37 |
+
$this->setId('catalog_category_products');
|
38 |
+
$this->setDefaultSort('value');
|
39 |
+
$this->setDefaultLimit(300);
|
40 |
+
$this->setUseAjax(true);
|
41 |
+
}
|
42 |
+
|
43 |
+
public function getCategory() {
|
44 |
+
return Mage::registry('category');
|
45 |
+
}
|
46 |
+
|
47 |
+
protected function _addColumnFilterToCollection($column) {
|
48 |
+
// Set custom filter for in category flag
|
49 |
+
if ($column->getId() == 'in_category') {
|
50 |
+
$brandIds = $this->_getSelectedBrands();
|
51 |
+
if (empty($brandIds)) {
|
52 |
+
$brandIds = 0;
|
53 |
+
}
|
54 |
+
if ($column->getFilter()->getValue()) {
|
55 |
+
$this->getCollection()->addFieldToFilter('entity_id', array('in' => $brandIds));
|
56 |
+
} elseif (!empty($brandIds)) {
|
57 |
+
$this->getCollection()->addFieldToFilter('entity_id', array('nin' => $brandIds));
|
58 |
+
}
|
59 |
+
} elseif($column->getId() == 'title'){
|
60 |
+
$this->getCollection()->addFieldToFilter('store_value.value', array('like' => $column->getFilter()->getValue()."%"));
|
61 |
+
}else {
|
62 |
+
parent::_addColumnFilterToCollection($column);
|
63 |
+
}
|
64 |
+
return $this;
|
65 |
+
}
|
66 |
+
|
67 |
+
protected function _prepareCollection() {
|
68 |
+
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
|
69 |
+
->setCodeFilter('brand')->getFirstItem();
|
70 |
+
$collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
71 |
+
->setPositionOrder('asc')
|
72 |
+
->setAttributeFilter($attributeInfo->getAttributeId())
|
73 |
+
->setStoreFilter(Mage::app()->getStore()->getId());
|
74 |
+
/* $collection = Mage::getModel('brand/brand')->getCollection(); */
|
75 |
+
$collection->getSelect()->joinLeft(
|
76 |
+
array('brand' => $collection->getTable('brand/brand')),
|
77 |
+
'brand.brand_option_id = main_table.option_id',
|
78 |
+
array('brand.status as brand_status', 'brand.filename as logo', 'brand.content as brand_content')
|
79 |
+
);
|
80 |
+
$this->setCollection($collection);
|
81 |
+
|
82 |
+
return parent::_prepareCollection();
|
83 |
+
}
|
84 |
+
|
85 |
+
protected function _prepareColumns() {
|
86 |
+
$this->addColumn('in_category', array(
|
87 |
+
'header_css_class' => 'a-center',
|
88 |
+
'type' => 'checkbox',
|
89 |
+
'name' => $this->_getName(),
|
90 |
+
'values' => $this->_getSelectedBrands(),
|
91 |
+
'align' => 'center',
|
92 |
+
'index' => 'option_id',
|
93 |
+
'renderer' => new Ktree_Brand_Block_Adminhtml_Tab_Brand_Renderer_Checkbox()
|
94 |
+
));
|
95 |
+
$this->addColumn('title', array(
|
96 |
+
'header_css_class' => 'a-center',
|
97 |
+
'header' => Mage::helper('brand')->__('Brand Name'),
|
98 |
+
'width' => '120',
|
99 |
+
'index' => 'value',
|
100 |
+
'filter_index' => 'store_value',
|
101 |
+
));
|
102 |
+
$this->addColumn('content', array(
|
103 |
+
'header_css_class' => 'a-center',
|
104 |
+
'header' => Mage::helper('brand')->__('Descrition'),
|
105 |
+
'sortable' => true,
|
106 |
+
'index' => 'brand_content'
|
107 |
+
));
|
108 |
+
$this->addColumn('logo', array(
|
109 |
+
'header_css_class' => 'a-center',
|
110 |
+
'header' => Mage::helper('brand')->__('Logo'),
|
111 |
+
'sortable' => true,
|
112 |
+
'width' => '120',
|
113 |
+
'align' => 'center',
|
114 |
+
'index' => 'logo',
|
115 |
+
'renderer' => new Ktree_Brand_Block_Adminhtml_Brand_Grid_Renderer_Image()
|
116 |
+
));
|
117 |
+
|
118 |
+
return parent::_prepareColumns();
|
119 |
+
}
|
120 |
+
|
121 |
+
public function getGridUrl() {
|
122 |
+
return $this->getUrl('*/*/grid', array('_current' => true));
|
123 |
+
}
|
124 |
+
|
125 |
+
protected function _getSelectedBrands() {
|
126 |
+
$brands = $this->getRequest()->getPost('selected_brands');
|
127 |
+
$categoryId = $this->getCategory()->getId();
|
128 |
+
if (is_null($brands)) {
|
129 |
+
$arrayBrands = array();
|
130 |
+
$brands = Mage::getModel("brand/category")->getCollection()->addFieldToFilter("entity_id", array("eq" => $categoryId));
|
131 |
+
foreach ($brands as $brand) {
|
132 |
+
$arrayBrands[] = $brand->getBrandId();
|
133 |
+
}
|
134 |
+
return $arrayBrands;
|
135 |
+
}
|
136 |
+
else
|
137 |
+
return $brands;
|
138 |
+
}
|
139 |
+
|
140 |
+
protected function _getName() {
|
141 |
+
return "brand[id][]";
|
142 |
+
}
|
143 |
+
|
144 |
+
}
|
145 |
+
|
app/code/local/Ktree/Brand/Block/Adminhtml/Tab/Brand/Renderer/Checkbox.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ktree_Brand_Block_Adminhtml_Tab_Brand_Renderer_Checkbox extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox
|
3 |
+
{
|
4 |
+
protected function _getCheckboxHtml($value, $checked){
|
5 |
+
return '<input type="checkbox" name="brands[]" value="' . $value . '" class="'. ($this->getColumn()->getInlineCss() ? $this->getColumn()->getInlineCss() : 'checkbox' ).'"'.$checked.'/>';
|
6 |
+
}
|
7 |
+
|
8 |
+
}
|
app/code/local/Ktree/Brand/Block/Adminhtml/Tabs.php
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Commercial Edition
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magento Commercial Edition License
|
8 |
+
* that is available at: http://www.magentocommerce.com/license/commercial-edition
|
9 |
+
* If you did not receive a copy of the license and are unable to
|
10 |
+
* obtain it through the world-wide-web, please send an email
|
11 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
16 |
+
* versions in the future. If you wish to customize Magento for your
|
17 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
18 |
+
*
|
19 |
+
* @category Mage
|
20 |
+
* @package Mage_Adminhtml
|
21 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
22 |
+
* @license http://www.magentocommerce.com/license/commercial-edition
|
23 |
+
*/
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Category tabs
|
27 |
+
*
|
28 |
+
* @category Mage
|
29 |
+
* @package Mage_Adminhtml
|
30 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
31 |
+
*/
|
32 |
+
class Ktree_Brand_Block_Adminhtml_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
33 |
+
{
|
34 |
+
/**
|
35 |
+
* Default Attribute Tab Block
|
36 |
+
*
|
37 |
+
* @var string
|
38 |
+
*/
|
39 |
+
protected $_attributeTabBlock = 'adminhtml/catalog_category_tab_attributes';
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Initialize Tabs
|
43 |
+
*
|
44 |
+
*/
|
45 |
+
public function __construct()
|
46 |
+
{
|
47 |
+
parent::__construct();
|
48 |
+
$this->setId('category_info_tabs');
|
49 |
+
$this->setDestElementId('category_tab_content');
|
50 |
+
$this->setTitle(Mage::helper('catalog')->__('Category Data'));
|
51 |
+
$this->setTemplate('widget/tabshoriz.phtml');
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Retrieve cattegory object
|
56 |
+
*
|
57 |
+
* @return Mage_Catalog_Model_Category
|
58 |
+
*/
|
59 |
+
public function getCategory()
|
60 |
+
{
|
61 |
+
return Mage::registry('current_category');
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Return Adminhtml Catalog Helper
|
66 |
+
*
|
67 |
+
* @return Mage_Adminhtml_Helper_Catalog
|
68 |
+
*/
|
69 |
+
public function getCatalogHelper()
|
70 |
+
{
|
71 |
+
return Mage::helper('adminhtml/catalog');
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Getting attribute block name for tabs
|
76 |
+
*
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
+
public function getAttributeTabBlock()
|
80 |
+
{
|
81 |
+
if ($block = $this->getCatalogHelper()->getCategoryAttributeTabBlock()) {
|
82 |
+
return $block;
|
83 |
+
}
|
84 |
+
return $this->_attributeTabBlock;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Prepare Layout Content
|
89 |
+
*
|
90 |
+
* @return Mage_Adminhtml_Block_Catalog_Category_Tabs
|
91 |
+
*/
|
92 |
+
protected function _prepareLayout()
|
93 |
+
{
|
94 |
+
$categoryAttributes = $this->getCategory()->getAttributes();
|
95 |
+
if (!$this->getCategory()->getId()) {
|
96 |
+
foreach ($categoryAttributes as $attribute) {
|
97 |
+
$default = $attribute->getDefaultValue();
|
98 |
+
if ($default != '') {
|
99 |
+
$this->getCategory()->setData($attribute->getAttributeCode(), $default);
|
100 |
+
}
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
$attributeSetId = $this->getCategory()->getDefaultAttributeSetId();
|
105 |
+
$groupCollection = Mage::getResourceModel('eav/entity_attribute_group_collection')
|
106 |
+
->setAttributeSetFilter($attributeSetId)
|
107 |
+
->load();
|
108 |
+
$defaultGroupId = 0;
|
109 |
+
foreach ($groupCollection as $group) {
|
110 |
+
/* @var $group Mage_Eav_Model_Entity_Attribute_Group */
|
111 |
+
if ($defaultGroupId == 0 or $group->getIsDefault()) {
|
112 |
+
$defaultGroupId = $group->getId();
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
foreach ($groupCollection as $group) {
|
117 |
+
/* @var $group Mage_Eav_Model_Entity_Attribute_Group */
|
118 |
+
$attributes = array();
|
119 |
+
foreach ($categoryAttributes as $attribute) {
|
120 |
+
/* @var $attribute Mage_Eav_Model_Entity_Attribute */
|
121 |
+
if ($attribute->isInGroup($attributeSetId, $group->getId())) {
|
122 |
+
$attributes[] = $attribute;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
// do not add grops without attributes
|
127 |
+
if (!$attributes) {
|
128 |
+
continue;
|
129 |
+
}
|
130 |
+
|
131 |
+
$active = $defaultGroupId == $group->getId();
|
132 |
+
$block = $this->getLayout()->createBlock($this->getAttributeTabBlock(), '')
|
133 |
+
->setGroup($group)
|
134 |
+
->setAttributes($attributes)
|
135 |
+
->setAddHiddenFields($active)
|
136 |
+
->toHtml();
|
137 |
+
$this->addTab('group_' . $group->getId(), array(
|
138 |
+
'label' => Mage::helper('catalog')->__($group->getAttributeGroupName()),
|
139 |
+
'content' => $block,
|
140 |
+
'active' => $active
|
141 |
+
));
|
142 |
+
}
|
143 |
+
|
144 |
+
// $this->addTab('general', array(
|
145 |
+
// 'label' => Mage::helper('catalog')->__('General Information'),
|
146 |
+
// 'content' => $this->getLayout()->createBlock('adminhtml/catalog_category_tab_general')->toHtml(),
|
147 |
+
// 'active' => true
|
148 |
+
// ));
|
149 |
+
|
150 |
+
$this->addTab('products', array(
|
151 |
+
'label' => Mage::helper('catalog')->__('Category Products'),
|
152 |
+
'content' => $this->getLayout()->createBlock('adminhtml/catalog_category_tab_product', 'category.product.grid')->toHtml(),
|
153 |
+
));
|
154 |
+
|
155 |
+
$this->addTab('brands', array(
|
156 |
+
'label' => Mage::helper('catalog')->__('Featured Brands'),
|
157 |
+
'content' => $this->getLayout()->createBlock('brand/adminhtml_tab_brand', 'category.brand.grid')->toHtml(),
|
158 |
+
));
|
159 |
+
|
160 |
+
// dispatch event add custom tabs
|
161 |
+
Mage::dispatchEvent('adminhtml_catalog_category_tabs', array(
|
162 |
+
'tabs' => $this
|
163 |
+
));
|
164 |
+
|
165 |
+
/**
|
166 |
+
* @todo Adding tab in observer
|
167 |
+
*/
|
168 |
+
if (Mage::app()->getConfig()->getModuleConfig('Mage_GoogleOptimizer')->is('active', true)
|
169 |
+
&& Mage::helper('googleoptimizer')->isOptimizerActive($this->getCategory()->getStoreId())) {
|
170 |
+
$this->addTab('googleoptimizer', array(
|
171 |
+
'label' => Mage::helper('googleoptimizer')->__('Category View Optimization'),
|
172 |
+
'content' => $this->getLayout()->createBlock('googleoptimizer/adminhtml_catalog_category_edit_tab_googleoptimizer')->toHtml(),
|
173 |
+
));
|
174 |
+
}
|
175 |
+
|
176 |
+
/*$this->addTab('features', array(
|
177 |
+
'label' => Mage::helper('catalog')->__('Feature Products'),
|
178 |
+
'content' => 'Feature Products'
|
179 |
+
)); */
|
180 |
+
return parent::_prepareLayout();
|
181 |
+
}
|
182 |
+
}
|
app/code/local/Ktree/Brand/Block/Brand.php
ADDED
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Block_Brand extends Mage_Core_Block_Template {
|
4 |
+
private $items = array();
|
5 |
+
|
6 |
+
public function _prepareLayout() {
|
7 |
+
if (!$this->hasData('brand')) {
|
8 |
+
$this->setData('brand', Mage::registry('brand'));
|
9 |
+
}
|
10 |
+
$c = 0;
|
11 |
+
$letters = array();
|
12 |
+
$collection = $this->getData('brand');
|
13 |
+
foreach ($collection as $opt){
|
14 |
+
|
15 |
+
$i = strtoupper(substr($opt['title'], 0, 1));
|
16 |
+
|
17 |
+
if (!isset($letters[$i]['items'])){
|
18 |
+
$letters[$i]['items'] = array();
|
19 |
+
}
|
20 |
+
|
21 |
+
$letters[$i]['items'][] = $opt;
|
22 |
+
|
23 |
+
if (!isset($letters[$i]['count'])){
|
24 |
+
$letters[$i]['count'] = 0;
|
25 |
+
}
|
26 |
+
|
27 |
+
$letters[$i]['count']++;
|
28 |
+
|
29 |
+
++$c;
|
30 |
+
|
31 |
+
}
|
32 |
+
if (!$letters){
|
33 |
+
return parent::_prepareLayout();
|
34 |
+
}
|
35 |
+
|
36 |
+
$itemsPerColumn = ceil(($c + sizeof($letters)) / max(1, abs(intVal($this->getColumns()))));
|
37 |
+
|
38 |
+
$col = 0; // current column
|
39 |
+
$num = 0; // current number of items in column
|
40 |
+
foreach ($letters as $letter => $items){
|
41 |
+
$this->items[$col][$letter] = $items['items'];
|
42 |
+
$num += $items['count'];
|
43 |
+
$num++;
|
44 |
+
if ($num >= $itemsPerColumn){
|
45 |
+
$num = 0;
|
46 |
+
$col++;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
return parent::_prepareLayout();
|
50 |
+
}
|
51 |
+
public function getItems()
|
52 |
+
{
|
53 |
+
return $this->items;
|
54 |
+
}
|
55 |
+
//Get Collection from Brand Controller
|
56 |
+
public function getBrand() {
|
57 |
+
if (!$this->hasData('brand')) {
|
58 |
+
$this->setData('brand', Mage::registry('brand'));
|
59 |
+
}
|
60 |
+
|
61 |
+
return $this->getData('brand');
|
62 |
+
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
public function getAllBrands()
|
67 |
+
{
|
68 |
+
|
69 |
+
}
|
70 |
+
//Get Brand Featured Collection
|
71 |
+
public function getFeaturedBrand() {
|
72 |
+
|
73 |
+
$result = array();
|
74 |
+
$sql = "SELECT * FROM brand where status=1";
|
75 |
+
|
76 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
77 |
+
|
78 |
+
$row = $connection->query($sql)->rowCount();
|
79 |
+
$result = $connection->fetchAll($sql);
|
80 |
+
return $result;
|
81 |
+
}
|
82 |
+
|
83 |
+
public function resizeBrand($img,$width=100, $height=60) {
|
84 |
+
if (!file_exists("./media/brand/resized"))
|
85 |
+
mkdir("./media/brand/resized", 0777);
|
86 |
+
$imageResized = Mage::getBaseDir('media') . DS . "brand" . DS . "resized" . DS . $width."x".$height.$img;
|
87 |
+
if (!file_exists($imageResized) && file_exists("./media/brand/" . $img)) {
|
88 |
+
$imageObj = new Varien_Image("./media/brand/" . $img);
|
89 |
+
$imageObj->constrainOnly(TRUE);
|
90 |
+
$imageObj->keepAspectRatio(TRUE);
|
91 |
+
$imageObj->keepFrame(FALSE);
|
92 |
+
$imageObj->resize($width, $height);
|
93 |
+
$imageObj->save($imageResized);
|
94 |
+
}
|
95 |
+
$newImageUrl = Mage::getBaseUrl('media')."brand/resized/".$width."x".$height.$img;
|
96 |
+
return $newImageUrl;
|
97 |
+
}
|
98 |
+
|
99 |
+
public function getNormalBrand() {
|
100 |
+
return $this->getBrand()->getCollection()->addFilter('status', '0');
|
101 |
+
}
|
102 |
+
|
103 |
+
public function getBrandChar() {
|
104 |
+
extract($this->getBrandKey());
|
105 |
+
return $this->getBrand()->getCollection()->saveBrandcollection($char);
|
106 |
+
}
|
107 |
+
|
108 |
+
//Create Alphabet navigation
|
109 |
+
public function navigation() {
|
110 |
+
extract($this->getBrandKey());
|
111 |
+
$alphas = range('A', 'Z');
|
112 |
+
$navigation = "";
|
113 |
+
$digitClass = "";
|
114 |
+
foreach ($alphas as $key) {
|
115 |
+
if ($char == $key)
|
116 |
+
$class_key = "current_char";
|
117 |
+
else
|
118 |
+
$class_key="";
|
119 |
+
$navigation .= "<li class='key_item " . $class_key." ".$key. "'>".$key."</li>";
|
120 |
+
}
|
121 |
+
if ($char == "digit") {
|
122 |
+
$digitClass = "current_char";
|
123 |
+
} elseif ($char == "all")
|
124 |
+
$allClass = "current_char";
|
125 |
+
//$navigation = "<li class='key_item " . $digitClass . "'><a href='" . Mage::getBaseUrl() . "brand/index/index/brand_key/digit'>ALL</a></li>" .
|
126 |
+
$navigation;
|
127 |
+
return $navigation;
|
128 |
+
}
|
129 |
+
|
130 |
+
//Get request for brand block
|
131 |
+
public function getBrandKey() {
|
132 |
+
$brand_key = Mage::registry('brand_key');
|
133 |
+
|
134 |
+
if ($brand_key) {
|
135 |
+
$char = $brand_key->getParam('brand_key') ? $brand_key->getParam('brand_key') : 'A';
|
136 |
+
$option_id = $brand_key->getParam('option_id') ? $brand_key->getParam('option_id') : '1';
|
137 |
+
$brand = $brand_key->getParam('brand') ? $brand_key->getParam('brand') : 'Nike11';
|
138 |
+
} else {
|
139 |
+
$char = 'digit';
|
140 |
+
$option_id = '544';
|
141 |
+
}
|
142 |
+
return compact('char', 'option_id', 'brand');
|
143 |
+
}
|
144 |
+
|
145 |
+
public function getBrandCategoryIds(){
|
146 |
+
$id = "";
|
147 |
+
$category = array();
|
148 |
+
$sql = "SELECT DISTINCT entity_id FROM brand_category";
|
149 |
+
|
150 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
151 |
+
|
152 |
+
$row = $connection->query($sql)->rowCount();
|
153 |
+
foreach($connection->fetchAll($sql) as $entity_id){
|
154 |
+
array_push($category,$entity_id['entity_id']);
|
155 |
+
}
|
156 |
+
return $category;
|
157 |
+
}
|
158 |
+
public function drawChildren($_category,$brandcats){
|
159 |
+
|
160 |
+
|
161 |
+
$_helper = Mage::helper('catalog/category');
|
162 |
+
$_categories = $_helper->getStoreCategories();
|
163 |
+
$html='';
|
164 |
+
|
165 |
+
$html = '<ul class="indentedUl">';
|
166 |
+
$loder=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'css/images/ajax_loader.gif';
|
167 |
+
foreach($_category->getChildren() as $_childCategory){
|
168 |
+
|
169 |
+
if(in_array($_childCategory->getId(),$brandcats)){
|
170 |
+
$html .= '<li id="'.$_childCategory->getId().'">';
|
171 |
+
$html .= '<a href="#" id="'.$_childCategory->getId().'">'.$_childCategory->getName().'</a><span id="loader_'.$_childCategory->getId().'" style="display:none"><img src="'.$loder.'"/></span>';
|
172 |
+
|
173 |
+
} else {
|
174 |
+
$html .= '<li>';
|
175 |
+
$html .= $_childCategory->getName();
|
176 |
+
|
177 |
+
}
|
178 |
+
//NEXT LVL
|
179 |
+
$html .= $this->drawChildren($_childCategory,$brandcats);
|
180 |
+
$html .= '</li>';
|
181 |
+
|
182 |
+
}
|
183 |
+
$html .= '</ul>';
|
184 |
+
|
185 |
+
return $html;
|
186 |
+
}
|
187 |
+
|
188 |
+
public function getClearanceSales(){
|
189 |
+
|
190 |
+
$result = array();
|
191 |
+
$sql = "SELECT * FROM brand where is_sale=1";
|
192 |
+
|
193 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
194 |
+
|
195 |
+
$row = $connection->query($sql)->rowCount();
|
196 |
+
$result = $connection->fetchAll($sql);
|
197 |
+
//foreach($connection->fetchAll($sql) as $brand){
|
198 |
+
//array_push($category,$brand_id['brand_option_id']);
|
199 |
+
//}
|
200 |
+
return $result;
|
201 |
+
|
202 |
+
}
|
203 |
+
|
204 |
+
}
|
app/code/local/Ktree/Brand/Block/Brandcategories.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Block_Brandcategories extends Mage_Core_Block_Template {
|
4 |
+
|
5 |
+
public function _prepareLayout() {
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
|
10 |
+
public function brandCategories() {
|
11 |
+
|
12 |
+
$brandname = $this->getRequest()->getParam('brand');
|
13 |
+
$brand = array();
|
14 |
+
$sql = "SELECT * FROM brand_category where brand_id = ".$brandname;
|
15 |
+
|
16 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
17 |
+
|
18 |
+
$row = $connection->query($sql)->rowCount();
|
19 |
+
$brand = $connection->fetchAll($sql);
|
20 |
+
|
21 |
+
return $brand;
|
22 |
+
}
|
23 |
+
public function drawChildren($_category,$brandid){
|
24 |
+
$brand = array();
|
25 |
+
$sql = "SELECT * FROM brand_category where brand_id = ".$brandid;
|
26 |
+
|
27 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
28 |
+
|
29 |
+
$row = $connection->query($sql)->rowCount();
|
30 |
+
$brand = $connection->fetchAll($sql);
|
31 |
+
foreach($brand as $item){
|
32 |
+
$_categoryid[] =$item['entity_id'];
|
33 |
+
}
|
34 |
+
$_helper = Mage::helper('catalog/category');
|
35 |
+
$_categories = $_helper->getStoreCategories();
|
36 |
+
$html='';
|
37 |
+
|
38 |
+
$html = '<ul class="indentedUl">+';
|
39 |
+
foreach($_category->getChildren() as $_childCategory){
|
40 |
+
$html .= '<li>';
|
41 |
+
if(in_array($_childCategory->getId(),$_categoryid)){
|
42 |
+
$html .= '<a href="'.Mage::getBaseUrl().'brand/index/viewcategory/?brand='.$brandid.'&category_id='.$_childCategory->getId().'">'.$_childCategory->getName().'</a>';
|
43 |
+
} else {
|
44 |
+
$html .= $_childCategory->getName();
|
45 |
+
}
|
46 |
+
//NEXT LVL
|
47 |
+
$html .= $this->drawChildren($_childCategory,$brandid);
|
48 |
+
|
49 |
+
$html .= '</li>';
|
50 |
+
}
|
51 |
+
$html .= '</ul>';
|
52 |
+
|
53 |
+
return $html;
|
54 |
+
}
|
55 |
+
|
56 |
+
}
|
app/code/local/Ktree/Brand/Block/Brandinfo.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Block_Brandinfo extends Mage_Core_Block_Template {
|
4 |
+
|
5 |
+
public function _prepareLayout() {
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
public function brandInfo() {
|
10 |
+
/*$brand = Mage::getModel('brand/brand')
|
11 |
+
->load(Mage::app()
|
12 |
+
->getRequest()
|
13 |
+
->getParam('brand'), 'brand_option_id');*/
|
14 |
+
$brandname = $this->getRequest()->getParam('brand');
|
15 |
+
$brand = array();
|
16 |
+
$sql = "SELECT * FROM brand where brand_option_id = ".$brandname;
|
17 |
+
|
18 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
19 |
+
|
20 |
+
$row = $connection->query($sql)->rowCount();
|
21 |
+
$brand = $connection->fetchAll($sql);
|
22 |
+
|
23 |
+
return $brand;
|
24 |
+
/*if ($brand->getBrandId()) {
|
25 |
+
return $brand;
|
26 |
+
} else {
|
27 |
+
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
|
28 |
+
->setCodeFilter('brand')->getFirstItem();
|
29 |
+
$collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
30 |
+
->setPositionOrder('asc')
|
31 |
+
->setAttributeFilter($attributeInfo->getAttributeId())
|
32 |
+
->setStoreFilter(Mage::app()->getStore()->getId());
|
33 |
+
$item = $collection->getItemByColumnValue("option_id", Mage::app()->getRequest()->getParam('brand'));
|
34 |
+
return $item;
|
35 |
+
}*/
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
app/code/local/Ktree/Brand/Block/Category.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Block_Category extends Mage_Core_Block_Template {
|
4 |
+
|
5 |
+
public function _prepareLayout() {
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
public function getBrandCategories($categoryId) {
|
10 |
+
$collection = Mage::getModel("brand/category")->getCollection()
|
11 |
+
->addFieldToFilter("entity_id",array("eq"=>$categoryId));
|
12 |
+
$collection->getSelect()->joinLeft(
|
13 |
+
array('brand' => $collection->getTable('brand/brand')),
|
14 |
+
'brand.brand_option_id = main_table.brand_id and brand.status = 1',
|
15 |
+
array('title'=>'brand.title', 'logo'=>'brand.filename', 'content'=>'brand.content')
|
16 |
+
);
|
17 |
+
return $collection;
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
app/code/local/Ktree/Brand/Block/Onbrand.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ktree_Brand_Block_Onbrand extends Mage_Catalog_Block_Product_List
|
3 |
+
{
|
4 |
+
/*function _getProductCollection()
|
5 |
+
{
|
6 |
+
$visibility = array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
|
7 |
+
Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG);
|
8 |
+
|
9 |
+
$urlKey = Mage::app()->getStore()->getCode();
|
10 |
+
|
11 |
+
$_featcategory = Mage::getResourceModel('catalog/category_collection')
|
12 |
+
->addAttributeToSelect('entity_id')
|
13 |
+
->addAttributeToFilter('url_key', $urlKey)
|
14 |
+
->getFirstItem();
|
15 |
+
|
16 |
+
$this->_productCollection = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('*')
|
17 |
+
->addAttributeToFilter('visibility', $visibility)->addCategoryFilter($_featcategory)
|
18 |
+
//->addFieldToFilter(array(array('attribute'=>'is_on_sale','eq'=>1)))
|
19 |
+
//->addAttributeToFilter('is_on_sale', array('null'=>true), 'left')
|
20 |
+
->setPageSize(9);
|
21 |
+
|
22 |
+
return $this->_productCollection;
|
23 |
+
|
24 |
+
}
|
25 |
+
*/
|
26 |
+
protected function _toHtml()
|
27 |
+
{
|
28 |
+
$html = parent::_toHtml();
|
29 |
+
$html .= '
|
30 |
+
<script type="text/javascript">
|
31 |
+
document.observe("dom:loaded", function() {
|
32 |
+
// initially hide all containers for tab content
|
33 |
+
$$("div.std").invoke("hide");
|
34 |
+
$$("div.page-title").invoke("hide");
|
35 |
+
|
36 |
+
});
|
37 |
+
</script>
|
38 |
+
';
|
39 |
+
return $html;
|
40 |
+
}
|
41 |
+
protected function _getProductCollection()
|
42 |
+
{
|
43 |
+
$layer = Mage::getSingleton('catalog/layer');
|
44 |
+
$rootCategoryId = Mage::app()->getStore()->getRootCategoryId();
|
45 |
+
$_featcategory = Mage::getModel('catalog/category')->load($rootCategoryId);
|
46 |
+
$layer->setCurrentCategory($_featcategory);
|
47 |
+
|
48 |
+
$layer = $this->getLayer();
|
49 |
+
$layer->setCurrentCategory($_featcategory);
|
50 |
+
Mage::App()->getRequest();
|
51 |
+
$this->_productCollection = Mage::getModel('catalog/product')->getCollection()
|
52 |
+
->addAttributeToFilter('brand', array("eq", Mage::App()->getRequest()->getParam('brand')));
|
53 |
+
$layer->prepareProductCollection($this->_productCollection);
|
54 |
+
return $this->_productCollection;
|
55 |
+
}
|
56 |
+
}
|
app/code/local/Ktree/Brand/Block/Onbrandcategory.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ktree_Brand_Block_Onbrandcategory extends Mage_Catalog_Block_Product_List
|
3 |
+
{
|
4 |
+
/*function _getProductCollection()
|
5 |
+
{
|
6 |
+
$visibility = array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
|
7 |
+
Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG);
|
8 |
+
|
9 |
+
$urlKey = Mage::app()->getStore()->getCode();
|
10 |
+
|
11 |
+
$_featcategory = Mage::getResourceModel('catalog/category_collection')
|
12 |
+
->addAttributeToSelect('entity_id')
|
13 |
+
->addAttributeToFilter('url_key', $urlKey)
|
14 |
+
->getFirstItem();
|
15 |
+
|
16 |
+
$this->_productCollection = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('*')
|
17 |
+
->addAttributeToFilter('visibility', $visibility)->addCategoryFilter($_featcategory)
|
18 |
+
//->addFieldToFilter(array(array('attribute'=>'is_on_sale','eq'=>1)))
|
19 |
+
//->addAttributeToFilter('is_on_sale', array('null'=>true), 'left')
|
20 |
+
->setPageSize(9);
|
21 |
+
|
22 |
+
return $this->_productCollection;
|
23 |
+
|
24 |
+
}
|
25 |
+
*/
|
26 |
+
protected function _toHtml()
|
27 |
+
{
|
28 |
+
$html = parent::_toHtml();
|
29 |
+
$html .= '
|
30 |
+
<script type="text/javascript">
|
31 |
+
document.observe("dom:loaded", function() {
|
32 |
+
// initially hide all containers for tab content
|
33 |
+
$$("div.std").invoke("hide");
|
34 |
+
$$("div.page-title").invoke("hide");
|
35 |
+
|
36 |
+
});
|
37 |
+
</script>
|
38 |
+
';
|
39 |
+
return $html;
|
40 |
+
}
|
41 |
+
protected function _getProductCollection()
|
42 |
+
{
|
43 |
+
$layer = Mage::getSingleton('catalog/layer');
|
44 |
+
$rootCategoryId = Mage::app()->getStore()->getRootCategoryId();
|
45 |
+
$categoryid=Mage::App()->getRequest()->getParam('category_id');
|
46 |
+
$_featcategory = Mage::getModel('catalog/category')->load($categoryid);
|
47 |
+
$layer->setCurrentCategory($_featcategory);
|
48 |
+
|
49 |
+
$layer = $this->getLayer();
|
50 |
+
$layer->setCurrentCategory($_featcategory);
|
51 |
+
Mage::App()->getRequest();
|
52 |
+
$this->_productCollection = Mage::getModel('catalog/product')->getCollection()
|
53 |
+
->addCategoryFilter($_featcategory)
|
54 |
+
->addAttributeToFilter('brand', array("eq", Mage::App()->getRequest()->getParam('brand')));
|
55 |
+
$layer->prepareProductCollection($this->_productCollection);
|
56 |
+
return $this->_productCollection;
|
57 |
+
}
|
58 |
+
}
|
app/code/local/Ktree/Brand/Block/Onbrandcategoryproduct.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ktree_Brand_Block_Onbrandcategoryproduct extends Mage_Catalog_Block_Product_List
|
3 |
+
{
|
4 |
+
/*function _getProductCollection()
|
5 |
+
{
|
6 |
+
$visibility = array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
|
7 |
+
Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG);
|
8 |
+
|
9 |
+
$urlKey = Mage::app()->getStore()->getCode();
|
10 |
+
|
11 |
+
$_featcategory = Mage::getResourceModel('catalog/category_collection')
|
12 |
+
->addAttributeToSelect('entity_id')
|
13 |
+
->addAttributeToFilter('url_key', $urlKey)
|
14 |
+
->getFirstItem();
|
15 |
+
|
16 |
+
$this->_productCollection = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('*')
|
17 |
+
->addAttributeToFilter('visibility', $visibility)->addCategoryFilter($_featcategory)
|
18 |
+
//->addFieldToFilter(array(array('attribute'=>'is_on_sale','eq'=>1)))
|
19 |
+
//->addAttributeToFilter('is_on_sale', array('null'=>true), 'left')
|
20 |
+
->setPageSize(9);
|
21 |
+
|
22 |
+
return $this->_productCollection;
|
23 |
+
|
24 |
+
}
|
25 |
+
*/
|
26 |
+
protected function _toHtml()
|
27 |
+
{
|
28 |
+
$html = parent::_toHtml();
|
29 |
+
$html .= '
|
30 |
+
<script type="text/javascript">
|
31 |
+
document.observe("dom:loaded", function() {
|
32 |
+
// initially hide all containers for tab content
|
33 |
+
$$("div.std").invoke("hide");
|
34 |
+
$$("div.page-title").invoke("hide");
|
35 |
+
|
36 |
+
});
|
37 |
+
</script>
|
38 |
+
';
|
39 |
+
return $html;
|
40 |
+
}
|
41 |
+
protected function _getProductCollection()
|
42 |
+
{
|
43 |
+
$layer = Mage::getSingleton('catalog/layer');
|
44 |
+
$rootCategoryId = Mage::app()->getStore()->getRootCategoryId();
|
45 |
+
$categoryid=Mage::App()->getRequest()->getParam('category_id');
|
46 |
+
$_featcategory = Mage::getModel('catalog/category')->load($categoryid);
|
47 |
+
$layer->setCurrentCategory($_featcategory);
|
48 |
+
|
49 |
+
$layer = $this->getLayer();
|
50 |
+
$layer->setCurrentCategory($_featcategory);
|
51 |
+
Mage::App()->getRequest();
|
52 |
+
$this->_productCollection = Mage::getModel('catalog/product')->getCollection()
|
53 |
+
->addCategoryFilter($_featcategory)
|
54 |
+
->addAttributeToFilter('brand', array("eq", Mage::App()->getRequest()->getParam('brand')));
|
55 |
+
$layer->prepareProductCollection($this->_productCollection);
|
56 |
+
return $this->_productCollection;
|
57 |
+
}
|
58 |
+
}
|
app/code/local/Ktree/Brand/Helper/Data.php
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Ktree Brand
|
5 |
+
*
|
6 |
+
* @category Ktree
|
7 |
+
* @package Ktree_Brand
|
8 |
+
|
9 |
+
*/
|
10 |
+
class Ktree_Brand_Helper_Data extends Mage_Core_Helper_Abstract {
|
11 |
+
|
12 |
+
public function getBrandofProduct($_product) {
|
13 |
+
$attribute = $_product->getResource()->getAttribute("brand");
|
14 |
+
if ($attribute->usesSource()) {
|
15 |
+
$options = $attribute->getSource()->getAllOptions(false);
|
16 |
+
if (is_numeric($options[0]['value']))
|
17 |
+
$brand = Mage::getModel("brand/brand")->load($options[0]['value'], 'brand_option_id');
|
18 |
+
if ($brand != NULL)
|
19 |
+
return $brand;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
public function getbrandConfig() {
|
24 |
+
$small['width'] = Mage::getStoreConfig('ktreebrand/small/width');
|
25 |
+
$small['height'] = Mage::getStoreConfig('ktreebrand/small/height');
|
26 |
+
$medium['width'] = Mage::getStoreConfig('ktreebrand/medium/width');
|
27 |
+
$medium['height'] = Mage::getStoreConfig('ktreebrand/medium/height');
|
28 |
+
$large['width'] = Mage::getStoreConfig('ktreebrand/large/width');
|
29 |
+
$large['height'] = Mage::getStoreConfig('ktreebrand/large/height');
|
30 |
+
|
31 |
+
return array('small' => $small, 'medium' => $medium, 'large' => $large);
|
32 |
+
}
|
33 |
+
|
34 |
+
public function deleteBrandImage($brand) {
|
35 |
+
$title = strtolower($brand->getTitle());
|
36 |
+
$subFolder = strtolower((string) $brand->getId() . $title);
|
37 |
+
$length = strlen($subFolder);
|
38 |
+
|
39 |
+
$path = Mage::getBaseDir('media') . DS . 'brand' . DS;
|
40 |
+
if ($length == 1) {
|
41 |
+
$firstFolder = $subFolder[0];
|
42 |
+
} else {
|
43 |
+
$firstFolder = $subFolder[0] . DS . $subFolder[1];
|
44 |
+
}
|
45 |
+
foreach ($this->getbrandConfig() as $size) {
|
46 |
+
if (file_exists($path . $firstFolder . DS . $brand->getId().$title . '_' . $size['width'] . '_' . $size['height'] . '.jpg') ||
|
47 |
+
file_exists($path . $firstFolder . DS . $brand->getId().$title . '.jpg')) {
|
48 |
+
unlink($path . $firstFolder . DS . $brand->getId().$title . '_' . $size['width'] . '_' . $size['height'] . '.jpg');
|
49 |
+
unlink($path . $firstFolder . DS . $brand->getId().$title . '.jpg');
|
50 |
+
} else if (file_exists($path . $firstFolder . DS . $brand->getId().$title . '_' . $size['width'] . '_' . $size['height'] . '.png') ||
|
51 |
+
file_exists($path . $firstFolder . DS . $brand->getId().$title . '.png')) {
|
52 |
+
unlink($path . $firstFolder . DS . $brand->getId().$title . '_' . $size['width'] . '_' . $size['height'] . '.png');
|
53 |
+
unlink($path . $firstFolder . DS . $brand->getId().$title . '.png');
|
54 |
+
} else if (file_exists($path . $firstFolder . DS . $brand->getId().$title . '_' . $size['width'] . '_' . $size['height'] . '.jpeg') ||
|
55 |
+
file_exists($path . $firstFolder . DS . $brand->getId().$title . '.jpeg')) {
|
56 |
+
unlink($path . $firstFolder . DS . $brand->getId().$title . '_' . $size['width'] . '_' . $size['height'] . '.jpeg');
|
57 |
+
unlink($path . $firstFolder . DS . $brand->getId().$title . '.jpeg');
|
58 |
+
} else if (file_exists($path . $firstFolder . DS . $brand->getId().$title . '_' . $size['width'] . '_' . $size['height'] . '.bmp') ||
|
59 |
+
file_exists($path . $firstFolder . DS . $brand->getId().$title . '.bmp')) {
|
60 |
+
unlink($path . $firstFolder . DS . $brand->getId().$title . '_' . $size['width'] . '_' . $size['height'] . '.bmp');
|
61 |
+
unlink($path . $firstFolder . DS . $brand->getId().$title . '.bmp');
|
62 |
+
} else if(file_exists($path . $firstFolder . DS . $brand->getId().$title . '_' . $size['width'] . '_' . $size['height'] . '.gif') ||
|
63 |
+
file_exists($path . $firstFolder . DS . $brand->getId().$title . '.gif')){
|
64 |
+
unlink($path . $firstFolder . DS . $brand->getId().$title . '_' . $size['width'] . '_' . $size['height'] . '.gif');
|
65 |
+
unlink($path . $firstFolder . DS . $brand->getId().$title . '.gif');
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
public function Brand_Image($brand , $size = "small")
|
70 |
+
{
|
71 |
+
$config = $this->getbrandConfig();
|
72 |
+
$title = strtolower($brand['title']);
|
73 |
+
// there are 3sizes: small, medium, large
|
74 |
+
$size = $config[$size];
|
75 |
+
$w = $size['width'];
|
76 |
+
$h = $size['height'];
|
77 |
+
$subFolder = (string) $brand['brand_id'] . $title;
|
78 |
+
$length = strlen($subFolder);
|
79 |
+
|
80 |
+
$path = Mage::getBaseDir('media') . DS . 'brand' . DS;
|
81 |
+
if ($length == 1) {
|
82 |
+
$firstFolder = $subFolder[0];
|
83 |
+
} else {
|
84 |
+
$firstFolder = $subFolder[0] . DS . $subFolder[1];
|
85 |
+
}
|
86 |
+
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)
|
87 |
+
. 'brand' . DS . $firstFolder . DS . $brand['brand_id'].$title;
|
88 |
+
if (file_exists($path . $firstFolder . DS . $brand['brand_id'] .$title. '.jpg')) {
|
89 |
+
$original = $path . $firstFolder . DS . $brand['brand_id'] .$title. '.jpg';
|
90 |
+
$cropImage = $path . $firstFolder . DS . $brand['brand_id'] .$title. '_' . $w . '_' . $h . '.jpg';
|
91 |
+
$image = $url . '_' . $w . '_' . $h . '.jpg';
|
92 |
+
} else if (file_exists($path . $firstFolder . DS . $brand['brand_id'] .$title. '.png')) {
|
93 |
+
$original = $path . $firstFolder . DS . $brand['brand_id'] .$title. '.png';
|
94 |
+
$cropImage = $path . $firstFolder . DS . $brand['brand_id'] .$title. '_' . $w . '_' . $h . '.png';
|
95 |
+
$image = $url . '_' . $w . '_' . $h . '.png';
|
96 |
+
} else if (file_exists($path . $firstFolder . DS . $brand['brand_id'] .$title. '.jpeg')) {
|
97 |
+
$original = $path . $firstFolder . DS . $brand['brand_id'] .$title. '.jpeg';
|
98 |
+
$cropImage = $path . $firstFolder . DS . $brand['brand_id'] .$title. '_' . $w . '_' . $h . '.jpeg';
|
99 |
+
$image = $url . '_' . $w . '_' . $h . '.jpeg';
|
100 |
+
} else if (file_exists($path . $firstFolder . DS . $brand['brand_id'] .$title. '.bmp')) {
|
101 |
+
$original = $path . $firstFolder . DS . $brand['brand_id'] .$title. '.bmp';
|
102 |
+
$cropImage = $path . $firstFolder . DS . $brand['brand_id'] .$title. '_' . $w . '_' . $h . '.bmp';
|
103 |
+
$image = $url . '_' . $w . '_' . $h . '.bmp';
|
104 |
+
} else {
|
105 |
+
$original = $path . $firstFolder . DS . $brand['brand_id'] .$title. '.gif';
|
106 |
+
$cropImage = $path . $firstFolder . DS . $brand['brand_id'] .$title. '_' . $w . '_' . $h . '.gif';
|
107 |
+
$image = $url . '_' . $w . '_' . $h . '.gif';
|
108 |
+
}
|
109 |
+
|
110 |
+
if (@file_exists($cropImage)) {
|
111 |
+
return $image;
|
112 |
+
} else {
|
113 |
+
$resizeObj = Mage::getModel('brand/resizeimage');
|
114 |
+
$resizeObj->setFile($original);
|
115 |
+
// *** 1) Initialise / load image
|
116 |
+
// *** 2) Resize image (options: exact, portrait, landscape, auto, crop)
|
117 |
+
$resizeObj->resizeImage($w, $h, 'crop');
|
118 |
+
// *** 3) Save image
|
119 |
+
$resizeObj->saveImage($cropImage, 100);
|
120 |
+
return $image;
|
121 |
+
}
|
122 |
+
|
123 |
+
|
124 |
+
}
|
125 |
+
public function getBrandImage($brand, $size = "small") {
|
126 |
+
|
127 |
+
$config = $this->getbrandConfig();
|
128 |
+
$title = strtolower($brand->getTitle());
|
129 |
+
// there are 3sizes: small, medium, large
|
130 |
+
$size = $config[$size];
|
131 |
+
$w = $size['width'];
|
132 |
+
$h = $size['height'];
|
133 |
+
$subFolder = (string) $brand->getId() . $title;
|
134 |
+
$length = strlen($subFolder);
|
135 |
+
|
136 |
+
$path = Mage::getBaseDir('media') . DS . 'brand' . DS;
|
137 |
+
if ($length == 1) {
|
138 |
+
$firstFolder = $subFolder[0];
|
139 |
+
} else {
|
140 |
+
$firstFolder = $subFolder[0] . DS . $subFolder[1];
|
141 |
+
}
|
142 |
+
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)
|
143 |
+
. 'brand' . DS . $firstFolder . DS . $brand->getId().$title;
|
144 |
+
if (file_exists($path . $firstFolder . DS . $brand->getId() .$title. '.jpg')) {
|
145 |
+
$original = $path . $firstFolder . DS . $brand->getId() .$title. '.jpg';
|
146 |
+
$cropImage = $path . $firstFolder . DS . $brand->getId() .$title. '_' . $w . '_' . $h . '.jpg';
|
147 |
+
$image = $url . '_' . $w . '_' . $h . '.jpg';
|
148 |
+
} else if (file_exists($path . $firstFolder . DS . $brand->getId() .$title. '.png')) {
|
149 |
+
$original = $path . $firstFolder . DS . $brand->getId() .$title. '.png';
|
150 |
+
$cropImage = $path . $firstFolder . DS . $brand->getId() .$title. '_' . $w . '_' . $h . '.png';
|
151 |
+
$image = $url . '_' . $w . '_' . $h . '.png';
|
152 |
+
} else if (file_exists($path . $firstFolder . DS . $brand->getId() .$title. '.jpeg')) {
|
153 |
+
$original = $path . $firstFolder . DS . $brand->getId() .$title. '.jpeg';
|
154 |
+
$cropImage = $path . $firstFolder . DS . $brand->getId() .$title. '_' . $w . '_' . $h . '.jpeg';
|
155 |
+
$image = $url . '_' . $w . '_' . $h . '.jpeg';
|
156 |
+
} else if (file_exists($path . $firstFolder . DS . $brand->getId() .$title. '.bmp')) {
|
157 |
+
$original = $path . $firstFolder . DS . $brand->getId() .$title. '.bmp';
|
158 |
+
$cropImage = $path . $firstFolder . DS . $brand->getId() .$title. '_' . $w . '_' . $h . '.bmp';
|
159 |
+
$image = $url . '_' . $w . '_' . $h . '.bmp';
|
160 |
+
} else {
|
161 |
+
$original = $path . $firstFolder . DS . $brand->getId() .$title. '.gif';
|
162 |
+
$cropImage = $path . $firstFolder . DS . $brand->getId() .$title. '_' . $w . '_' . $h . '.gif';
|
163 |
+
$image = $url . '_' . $w . '_' . $h . '.gif';
|
164 |
+
}
|
165 |
+
|
166 |
+
if (@file_exists($cropImage)) {
|
167 |
+
return $image;
|
168 |
+
} else {
|
169 |
+
$resizeObj = Mage::getModel('brand/resizeimage');
|
170 |
+
$resizeObj->setFile($original);
|
171 |
+
// *** 1) Initialise / load image
|
172 |
+
// *** 2) Resize image (options: exact, portrait, landscape, auto, crop)
|
173 |
+
$resizeObj->resizeImage($w, $h, 'crop');
|
174 |
+
// *** 3) Save image
|
175 |
+
$resizeObj->saveImage($cropImage, 100);
|
176 |
+
return $image;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
//to get the brand name
|
180 |
+
public function getBrandName($brand) {
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
}
|
185 |
+
}
|
app/code/local/Ktree/Brand/Model/Adminhtml/System/Config/Backend/Brand/Branddata.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Webshopapps Shipping Module
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* Shipping MatrixRates
|
22 |
+
*
|
23 |
+
* @category Webshopapps
|
24 |
+
* @package Webshopapps_Matrixrate
|
25 |
+
* @copyright Copyright (c) 2010 Zowta Ltd (http://www.webshopapps.com)
|
26 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
27 |
+
* @author Karen Baker <sales@webshopapps.com>
|
28 |
+
*/
|
29 |
+
|
30 |
+
|
31 |
+
class Ktree_Brand_Model_Adminhtml_System_Config_Backend_Brand_Branddata extends Mage_Core_Model_Config_Data
|
32 |
+
{
|
33 |
+
public function _afterSave()
|
34 |
+
{
|
35 |
+
Mage::getResourceModel('brand/brand')->uploadAndImport($this);
|
36 |
+
}
|
37 |
+
}
|
app/code/local/Ktree/Brand/Model/Adminhtml/System/Config/Source/Brand/Brand.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Webshopapps Shipping Module
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* Shipping MatrixRates
|
22 |
+
*
|
23 |
+
* @category Webshopapps
|
24 |
+
* @package Webshopapps_Matrixrate
|
25 |
+
* @copyright Copyright (c) 2010 Zowta Ltd (http://www.webshopapps.com)
|
26 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
27 |
+
* @author Karen Baker <sales@webshopapps.com>
|
28 |
+
*/
|
29 |
+
|
30 |
+
class Ktree_Brand_Model_Adminhtml_System_Config_Source_Brand_Brand
|
31 |
+
{
|
32 |
+
public function toOptionArray()
|
33 |
+
{
|
34 |
+
|
35 |
+
/* $tableRate = Mage::getSingleton('priceslider/priceslider_volume');
|
36 |
+
$arr = array();
|
37 |
+
foreach ($tableRate->getCode('condition_name') as $k=>$v) {
|
38 |
+
$arr[] = array('value'=>$k, 'label'=>$v);
|
39 |
+
}
|
40 |
+
return $arr;*/
|
41 |
+
}
|
42 |
+
}
|
app/code/local/Ktree/Brand/Model/Brand.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Ktree Brand Status Model
|
5 |
+
*
|
6 |
+
* @category Ktree
|
7 |
+
* @package Ktree_Brand
|
8 |
+
* @author An <an@Vilpjscusa.com>
|
9 |
+
*/
|
10 |
+
class Ktree_Brand_Model_Brand extends Mage_Core_Model_Abstract
|
11 |
+
{
|
12 |
+
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('brand/brand');
|
17 |
+
}
|
18 |
+
|
19 |
+
}
|
app/code/local/Ktree/Brand/Model/Category.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Ktree Brand Category Model
|
5 |
+
*
|
6 |
+
* @category Ktree
|
7 |
+
* @package Ktree_Brand
|
8 |
+
*/
|
9 |
+
class Ktree_Brand_Model_Category extends Mage_Core_Model_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
public function _construct()
|
13 |
+
{
|
14 |
+
parent::_construct();
|
15 |
+
$this->_init('brand/category');
|
16 |
+
}
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
}
|
app/code/local/Ktree/Brand/Model/Categoryname.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Ktree gallery Status Model
|
5 |
+
*
|
6 |
+
* @category Ktree
|
7 |
+
* @package Ktree_gallery
|
8 |
+
* @author An <an@Vilpjscusa.com>
|
9 |
+
*/
|
10 |
+
class Ktree_Brand_Model_Categoryname extends Varien_Object {
|
11 |
+
|
12 |
+
static public function getOptionArray() {
|
13 |
+
$array = array();
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
|
17 |
+
}
|
app/code/local/Ktree/Brand/Model/Mysql4/Brand.php
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Ktree Brand
|
5 |
+
*
|
6 |
+
* @category Ktree
|
7 |
+
* @package Ktree_Brand
|
8 |
+
* @author An <an@Ktreeusa.com>
|
9 |
+
*/
|
10 |
+
class Ktree_Brand_Model_Mysql4_Brand extends Mage_Core_Model_Mysql4_Abstract
|
11 |
+
{
|
12 |
+
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
// Note that the brand_id refers to the key field in your database table.
|
16 |
+
$this->_init('brand/brand','brand_id');
|
17 |
+
}
|
18 |
+
public function uploadAndImport(Varien_Object $object)
|
19 |
+
{
|
20 |
+
$csvFile = $_FILES["groups"]["tmp_name"]["importbrands"]["fields"]["import"]["value"];
|
21 |
+
|
22 |
+
if (!empty($csvFile)) {
|
23 |
+
|
24 |
+
$csv = trim(file_get_contents($csvFile));
|
25 |
+
|
26 |
+
$table = 'brand';
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
$conditionName = $_POST['groups']['importbrands']['fields']['import']['value'];
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
if (!empty($csv)) {
|
35 |
+
$exceptions = array();
|
36 |
+
$csvLines = explode("\n", $csv);
|
37 |
+
$csvLine = array_shift($csvLines);
|
38 |
+
$csvLine = $this->_getCsvValues($csvLine);
|
39 |
+
if (count($csvLine) < 5) {
|
40 |
+
$exceptions[0] = Mage::helper('brand')->__('Invalid Brand CSV File Format');
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
+
if (empty($exceptions)) {
|
46 |
+
$data = array();
|
47 |
+
$data1 = array();
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
foreach ($csvLines as $k=>$csvLine) {
|
52 |
+
|
53 |
+
$csvLine = $this->_getCsvValues($csvLine);
|
54 |
+
|
55 |
+
|
56 |
+
$title = $csvLine[0];
|
57 |
+
$filename = $csvLine[1];
|
58 |
+
$sale_label = $csvLine[2];
|
59 |
+
$content = $csvLine[3];
|
60 |
+
$issale=$csvLine[4];
|
61 |
+
$store_id=$csvLine[5];
|
62 |
+
$status = $csvLine[6];
|
63 |
+
$categoryids=$csvLine[7];
|
64 |
+
$productsku=$csvLine[8];
|
65 |
+
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
|
66 |
+
->setCodeFilter('brand')->getFirstItem();
|
67 |
+
$option['attribute_id'] = $attributeInfo->getAttributeId();
|
68 |
+
$option['value'][0][Mage::app()->getStore()->getId()] = $title;
|
69 |
+
$option['value'][0][1] = $title;
|
70 |
+
$collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
71 |
+
->setPositionOrder('asc')
|
72 |
+
->setAttributeFilter($attributeInfo->getAttributeId())
|
73 |
+
->setStoreFilter(Mage::app()->getStore()->getId());
|
74 |
+
$exist = $collection->getItemByColumnValue("value", $title);
|
75 |
+
if (!$exist) {
|
76 |
+
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
|
77 |
+
$setup->addAttributeOption($option);
|
78 |
+
$newOption = $newcollection = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
79 |
+
->setPositionOrder('asc')
|
80 |
+
->setAttributeFilter($attributeInfo->getAttributeId())
|
81 |
+
->setStoreFilter(Mage::app()->getStore()->getId())->getItemByColumnValue("value", $title);
|
82 |
+
$manufacturureid=$newOption['option_id'];
|
83 |
+
} else {
|
84 |
+
|
85 |
+
$manufacturureid=$exist['option_id'];
|
86 |
+
}
|
87 |
+
$data[] = array('title'=>$title, 'filename'=>$filename, 'sale_label'=>$sale_label,'status'=>$status,'store_id'=>$store_id,'is_sale'=>$issale,'content'=>$content,'brand_option_id'=>$manufacturureid );
|
88 |
+
//$data1[] = array('id'=>$id, 'sicdescription'=>$sicdescription, 'tier1'=>$tier11,'tier2'=>$tier12,'tier3'=>$tier13,'tier4'=>$tier14 );
|
89 |
+
$cat_ids=explode(",",$categoryids);
|
90 |
+
|
91 |
+
foreach($cat_ids as $catid ){
|
92 |
+
$data1[] = array('entity_id'=>$catid, 'brand_id'=>$manufacturureid);
|
93 |
+
}
|
94 |
+
|
95 |
+
if($productsku){
|
96 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); // setting the admin store id for updating product details
|
97 |
+
$prod_skus=explode(",",$productsku);
|
98 |
+
foreach($prod_skus as $sku){
|
99 |
+
$product_id = Mage::getModel('catalog/product')->getIdBySku($sku); //retrive the product id based on the product sku
|
100 |
+
$product = Mage::getModel('catalog/product')->load($product_id); //load the product data based on ID.
|
101 |
+
$productInfoData = $product->getData();
|
102 |
+
$productInfoData['brand'] = $manufacturureid;
|
103 |
+
$product->setData($productInfoData);
|
104 |
+
$product->save();
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
}
|
109 |
+
if (empty($exceptions)) {
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
|
114 |
+
$connection = $this->_getWriteAdapter();
|
115 |
+
$connection1 = $this->_getWriteAdapter();
|
116 |
+
$model = Mage::getModel('brand/brand')->getCollection()->getData();
|
117 |
+
$titlearray=array();
|
118 |
+
$idarray=array();
|
119 |
+
foreach($model as $mod) {
|
120 |
+
$titlearray[]=strtoupper($mod['title']);
|
121 |
+
$idarray[]=$mod['brand_id'];
|
122 |
+
}
|
123 |
+
$connection2 = Mage::getSingleton('core/resource')->getConnection('distributor_read'); //I assuming that you created the model for your table
|
124 |
+
$result = $connection2->fetchAll("SELECT * FROM brand_category");
|
125 |
+
foreach($result as $mod) {
|
126 |
+
$brandcat[]=$mod['entity_id'].','.$mod['brand_id'];
|
127 |
+
}
|
128 |
+
|
129 |
+
foreach($data as $k=>$dataLine) {
|
130 |
+
|
131 |
+
if (in_array(strtoupper($dataLine['title']),$titlearray))
|
132 |
+
{
|
133 |
+
$key = array_search(strtoupper($dataLine['title']), $titlearray);
|
134 |
+
$condition = array($connection->quoteInto('title = ?', $dataLine['title']),);
|
135 |
+
$connection->delete($table,$condition);
|
136 |
+
$dataLine['brand_id']=$idarray[$key];
|
137 |
+
try{
|
138 |
+
$connection->insert($table, $dataLine);
|
139 |
+
} catch (Exception $e) {
|
140 |
+
$exceptions[] = Mage::helper('brand')->__($table);
|
141 |
+
}
|
142 |
+
} else {
|
143 |
+
try {
|
144 |
+
//$model = Mage::getModel('priceslider/priceslider_volume');
|
145 |
+
//$model->setData($dataLine);
|
146 |
+
|
147 |
+
//$model->save();
|
148 |
+
|
149 |
+
$connection->insert($table, $dataLine);
|
150 |
+
} catch (Exception $e) {
|
151 |
+
$exceptions[] = Mage::helper('brand')->__($table);
|
152 |
+
}
|
153 |
+
}
|
154 |
+
}
|
155 |
+
foreach($data1 as $k=>$dataLine1) {
|
156 |
+
|
157 |
+
try {
|
158 |
+
$stringval=$dataLine1['entity_id'].','.$dataLine1['brand_id'];
|
159 |
+
if(!in_array($stringval,$brandcat)){
|
160 |
+
$connection1->insert('brand_category', $dataLine1);
|
161 |
+
}
|
162 |
+
} catch (Exception $e) {
|
163 |
+
$exceptions[] = Mage::helper('brand')->__($e);
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
}
|
168 |
+
if (!empty($exceptions)) {
|
169 |
+
throw new Exception( "\n" . implode("\n", $exceptions) );
|
170 |
+
}
|
171 |
+
}
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
private function _getCsvValues($string, $separator=",")
|
177 |
+
{
|
178 |
+
$elements = explode($separator, trim($string));
|
179 |
+
for ($i = 0; $i < count($elements); $i++) {
|
180 |
+
$nquotes = substr_count($elements[$i], '"');
|
181 |
+
if ($nquotes %2 == 1) {
|
182 |
+
for ($j = $i+1; $j < count($elements); $j++) {
|
183 |
+
if (substr_count($elements[$j], '"') > 0) {
|
184 |
+
// Put the quoted string's pieces back together again
|
185 |
+
array_splice($elements, $i, $j-$i+1, implode($separator, array_slice($elements, $i, $j-$i+1)));
|
186 |
+
break;
|
187 |
+
}
|
188 |
+
}
|
189 |
+
}
|
190 |
+
if ($nquotes > 0) {
|
191 |
+
// Remove first and last quotes, then merge pairs of quotes
|
192 |
+
$qstr =& $elements[$i];
|
193 |
+
$qstr = substr_replace($qstr, '', strpos($qstr, '"'), 1);
|
194 |
+
$qstr = substr_replace($qstr, '', strrpos($qstr, '"'), 1);
|
195 |
+
$qstr = str_replace('""', '"', $qstr);
|
196 |
+
}
|
197 |
+
$elements[$i] = trim($elements[$i]);
|
198 |
+
}
|
199 |
+
return $elements;
|
200 |
+
}
|
201 |
+
|
202 |
+
}
|
app/code/local/Ktree/Brand/Model/Mysql4/Brand/Collection.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Ktree Brand Status Model
|
5 |
+
*
|
6 |
+
* @category Ktree
|
7 |
+
* @package Ktree_Brand
|
8 |
+
* @author An <an@Ktreeusa.com>
|
9 |
+
*/
|
10 |
+
class Ktree_Brand_Model_Mysql4_Brand_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
11 |
+
|
12 |
+
private $collect;
|
13 |
+
|
14 |
+
public function _construct() {
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('brand/brand');
|
17 |
+
}
|
18 |
+
|
19 |
+
public function saveBrandcollection($char = "all") {
|
20 |
+
|
21 |
+
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
|
22 |
+
->setCodeFilter('brand')->getFirstItem();
|
23 |
+
$collect = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
24 |
+
->setPositionOrder('asc')
|
25 |
+
->setAttributeFilter($attributeInfo->getAttributeId())
|
26 |
+
->setStoreFilter(Mage::app()->getStore()->getId());
|
27 |
+
if ($char == "digit") {
|
28 |
+
$query = "value REGEXP ?";
|
29 |
+
$key = "^[0-9]";
|
30 |
+
$collect->getSelect()->having($query, $key);
|
31 |
+
} else {
|
32 |
+
$query = "value like ?";
|
33 |
+
$key = $char . '%';
|
34 |
+
$collect->getSelect()->having($query, $key);
|
35 |
+
}
|
36 |
+
return $collect;
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
app/code/local/Ktree/Brand/Model/Mysql4/Category.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Ktree Brand
|
5 |
+
*
|
6 |
+
* @category Ktree
|
7 |
+
* @package Ktree_Brand
|
8 |
+
* @author An <an@Ktreeusa.com>
|
9 |
+
*/
|
10 |
+
class Ktree_Brand_Model_Mysql4_Category extends Mage_Core_Model_Mysql4_Abstract
|
11 |
+
{
|
12 |
+
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
// Note that the brand_id refers to the key field in your database table.
|
16 |
+
$this->_init('brand/category','brand_category_id');
|
17 |
+
}
|
18 |
+
|
19 |
+
}
|
app/code/local/Ktree/Brand/Model/Mysql4/Category/Collection.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Ktree Brand Category Model
|
5 |
+
*
|
6 |
+
* @category Ktree
|
7 |
+
* @package Ktree_Brand
|
8 |
+
* @author An <an@Ktreeusa.com>
|
9 |
+
*/
|
10 |
+
class Ktree_Brand_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
11 |
+
|
12 |
+
|
13 |
+
public function _construct() {
|
14 |
+
parent::_construct();
|
15 |
+
$this->_init('brand/category');
|
16 |
+
}
|
17 |
+
|
18 |
+
}
|
app/code/local/Ktree/Brand/Model/Mysql4/Setup.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Brand Setup
|
5 |
+
*
|
6 |
+
* @category Ktree
|
7 |
+
* @package Ktree_Brand
|
8 |
+
* @author
|
9 |
+
*/
|
10 |
+
class Ktree_Brand_Model_Mysql4_Setup extends Mage_Catalog_Model_Resource_Eav_Mysql4_Setup
|
11 |
+
{
|
12 |
+
}
|
app/code/local/Ktree/Brand/Model/Observer.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Model_Observer extends Mage_Core_Model_Abstract {
|
4 |
+
|
5 |
+
public function saveCategory($observer) {
|
6 |
+
$event = $observer->getEvent();
|
7 |
+
$brands = $observer->getEvent()->getRequest()->getPost('brands');
|
8 |
+
$categoryId = $event->getCategory()->getId();
|
9 |
+
$model = Mage::getModel("brand/category")->load($categoryId, "entity_id");
|
10 |
+
$collection = $model->getCollection()->addFieldToFilter("entity_id", array("eq" => $categoryId));
|
11 |
+
$arrayBrands = array();
|
12 |
+
foreach ($collection as $bcate) {
|
13 |
+
$arrayBrands[] = $bcate->getBrandId();
|
14 |
+
}
|
15 |
+
if ($brands != NULL) {
|
16 |
+
$delete = array_diff($arrayBrands, $brands);
|
17 |
+
$save = array_diff($brands, $arrayBrands);
|
18 |
+
foreach ($save as $item) {
|
19 |
+
|
20 |
+
try {
|
21 |
+
$newmodel = Mage::getModel("brand/category");
|
22 |
+
$newmodel->setBrandId($item)->setEntityId($categoryId)->save();
|
23 |
+
} catch (Exception $e) {
|
24 |
+
|
25 |
+
}
|
26 |
+
}
|
27 |
+
foreach ($delete as $item) {
|
28 |
+
try {
|
29 |
+
$newmodel = Mage::getModel("brand/category")->load($categoryId, "entity_id");
|
30 |
+
$newmodel->load($item, "brand_id")->delete();
|
31 |
+
} catch (Exception $e) {
|
32 |
+
|
33 |
+
}
|
34 |
+
}
|
35 |
+
} else {
|
36 |
+
foreach ($arrayBrands as $item) {
|
37 |
+
|
38 |
+
try {
|
39 |
+
$model->load($item, "brand_id")->delete();
|
40 |
+
} catch (Exception $e) {
|
41 |
+
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
}
|
app/code/local/Ktree/Brand/Model/Resizeimage.php
ADDED
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_Model_Resizeimage {
|
4 |
+
|
5 |
+
// *** Class variables
|
6 |
+
private $image;
|
7 |
+
private $width;
|
8 |
+
private $height;
|
9 |
+
private $imageResized;
|
10 |
+
|
11 |
+
function __construct($fileName) {
|
12 |
+
// *** Open up the file
|
13 |
+
}
|
14 |
+
|
15 |
+
public function setFile($fileName){
|
16 |
+
$this->image = $this->openImage($fileName);
|
17 |
+
|
18 |
+
// *** Get width and height
|
19 |
+
$this->width = imagesx($this->image);
|
20 |
+
$this->height = imagesy($this->image);
|
21 |
+
}
|
22 |
+
## --------------------------------------------------------
|
23 |
+
|
24 |
+
private function openImage($file) {
|
25 |
+
// *** Get extension
|
26 |
+
$extension = strtolower(strrchr($file, '.'));
|
27 |
+
|
28 |
+
switch ($extension) {
|
29 |
+
case '.jpg':
|
30 |
+
case '.jpeg':
|
31 |
+
$img = @imagecreatefromjpeg($file);
|
32 |
+
break;
|
33 |
+
case '.gif':
|
34 |
+
$img = @imagecreatefromgif($file);
|
35 |
+
break;
|
36 |
+
case '.png':
|
37 |
+
$img = @imagecreatefrompng($file);
|
38 |
+
break;
|
39 |
+
default:
|
40 |
+
$img = false;
|
41 |
+
break;
|
42 |
+
}
|
43 |
+
return $img;
|
44 |
+
}
|
45 |
+
|
46 |
+
## --------------------------------------------------------
|
47 |
+
|
48 |
+
public function resizeImage($newWidth, $newHeight, $option="auto") {
|
49 |
+
// *** Get optimal width and height - based on $option
|
50 |
+
$optionArray = $this->getDimensions($newWidth, $newHeight, $option);
|
51 |
+
|
52 |
+
$optimalWidth = $optionArray['optimalWidth'];
|
53 |
+
$optimalHeight = $optionArray['optimalHeight'];
|
54 |
+
|
55 |
+
|
56 |
+
// *** Resample - create image canvas of x, y size
|
57 |
+
$this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight);
|
58 |
+
imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height);
|
59 |
+
|
60 |
+
|
61 |
+
// *** if option is 'crop', then crop too
|
62 |
+
if ($option == 'crop') {
|
63 |
+
$this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
## --------------------------------------------------------
|
68 |
+
|
69 |
+
private function getDimensions($newWidth, $newHeight, $option) {
|
70 |
+
|
71 |
+
switch ($option) {
|
72 |
+
case 'exact':
|
73 |
+
$optimalWidth = $newWidth;
|
74 |
+
$optimalHeight = $newHeight;
|
75 |
+
break;
|
76 |
+
case 'portrait':
|
77 |
+
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
|
78 |
+
$optimalHeight = $newHeight;
|
79 |
+
break;
|
80 |
+
case 'landscape':
|
81 |
+
$optimalWidth = $newWidth;
|
82 |
+
$optimalHeight = $this->getSizeByFixedWidth($newWidth);
|
83 |
+
break;
|
84 |
+
case 'auto':
|
85 |
+
$optionArray = $this->getSizeByAuto($newWidth, $newHeight);
|
86 |
+
$optimalWidth = $optionArray['optimalWidth'];
|
87 |
+
$optimalHeight = $optionArray['optimalHeight'];
|
88 |
+
break;
|
89 |
+
case 'crop':
|
90 |
+
$optionArray = $this->getOptimalCrop($newWidth, $newHeight);
|
91 |
+
$optimalWidth = $optionArray['optimalWidth'];
|
92 |
+
$optimalHeight = $optionArray['optimalHeight'];
|
93 |
+
break;
|
94 |
+
}
|
95 |
+
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
|
96 |
+
}
|
97 |
+
|
98 |
+
## --------------------------------------------------------
|
99 |
+
|
100 |
+
private function getSizeByFixedHeight($newHeight) {
|
101 |
+
$ratio = $this->width / $this->height;
|
102 |
+
$newWidth = $newHeight * $ratio;
|
103 |
+
return $newWidth;
|
104 |
+
}
|
105 |
+
|
106 |
+
private function getSizeByFixedWidth($newWidth) {
|
107 |
+
$ratio = $this->height / $this->width;
|
108 |
+
$newHeight = $newWidth * $ratio;
|
109 |
+
return $newHeight;
|
110 |
+
}
|
111 |
+
|
112 |
+
private function getSizeByAuto($newWidth, $newHeight) {
|
113 |
+
if ($this->height < $this->width) {
|
114 |
+
// *** Image to be resized is wider (landscape)
|
115 |
+
$optimalWidth = $newWidth;
|
116 |
+
$optimalHeight = $this->getSizeByFixedWidth($newWidth);
|
117 |
+
} elseif ($this->height > $this->width) {
|
118 |
+
// *** Image to be resized is taller (portrait)
|
119 |
+
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
|
120 |
+
$optimalHeight = $newHeight;
|
121 |
+
} else {
|
122 |
+
// *** Image to be resizerd is a square
|
123 |
+
if ($newHeight < $newWidth) {
|
124 |
+
$optimalWidth = $newWidth;
|
125 |
+
$optimalHeight = $this->getSizeByFixedWidth($newWidth);
|
126 |
+
} else if ($newHeight > $newWidth) {
|
127 |
+
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
|
128 |
+
$optimalHeight = $newHeight;
|
129 |
+
} else {
|
130 |
+
// *** Sqaure being resized to a square
|
131 |
+
$optimalWidth = $newWidth;
|
132 |
+
$optimalHeight = $newHeight;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
|
137 |
+
}
|
138 |
+
|
139 |
+
## --------------------------------------------------------
|
140 |
+
|
141 |
+
private function getOptimalCrop($newWidth, $newHeight) {
|
142 |
+
|
143 |
+
$heightRatio = $this->height / $newHeight;
|
144 |
+
$widthRatio = $this->width / $newWidth;
|
145 |
+
|
146 |
+
if ($heightRatio < $widthRatio) {
|
147 |
+
$optimalRatio = $heightRatio;
|
148 |
+
} else {
|
149 |
+
$optimalRatio = $widthRatio;
|
150 |
+
}
|
151 |
+
|
152 |
+
$optimalHeight = $this->height / $optimalRatio;
|
153 |
+
$optimalWidth = $this->width / $optimalRatio;
|
154 |
+
|
155 |
+
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
|
156 |
+
}
|
157 |
+
|
158 |
+
## --------------------------------------------------------
|
159 |
+
|
160 |
+
private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight) {
|
161 |
+
// *** Find center - this will be used for the crop
|
162 |
+
$cropStartX = ( $optimalWidth / 2) - ( $newWidth / 2 );
|
163 |
+
$cropStartY = ( $optimalHeight / 2) - ( $newHeight / 2 );
|
164 |
+
|
165 |
+
$crop = $this->imageResized;
|
166 |
+
//imagedestroy($this->imageResized);
|
167 |
+
// *** Now crop from center to exact requested size
|
168 |
+
$this->imageResized = imagecreatetruecolor($newWidth, $newHeight);
|
169 |
+
imagecopyresampled($this->imageResized, $crop, 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight, $newWidth, $newHeight);
|
170 |
+
}
|
171 |
+
|
172 |
+
## --------------------------------------------------------
|
173 |
+
|
174 |
+
public function saveImage($savePath, $imageQuality="100") {
|
175 |
+
// *** Get extension
|
176 |
+
$extension = strrchr($savePath, '.');
|
177 |
+
$extension = strtolower($extension);
|
178 |
+
|
179 |
+
switch ($extension) {
|
180 |
+
case '.jpg':
|
181 |
+
case '.jpeg':
|
182 |
+
if (imagetypes() & IMG_JPG) {
|
183 |
+
imagejpeg($this->imageResized, $savePath, $imageQuality);
|
184 |
+
}
|
185 |
+
break;
|
186 |
+
|
187 |
+
case '.gif':
|
188 |
+
if (imagetypes() & IMG_GIF) {
|
189 |
+
imagegif($this->imageResized, $savePath);
|
190 |
+
}
|
191 |
+
break;
|
192 |
+
|
193 |
+
case '.png':
|
194 |
+
// *** Scale quality from 0-100 to 0-9
|
195 |
+
$scaleQuality = round(($imageQuality / 100) * 9);
|
196 |
+
|
197 |
+
// *** Invert quality setting as 0 is best, not 9
|
198 |
+
$invertScaleQuality = 9 - $scaleQuality;
|
199 |
+
|
200 |
+
if (imagetypes() & IMG_PNG) {
|
201 |
+
imagepng($this->imageResized, $savePath, $invertScaleQuality);
|
202 |
+
}
|
203 |
+
break;
|
204 |
+
|
205 |
+
// ... etc
|
206 |
+
|
207 |
+
default:
|
208 |
+
// *** No extension - No save.
|
209 |
+
break;
|
210 |
+
}
|
211 |
+
|
212 |
+
imagedestroy($this->imageResized);
|
213 |
+
}
|
214 |
+
|
215 |
+
## --------------------------------------------------------
|
216 |
+
}
|
app/code/local/Ktree/Brand/Model/Status.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Ktree gallery Status Model
|
5 |
+
*
|
6 |
+
* @category Ktree
|
7 |
+
* @package Ktree_gallery
|
8 |
+
* @author An <an@Vilpjscusa.com>
|
9 |
+
*/
|
10 |
+
class Ktree_Brand_Model_Status extends Varien_Object
|
11 |
+
{
|
12 |
+
const STATUS_ENABLED = 1;
|
13 |
+
const STATUS_DISABLED = 2;
|
14 |
+
|
15 |
+
static public function getOptionArray()
|
16 |
+
{
|
17 |
+
return array(
|
18 |
+
self::STATUS_ENABLED => Mage::helper('brand')->__('Enabled'),
|
19 |
+
self::STATUS_DISABLED => Mage::helper('brand')->__('Disabled')
|
20 |
+
);
|
21 |
+
}
|
22 |
+
|
23 |
+
}
|
app/code/local/Ktree/Brand/controllers/Adminhtml/BrandController.php
ADDED
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Ktree Brand Admin brand controller
|
5 |
+
*
|
6 |
+
* @category Ktree
|
7 |
+
* @package Ktree_Brand
|
8 |
+
* @author An <samanta.sanghamitra@ktree.com>
|
9 |
+
*/
|
10 |
+
class Ktree_Brand_Adminhtml_BrandController extends Mage_Adminhtml_Controller_action {
|
11 |
+
|
12 |
+
protected function _initAction() {
|
13 |
+
$this->loadLayout()
|
14 |
+
->_setActiveMenu('brand/items')
|
15 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Brand Names Manager'), Mage::helper('adminhtml')->__('Brand Names Manager'));
|
16 |
+
|
17 |
+
return $this;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function indexAction() {
|
21 |
+
$this->_initAction()->renderLayout();
|
22 |
+
}
|
23 |
+
|
24 |
+
public function editAction() {
|
25 |
+
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
|
26 |
+
->setCodeFilter('brand')->getFirstItem();
|
27 |
+
$collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
28 |
+
->setPositionOrder('asc')
|
29 |
+
->setAttributeFilter($attributeInfo->getAttributeId())
|
30 |
+
->setStoreFilter(Mage::app()->getStore()->getId());
|
31 |
+
$id = $this->getRequest()->getParam('brand_option_id');
|
32 |
+
$model = Mage::getModel('brand/brand')->load($id, 'brand_option_id');
|
33 |
+
|
34 |
+
if ($model->getBrandOptionId()) {
|
35 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
36 |
+
if (!empty($data)) {
|
37 |
+
$model->setData($data);
|
38 |
+
}
|
39 |
+
|
40 |
+
Mage::register('brand_data', $model);
|
41 |
+
|
42 |
+
$this->loadLayout();
|
43 |
+
$this->_setActiveMenu('brand/items');
|
44 |
+
|
45 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Brand Names Manager'), Mage::helper('adminhtml')->__('Brand Names Manager'));
|
46 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Brand Name'), Mage::helper('adminhtml')->__('Brand Name'));
|
47 |
+
|
48 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
49 |
+
|
50 |
+
$this->_addContent($this->getLayout()->createBlock('brand/adminhtml_brand_edit'))
|
51 |
+
->_addLeft($this->getLayout()->createBlock('brand/adminhtml_brand_edit_tabs'));
|
52 |
+
|
53 |
+
$this->renderLayout();
|
54 |
+
} else {
|
55 |
+
$data = $collection->getItemByColumnValue("option_id", $id);
|
56 |
+
if ($data) {
|
57 |
+
$data->getData();
|
58 |
+
$model->setTitle($data['value']);
|
59 |
+
$model->setStatus(2);
|
60 |
+
$model->setContent("Logo of " . $data['value']);
|
61 |
+
$model->setFilename("");
|
62 |
+
$model->setBrandOptionId($data['option_id']);
|
63 |
+
}
|
64 |
+
|
65 |
+
Mage::register('brand_data', $model);
|
66 |
+
|
67 |
+
$this->loadLayout();
|
68 |
+
$this->_setActiveMenu('brand/items');
|
69 |
+
|
70 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Brand Name Manager'), Mage::helper('adminhtml')->__('Brand Names Manager'));
|
71 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Brand Name'), Mage::helper('adminhtml')->__('Brand Name'));
|
72 |
+
|
73 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
74 |
+
|
75 |
+
$this->_addContent($this->getLayout()->createBlock('brand/adminhtml_brand_edit'))
|
76 |
+
->_addLeft($this->getLayout()->createBlock('brand/adminhtml_brand_edit_tabs'));
|
77 |
+
|
78 |
+
$this->renderLayout();
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
public function newAction() {
|
83 |
+
$this->_forward('edit');
|
84 |
+
}
|
85 |
+
|
86 |
+
public function saveAction() {
|
87 |
+
if ($data = $this->getRequest()->getPost()) {
|
88 |
+
if(isset($data['stores'])) {
|
89 |
+
$stores = $data['stores'];
|
90 |
+
$storesCount = count($stores);
|
91 |
+
$storesIndex = 1;
|
92 |
+
$storesData = '';
|
93 |
+
foreach($stores as $store) {
|
94 |
+
$storesData .= $store;
|
95 |
+
if($storesIndex < $storesCount) {
|
96 |
+
$storesData .= ',';
|
97 |
+
}
|
98 |
+
$storesIndex++;
|
99 |
+
}
|
100 |
+
$data['store_id'] = $storesData;
|
101 |
+
}
|
102 |
+
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
|
103 |
+
->setCodeFilter('brand')->getFirstItem();
|
104 |
+
$option['attribute_id'] = $attributeInfo->getAttributeId();
|
105 |
+
$option['value'][0][Mage::app()->getStore()->getId()] = $data['title'];
|
106 |
+
$option['value'][0][1] = $data['title'];
|
107 |
+
$collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
108 |
+
->setPositionOrder('asc')
|
109 |
+
->setAttributeFilter($attributeInfo->getAttributeId())
|
110 |
+
->setStoreFilter(Mage::app()->getStore()->getId());
|
111 |
+
$resource = Mage::getSingleton('core/resource');
|
112 |
+
$readConnection = $resource->getConnection('core_read');
|
113 |
+
if($this->getRequest()->getParam('id')){
|
114 |
+
$query = 'SELECT * FROM brand where brand_id='.$this->getRequest()->getParam('id');
|
115 |
+
$results = $readConnection->fetchAll($query);
|
116 |
+
$exist = $collection->getItemByColumnValue("option_id", $results[0]['brand_option_id']);
|
117 |
+
}
|
118 |
+
else {
|
119 |
+
$exist='';
|
120 |
+
}
|
121 |
+
//this way the name is saved in DB
|
122 |
+
/*if (isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
|
123 |
+
$data['filename'] = $_FILES['filename']['name'];
|
124 |
+
}*/
|
125 |
+
if(isset($_FILES['filename']['name']) and (file_exists($_FILES['filename']['tmp_name']))) {
|
126 |
+
try {
|
127 |
+
$uploader = new Varien_File_Uploader('filename');
|
128 |
+
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); // or pdf or anything
|
129 |
+
$uploader->setAllowRenameFiles(false);
|
130 |
+
$uploader->setFilesDispersion(false);
|
131 |
+
$path = Mage::getBaseDir('media') . DS . 'brand' . DS;
|
132 |
+
|
133 |
+
$uploader->save($path, $_FILES['filename']['name']);
|
134 |
+
|
135 |
+
$data['filename'] = $_FILES['filename']['name'];
|
136 |
+
}catch(Exception $e) {
|
137 |
+
|
138 |
+
}
|
139 |
+
}
|
140 |
+
else {
|
141 |
+
|
142 |
+
|
143 |
+
if(isset($data['filename']['delete']) && $data['filename']['delete'] == 1)
|
144 |
+
$data['filename'] = '';
|
145 |
+
else
|
146 |
+
unset($data['filename']);
|
147 |
+
|
148 |
+
}
|
149 |
+
if (!$exist) {
|
150 |
+
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
|
151 |
+
$setup->addAttributeOption($option);
|
152 |
+
$newOption = $newcollection = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
153 |
+
->setPositionOrder('asc')
|
154 |
+
->setAttributeFilter($attributeInfo->getAttributeId())
|
155 |
+
->setStoreFilter(Mage::app()->getStore()->getId())->getItemByColumnValue("value", $data['title']);
|
156 |
+
$model = Mage::getModel('brand/brand');
|
157 |
+
$model->setData($data)
|
158 |
+
->setBrandOptionId($newOption['option_id']);
|
159 |
+
} else {
|
160 |
+
$writeConnection = $resource->getConnection('core_write');
|
161 |
+
$query = "UPDATE eav_attribute_option_value set value='".$data['title']."' where option_id=".$results[0]['brand_option_id'];
|
162 |
+
$writeConnection->query($query);
|
163 |
+
$model = Mage::getModel('brand/brand');
|
164 |
+
$model->setData($data)->setId($this->getRequest()->getParam('id'))
|
165 |
+
->setBrandOptionId($exist['option_id']);
|
166 |
+
}
|
167 |
+
|
168 |
+
try {
|
169 |
+
$model->save();
|
170 |
+
/* if (isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
|
171 |
+
try {*/
|
172 |
+
/* Starting upload */
|
173 |
+
/* $uploader = new Varien_File_Uploader('filename');
|
174 |
+
|
175 |
+
// Any extension would work
|
176 |
+
$uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
|
177 |
+
$uploader->setAllowRenameFiles(false);
|
178 |
+
|
179 |
+
// Set the file upload mode
|
180 |
+
// false -> get the file directly in the specified folder
|
181 |
+
// true -> get the file in the product like folders
|
182 |
+
// (file.jpg will go in something like /media/f/i/file.jpg)
|
183 |
+
$uploader->setFilesDispersion(true);
|
184 |
+
|
185 |
+
// We set media as the upload dir
|
186 |
+
$path = Mage::getBaseDir('media') . DS . 'brand' . DS;
|
187 |
+
preg_match('/\.([^\.]+)$/', $_FILES['filename']['name'], $extension);
|
188 |
+
Mage::helper('brand')->deleteBrandImage($model);
|
189 |
+
// if resized image doesn't exist, save the resized image to the resized directory
|
190 |
+
$uploader->save($path, $model->getId().$data['title'].strtolower($extension[0]));
|
191 |
+
} catch (Exception $e) {
|
192 |
+
|
193 |
+
}
|
194 |
+
}*/
|
195 |
+
|
196 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('brand')->__('Item was successfully saved'));
|
197 |
+
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
198 |
+
|
199 |
+
if ($this->getRequest()->getParam('back')) {
|
200 |
+
$this->_redirect('*/*/edit', array('brand_option_id' => $model->getManufacturerOptionId()));
|
201 |
+
return;
|
202 |
+
}
|
203 |
+
$this->_redirect('*/*/');
|
204 |
+
return;
|
205 |
+
} catch (Exception $e) {
|
206 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
207 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
208 |
+
$this->_redirect('*/*/edit', array('brand_option_id' => $this->getRequest()->getParam('brand_option_id')));
|
209 |
+
return;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('brand')->__('Unable to find item to save'));
|
213 |
+
$this->_redirect('*/*/');
|
214 |
+
}
|
215 |
+
|
216 |
+
public function installAction() {
|
217 |
+
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
|
218 |
+
->setCodeFilter('brand')
|
219 |
+
->getFirstItem();
|
220 |
+
|
221 |
+
$collectionTable = $attributeInfo->getSource();
|
222 |
+
|
223 |
+
$collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
224 |
+
->setPositionOrder('asc')
|
225 |
+
->setAttributeFilter($collectionTable->getAttribute()->getId())
|
226 |
+
->setStoreFilter($collectionTable->getAttribute()->getStoreId())
|
227 |
+
->load();
|
228 |
+
foreach ($collection->getData() as $item) {
|
229 |
+
$data = array("title" => $item['value'], "status" => "2", "content" => "Logo of " . $item['value'], "brand_id" => $item['option_id'], "filename" => "");
|
230 |
+
$model = Mage::getModel('brand/brand');
|
231 |
+
$model->setData($data);
|
232 |
+
try {
|
233 |
+
Mage::getModel('brand/brand')->save($model);
|
234 |
+
} catch (Exception $e) {
|
235 |
+
echo "<pre>";
|
236 |
+
print_r($e);
|
237 |
+
echo "</pre>";
|
238 |
+
}
|
239 |
+
print_r($model->getData());
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
public function deleteAction() {
|
244 |
+
if ($this->getRequest()->getParam('brand_option_id') > 0) {
|
245 |
+
try {
|
246 |
+
$query = Mage::getSingleton('core/resource')->getConnection('core_write');
|
247 |
+
$tableName = Mage::getSingleton('core/resource')->getTableName('eav_attribute_option_value');
|
248 |
+
$sql = "DELETE FROM " . $tableName . " WHERE " . $tableName . ".`option_id` = " . $this->getRequest()->getParam('brand_option_id');
|
249 |
+
$query->multi_query($sql);
|
250 |
+
$tableNameOption = Mage::getSingleton('core/resource')->getTableName('eav_attribute_option');
|
251 |
+
$sqlOption = "DELETE FROM " . $tableNameOption . " WHERE " . $tableNameOption . ".`option_id` = " . $this->getRequest()->getParam('brand_option_id');
|
252 |
+
$query->multi_query($sqlOption);
|
253 |
+
$model = Mage::getModel('brand/brand')->load($this->getRequest()->getParam('brand_option_id'), 'brand_option_id');
|
254 |
+
if ($model->getManufacturerOptionId()) {
|
255 |
+
$model->delete();
|
256 |
+
}
|
257 |
+
} catch (Exception $e) {
|
258 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Item could not be deleted'));
|
259 |
+
$this->_redirect('*/*/');
|
260 |
+
}
|
261 |
+
}
|
262 |
+
$this->_redirect('*/*/');
|
263 |
+
}
|
264 |
+
|
265 |
+
public function massDeleteAction() {
|
266 |
+
$brandIds = $this->getRequest()->getParam('brand');
|
267 |
+
if (!is_array($brandIds)) {
|
268 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
269 |
+
} else {
|
270 |
+
try {
|
271 |
+
foreach ($brandIds as $brandId) {
|
272 |
+
$query = Mage::getSingleton('core/resource')->getConnection('core_write');
|
273 |
+
$tableName = Mage::getSingleton('core/resource')->getTableName('eav_attribute_option_value');
|
274 |
+
$sql = "DELETE FROM " . $tableName . " WHERE " . $tableName . ".`option_id` = " . $brandId;
|
275 |
+
$query->multi_query($sql);
|
276 |
+
$tableNameOption = Mage::getSingleton('core/resource')->getTableName('eav_attribute_option');
|
277 |
+
$sqlOption = "DELETE FROM " . $tableNameOption . " WHERE " . $tableNameOption . ".`option_id` = " . $brandId;
|
278 |
+
$query->multi_query($sqlOption);
|
279 |
+
$model = Mage::getModel('brand/brand')->load($brandId, 'brand_option_id');
|
280 |
+
if ($model->getManufacturerOptionId()) {
|
281 |
+
$model->delete();
|
282 |
+
}
|
283 |
+
}
|
284 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
285 |
+
Mage::helper('adminhtml')->__(
|
286 |
+
'Total of %d record(s) were successfully deleted', count($brandIds)
|
287 |
+
)
|
288 |
+
);
|
289 |
+
} catch (Exception $e) {
|
290 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
291 |
+
}
|
292 |
+
}
|
293 |
+
$this->_redirect('*/*/index');
|
294 |
+
}
|
295 |
+
|
296 |
+
public function massStatusAction() {
|
297 |
+
$brandIds = $this->getRequest()->getParam('brand');
|
298 |
+
if (!is_array($brandIds)) {
|
299 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
300 |
+
} else {
|
301 |
+
try {
|
302 |
+
foreach ($brandIds as $brandId) {
|
303 |
+
$brand = Mage::getSingleton('brand/brand')
|
304 |
+
->load($brandId, 'brand_option_id')
|
305 |
+
->setStatus($this->getRequest()->getParam('status'))
|
306 |
+
->setIsMassupdate(true)
|
307 |
+
->save();
|
308 |
+
}
|
309 |
+
$this->_getSession()->addSuccess(
|
310 |
+
$this->__('Total of %d record(s) were successfully updated', count($brandIds))
|
311 |
+
);
|
312 |
+
} catch (Exception $e) {
|
313 |
+
$this->_getSession()->addError($e->getMessage());
|
314 |
+
}
|
315 |
+
}
|
316 |
+
$this->_redirect('*/*/index');
|
317 |
+
}
|
318 |
+
|
319 |
+
public function exportCsvAction() {
|
320 |
+
$fileName = 'brand.csv';
|
321 |
+
$content = $this->getLayout()->createBlock('brand/adminhtml_brand_grid')
|
322 |
+
->getCsv();
|
323 |
+
|
324 |
+
$this->_sendUploadResponse($fileName, $content);
|
325 |
+
}
|
326 |
+
|
327 |
+
public function exportXmlAction() {
|
328 |
+
$fileName = 'brand.xml';
|
329 |
+
$content = $this->getLayout()->createBlock('brand/adminhtml_brand_grid')
|
330 |
+
->getXml();
|
331 |
+
|
332 |
+
$this->_sendUploadResponse($fileName, $content);
|
333 |
+
}
|
334 |
+
|
335 |
+
protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream') {
|
336 |
+
$response = $this->getResponse();
|
337 |
+
$response->setHeader('HTTP/1.1 200 OK', '');
|
338 |
+
$response->setHeader('Pragma', 'public', true);
|
339 |
+
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
|
340 |
+
$response->setHeader('Content-Disposition', 'attachment; filename=' . $fileName);
|
341 |
+
$response->setHeader('Last-Modified', date('r'));
|
342 |
+
$response->setHeader('Accept-Ranges', 'bytes');
|
343 |
+
$response->setHeader('Content-Length', strlen($content));
|
344 |
+
$response->setHeader('Content-type', $contentType);
|
345 |
+
$response->setBody($content);
|
346 |
+
$response->sendResponse();
|
347 |
+
die;
|
348 |
+
}
|
349 |
+
|
350 |
+
}
|
app/code/local/Ktree/Brand/controllers/Catalog/CategoryController.php
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once 'Mage/Catalog/CategoryController.php';
|
3 |
+
class Ktree_Brand_Category_CategoryController extends Mage_Catalog_CategoryController
|
4 |
+
{
|
5 |
+
public function viewAction()
|
6 |
+
{
|
7 |
+
$params = $this->getRequest()->getParams();
|
8 |
+
if($params['isAjax'] == 1){ //Check if it was an AJAX request
|
9 |
+
$response = array();
|
10 |
+
|
11 |
+
if ($category = $this->_initCatagory()) {
|
12 |
+
$design = Mage::getSingleton('catalog/design');
|
13 |
+
$settings = $design->getDesignSettings($category);
|
14 |
+
|
15 |
+
// apply custom design
|
16 |
+
if ($settings->getCustomDesign()) {
|
17 |
+
$design->applyCustomDesign($settings->getCustomDesign());
|
18 |
+
}
|
19 |
+
|
20 |
+
Mage::getSingleton('catalog/session')->setLastViewedCategoryId($category->getId());
|
21 |
+
|
22 |
+
$update = $this->getLayout()->getUpdate();
|
23 |
+
$update->addHandle('default');
|
24 |
+
|
25 |
+
if (!$category->hasChildren()) {
|
26 |
+
$update->addHandle('catalog_category_layered_nochildren');
|
27 |
+
}
|
28 |
+
|
29 |
+
$this->addActionLayoutHandles();
|
30 |
+
$update->addHandle($category->getLayoutUpdateHandle());
|
31 |
+
$update->addHandle('CATEGORY_' . $category->getId());
|
32 |
+
$this->loadLayoutUpdates();
|
33 |
+
|
34 |
+
// apply custom layout update once layout is loaded
|
35 |
+
if ($layoutUpdates = $settings->getLayoutUpdates()) {
|
36 |
+
if (is_array($layoutUpdates)) {
|
37 |
+
foreach($layoutUpdates as $layoutUpdate) {
|
38 |
+
$update->addUpdate($layoutUpdate);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
$this->generateLayoutXml()->generateLayoutBlocks(); //Generate new blocks
|
44 |
+
$viewpanel = $this->getLayout()->getBlock('catalog.leftnav')->toHtml(); // Generate New Layered Navigation Menu
|
45 |
+
$productlist = $this->getLayout()->getBlock('product_list')->toHtml(); // Generate product list
|
46 |
+
$response['status'] = 'SUCCESS';
|
47 |
+
$response['viewpanel']=$viewpanel;
|
48 |
+
$response['productlist'] = $productlist;
|
49 |
+
|
50 |
+
// apply custom layout (page) template once the blocks are generated
|
51 |
+
}
|
52 |
+
elseif (!$this->getResponse()->isRedirect()) {
|
53 |
+
$this->_forward('noRoute');
|
54 |
+
$response['status'] = 'FAILURE';
|
55 |
+
|
56 |
+
}
|
57 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
58 |
+
return;
|
59 |
+
}
|
60 |
+
if ($category = $this->_initCatagory()) {
|
61 |
+
$design = Mage::getSingleton('catalog/design');
|
62 |
+
$settings = $design->getDesignSettings($category);
|
63 |
+
|
64 |
+
// apply custom design
|
65 |
+
if ($settings->getCustomDesign()) {
|
66 |
+
$design->applyCustomDesign($settings->getCustomDesign());
|
67 |
+
}
|
68 |
+
|
69 |
+
Mage::getSingleton('catalog/session')->setLastViewedCategoryId($category->getId());
|
70 |
+
|
71 |
+
$update = $this->getLayout()->getUpdate();
|
72 |
+
$update->addHandle('default');
|
73 |
+
|
74 |
+
if (!$category->hasChildren()) {
|
75 |
+
$update->addHandle('catalog_category_layered_nochildren');
|
76 |
+
}
|
77 |
+
|
78 |
+
$this->addActionLayoutHandles();
|
79 |
+
$update->addHandle($category->getLayoutUpdateHandle());
|
80 |
+
$update->addHandle('CATEGORY_' . $category->getId());
|
81 |
+
$this->loadLayoutUpdates();
|
82 |
+
|
83 |
+
// apply custom layout update once layout is loaded
|
84 |
+
if ($layoutUpdates = $settings->getLayoutUpdates()) {
|
85 |
+
if (is_array($layoutUpdates)) {
|
86 |
+
foreach($layoutUpdates as $layoutUpdate) {
|
87 |
+
$update->addUpdate($layoutUpdate);
|
88 |
+
}
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
$this->generateLayoutXml()->generateLayoutBlocks();
|
93 |
+
// apply custom layout (page) template once the blocks are generated
|
94 |
+
if ($settings->getPageLayout()) {
|
95 |
+
$this->getLayout()->helper('page/layout')->applyTemplate($settings->getPageLayout());
|
96 |
+
}
|
97 |
+
|
98 |
+
if ($root = $this->getLayout()->getBlock('root')) {
|
99 |
+
$root->addBodyClass('categorypath-' . $category->getUrlPath())
|
100 |
+
->addBodyClass('category-' . $category->getUrlKey());
|
101 |
+
}
|
102 |
+
|
103 |
+
$this->_initLayoutMessages('catalog/session');
|
104 |
+
$this->_initLayoutMessages('checkout/session');
|
105 |
+
$this->renderLayout();
|
106 |
+
}
|
107 |
+
elseif (!$this->getResponse()->isRedirect()) {
|
108 |
+
$this->_forward('noRoute');
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
} // end of class
|
app/code/local/Ktree/Brand/controllers/CatalogSearch/ResultController.php
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once 'Mage/CatalogSearch/ResuleController.php';
|
3 |
+
class Ktree_Brand_CatalogSearch_ResuleController extends Mage_CatalogSearch_ResuleController
|
4 |
+
{
|
5 |
+
public function indexAction()
|
6 |
+
|
7 |
+
{
|
8 |
+
$params = $this->getRequest()->getParams();
|
9 |
+
if($params['isAjax'] == 1){ \\Check for AJAX query
|
10 |
+
$response = array();
|
11 |
+
|
12 |
+
$query = Mage::helper('catalogsearch')->getQuery();
|
13 |
+
/* @var $query Mage_CatalogSearch_Model_Query */
|
14 |
+
|
15 |
+
$query->setStoreId(Mage::app()->getStore()->getId());
|
16 |
+
|
17 |
+
if ($query->getQueryText()) {
|
18 |
+
if (Mage::helper('catalogsearch')->isMinQueryLength()) {
|
19 |
+
$query->setId(0)
|
20 |
+
->setIsActive(1)
|
21 |
+
->setIsProcessed(1);
|
22 |
+
}
|
23 |
+
else {
|
24 |
+
if ($query->getId()) {
|
25 |
+
$query->setPopularity($query->getPopularity()+1);
|
26 |
+
}
|
27 |
+
else {
|
28 |
+
$query->setPopularity(1);
|
29 |
+
}
|
30 |
+
|
31 |
+
if ($query->getRedirect()){
|
32 |
+
$query->save();
|
33 |
+
$this->getResponse()->setRedirect($query->getRedirect());
|
34 |
+
return;
|
35 |
+
}
|
36 |
+
else {
|
37 |
+
$query->prepare();
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
Mage::helper('catalogsearch')->checkNotes();
|
42 |
+
|
43 |
+
$this->loadLayout();
|
44 |
+
$this->_initLayoutMessages('catalog/session');
|
45 |
+
$this->_initLayoutMessages('checkout/session');
|
46 |
+
$this->renderLayout();
|
47 |
+
|
48 |
+
if (!Mage::helper('catalogsearch')->isMinQueryLength()) {
|
49 |
+
$query->save();
|
50 |
+
}
|
51 |
+
}
|
52 |
+
else {
|
53 |
+
$this->_redirectReferer();
|
54 |
+
$response['status'] = 'FAILURE'; //Add failure when filter can't be applied
|
55 |
+
|
56 |
+
}
|
57 |
+
|
58 |
+
$viewpanel = $this->getLayout()->getBlock('catalogsearch.leftnav')->toHtml(); //Get the new Layered Manu
|
59 |
+
$productlist = $this->getLayout()->getBlock('search_result_list')->toHtml(); //New product List
|
60 |
+
$response['status'] = 'SUCCESS'; //Send Success
|
61 |
+
$response['viewpanel']=$viewpanel;
|
62 |
+
$response['productlist'] = $productlist;
|
63 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
64 |
+
return;
|
65 |
+
|
66 |
+
}
|
67 |
+
$query = Mage::helper('catalogsearch')->getQuery();
|
68 |
+
/* @var $query Mage_CatalogSearch_Model_Query */
|
69 |
+
|
70 |
+
$query->setStoreId(Mage::app()->getStore()->getId());
|
71 |
+
|
72 |
+
if ($query->getQueryText()) {
|
73 |
+
if (Mage::helper('catalogsearch')->isMinQueryLength()) {
|
74 |
+
$query->setId(0)
|
75 |
+
->setIsActive(1)
|
76 |
+
->setIsProcessed(1);
|
77 |
+
}
|
78 |
+
else {
|
79 |
+
if ($query->getId()) {
|
80 |
+
$query->setPopularity($query->getPopularity()+1);
|
81 |
+
}
|
82 |
+
else {
|
83 |
+
$query->setPopularity(1);
|
84 |
+
}
|
85 |
+
|
86 |
+
if ($query->getRedirect()){
|
87 |
+
$query->save();
|
88 |
+
$this->getResponse()->setRedirect($query->getRedirect());
|
89 |
+
return;
|
90 |
+
}
|
91 |
+
else {
|
92 |
+
$query->prepare();
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
Mage::helper('catalogsearch')->checkNotes();
|
97 |
+
|
98 |
+
$this->loadLayout();
|
99 |
+
$this->_initLayoutMessages('catalog/session');
|
100 |
+
$this->_initLayoutMessages('checkout/session');
|
101 |
+
$this->renderLayout();
|
102 |
+
|
103 |
+
if (!Mage::helper('catalogsearch')->isMinQueryLength()) {
|
104 |
+
$query->save();
|
105 |
+
}
|
106 |
+
}
|
107 |
+
else {
|
108 |
+
$this->_redirectReferer();
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
} // end of class
|
app/code/local/Ktree/Brand/controllers/CategoryController.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once 'Mage/Catalog/controllers/CategoryController.php';
|
3 |
+
class Ktree_Brand_CategoryController extends Mage_Catalog_CategoryController
|
4 |
+
{
|
5 |
+
public function viewproductsAction()
|
6 |
+
{
|
7 |
+
$isAjax = $this->getRequest()->getParam('isAjax');
|
8 |
+
//$this->loadLayout()->renderLayout();
|
9 |
+
$this->loadLayout();
|
10 |
+
if($isAjax==1){
|
11 |
+
$productlist = $this->getLayout()->getBlock('onbrandcategoryproducts')->toHtml();
|
12 |
+
$response['productlist'] = $productlist;
|
13 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
14 |
+
return;
|
15 |
+
}
|
16 |
+
else {
|
17 |
+
$this->loadLayout()->renderLayout();
|
18 |
+
}
|
19 |
+
}
|
20 |
+
} // end of class
|
app/code/local/Ktree/Brand/controllers/IndexController.php
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ktree_Brand_IndexController extends Mage_Core_Controller_Front_Action
|
4 |
+
{
|
5 |
+
//Index Page of Shop by brand's module
|
6 |
+
public function indexAction()
|
7 |
+
{
|
8 |
+
Mage::register('brand_key', $this->getRequest());
|
9 |
+
$brand = Mage::getModel("brand/brand")
|
10 |
+
->getCollection()
|
11 |
+
->addFieldToFilter('main_table.status', 1)
|
12 |
+
->addOrder('title','ASC')
|
13 |
+
->getData();
|
14 |
+
Mage::register('brand', $brand);
|
15 |
+
$this->loadLayout();
|
16 |
+
$this->getLayout()->getBlock('head')->setTitle('Shop By brand');
|
17 |
+
$this->renderLayout();
|
18 |
+
}
|
19 |
+
//View Each brand name
|
20 |
+
public function viewAction()
|
21 |
+
{
|
22 |
+
Mage::register('brand_key', $this->getRequest());
|
23 |
+
$this->loadLayout();
|
24 |
+
$this->getLayout()->getBlock('head')->setTitle(Mage::helper("brand")->__("All products of ").preg_replace("/%20/", " ", Mage::app()->getRequest()->getParam('brandname')))
|
25 |
+
->setKeywords(Mage::app()->getRequest()->getParam('brandname').Mage::helper("brand")->__("brand name"))
|
26 |
+
->setDescription(Mage::helper("brand")->__("All products of ").preg_replace("/%20/", " ", Mage::app()->getRequest()->getParam('brandname')));
|
27 |
+
$this->renderLayout();
|
28 |
+
}
|
29 |
+
public function viewcategoryAction()
|
30 |
+
{
|
31 |
+
Mage::register('brand_key', $this->getRequest());
|
32 |
+
$this->loadLayout();
|
33 |
+
$this->getLayout()->getBlock('head')->setTitle(Mage::helper("brand")->__("All products of ").preg_replace("/%20/", " ", Mage::app()->getRequest()->getParam('brandname')))
|
34 |
+
->setKeywords(Mage::app()->getRequest()->getParam('brandname').Mage::helper("brand")->__("brand name"))
|
35 |
+
->setDescription(Mage::helper("brand")->__("All products of ").preg_replace("/%20/", " ", Mage::app()->getRequest()->getParam('brandname')));
|
36 |
+
$this->renderLayout();
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
public function getBrandCategoryAction(){
|
41 |
+
$html = "";
|
42 |
+
$brand = array();
|
43 |
+
$category_id = $this->getRequest()->getParam('id');
|
44 |
+
$sql = "SELECT * FROM brand_category where entity_id = ".$category_id;
|
45 |
+
|
46 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
47 |
+
|
48 |
+
|
49 |
+
foreach($connection->fetchAll($sql) as $entity_id){
|
50 |
+
// $id .= $entity_id['brand_id'];
|
51 |
+
|
52 |
+
//array_push($brand,$entity_id['brand_id']);
|
53 |
+
$storeid=Mage::app()->getStore()->getId();
|
54 |
+
$sql1 = "SELECT * FROM brand where brand_option_id = ".$entity_id['brand_id']." and ( store_id LIKE '".$storeid.",%'
|
55 |
+
OR store_id LIKE '%,".$storeid."'
|
56 |
+
OR store_id LIKE '%,".$storeid.",%'
|
57 |
+
OR store_id LIKE '".$storeid."' or store_id=0 )";
|
58 |
+
$row = $connection->query($sql1)->rowCount();
|
59 |
+
$html .= '<table><tr>';
|
60 |
+
foreach($connection->fetchAll($sql1) as $o){
|
61 |
+
if($o['filename']){
|
62 |
+
$brand_image= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."brand/".$o['filename'] ;
|
63 |
+
}
|
64 |
+
else {
|
65 |
+
$brand_image=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'brand/no_image_available.jpg';
|
66 |
+
}
|
67 |
+
$html .= '<td> ';
|
68 |
+
if(Mage::getStoreConfig('ktreebrand/filter/show_brands_with_logos') == 1){
|
69 |
+
$html .= '<a href="' . Mage::getBaseUrl() . 'brand/index/viewcategory/?brand=' . $o['brand_option_id'] . '&category_id=' . $category_id . '">'.$o['title'].'<img src="'.$brand_image.'" height="100"></a><br><br>';
|
70 |
+
}else{
|
71 |
+
$html .= '<a href="' . Mage::getBaseUrl() . 'brand/index/viewcategory/?brand=' . $o['brand_option_id'] . '&category_id=' . $category_id . '">' . $o['title'] . '</a><br><br>';}
|
72 |
+
$html .= '</td>';
|
73 |
+
}
|
74 |
+
}
|
75 |
+
$html .= '</tr></table>';
|
76 |
+
|
77 |
+
echo $html;
|
78 |
+
}
|
79 |
+
public function brandCategoryProductsAction(){
|
80 |
+
/* $html = "";
|
81 |
+
$brand = $this->getRequest()->getParam('brand');
|
82 |
+
$category_id = $this->getRequest()->getParam('category_id');
|
83 |
+
$layer = Mage::getSingleton('catalog/layer');
|
84 |
+
$categoryid=$this->getRequest()->getParam('category_id');
|
85 |
+
$_featcategory = Mage::getModel('catalog/category')->load($categoryid);
|
86 |
+
$layer->setCurrentCategory($_featcategory);
|
87 |
+
|
88 |
+
$layer = Ktree_Brand_Block_Onbrandcategory::getLayer();
|
89 |
+
$layer->setCurrentCategory($_featcategory);
|
90 |
+
Mage::App()->getRequest();
|
91 |
+
$this->_productCollection = Mage::getModel('catalog/product')->getCollection()
|
92 |
+
->addCategoryFilter($_featcategory)
|
93 |
+
->addAttributeToFilter('brand', array("eq", $this->getRequest()->getParam('brand')));
|
94 |
+
$layer->prepareProductCollection($this->_productCollection);
|
95 |
+
$productcollection=$this->_productCollection;
|
96 |
+
if(!count($productcollection)):
|
97 |
+
$html.='<p class="note-msg">There are no products matching the selection.</p>';
|
98 |
+
else:
|
99 |
+
$html.='<div class="category-products">';
|
100 |
+
//echo $this->getToolbarHtml();
|
101 |
+
|
102 |
+
// Grid Mode
|
103 |
+
|
104 |
+
$_collectionSize = count($productcollection);
|
105 |
+
$_columnCount = 3;
|
106 |
+
$i=0; foreach ($productcollection as $_product):
|
107 |
+
if ($i++%$_columnCount==0):
|
108 |
+
$html.='<ul class="products-grid">';
|
109 |
+
endif;
|
110 |
+
if(($i-1)%$_columnCount==0) {
|
111 |
+
$html.='<li class="itemfirst">';
|
112 |
+
}
|
113 |
+
elseif($i%$_columnCount==0) {
|
114 |
+
$html.='<li class="itemlast">';
|
115 |
+
}
|
116 |
+
else {
|
117 |
+
$html.='<li class="item">';
|
118 |
+
}
|
119 |
+
$html.='<a href="'.$_product->getProductUrl().'" title="'.$_product['small_image'].'" class="product-image"><img src="'.$_product['small_image'].'" width="135" height="135" alt="'. $_product['small_image'].'" /></a>';
|
120 |
+
$html.='<h2 class="product-name"><a href="'.$_product->getProductUrl().'" title="'. $_product['name'].'">'.$_product['name'].'</a></h2>';
|
121 |
+
if($_product->getRatingSummary()):
|
122 |
+
//echo $this->getReviewsSummaryHtml($_product, 'short');
|
123 |
+
endif;
|
124 |
+
//echo $this->getPriceHtml($_product, true);
|
125 |
+
$html.='<div class="actions">';
|
126 |
+
if($_product->isSaleable()):
|
127 |
+
$html.='<p><button type="button" title="Add to Cart" class="button btn-cart" onclick="setLocation(\'checkout/cart/product\')"><span><span>Add to Cart</span></span></button></p>';
|
128 |
+
else:
|
129 |
+
$html.='<p class="availability out-of-stock"><span>Out of stock</span></p>';
|
130 |
+
endif;
|
131 |
+
|
132 |
+
$html.='</div></li>';
|
133 |
+
if ($i%$_columnCount==0 || $i==$_collectionSize):
|
134 |
+
$html.='</ul>';
|
135 |
+
endif;
|
136 |
+
endforeach;
|
137 |
+
$html.='<script type="text/javascript">decorateGeneric($$(\'ul.products-grid\'), [\'odd\',\'even\',\'first\',\'last\'])</script>';
|
138 |
+
*/
|
139 |
+
/*
|
140 |
+
<div class="toolbar-bottom">
|
141 |
+
<?php echo $this->getToolbarHtml() ?>
|
142 |
+
</div>*/
|
143 |
+
/*$html.='</div>';
|
144 |
+
endif;
|
145 |
+
|
146 |
+
echo $html;
|
147 |
+
*/
|
148 |
+
}
|
149 |
+
|
150 |
+
|
151 |
+
|
152 |
+
} // end of class
|
app/code/local/Ktree/Brand/etc/adminhtml.xml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<all>
|
6 |
+
<title>Allow Everything</title>
|
7 |
+
</all>
|
8 |
+
<admin>
|
9 |
+
<children>
|
10 |
+
<system>
|
11 |
+
<children>
|
12 |
+
<config>
|
13 |
+
<children>
|
14 |
+
<ktreebrand translate="title">
|
15 |
+
<title>Brand's Image Setting</title>
|
16 |
+
<sort_order>92</sort_order>
|
17 |
+
</ktreebrand>
|
18 |
+
</children>
|
19 |
+
</config>
|
20 |
+
</children>
|
21 |
+
</system>
|
22 |
+
</children>
|
23 |
+
</admin>
|
24 |
+
</resources>
|
25 |
+
</acl>
|
26 |
+
</config>
|
app/code/local/Ktree/Brand/etc/config.xml
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Ktree_Brand>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Ktree_Brand>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<brand>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Ktree_Brand</module>
|
14 |
+
<frontName>brand</frontName>
|
15 |
+
</args>
|
16 |
+
</brand>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<brand>
|
21 |
+
<file>brand.xml</file>
|
22 |
+
</brand>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<admin>
|
27 |
+
<routers>
|
28 |
+
<brand>
|
29 |
+
<use>admin</use>
|
30 |
+
<args>
|
31 |
+
<module>Ktree_Brand</module>
|
32 |
+
<frontName>brand</frontName>
|
33 |
+
</args>
|
34 |
+
</brand>
|
35 |
+
</routers>
|
36 |
+
</admin>
|
37 |
+
<adminhtml>
|
38 |
+
<menu>
|
39 |
+
<brand module="brand">
|
40 |
+
<title>Brands</title>
|
41 |
+
<sort_order>70</sort_order>
|
42 |
+
<children>
|
43 |
+
<items module="brand">
|
44 |
+
<title>Manage Brands</title>
|
45 |
+
<sort_order>0</sort_order>
|
46 |
+
<action>brand/adminhtml_brand</action>
|
47 |
+
</items>
|
48 |
+
</children>
|
49 |
+
</brand>
|
50 |
+
</menu>
|
51 |
+
|
52 |
+
<acl>
|
53 |
+
<resources>
|
54 |
+
<all>
|
55 |
+
<title>Allow Everything</title>
|
56 |
+
</all>
|
57 |
+
<admin>
|
58 |
+
<children>
|
59 |
+
<Ktree_Brand>
|
60 |
+
<title>Brand Module</title>
|
61 |
+
<sort_order>10</sort_order>
|
62 |
+
</Ktree_Brand>
|
63 |
+
</children>
|
64 |
+
</admin>
|
65 |
+
</resources>
|
66 |
+
</acl>
|
67 |
+
<layout>
|
68 |
+
<updates>
|
69 |
+
<brand>
|
70 |
+
<file>brand.xml</file>
|
71 |
+
</brand>
|
72 |
+
</updates>
|
73 |
+
</layout>
|
74 |
+
<events>
|
75 |
+
<catalog_category_prepare_save>
|
76 |
+
<observers>
|
77 |
+
<brandCategory>
|
78 |
+
<type>singleton</type>
|
79 |
+
<class>brand/observer</class>
|
80 |
+
<method>saveCategory</method>
|
81 |
+
</brandCategory>
|
82 |
+
</observers>
|
83 |
+
</catalog_category_prepare_save>
|
84 |
+
</events>
|
85 |
+
</adminhtml>
|
86 |
+
<global>
|
87 |
+
<models>
|
88 |
+
<brand>
|
89 |
+
<class>Ktree_Brand_Model</class>
|
90 |
+
<resourceModel>brand_mysql4</resourceModel>
|
91 |
+
</brand>
|
92 |
+
<brand_mysql4>
|
93 |
+
<class>Ktree_Brand_Model_Mysql4</class>
|
94 |
+
<entities>
|
95 |
+
<brand>
|
96 |
+
<table>brand</table>
|
97 |
+
</brand>
|
98 |
+
<category>
|
99 |
+
<table>brand_category</table>
|
100 |
+
</category>
|
101 |
+
</entities>
|
102 |
+
</brand_mysql4>
|
103 |
+
<brand_adminhtml>
|
104 |
+
<class>Ktree_Brand_Model_Adminhtml</class>
|
105 |
+
</brand_adminhtml>
|
106 |
+
</models>
|
107 |
+
<resources>
|
108 |
+
<brand_setup>
|
109 |
+
<setup>
|
110 |
+
<module>Ktree_Brand</module>
|
111 |
+
</setup>
|
112 |
+
<connection>
|
113 |
+
<use>core_setup</use>
|
114 |
+
</connection>
|
115 |
+
</brand_setup>
|
116 |
+
<brand_write>
|
117 |
+
<connection>
|
118 |
+
<use>core_write</use>
|
119 |
+
</connection>
|
120 |
+
</brand_write>
|
121 |
+
<brand_read>
|
122 |
+
<connection>
|
123 |
+
<use>core_read</use>
|
124 |
+
</connection>
|
125 |
+
</brand_read>
|
126 |
+
</resources>
|
127 |
+
<blocks>
|
128 |
+
<brand>
|
129 |
+
<class>Ktree_Brand_Block</class>
|
130 |
+
</brand>
|
131 |
+
</blocks>
|
132 |
+
<helpers>
|
133 |
+
<brand>
|
134 |
+
<class>Ktree_Brand_Helper</class>
|
135 |
+
</brand>
|
136 |
+
</helpers>
|
137 |
+
<blocks>
|
138 |
+
<adminhtml>
|
139 |
+
<rewrite>
|
140 |
+
<catalog_category_tabs>Ktree_Brand_Block_Adminhtml_Tabs</catalog_category_tabs>
|
141 |
+
</rewrite>
|
142 |
+
</adminhtml>
|
143 |
+
</blocks>
|
144 |
+
</global>
|
145 |
+
<default>
|
146 |
+
<ktreebrand>
|
147 |
+
<small>
|
148 |
+
<width>64</width>
|
149 |
+
<height>64</height>
|
150 |
+
</small>
|
151 |
+
<medium>
|
152 |
+
<width>128</width>
|
153 |
+
<height>128</height>
|
154 |
+
</medium>
|
155 |
+
<large>
|
156 |
+
<width>256</width>
|
157 |
+
<height>256</height>
|
158 |
+
</large>
|
159 |
+
</ktreebrand>
|
160 |
+
</default>
|
161 |
+
</config>
|
app/code/local/Ktree/Brand/etc/system.xml
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<ktree translate="label" module="brand">
|
5 |
+
<label>Ktree Extensions</label>
|
6 |
+
<sort_order>400</sort_order>
|
7 |
+
</ktree>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<ktreebrand translate="label">
|
11 |
+
<label>Configuration For Brand's </label>
|
12 |
+
<tab>ktree</tab>
|
13 |
+
<sort_order>130</sort_order>
|
14 |
+
<show_in_default>1</show_in_default>
|
15 |
+
<show_in_website>1</show_in_website>
|
16 |
+
<show_in_store>1</show_in_store>
|
17 |
+
<groups>
|
18 |
+
<!--<small translate="label">
|
19 |
+
<label>Small Image Size</label>
|
20 |
+
<frontend_type>text</frontend_type>
|
21 |
+
<sort_order>1</sort_order>
|
22 |
+
<show_in_default>1</show_in_default>
|
23 |
+
<show_in_website>1</show_in_website>
|
24 |
+
<show_in_store>1</show_in_store>
|
25 |
+
<fields>
|
26 |
+
<width translate="label comment">
|
27 |
+
<label>Width</label>
|
28 |
+
<frontend_type>text</frontend_type>
|
29 |
+
<validate>validate-digits</validate>
|
30 |
+
<sort_order>1</sort_order>
|
31 |
+
<show_in_default>1</show_in_default>
|
32 |
+
<show_in_website>1</show_in_website>
|
33 |
+
<show_in_store>1</show_in_store>
|
34 |
+
</width>
|
35 |
+
<height translate="label comment">
|
36 |
+
<label>Height</label>
|
37 |
+
<frontend_type>text</frontend_type>
|
38 |
+
<validate>validate-digits</validate>
|
39 |
+
<sort_order>2</sort_order>
|
40 |
+
<show_in_default>1</show_in_default>
|
41 |
+
<show_in_website>1</show_in_website>
|
42 |
+
<show_in_store>1</show_in_store>
|
43 |
+
<comment>This width,height for All Brands Page Images size</comment>
|
44 |
+
</height>
|
45 |
+
</fields>
|
46 |
+
</small>
|
47 |
+
<medium translate="label">
|
48 |
+
<label>Medium Size</label>
|
49 |
+
<frontend_type>text</frontend_type>
|
50 |
+
<sort_order>1</sort_order>
|
51 |
+
<show_in_default>1</show_in_default>
|
52 |
+
<show_in_website>1</show_in_website>
|
53 |
+
<show_in_store>1</show_in_store>
|
54 |
+
<fields>
|
55 |
+
<width translate="label comment">
|
56 |
+
<label>Width</label>
|
57 |
+
<frontend_type>text</frontend_type>
|
58 |
+
<validate>validate-digits</validate>
|
59 |
+
<sort_order>1</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>1</show_in_store>
|
63 |
+
</width>
|
64 |
+
<height translate="label">
|
65 |
+
<label>Height</label>
|
66 |
+
<frontend_type>text</frontend_type>
|
67 |
+
<validate>validate-digits</validate>
|
68 |
+
<sort_order>2</sort_order>
|
69 |
+
<show_in_default>1</show_in_default>
|
70 |
+
<show_in_website>1</show_in_website>
|
71 |
+
<show_in_store>1</show_in_store>
|
72 |
+
<comment>This width,height for FeaturedBrands Images size</comment>
|
73 |
+
</height>
|
74 |
+
|
75 |
+
</fields>
|
76 |
+
</medium>
|
77 |
+
<large translate="label">
|
78 |
+
<label>Large Image Size</label>
|
79 |
+
<frontend_type>text</frontend_type>
|
80 |
+
<sort_order>1</sort_order>
|
81 |
+
<show_in_default>1</show_in_default>
|
82 |
+
<show_in_website>1</show_in_website>
|
83 |
+
<show_in_store>1</show_in_store>
|
84 |
+
<fields>
|
85 |
+
<width translate="label comment">
|
86 |
+
<label>Width</label>
|
87 |
+
<frontend_type>text</frontend_type>
|
88 |
+
<validate>validate-digits</validate>
|
89 |
+
<sort_order>1</sort_order>
|
90 |
+
<show_in_default>1</show_in_default>
|
91 |
+
<show_in_website>1</show_in_website>
|
92 |
+
<show_in_store>1</show_in_store>
|
93 |
+
</width>
|
94 |
+
<height translate="label comment">
|
95 |
+
<label>Height</label>
|
96 |
+
<frontend_type>text</frontend_type>
|
97 |
+
<validate>validate-digits</validate>
|
98 |
+
<sort_order>2</sort_order>
|
99 |
+
<show_in_default>1</show_in_default>
|
100 |
+
<show_in_website>1</show_in_website>
|
101 |
+
<show_in_store>1</show_in_store>
|
102 |
+
<comment>This width,height for Brands Page Images size</comment>
|
103 |
+
</height>
|
104 |
+
</fields>
|
105 |
+
</large>-->
|
106 |
+
<filter>
|
107 |
+
<label>Filters on All Brands Page</label>
|
108 |
+
<frontend_type>text</frontend_type>
|
109 |
+
<sort_order>3</sort_order>
|
110 |
+
<show_in_default>1</show_in_default>
|
111 |
+
<show_in_website>1</show_in_website>
|
112 |
+
<show_in_store>1</show_in_store>
|
113 |
+
<fields>
|
114 |
+
<show_brands_with_az translate="label">
|
115 |
+
<label>Enable A to Z Filter </label>
|
116 |
+
<frontend_type>select</frontend_type>
|
117 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
118 |
+
<sort_order>1</sort_order>
|
119 |
+
<show_in_default>1</show_in_default>
|
120 |
+
<show_in_website>1</show_in_website>
|
121 |
+
<show_in_store>1</show_in_store>
|
122 |
+
<comment>If this is set to yes Brands/Manufacturers shown A to Z filter by default</comment>
|
123 |
+
</show_brands_with_az>
|
124 |
+
<show_brands_with_category translate="label">
|
125 |
+
<label>Enable Category Filter </label>
|
126 |
+
<frontend_type>select</frontend_type>
|
127 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
128 |
+
<sort_order>1</sort_order>
|
129 |
+
<show_in_default>1</show_in_default>
|
130 |
+
<show_in_website>1</show_in_website>
|
131 |
+
<show_in_store>1</show_in_store>
|
132 |
+
<comment>If this is set to yes Brands/Manufacturers shown category filter by default</comment>
|
133 |
+
</show_brands_with_category>
|
134 |
+
<!--<show_brands_with_clearencesale translate="label">
|
135 |
+
<label>Enable Clearence Sale Filter</label>
|
136 |
+
<frontend_type>select</frontend_type>
|
137 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
138 |
+
<sort_order>2</sort_order>
|
139 |
+
<show_in_default>1</show_in_default>
|
140 |
+
<show_in_website>1</show_in_website>
|
141 |
+
<show_in_store>1</show_in_store>
|
142 |
+
<comment>If this is set to yes Brands/Manufacturers shown clearence sale filter by default</comment>
|
143 |
+
</show_brands_with_clearencesale>-->
|
144 |
+
<show_brands_with_logos translate="label">
|
145 |
+
<label>Show Logo's </label>
|
146 |
+
<frontend_type>select</frontend_type>
|
147 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
148 |
+
<sort_order>3</sort_order>
|
149 |
+
<show_in_default>1</show_in_default>
|
150 |
+
<show_in_website>1</show_in_website>
|
151 |
+
<show_in_store>1</show_in_store>
|
152 |
+
<comment>If this is set to yes Brands/Manufacturers shown logos in filter by default</comment>
|
153 |
+
</show_brands_with_logos>
|
154 |
+
</fields>
|
155 |
+
</filter>
|
156 |
+
<importbrands translate="label">
|
157 |
+
<label>Import Brands</label>
|
158 |
+
<frontend_type>text</frontend_type>
|
159 |
+
<sort_order>1</sort_order>
|
160 |
+
<show_in_default>1</show_in_default>
|
161 |
+
<show_in_website>1</show_in_website>
|
162 |
+
<show_in_store>1</show_in_store>
|
163 |
+
<fields>
|
164 |
+
<import translate="label">
|
165 |
+
<label>Import</label>
|
166 |
+
<frontend_type>import</frontend_type>
|
167 |
+
<backend_model>brand_adminhtml/system_config_backend_brand_branddata</backend_model>
|
168 |
+
<sort_order>40</sort_order>
|
169 |
+
<show_in_default>1</show_in_default>
|
170 |
+
<show_in_website>1</show_in_website>
|
171 |
+
<show_in_store>1</show_in_store>
|
172 |
+
</import>
|
173 |
+
</fields>
|
174 |
+
</importbrands>
|
175 |
+
</groups>
|
176 |
+
</ktreebrand>
|
177 |
+
</sections>
|
178 |
+
</config>
|
app/code/local/Ktree/Brand/sql/brand_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
$installer->run("
|
7 |
+
|
8 |
+
-- DROP TABLE IF EXISTS {$installer->getTable('brand')};
|
9 |
+
|
10 |
+
CREATE TABLE {$installer->getTable('brand')} (
|
11 |
+
|
12 |
+
`brand_id` int(11) unsigned NOT NULL auto_increment,
|
13 |
+
|
14 |
+
`brand_option_id` int(11) NOT NULL default '0',
|
15 |
+
|
16 |
+
`title` varchar(255) NOT NULL default '',
|
17 |
+
|
18 |
+
`filename` varchar(255) NOT NULL default '',
|
19 |
+
|
20 |
+
`is_sale` smallint(6) NOT NULL default '0',
|
21 |
+
|
22 |
+
`sale_label` varchar(255) NOT NULL default '',
|
23 |
+
|
24 |
+
`store_id` varchar(255) NOT NULL default '',
|
25 |
+
|
26 |
+
`content` text NOT NULL default '',
|
27 |
+
|
28 |
+
`status` smallint(6) NOT NULL default '0',
|
29 |
+
|
30 |
+
PRIMARY KEY (`brand_id`)
|
31 |
+
|
32 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
33 |
+
|
34 |
+
DROP TABLE IF EXISTS {$installer->getTable('brand_category')};
|
35 |
+
|
36 |
+
CREATE TABLE {$installer->getTable('brand_category')} (
|
37 |
+
`entity_id` int(10) NOT NULL,
|
38 |
+
`brand_id` int(11) NOT NULL,
|
39 |
+
`brand_category_id` int(11) NOT NULL AUTO_INCREMENT,
|
40 |
+
PRIMARY KEY (`brand_category_id`)
|
41 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
42 |
+
|
43 |
+
");
|
44 |
+
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
|
45 |
+
// adding attribute group
|
46 |
+
$setup->addAttributeGroup('catalog_product', 'Default', 'General', 1000);
|
47 |
+
|
48 |
+
// the attribute added will be displayed under the group/tab Special Attributes in product edit page
|
49 |
+
$setup->addAttribute('catalog_product', 'brand', array(
|
50 |
+
'group' => 'General',
|
51 |
+
'input' => 'select',
|
52 |
+
'type' => 'text',
|
53 |
+
'label' => 'Brand',
|
54 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
55 |
+
'visible' => 1,
|
56 |
+
'required' => 0,
|
57 |
+
'user_defined' => 1,
|
58 |
+
'searchable' => 1,
|
59 |
+
'filterable' => 1,
|
60 |
+
'comparable' => 1,
|
61 |
+
'visible_on_front' => 1,
|
62 |
+
'visible_in_advanced_search' => 0,
|
63 |
+
'is_html_allowed_on_front' => 0,
|
64 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
65 |
+
));
|
66 |
+
|
67 |
+
$installer->endSetup();
|
app/code/local/Ktree/Brand/sql/brand_setup/mysql4-upgrade-0.1.0-1.0.0.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
$installer->run("
|
7 |
+
|
8 |
+
-- DROP TABLE IF EXISTS {$installer->getTable('brand_category')};
|
9 |
+
|
10 |
+
CREATE TABLE {$installer->getTable('brand_category')} (
|
11 |
+
`entity_id` int(10) NOT NULL,
|
12 |
+
`brand_id` int(11) NOT NULL,
|
13 |
+
`brand_category_id` int(11) NOT NULL AUTO_INCREMENT,
|
14 |
+
PRIMARY KEY (`brand_category_id`)
|
15 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
16 |
+
|
17 |
+
");
|
18 |
+
|
19 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/brand.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="1.0.0">
|
3 |
+
<brand_adminhtml_brand_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="brand/adminhtml_brand" name="brand" />
|
6 |
+
</reference>
|
7 |
+
</brand_adminhtml_brand_index>
|
8 |
+
</layout>
|
app/design/frontend/base/default/layout/brand.xml
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addCss"><stylesheet>css/ktree/style.css</stylesheet></action>
|
6 |
+
<action method="addJs"><script>brand/jquery-1.7.2.min.js</script></action>
|
7 |
+
<action method="addJs"><script>brand/noconflict.js</script></action>
|
8 |
+
<action method="addJs"><script>brand/smoothdivscroll/jquery.mousewheel.min.js</script></action>
|
9 |
+
<action method="addJs"><script>brand/smoothdivscroll/jquery-ui-1.8.23.custom.min.js</script></action>
|
10 |
+
<action method="addJs"><script>brand/smoothdivscroll/jquery.kinetic.js</script></action>
|
11 |
+
<!--<action method="addJs"><script>brand/smoothdivscroll/jquery.smoothDivScroll-1.3.js</script></action>-->
|
12 |
+
<action method="addJs"><script>brand/smoothdivscroll/jquery.smoothdivscroll-1.3-min.js</script></action>
|
13 |
+
<action method="addJs"><script>brand/jquery.easing.1.3.js</script></action>
|
14 |
+
<!--<action method="addJs"><script>brand/jquery.contentcarousel.js</script></action>-->
|
15 |
+
<action method="addJs"><script>brand/brand.js</script></action>
|
16 |
+
</reference>
|
17 |
+
<reference name="footer_links">
|
18 |
+
<!-- Add custom links. Pretty self-explanatory.
|
19 |
+
Dig into app/code/core/Mage/Page/Block/Template/Links.php for more info -->
|
20 |
+
<action method="addLink" translate="label title">
|
21 |
+
<label>Brands</label>
|
22 |
+
<url>brand</url>
|
23 |
+
<prepare>true</prepare>
|
24 |
+
</action>
|
25 |
+
</reference>
|
26 |
+
<reference name="root">
|
27 |
+
<action method="setTemplate">
|
28 |
+
<template>page/3columns.phtml</template>
|
29 |
+
</action>
|
30 |
+
|
31 |
+
</reference>
|
32 |
+
</default>
|
33 |
+
<brand_index_index>
|
34 |
+
<reference name="root">
|
35 |
+
<action method="setTemplate">
|
36 |
+
<template>page/1column.phtml</template>
|
37 |
+
</action>
|
38 |
+
</reference>
|
39 |
+
<reference name="content">
|
40 |
+
<!--<block type="brand/brand" name="brand-featured" template="brand/featuredbrands.phtml"/>-->
|
41 |
+
<block type="brand/brand" name="brand-index" template="brand/brands.phtml"/>
|
42 |
+
<block type="brand/brand" name="featuredbrands" template="brand/featuredbrands.phtml"/>
|
43 |
+
</reference>
|
44 |
+
</brand_index_index>
|
45 |
+
<brand_index_view>
|
46 |
+
<reference name="root">
|
47 |
+
<action method="setTemplate">
|
48 |
+
<template>page/2columns-left.phtml</template>
|
49 |
+
</action>
|
50 |
+
</reference>
|
51 |
+
<reference name="left">
|
52 |
+
<block type="catalog/layer_view" name="catalog.layer_view" after="currency" template="catalog/layer/view.phtml"/>
|
53 |
+
|
54 |
+
<!--block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/-->
|
55 |
+
<block type="reports/product_viewed" name="left.reports.product.viewed" template="reports/product_viewed.phtml" />
|
56 |
+
<block type="checkout/cart_sidebar" after="product_viewed" name="cart_sidebar" template="checkout/cart/sidebar.phtml">
|
57 |
+
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
|
58 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
|
59 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
|
60 |
+
<block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions"/>
|
61 |
+
</block>
|
62 |
+
<block type="catalog/product_compare_sidebar" after="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
|
63 |
+
</reference>
|
64 |
+
<reference name="content">
|
65 |
+
<block type="brand/brandinfo" name="brandinfo" template="brand/brand_info.phtml"/>
|
66 |
+
<block type="brand/onbrand" name="onbrand" template="catalog/product/list.phtml">
|
67 |
+
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
|
68 |
+
<block type="page/html_pager" name="product_list_toolbar_pager"/>
|
69 |
+
</block>
|
70 |
+
<action method="setColumnCount">
|
71 |
+
<columns>3</columns>
|
72 |
+
</action>
|
73 |
+
<action method="setToolbarBlockName">
|
74 |
+
<name>product_list_toolbar</name>
|
75 |
+
</action>
|
76 |
+
</block>
|
77 |
+
</reference>
|
78 |
+
</brand_index_view>
|
79 |
+
<brand_index_viewcategory>
|
80 |
+
<reference name="root">
|
81 |
+
<action method="setTemplate">
|
82 |
+
<template>page/3columns.phtml</template>
|
83 |
+
</action>
|
84 |
+
</reference>
|
85 |
+
<reference name="left">
|
86 |
+
<block type="brand/brandcategories" name="brandcategories" template="brand/brand_categories.phtml"/>
|
87 |
+
<block type="catalog/layer_view" name="catalog.layer_view" after="currency" template="catalog/layer/view.phtml"/>
|
88 |
+
<block type="catalog/product_compare_sidebar" after="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
|
89 |
+
</reference>
|
90 |
+
<reference name="content">
|
91 |
+
|
92 |
+
<block type="brand/brandinfo" name="brandinfo" template="brand/brand_info.phtml"/>
|
93 |
+
<block type="brand/onbrandcategory" name="onbrandcategory" template="catalog/product/list.phtml">
|
94 |
+
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
|
95 |
+
<block type="page/html_pager" name="product_list_toolbar_pager"/>
|
96 |
+
</block>
|
97 |
+
<action method="setColumnCount">
|
98 |
+
<columns>3</columns>
|
99 |
+
</action>
|
100 |
+
<action method="setToolbarBlockName">
|
101 |
+
<name>product_list_toolbar</name>
|
102 |
+
</action>
|
103 |
+
</block>
|
104 |
+
</reference>
|
105 |
+
</brand_index_viewcategory>
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
<catalog_category_default>
|
110 |
+
<!--<reference name="left">
|
111 |
+
<block type="brand/category" name="brandcategory" template="brand/categorybrand.phtml"/>
|
112 |
+
</reference>-->
|
113 |
+
</catalog_category_default>
|
114 |
+
<brand_category_viewproducts>
|
115 |
+
<reference name="left">
|
116 |
+
<block type="brand/brandcategories" name="brandcategories" template="brand/brand_categories.phtml"/>
|
117 |
+
<block type="catalog/layer_view" name="catalog.layer_view" after="currency" template="catalog/layer/view.phtml"/>
|
118 |
+
<block type="catalog/product_compare_sidebar" after="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
|
119 |
+
</reference>
|
120 |
+
<reference name="content">
|
121 |
+
<block type="brand/onbrandcategory" name="onbrandcategoryproducts" template="catalog/product/list.phtml">
|
122 |
+
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
|
123 |
+
<block type="page/html_pager" name="product_list_toolbar_pager"/>
|
124 |
+
</block>
|
125 |
+
<action method="setColumnCount">
|
126 |
+
<columns>3</columns>
|
127 |
+
</action>
|
128 |
+
<action method="setToolbarBlockName">
|
129 |
+
<name>product_list_toolbar</name>
|
130 |
+
</action>
|
131 |
+
</block>
|
132 |
+
</reference>
|
133 |
+
</brand_category_viewproducts>
|
134 |
+
</layout>
|
app/design/frontend/base/default/template/brand/brand_categories.phtml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style>
|
2 |
+
<!--.brand-categories{
|
3 |
+
border:2px solid #a1a1a1;
|
4 |
+
|
5 |
+
background:#dddddd;
|
6 |
+
|
7 |
+
}-->
|
8 |
+
.cats-in-brand ul li ul { display: none; }
|
9 |
+
</style>
|
10 |
+
<?php
|
11 |
+
$items = $this->brandCategories();
|
12 |
+
?>
|
13 |
+
<div class="brand-categories">
|
14 |
+
|
15 |
+
<div class="block-title">
|
16 |
+
<strong><span>Categories In Brand</span></strong>
|
17 |
+
</div>
|
18 |
+
<?php //print_r($items); ?>
|
19 |
+
<?php foreach($items as $item){
|
20 |
+
$_categoryid[] =$item['entity_id'];
|
21 |
+
$brandid=$item['brand_id'];
|
22 |
+
}
|
23 |
+
?>
|
24 |
+
|
25 |
+
<?php $_helper = Mage::helper('catalog/category') ?>
|
26 |
+
<?php $_categories = $_helper->getStoreCategories() ?>
|
27 |
+
<ul class="cats-in-brand">
|
28 |
+
<?php foreach ($_categories as $_category):?>
|
29 |
+
<li>+
|
30 |
+
<?php if(in_array($_category->getId(),$_categoryid)){ ?>
|
31 |
+
<a href="<?php echo Mage::getBaseUrl()?>brand/index/viewcategory/?brand=<?php echo $brandid; ?>&category_id=<?php echo $_category->getId(); ?>"><?php echo strtoupper($_category->getName())?></a>
|
32 |
+
<?php } else { ?>
|
33 |
+
<?php echo strtoupper($_category->getName())?>
|
34 |
+
<?php } ?>
|
35 |
+
|
36 |
+
<?
|
37 |
+
$output = $this->drawChildren($_category,$brandid);
|
38 |
+
echo $output;
|
39 |
+
?>
|
40 |
+
</li>
|
41 |
+
<?php endforeach?>
|
42 |
+
</ul>
|
43 |
+
</div>
|
44 |
+
<?php ?>
|
45 |
+
<script>
|
46 |
+
jQuery('.cats-in-brand li').click(function(e){
|
47 |
+
jQuery(this).children('ul').slideToggle();
|
48 |
+
e.stopPropagation();
|
49 |
+
});
|
50 |
+
</script>
|
51 |
+
|
52 |
+
|
app/design/frontend/base/default/template/brand/brand_info.phtml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$items = $this->brandInfo();
|
3 |
+
//$breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
|
4 |
+
|
5 |
+
//$breadcrumbs->addCrumb('home', array('label' => Mage::helper('cms')->__('Home'), 'title' => Mage::helper('cms')->__('Home Page'), 'link' => Mage::getBaseUrl()));
|
6 |
+
|
7 |
+
//$breadcrumbs->addCrumb('country', array('label' => Mage::helper('brand')->__('All Brands'), 'title' => Mage::helper('brand')->__('All Brands'), 'link' => Mage::getBaseUrl() . 'brand/index'));
|
8 |
+
|
9 |
+
//$breadcrumbs->addCrumb('brand', array('label' => preg_replace("/%20/", " ", Mage::app()->getRequest()->getParam('brandname')), 'title' => preg_replace("/%20/", " ", Mage::app()->getRequest()->getParam('brandname'))));
|
10 |
+
|
11 |
+
//echo $this->getLayout()->getBlock('breadcrumbs')->toHtml();?>
|
12 |
+
<?php foreach($items as $item){ ?>
|
13 |
+
<?php if($item!= NULL){?>
|
14 |
+
<?php $image= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."brand/".$item['filename'] ?>
|
15 |
+
<?php if ($image):
|
16 |
+
?>
|
17 |
+
<span>
|
18 |
+
<strong><?php echo $item['title'] ?></strong>
|
19 |
+
<div class="brand_info"><img src="<?php echo $image ?>" alt="<?php echo $item['title'] ?>"/>
|
20 |
+
<div class="brand_content"><?php echo $item['content'];?></div>
|
21 |
+
</div>
|
22 |
+
<?php
|
23 |
+
else:
|
24 |
+
$image = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'brand/no_image_available.jpg';?>
|
25 |
+
<div class="brand_info"><img src="<?php echo $image; ?>" alt="<?php echo $item['title'] ?>"/>
|
26 |
+
<div class="brand_content"><?php echo $item['content'];?></div>
|
27 |
+
</div>
|
28 |
+
<?php endif;
|
29 |
+
?><?php }?>
|
30 |
+
<?php }?>
|
31 |
+
|
app/design/frontend/base/default/template/brand/brands.phtml
ADDED
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<?php
|
3 |
+
?>
|
4 |
+
<style>
|
5 |
+
ul.cat-brands li ul { display: none; }
|
6 |
+
</style>
|
7 |
+
<div id="whole_most_prod">
|
8 |
+
<div class="most_prod_cont">
|
9 |
+
<div class="brand_block">
|
10 |
+
<div class="navigation_b" >
|
11 |
+
<p class="title">Filter brands by:
|
12 |
+
<span <?php if(Mage::getStoreConfig('ktreebrand/filter/show_brands_with_az') == 1){?>id="alphabet_filter" style="padding:5px;background:#DDD;margin-left:10px; margin-right:10px;">Alphabet
|
13 |
+
<?php } ?></span>
|
14 |
+
<span <?php if(Mage::getStoreConfig('ktreebrand/filter/show_brands_with_category') == 1){?> id="category_filter" style="padding:5px;background:#DDD;margin-left:10px; margin-right:10px;">Category
|
15 |
+
<?php } ?> </span>
|
16 |
+
<!-- <span <?php if(Mage::getStoreConfig('ktreebrand/filter/show_brands_with_clearencesale') == 1){?> id="sales" style="padding:5px;background:#DDD;;margin-left:10px; margin-right:10px;cursor:hand;" >Clearence Sale
|
17 |
+
<?php } ?> </span></p>-->
|
18 |
+
|
19 |
+
<div id="alphabet_content" style="display:none;">
|
20 |
+
<?php //echo Mage::helper("brand")->__("All Brands") ?></h3>
|
21 |
+
<ul class="navigation_char">
|
22 |
+
<?php echo $this->navigation() ?>
|
23 |
+
</ul>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<div id="category_content" style="padding-left:170px;display:none;">
|
27 |
+
|
28 |
+
<?php //echo $this->getBrandCategoryIds();
|
29 |
+
$loder=$this->getSkinUrl('css/images/ajax_loader.gif');
|
30 |
+
// print_r($this->getBrandCategoryIds());
|
31 |
+
/* echo "<ul id='category'>";
|
32 |
+
foreach($this->getBrandCategoryIds() as $id){
|
33 |
+
|
34 |
+
echo '<li id="'.$id.'"><a href="#">'.Mage::getModel('catalog/category')->load($id)->getName().'</a><span id="loader_'.$id.'" style="display:none"><img src="'.$loder.'"/></span></li>';
|
35 |
+
|
36 |
+
}echo "</ul>"; */
|
37 |
+
?>
|
38 |
+
<?php $_helper = Mage::helper('catalog/category') ?>
|
39 |
+
<?php $_categories = $_helper->getStoreCategories() ?>
|
40 |
+
<?php $brandcats=$this->getBrandCategoryIds(); ?>
|
41 |
+
<ul class="cat-brands">
|
42 |
+
<?php foreach ($_categories as $_category):?>
|
43 |
+
|
44 |
+
<?php if(in_array($_category->getId(),$brandcats)){ ?>
|
45 |
+
<li id="<?php echo $_category->getId() ?>">
|
46 |
+
<!--<a href="<?php echo Mage::getBaseUrl()?>brand/index/viewcategory/?brand=<?php echo $brandid; ?>&category_id=<?php echo $_category->getId(); ?>"><?php echo strtoupper($_category->getName())?></a>-->
|
47 |
+
<?php echo '<a href="#" id="'.$_category->getId().'">'.$_category->getName().'</a><span id="loader_'.$_category->getId().'" style="display:none"><img src="'.$loder.'"/></span>'; ?>
|
48 |
+
|
49 |
+
<?php } else { ?>
|
50 |
+
<li>
|
51 |
+
<?php echo strtoupper($_category->getName())?>
|
52 |
+
|
53 |
+
<?php } ?>
|
54 |
+
|
55 |
+
<?
|
56 |
+
$output = $this->drawChildren($_category,$brandcats);
|
57 |
+
echo $output;
|
58 |
+
?>
|
59 |
+
</li>
|
60 |
+
<?php endforeach?>
|
61 |
+
</ul>
|
62 |
+
|
63 |
+
</div>
|
64 |
+
|
65 |
+
</div>
|
66 |
+
</div>
|
67 |
+
<br/> <br/>
|
68 |
+
|
69 |
+
<?php $items = $this->getItems() ?>
|
70 |
+
<div id="content_sale" class="content_sale" style="display:none;">
|
71 |
+
<?php echo "<h2>Sales On Brands</h2>"?>
|
72 |
+
<ul>
|
73 |
+
|
74 |
+
<?php foreach($this->getClearanceSales() as $sale){?>
|
75 |
+
<li>
|
76 |
+
<?php if(Mage::getStoreConfig('ktreebrand/filter/show_brands_with_logos') == 1){?>
|
77 |
+
<?php $image = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."brand/".$sale['filename'] ?>
|
78 |
+
<a href="<?php echo Mage::getBaseUrl()?>brand/index/view/brand/<?php echo $sale['brand_option_id']?>/?brandname=<?php echo $sale['title']?>"><img src="<?php echo $image?>"></a><?php }else{ ?><a href="<?php echo Mage::getBaseUrl()?>brand/index/view/brand/<?php echo $sale['brand_option_id']?>/?brandname=<?php echo $sale['title']?>"><?php echo $sale['title']?></a><?php } ?>
|
79 |
+
</br><?php echo $sale['sale_label']?>
|
80 |
+
|
81 |
+
</li>
|
82 |
+
<?php } ?>
|
83 |
+
</ul>
|
84 |
+
</div>
|
85 |
+
<div id="content1" class="content1" style="font-weight:bold;text-align:center;color:#464646; font-size: 18px;padding-top:20px;"></div>
|
86 |
+
<div id="content2" style="display:none;" >
|
87 |
+
Category Brands Content
|
88 |
+
</div>
|
89 |
+
<div id="content" class="content">
|
90 |
+
<?php if ($items): ?>
|
91 |
+
<?php $width = floor(100/count($items)) ?>
|
92 |
+
|
93 |
+
<?php foreach ($items as $letters): ?>
|
94 |
+
|
95 |
+
<?php foreach ($letters as $letter => $options): ?>
|
96 |
+
<div class="brand-directory-category_<?php echo $letter;?>" style="float:left; width:100%; list-style-type: none;">
|
97 |
+
<dl>
|
98 |
+
<dt><?php echo $letter ?></dt>
|
99 |
+
<dd>
|
100 |
+
<ul class="bare-list">
|
101 |
+
<?php foreach ($options as $o): ?>
|
102 |
+
<?php $stores=explode(",",$o['store_id']);
|
103 |
+
$currentStoreId = Mage::app()->getStore()->getId();
|
104 |
+
if(in_array($currentStoreId, $stores) || in_array(0, $stores)) {
|
105 |
+
?>
|
106 |
+
<li>
|
107 |
+
<?php if(Mage::getStoreConfig('ktreebrand/filter/show_brands_with_logos') == 0){?>
|
108 |
+
<?php echo '<a href="' . Mage::getBaseUrl() . 'brand/index/view/brand/' . $o['brand_option_id'] . '/?brandname=' . $o['title'] . '">' . $o['title'] . '</a>';?>
|
109 |
+
<?php }else {?><?php echo $o['title'] ?>
|
110 |
+
<a href="<?php echo Mage::getBaseUrl() ?>brand/index/view/brand/<?php echo $o['brand_option_id'] ?>/?brandname=<?php echo $o['title'] ?>">
|
111 |
+
<?php
|
112 |
+
if($o['filename']){
|
113 |
+
$image1= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'brand/'.$o['filename'];
|
114 |
+
} else {
|
115 |
+
$image1= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'brand/no_image_available.jpg';
|
116 |
+
}
|
117 |
+
?>
|
118 |
+
|
119 |
+
<img src="<?php echo $image1 ?>" alt="<?php echo $o['title'] ?>" height="100"/><br><br>
|
120 |
+
</a><?php }?>
|
121 |
+
</li>
|
122 |
+
<?php } endforeach ?>
|
123 |
+
</ul>
|
124 |
+
</dd>
|
125 |
+
</dl>
|
126 |
+
</div>
|
127 |
+
<?php endforeach ?>
|
128 |
+
|
129 |
+
<?php endforeach ?>
|
130 |
+
<?php endif ?>
|
131 |
+
</div>
|
132 |
+
<div class="brand_list">
|
133 |
+
<ul class="brand_normal">
|
134 |
+
<?php
|
135 |
+
|
136 |
+
/*$collection = $this->getBrandChar();
|
137 |
+
$noItem = $collection->count();
|
138 |
+
if ($noItem > 12)
|
139 |
+
$column = 4;
|
140 |
+
elseif ($noItem <= 12 && $noItem > 8)
|
141 |
+
$column = 2;
|
142 |
+
elseif ($noItem <= 8 && $noItem > 4)
|
143 |
+
$column = 3;
|
144 |
+
else
|
145 |
+
$column = 1;
|
146 |
+
$itemEachColumn = floor($noItem / $column);
|
147 |
+
$firstColumn = $itemEachColumn + $noItem % $column;
|
148 |
+
$itemCount = 1;
|
149 |
+
$column1 = '<div class="column1">';
|
150 |
+
$column2 = '<div class="column2">';
|
151 |
+
$column3 = '<div class="column3">';
|
152 |
+
$column4 = '<div class="column4">';
|
153 |
+
|
154 |
+
foreach ($collection as $brand):
|
155 |
+
|
156 |
+
$item = '<li>
|
157 |
+
<a href="' . Mage::getBaseUrl() . 'brand/index/view/brand/' . $brand['option_id'] . '/?brandname=' . $brand['value'] . '">' . $brand['value'] . '</a>
|
158 |
+
</li>';
|
159 |
+
if ($itemCount <= $firstColumn)
|
160 |
+
$column1 .= $item;
|
161 |
+
elseif ($itemCount <= ($firstColumn + $itemEachColumn) && $itemCount > $firstColumn)
|
162 |
+
$column2 .=$item;
|
163 |
+
elseif ($itemCount <= ($firstColumn + $itemEachColumn * 2) && $itemCount > $firstColumn + $itemColum)
|
164 |
+
$column3 .=$item;
|
165 |
+
else
|
166 |
+
$column4 .=$item;
|
167 |
+
$itemCount++;
|
168 |
+
endforeach;
|
169 |
+
echo $column1 . "</div>" . $column2 . "</div>" . $column3 . "</div>" . $column4 . "</div>";
|
170 |
+
*/?>
|
171 |
+
</ul>
|
172 |
+
</div>
|
173 |
+
</div>
|
174 |
+
</div>
|
175 |
+
|
app/design/frontend/base/default/template/brand/categorybrand.phtml
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
?>
|
3 |
+
<div id="whole_most_prod">
|
4 |
+
<div class="most_prod_hd"><img src="<?php echo $this->getSkinUrl()?>/images/most_prod_box_hd_left.jpg" class="floatLeft"><img src="<?php echo Mage::getBaseUrl()?>skin/frontend/default/patronstore/images/most_prod_box_hd_right.jpg" class="floatRight"></div>
|
5 |
+
<div class="most_prod_cont">
|
6 |
+
<h1>Featured Brands</h1>
|
7 |
+
<?php $_category = Mage::registry('current_category');
|
8 |
+
$categoryId = $_category->getId();
|
9 |
+
$categoryBrands = $this->getBrandCategories($categoryId);
|
10 |
+
foreach($categoryBrands as $brand):?>
|
11 |
+
<div class="most_prod_row">
|
12 |
+
<div class="mstprod_eabox line_mprd">
|
13 |
+
<a title="<?php echo $brand['title']?>" rel="<?php echo $this->getBaseUrl()?>brand/category/viewproducts/?brand=<?php echo $brand['brand_id']?>&category_id=<?php echo $categoryId ?>" id="<?php echo $brand['brand_id']?>-<?php echo $categoryId ?>" class="category-brand">
|
14 |
+
<?php echo $brand['title']?>
|
15 |
+
</a>
|
16 |
+
</div>
|
17 |
+
<div class="clear"></div>
|
18 |
+
</div>
|
19 |
+
<?php endforeach ?>
|
20 |
+
</div>
|
21 |
+
<div class="most_prod_ft"><img src="<?php echo $this->getSkinUrl()?>/images/most_prod_box_ft_left.jpg" class="floatLeft"><img src="<?php echo Mage::getBaseUrl()?>skin/frontend/default/patronstore/images/most_prod_box_ft_right.jpg" class="floatRight"></div>
|
22 |
+
</div>
|
23 |
+
<script>
|
24 |
+
jQuery('.category-brand').click(function(){
|
25 |
+
var url=jQuery(this).attr('rel');
|
26 |
+
var ids=jQuery(this).attr('id');
|
27 |
+
var id=ids.split("-");
|
28 |
+
var brand=id['0'];
|
29 |
+
var category_id=id['1'];
|
30 |
+
var data="brand="+brand+"&category_id="+category_id;
|
31 |
+
data += '&isAjax=1';
|
32 |
+
|
33 |
+
jQuery.ajax({
|
34 |
+
url: url,
|
35 |
+
dataType: 'json',
|
36 |
+
type : 'post',
|
37 |
+
data: data,
|
38 |
+
success: function(data){
|
39 |
+
if(data.productlist){
|
40 |
+
jQuery('.category-products').empty();
|
41 |
+
jQuery('.category-products').append(data.productlist);
|
42 |
+
}
|
43 |
+
|
44 |
+
}
|
45 |
+
});
|
46 |
+
|
47 |
+
|
48 |
+
});
|
49 |
+
</script>
|
app/design/frontend/base/default/template/brand/featured.phtml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="brand_logo_container">
|
2 |
+
<h3><?php echo $this->__('Featured Brands') ?></h3>
|
3 |
+
<?php $i = 1;
|
4 |
+
foreach ($this->getFeaturedBrand() as $item): ?>
|
5 |
+
<div class="featured_brand <?php if ($i % 4 == 0)
|
6 |
+
echo 'no-margin' ?>">
|
7 |
+
<?php $image= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'brand/'.$item['filename']?>
|
8 |
+
|
9 |
+
<a href="<?php echo Mage::getBaseUrl() ?>brand/index/view/brand/<?php echo $item['brand_option_id'] ?>/?brandname=<?php echo $item['title'] ?>">
|
10 |
+
<img src="<?php echo $image ?>"
|
11 |
+
alt="<?php echo $item['title'] ?>"/>
|
12 |
+
</a>
|
13 |
+
<span>
|
14 |
+
<strong><?php echo $item['title'] ?></strong>
|
15 |
+
<h4><?php// echo $item['content'] ?></h4>
|
16 |
+
</span>
|
17 |
+
</div>
|
18 |
+
<?php $i++;
|
19 |
+
endforeach; ?>
|
20 |
+
</div>
|
app/design/frontend/base/default/template/brand/featuredbrands.phtml
ADDED
@@ -0,0 +1,276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<link rel="Stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/ktree/smoothDivScroll.css');?>">
|
2 |
+
<h3><?php echo $this->__('Featured Brands') ?></h3>
|
3 |
+
<div id="makeMeScrollable">
|
4 |
+
|
5 |
+
<?php $i = 1;
|
6 |
+
foreach ($this->getFeaturedBrand() as $item): ?>
|
7 |
+
<?php if($item['filename']) {
|
8 |
+
$image= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'brand/'.$item['filename'];
|
9 |
+
} else {
|
10 |
+
$image = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'brand/no_image_available.jpg';
|
11 |
+
}
|
12 |
+
?>
|
13 |
+
<div class="featured_brand <?php if ($i % 4 == 0)
|
14 |
+
echo 'no-margin' ?>">
|
15 |
+
|
16 |
+
<a href="<?php echo Mage::getBaseUrl() ?>brand/index/view/brand/<?php echo $item['brand_option_id'] ?>/?brandname=<?php echo $item['title'] ?>">
|
17 |
+
<img src="<?php echo $image ?>"
|
18 |
+
alt="<?php echo $item['title'] ?>"/>
|
19 |
+
</a>
|
20 |
+
</div>
|
21 |
+
<?php $i++;
|
22 |
+
endforeach; ?>
|
23 |
+
</div>
|
24 |
+
|
25 |
+
<script type="text/javascript">
|
26 |
+
jQuery(document).ready(function () {
|
27 |
+
jQuery('#makeMeScrollable').smoothDivScroll();
|
28 |
+
});
|
29 |
+
</script>
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
<!--
|
35 |
+
<?php
|
36 |
+
/**
|
37 |
+
* Manufacturers extension
|
38 |
+
*
|
39 |
+
* NOTICE OF LICENSE
|
40 |
+
*
|
41 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
42 |
+
* that is bundled with this package in the file LICENSE.txt.
|
43 |
+
* It is also available through the world-wide-web at this URL:
|
44 |
+
* http://opensource.org/licenses/osl-3.0.php
|
45 |
+
*
|
46 |
+
* @category FME
|
47 |
+
* @package Manufacturers
|
48 |
+
* @author Kamran Rafiq Malik <kamran.malik@unitedsol.net>
|
49 |
+
* @copyright Copyright 2010 � free-magentoextensions.com All right reserved
|
50 |
+
*/
|
51 |
+
?>
|
52 |
+
<?php $collection = $this->getFeaturedBrand(); ?>
|
53 |
+
|
54 |
+
<?php
|
55 |
+
if(!empty($collection)) {
|
56 |
+
|
57 |
+
?>
|
58 |
+
|
59 |
+
<html>
|
60 |
+
<head>
|
61 |
+
<link rel="Stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/smoothDivScroll.css');?>">
|
62 |
+
<style type="text/css">
|
63 |
+
|
64 |
+
#makeMeScrollable
|
65 |
+
{
|
66 |
+
width:100%;
|
67 |
+
height:175px;
|
68 |
+
position: relative;
|
69 |
+
|
70 |
+
}
|
71 |
+
|
72 |
+
#makeMeScrollable div.scrollableArea img
|
73 |
+
{
|
74 |
+
position: relative;
|
75 |
+
float: left;
|
76 |
+
margin: 0;
|
77 |
+
padding: 0;
|
78 |
+
|
79 |
+
}
|
80 |
+
#ca-container3 .ca-item {
|
81 |
+
height: 67px !important;
|
82 |
+
width: auto !important;
|
83 |
+
}
|
84 |
+
#ca-container3.ca-container{
|
85 |
+
height: 67px !important;
|
86 |
+
}
|
87 |
+
#dhtmlgoodies_slideshow {
|
88 |
+
height: 100px;
|
89 |
+
margin: 0 auto;
|
90 |
+
width: 1024px;
|
91 |
+
}
|
92 |
+
#galleryContainer {
|
93 |
+
height: 100px;
|
94 |
+
overflow: hidden;
|
95 |
+
position: relative;
|
96 |
+
}
|
97 |
+
#theImages {
|
98 |
+
height: 1000px;
|
99 |
+
left: 40px;
|
100 |
+
position: absolute;
|
101 |
+
top: 10px !important;
|
102 |
+
width: 10000px;
|
103 |
+
}#theImages #slideEnd {
|
104 |
+
float: left;
|
105 |
+
}
|
106 |
+
#galleryContainer #theImages a img {
|
107 |
+
margin: 0px 3px;
|
108 |
+
border: solid 1px #eaeaea;
|
109 |
+
padding: 2px;
|
110 |
+
opacity:1 !important;
|
111 |
+
}
|
112 |
+
|
113 |
+
</style>
|
114 |
+
<script>
|
115 |
+
// Logo slide show
|
116 |
+
var displayWaitMessage=true; // Display a please wait message while images are loading?
|
117 |
+
|
118 |
+
|
119 |
+
var activeImage = false;
|
120 |
+
var imageGalleryLeftPos = false;
|
121 |
+
var imageGalleryWidth = false;
|
122 |
+
var imageGalleryObj = false;
|
123 |
+
var maxGalleryXPos = false;
|
124 |
+
var slideSpeed = -1;
|
125 |
+
var imageGalleryCaptions = new Array();
|
126 |
+
function startSlide(e)
|
127 |
+
{
|
128 |
+
if(document.all)e = event;
|
129 |
+
var id = this.id;
|
130 |
+
if(this.id=='arrow_right'){
|
131 |
+
slideSpeedMultiply = Math.floor((e.clientX - this.offsetLeft) / 5);
|
132 |
+
slideSpeed = -1*slideSpeedMultiply;
|
133 |
+
slideSpeed = Math.max(-10,slideSpeed);
|
134 |
+
}else{
|
135 |
+
slideSpeedMultiply = 10 - Math.floor((e.clientX - this.offsetLeft) / 5);
|
136 |
+
slideSpeed = 1*slideSpeedMultiply;
|
137 |
+
slideSpeed = Math.min(10,slideSpeed);
|
138 |
+
if(slideSpeed<0)slideSpeed=10;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
function releaseSlide()
|
143 |
+
{
|
144 |
+
var id = this.id;
|
145 |
+
slideSpeed=-1;
|
146 |
+
}
|
147 |
+
|
148 |
+
function gallerySlide()
|
149 |
+
{
|
150 |
+
if(slideSpeed!=0){
|
151 |
+
var leftPos = imageGalleryObj.offsetLeft;
|
152 |
+
leftPos = leftPos/1 + slideSpeed;
|
153 |
+
if(leftPos>maxGalleryXPos){
|
154 |
+
leftPos = maxGalleryXPos;
|
155 |
+
slideSpeed = 0;
|
156 |
+
|
157 |
+
}
|
158 |
+
if(leftPos<minGalleryXPos){
|
159 |
+
leftPos = minGalleryXPos;
|
160 |
+
slideSpeed=0;
|
161 |
+
}
|
162 |
+
|
163 |
+
imageGalleryObj.style.left = leftPos + 'px';
|
164 |
+
}
|
165 |
+
setTimeout('gallerySlide()',50);
|
166 |
+
|
167 |
+
}
|
168 |
+
|
169 |
+
function showImage()
|
170 |
+
{
|
171 |
+
if(activeImage){
|
172 |
+
activeImage.style.filter = 'alpha(opacity=50)';
|
173 |
+
activeImage.style.opacity = 0.5;
|
174 |
+
}
|
175 |
+
this.style.filter = 'alpha(opacity=100)';
|
176 |
+
this.style.opacity = 1;
|
177 |
+
activeImage = this;
|
178 |
+
}
|
179 |
+
|
180 |
+
function initSlideShow()
|
181 |
+
{
|
182 |
+
document.getElementById('arrow_left').onmousedown = startSlide;
|
183 |
+
document.getElementById('arrow_left').onmouseup = releaseSlide;
|
184 |
+
document.getElementById('arrow_right').onmousedown = startSlide;
|
185 |
+
document.getElementById('arrow_right').onmouseup = releaseSlide;
|
186 |
+
|
187 |
+
|
188 |
+
imageGalleryObj = document.getElementById('theImages');
|
189 |
+
imageGalleryLeftPos = imageGalleryObj.offsetLeft;
|
190 |
+
imageGalleryWidth = document.getElementById('galleryContainer').offsetWidth - 80;
|
191 |
+
maxGalleryXPos = imageGalleryObj.offsetLeft;
|
192 |
+
minGalleryXPos = imageGalleryWidth - document.getElementById('slideEnd').offsetLeft;
|
193 |
+
var slideshowImages = imageGalleryObj.getElementsByTagName('IMG');
|
194 |
+
for(var no=0;no<slideshowImages.length;no++){
|
195 |
+
slideshowImages[no].onmouseover = showImage;
|
196 |
+
}
|
197 |
+
|
198 |
+
var divs = imageGalleryObj.getElementsByTagName('DIV');
|
199 |
+
for(var no=0;no<divs.length;no++){
|
200 |
+
if(divs[no].className=='imageCaption')imageGalleryCaptions[imageGalleryCaptions.length] = divs[no].innerHTML;
|
201 |
+
}
|
202 |
+
gallerySlide();
|
203 |
+
}
|
204 |
+
|
205 |
+
function showPreview(imagePath,imageIndex){
|
206 |
+
var subImages = document.getElementById('previewPane').getElementsByTagName('IMG');
|
207 |
+
if(subImages.length==0){
|
208 |
+
var img = document.createElement('IMG');
|
209 |
+
document.getElementById('previewPane').appendChild(img);
|
210 |
+
}else img = subImages[0];
|
211 |
+
|
212 |
+
if(displayWaitMessage){
|
213 |
+
document.getElementById('waitMessage').style.display='inline';
|
214 |
+
}
|
215 |
+
document.getElementById('largeImageCaption').style.display='none';
|
216 |
+
img.onload = function() { hideWaitMessageAndShowCaption(imageIndex-1); };
|
217 |
+
img.src = imagePath;
|
218 |
+
|
219 |
+
}
|
220 |
+
function hideWaitMessageAndShowCaption(imageIndex)
|
221 |
+
{
|
222 |
+
document.getElementById('waitMessage').style.display='none';
|
223 |
+
document.getElementById('largeImageCaption').innerHTML = imageGalleryCaptions[imageIndex];
|
224 |
+
document.getElementById('largeImageCaption').style.display='block';
|
225 |
+
|
226 |
+
}
|
227 |
+
window.onload = initSlideShow;
|
228 |
+
</script>
|
229 |
+
</head>
|
230 |
+
|
231 |
+
<body>
|
232 |
+
<div id='dhtmlgoodies_slideshow'>
|
233 |
+
<div id="galleryContainer" class="ca-container">
|
234 |
+
<div id="arrow_left"></div>
|
235 |
+
<div id="arrow_right"></div>
|
236 |
+
<div id="theImages">
|
237 |
+
|
238 |
+
<?php $i=0; foreach ( $collection as $_feaManufacturers ) :
|
239 |
+
if ($i < 15) {
|
240 |
+
|
241 |
+
?>
|
242 |
+
<?php
|
243 |
+
if($_feaManufacturers["filename"] != "") {
|
244 |
+
$imgPath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'brand/'.$_feaManufacturers["filename"];
|
245 |
+
} else {
|
246 |
+
$imageFile = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."brand/no_image_available.jpg";
|
247 |
+
$imgPath = $imageFile;
|
248 |
+
}
|
249 |
+
?>
|
250 |
+
|
251 |
+
<a class="wrapper" style="text-decoration:none;" href="<?php echo Mage::getBaseUrl() ?>brand/index/view/brand/<?php echo $_feaManufacturers['brand_option_id'] ?>/?brandname=<?php echo $_feaManufacturers['title'] ?>" title="<?php echo $_feaManufacturers['title']; ?>">
|
252 |
+
<img src="<?php echo $imgPath; ?>" class="logo" alt="<?php echo $_feaManufacturers['title'];?>" height='100px'/>
|
253 |
+
|
254 |
+
</a>
|
255 |
+
|
256 |
+
<?php $i +=1;
|
257 |
+
} ?>
|
258 |
+
<? endforeach ?>
|
259 |
+
<div id='slideEnd'></div>
|
260 |
+
</div>
|
261 |
+
</div>
|
262 |
+
</div>
|
263 |
+
|
264 |
+
|
265 |
+
|
266 |
+
<?php
|
267 |
+
}
|
268 |
+
?>
|
269 |
+
</body>
|
270 |
+
</html>
|
271 |
+
|
272 |
+
-->
|
273 |
+
|
274 |
+
|
275 |
+
|
276 |
+
|
app/etc/modules/Ktree_Brand.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Ktree_Brand>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Ktree_Brand>
|
8 |
+
</modules>
|
9 |
+
</config>
|
js/brand/brand.js
ADDED
@@ -0,0 +1,484 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
$j=jQuery.noConflict();
|
2 |
+
jQuery(document).ready(function() {
|
3 |
+
|
4 |
+
jQuery("#alphabet_filter").mouseover(function(){
|
5 |
+
jQuery("#alphabet_content").show();
|
6 |
+
jQuery("#category_content").hide();
|
7 |
+
});
|
8 |
+
jQuery("#sales").click(function(){
|
9 |
+
jQuery("#content_sale").show();
|
10 |
+
jQuery("#content").hide();
|
11 |
+
jQuery("#content1").hide();
|
12 |
+
jQuery("#content2").hide();
|
13 |
+
jQuery("#category_content").hide();
|
14 |
+
jQuery("#alphabet_content").hide();
|
15 |
+
});
|
16 |
+
|
17 |
+
jQuery("#category_filter").mouseover(function(){
|
18 |
+
jQuery("#alphabet_content").hide();
|
19 |
+
jQuery("#category_content").show();
|
20 |
+
});
|
21 |
+
jQuery("#category_filter").mouseout(function(){
|
22 |
+
//jQuery("#category_content").hide();
|
23 |
+
});
|
24 |
+
jQuery('#category_content li').hover(function(e){
|
25 |
+
jQuery(this).children('ul').slideToggle();
|
26 |
+
e.stopPropagation();
|
27 |
+
});
|
28 |
+
jQuery("#category_content ul li a").click(function(){
|
29 |
+
var id = jQuery(this).attr('id');
|
30 |
+
jQuery('#loader_'+id).show();
|
31 |
+
// var url = currenturl.replace(currenturl,url);
|
32 |
+
var url = "brand/index/getBrandCategory";
|
33 |
+
jQuery.ajax({
|
34 |
+
url: url,
|
35 |
+
// datatype:"json",
|
36 |
+
data:{ id: id},
|
37 |
+
|
38 |
+
success: function(html){
|
39 |
+
jQuery('#loader_'+id).hide();
|
40 |
+
jQuery("#content2").html(html).show();
|
41 |
+
jQuery("#content").hide();
|
42 |
+
jQuery("#content1").hide();
|
43 |
+
jQuery("#content_sale").hide();
|
44 |
+
}
|
45 |
+
|
46 |
+
});
|
47 |
+
});
|
48 |
+
|
49 |
+
$j('.A').click(function(){
|
50 |
+
var check = $j(".brand-directory-category_A").text();
|
51 |
+
if(check == ""){
|
52 |
+
$j("#content1").html(" No Products For Brand A").show();
|
53 |
+
$j("#content").hide();
|
54 |
+
$j("#content2").hide();
|
55 |
+
$j("#content_sale").hide();
|
56 |
+
}else{
|
57 |
+
$j("#content").show();
|
58 |
+
$j("#content").children().filter(".brand-directory-category_A").show();
|
59 |
+
$j("#content").children().filter(":not(.brand-directory-category_A)").hide();
|
60 |
+
$j("#content1").hide();
|
61 |
+
$j("#content2").hide();
|
62 |
+
$j("#content_sale").hide();
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
});
|
67 |
+
$j('.B').click(function(){
|
68 |
+
var check = $j(".brand-directory-category_B").text();
|
69 |
+
if(check == ""){
|
70 |
+
$j("#content1").html(" No Products For Brand B").show();
|
71 |
+
$j("#content").hide();
|
72 |
+
$j("#content2").hide();
|
73 |
+
$j("#content_sale").hide();
|
74 |
+
}else{
|
75 |
+
$j("#content").show();
|
76 |
+
$j("#content").children().filter(".brand-directory-category_B").show();
|
77 |
+
$j("#content").children().filter(":not(.brand-directory-category_B)").hide();
|
78 |
+
$j("#content1").hide();
|
79 |
+
$j("#content2").hide();
|
80 |
+
$j("#content_sale").hide();
|
81 |
+
}
|
82 |
+
});
|
83 |
+
$j('.C').click(function(){
|
84 |
+
var check = $j(".brand-directory-category_C").text();
|
85 |
+
if(check == ""){
|
86 |
+
$j("#content1").html(" No Products For Brand C").show();
|
87 |
+
$j("#content").hide();
|
88 |
+
$j("#content2").hide();
|
89 |
+
$j("#content_sale").hide();
|
90 |
+
}else{
|
91 |
+
$j("#content").show();
|
92 |
+
$j("#content").children().filter(".brand-directory-category_C").show();
|
93 |
+
$j("#content").children().filter(":not(.brand-directory-category_C)").hide();
|
94 |
+
$j("#content1").hide();
|
95 |
+
$j("#content2").hide();
|
96 |
+
$j("#content_sale").hide();
|
97 |
+
}
|
98 |
+
|
99 |
+
});
|
100 |
+
$j('.D').click(function(){
|
101 |
+
var check = $j(".brand-directory-category_D").text();
|
102 |
+
if(check == ""){
|
103 |
+
$j("#content1").html(" No Products For Brand D").show();
|
104 |
+
$j("#content").hide();
|
105 |
+
$j("#content2").hide();
|
106 |
+
$j("#content_sale").hide();
|
107 |
+
}else{
|
108 |
+
$j("#content").show();
|
109 |
+
$j("#content").children().filter(".brand-directory-category_D").show();
|
110 |
+
$j("#content").children().filter(":not(.brand-directory-category_D)").hide();
|
111 |
+
$j("#content1").hide();
|
112 |
+
$j("#content2").hide();
|
113 |
+
$j("#content_sale").hide();
|
114 |
+
}
|
115 |
+
});
|
116 |
+
$j('.E').click(function(){
|
117 |
+
var check = $j(".brand-directory-category_E").text();
|
118 |
+
if(check == ""){
|
119 |
+
$j("#content1").html(" No Products For Brand E").show();
|
120 |
+
$j("#content").hide();
|
121 |
+
$j("#content2").hide();
|
122 |
+
$j("#content_sale").hide();
|
123 |
+
}else{
|
124 |
+
$j("#content").show();
|
125 |
+
$j("#content").children().filter(".brand-directory-category_E").show();
|
126 |
+
$j("#content").children().filter(":not(.brand-directory-category_E)").hide();
|
127 |
+
$j("#content1").hide();
|
128 |
+
$j("#content2").hide();
|
129 |
+
$j("#content_sale").hide();
|
130 |
+
}
|
131 |
+
|
132 |
+
});
|
133 |
+
$j('.F').click(function(){
|
134 |
+
var check = $j(".brand-directory-category_F").text();
|
135 |
+
if(check == ""){
|
136 |
+
$j("#content1").html(" No Products For Brand F").show();
|
137 |
+
$j("#content").hide();
|
138 |
+
$j("#content2").hide();
|
139 |
+
$j("#content_sale").hide();
|
140 |
+
}else{
|
141 |
+
$j("#content").show();
|
142 |
+
$j("#content").children().filter(".brand-directory-category_F").show();
|
143 |
+
$j("#content").children().filter(":not(.brand-directory-category_F)").hide();
|
144 |
+
$j("#content1").hide();
|
145 |
+
$j("#content2").hide();
|
146 |
+
$j("#content_sale").hide();
|
147 |
+
}
|
148 |
+
});
|
149 |
+
$j('.G').click(function(){
|
150 |
+
var check = $j(".brand-directory-category_G").text();
|
151 |
+
if(check == ""){
|
152 |
+
$j("#content1").html(" No Products For Brand G").show();
|
153 |
+
$j("#content").hide();
|
154 |
+
$j("#content2").hide();
|
155 |
+
$j("#content_sale").hide();
|
156 |
+
}else{
|
157 |
+
$j("#content").show();
|
158 |
+
$j("#content").children().filter(".brand-directory-category_G").show();
|
159 |
+
$j("#content").children().filter(":not(.brand-directory-category_G)").hide();
|
160 |
+
$j("#content1").hide();
|
161 |
+
$j("#content2").hide();
|
162 |
+
$j("#content_sale").hide();
|
163 |
+
}
|
164 |
+
});
|
165 |
+
$j('.H').click(function(){
|
166 |
+
var check = $j(".brand-directory-category_H").text();
|
167 |
+
if(check == ""){
|
168 |
+
$j("#content1").html(" No Products For Brand H").show();
|
169 |
+
$j("#content").hide();
|
170 |
+
$j("#content2").hide();
|
171 |
+
$j("#content_sale").hide();
|
172 |
+
}else{
|
173 |
+
$j("#content").show();
|
174 |
+
$j("#content").children().filter(".brand-directory-category_H").show();
|
175 |
+
$j("#content").children().filter(":not(.brand-directory-category_H)").hide();
|
176 |
+
$j("#content1").hide();
|
177 |
+
$j("#content2").hide();
|
178 |
+
$j("#content_sale").hide();
|
179 |
+
}
|
180 |
+
});
|
181 |
+
$j('.I').click(function(){
|
182 |
+
var check = $j(".brand-directory-category_I").text();
|
183 |
+
if(check == ""){
|
184 |
+
$j("#content1").html("No Products For Brand I").show();
|
185 |
+
$j("#content").hide();
|
186 |
+
$j("#content2").hide();
|
187 |
+
$j("#content_sale").hide();
|
188 |
+
}else{
|
189 |
+
$j("#content").show();
|
190 |
+
$j("#content").children().filter(".brand-directory-category_I").show();
|
191 |
+
$j("#content").children().filter(":not(.brand-directory-category_I)").hide();
|
192 |
+
$j("#content1").hide();
|
193 |
+
$j("#content2").hide();
|
194 |
+
$j("#content_sale").hide();
|
195 |
+
}
|
196 |
+
});
|
197 |
+
$j('.J').click(function(){
|
198 |
+
var check = $j(".brand-directory-category_J").text();
|
199 |
+
if(check == ""){
|
200 |
+
$j("#content1").html(" No Products For Brand J").show();
|
201 |
+
$j("#content").hide();
|
202 |
+
$j("#content2").hide();
|
203 |
+
$j("#content_sale").hide();
|
204 |
+
}else{
|
205 |
+
$j("#content").show();
|
206 |
+
$j("#content").children().filter(".brand-directory-category_J").show();
|
207 |
+
$j("#content").children().filter(":not(.brand-directory-category_J)").hide();
|
208 |
+
$j("#content1").hide();
|
209 |
+
$j("#content2").hide();
|
210 |
+
$j("#content_sale").hide();
|
211 |
+
}
|
212 |
+
});
|
213 |
+
$j('.K').click(function(){
|
214 |
+
var check = $j(".brand-directory-category_K").text();
|
215 |
+
if(check == ""){
|
216 |
+
$j("#content1").html(" No Products For Brand K").show();
|
217 |
+
$j("#content").hide();
|
218 |
+
$j("#content2").hide();
|
219 |
+
$j("#content_sale").hide();
|
220 |
+
}else{
|
221 |
+
$j("#content").show();
|
222 |
+
$j("#content").children().filter(".brand-directory-category_K").show();
|
223 |
+
$j("#content").children().filter(":not(.brand-directory-category_K)").hide();
|
224 |
+
$j("#content1").hide();
|
225 |
+
$j("#content2").hide();
|
226 |
+
$j("#content_sale").hide();
|
227 |
+
}
|
228 |
+
});
|
229 |
+
$j('.L').click(function(){
|
230 |
+
var check = $j(".brand-directory-category_L").text();
|
231 |
+
if(check == ""){
|
232 |
+
$j("#content1").html(" No Products For Brand L").show();
|
233 |
+
$j("#content").hide();
|
234 |
+
$j("#content2").hide();
|
235 |
+
$j("#content_sale").hide();
|
236 |
+
}else{
|
237 |
+
$j("#content").show();
|
238 |
+
$j("#content").children().filter(".brand-directory-category_L").show();
|
239 |
+
$j("#content").children().filter(":not(.brand-directory-category_L)").hide();
|
240 |
+
$j("#content1").hide();
|
241 |
+
$j("#content2").hide();
|
242 |
+
$j("#content_sale").hide();
|
243 |
+
}
|
244 |
+
});
|
245 |
+
$j('.M').click(function(){
|
246 |
+
var check = $j(".brand-directory-category_M").text();
|
247 |
+
if(check == ""){
|
248 |
+
$j("#content1").html(" No Products For Brand M").show();
|
249 |
+
$j("#content").hide();
|
250 |
+
$j("#content2").hide();
|
251 |
+
$j("#content_sale").hide();
|
252 |
+
}else{
|
253 |
+
$j("#content").show();
|
254 |
+
$j("#content").children().filter(".brand-directory-category_M").show();
|
255 |
+
$j("#content").children().filter(":not(.brand-directory-category_M)").hide();
|
256 |
+
$j("#content1").hide();
|
257 |
+
$j("#content2").hide();
|
258 |
+
$j("#content_sale").hide();
|
259 |
+
}
|
260 |
+
|
261 |
+
});
|
262 |
+
$j('.N').click(function(){
|
263 |
+
var check = $j(".brand-directory-category_N").text();
|
264 |
+
if(check == ""){
|
265 |
+
$j("#content1").html("No Products For Brand N").show();
|
266 |
+
$j("#content").hide();
|
267 |
+
$j("#content2").hide();
|
268 |
+
$j("#content_sale").hide();
|
269 |
+
}else{
|
270 |
+
$j("#content").show();
|
271 |
+
$j("#content").children().filter(".brand-directory-category_N").show();
|
272 |
+
$j("#content").children().filter(":not(.brand-directory-category_N)").hide();
|
273 |
+
$j("#content1").hide();
|
274 |
+
$j("#content2").hide();
|
275 |
+
$j("#content_sale").hide();
|
276 |
+
}
|
277 |
+
|
278 |
+
});
|
279 |
+
$j('.O').click(function(){
|
280 |
+
var check = $j(".brand-directory-category_O").text();
|
281 |
+
if(check == ""){
|
282 |
+
$j("#content1").html(" No Products For Brand O").show();
|
283 |
+
$j("#content").hide();
|
284 |
+
$j("#content2").hide();
|
285 |
+
$j("#content_sale").hide();
|
286 |
+
}else{
|
287 |
+
$j("#content").show();
|
288 |
+
$j("#content").children().filter(".brand-directory-category_O").show();
|
289 |
+
$j("#content").children().filter(":not(.brand-directory-category_O)").hide();
|
290 |
+
$j("#content1").hide();
|
291 |
+
$j("#content2").hide();
|
292 |
+
$j("#content_sale").hide();
|
293 |
+
}
|
294 |
+
|
295 |
+
});
|
296 |
+
$j('.P').click(function(){
|
297 |
+
var check = $j(".brand-directory-category_P").text();
|
298 |
+
if(check == ""){
|
299 |
+
$j("#content1").html(" No Products For Brand P").show();
|
300 |
+
$j("#content").hide();
|
301 |
+
$j("#content2").hide();
|
302 |
+
$j("#content_sale").hide();
|
303 |
+
}else{
|
304 |
+
$j("#content").show();
|
305 |
+
$j("#content").children().filter(".brand-directory-category_P").show();
|
306 |
+
$j("#content").children().filter(":not(.brand-directory-category_P)").hide();
|
307 |
+
$j("#content1").hide();
|
308 |
+
$j("#content2").hide();
|
309 |
+
$j("#content_sale").hide();
|
310 |
+
}
|
311 |
+
|
312 |
+
});
|
313 |
+
$j('.Q').click(function(){
|
314 |
+
var check = $j(".brand-directory-category_Q").text();
|
315 |
+
if(check == ""){
|
316 |
+
$j("#content1").html(" No Products For Brand Q").show();
|
317 |
+
$j("#content").hide();
|
318 |
+
$j("#content2").hide();
|
319 |
+
$j("#content_sale").hide();
|
320 |
+
}else{
|
321 |
+
$j("#content").show();
|
322 |
+
$j("#content").children().filter(".brand-directory-category_Q").show();
|
323 |
+
$j("#content").children().filter(":not(.brand-directory-category_Q)").hide();
|
324 |
+
$j("#content1").hide();
|
325 |
+
$j("#content2").hide();
|
326 |
+
$j("#content_sale").hide();
|
327 |
+
}
|
328 |
+
|
329 |
+
});
|
330 |
+
$j('.R').click(function(){
|
331 |
+
var check = $j(".brand-directory-category_R").text();
|
332 |
+
if(check == ""){
|
333 |
+
$j("#content1").html(" No Products For Brand R").show();
|
334 |
+
$j("#content").hide();
|
335 |
+
$j("#content2").hide();
|
336 |
+
$j("#content_sale").hide();
|
337 |
+
}else{
|
338 |
+
$j("#content").show();
|
339 |
+
$j("#content").children().filter(".brand-directory-category_R").show();
|
340 |
+
$j("#content").children().filter(":not(.brand-directory-category_R)").hide();
|
341 |
+
$j("#content1").hide();
|
342 |
+
$j("#content2").hide();
|
343 |
+
$j("#content_sale").hide();
|
344 |
+
}
|
345 |
+
|
346 |
+
});
|
347 |
+
$j('.S').click(function(){
|
348 |
+
var check = $j(".brand-directory-category_S").text();
|
349 |
+
if(check == ""){
|
350 |
+
$j("#content1").html(" No Products For Brand S").show();
|
351 |
+
$j("#content").hide();
|
352 |
+
$j("#content2").hide();
|
353 |
+
$j("#content_sale").hide();
|
354 |
+
}else{
|
355 |
+
$j("#content").show();
|
356 |
+
$j("#content").children().filter(".brand-directory-category_S").show();
|
357 |
+
$j("#content").children().filter(":not(.brand-directory-category_S)").hide();
|
358 |
+
$j("#content1").hide();
|
359 |
+
$j("#content2").hide();
|
360 |
+
$j("#content_sale").hide();
|
361 |
+
}
|
362 |
+
|
363 |
+
});
|
364 |
+
$j('.T').click(function(){
|
365 |
+
var check = $j(".brand-directory-category_T").text();
|
366 |
+
if(check == ""){
|
367 |
+
$j("#content1").html(" No Products For Brand T").show();
|
368 |
+
$j("#content").hide();
|
369 |
+
$j("#content2").hide();
|
370 |
+
$j("#content_sale").hide();
|
371 |
+
}else{
|
372 |
+
$j("#content").show();
|
373 |
+
$j("#content").children().filter(".brand-directory-category_T").show();
|
374 |
+
$j("#content").children().filter(":not(.brand-directory-category_T)").hide();
|
375 |
+
$j("#content1").hide();
|
376 |
+
$j("#content2").hide();
|
377 |
+
$j("#content_sale").hide();
|
378 |
+
}
|
379 |
+
|
380 |
+
});
|
381 |
+
$j('.U').click(function(){
|
382 |
+
var check = $j(".brand-directory-category_U").text();
|
383 |
+
if(check == ""){
|
384 |
+
$j("#content1").html(" No Products For Brand U").show();
|
385 |
+
$j("#content").hide();
|
386 |
+
$j("#content2").hide();
|
387 |
+
$j("#content_sale").hide();
|
388 |
+
}else{
|
389 |
+
$j("#content").show();
|
390 |
+
$j("#content1").children().filter(".brand-directory-category_U").show();
|
391 |
+
$j("#content").children().filter(":not(.brand-directory-category_U)").hide();
|
392 |
+
$j("#content1").hide();
|
393 |
+
$j("#content2").hide();
|
394 |
+
$j("#content_sale").hide();
|
395 |
+
}
|
396 |
+
|
397 |
+
});
|
398 |
+
$j('.V').click(function(){
|
399 |
+
var check = $j(".brand-directory-category_V").text();
|
400 |
+
if(check == ""){
|
401 |
+
$j("#content1").html(" No Products For Brand V").show();
|
402 |
+
$j("#content").hide();
|
403 |
+
$j("#content2").hide();
|
404 |
+
$j("#content_sale").hide();
|
405 |
+
}else{
|
406 |
+
$j("#content").show();
|
407 |
+
$j("#content").children().filter(".brand-directory-category_V").show();
|
408 |
+
$j("#content").children().filter(":not(.brand-directory-category_V)").hide();
|
409 |
+
$j("#content1").hide();
|
410 |
+
$j("#content2").hide();
|
411 |
+
$j("#content_sale").hide();
|
412 |
+
}
|
413 |
+
|
414 |
+
});
|
415 |
+
$j('.W').click(function(){
|
416 |
+
var check = $j(".brand-directory-category_W").text();
|
417 |
+
if(check == ""){
|
418 |
+
$j("#content1").html(" No Products For Brand W").show();
|
419 |
+
$j("#content").hide();
|
420 |
+
$j("#content2").hide();
|
421 |
+
$j("#content_sale").hide();
|
422 |
+
}else{
|
423 |
+
$j("#content").show();
|
424 |
+
$j("#content").children().filter(".brand-directory-category_W").show();
|
425 |
+
$j("#content").children().filter(":not(.brand-directory-category_W)").hide();
|
426 |
+
$j("#content1").hide();
|
427 |
+
$j("#content2").hide();
|
428 |
+
$j("#content_sale").hide();
|
429 |
+
}
|
430 |
+
|
431 |
+
});
|
432 |
+
$j('.X').click(function(){
|
433 |
+
var check = $j(".brand-directory-category_X").text();
|
434 |
+
if(check == ""){
|
435 |
+
$j("#content1").html(" No Products For Brand X").show();
|
436 |
+
$j("#content").hide();
|
437 |
+
$j("#content2").hide();
|
438 |
+
$j("#content_sale").hide();
|
439 |
+
}else{
|
440 |
+
$j("#content").show();
|
441 |
+
$j("#content").children().filter(".brand-directory-category_X").show();
|
442 |
+
$j("#content").children().filter(":not(.brand-directory-category_X)").hide();
|
443 |
+
$j("#content1").hide();
|
444 |
+
$j("#content2").hide();
|
445 |
+
$j("#content_sale").hide();
|
446 |
+
}
|
447 |
+
|
448 |
+
});
|
449 |
+
$j('.Y').click(function(){
|
450 |
+
var check = $j(".brand-directory-category_Y").text();
|
451 |
+
if(check == ""){
|
452 |
+
$j("#content1").html(" No Products For Brand Y").show();
|
453 |
+
$j("#content").hide();
|
454 |
+
$j("#content2").hide();
|
455 |
+
$j("#content_sale").hide();
|
456 |
+
}else{
|
457 |
+
$j("#content").show();
|
458 |
+
$j("#content").children().filter(".brand-directory-category_Y").show();
|
459 |
+
$j("#content").children().filter(":not(.brand-directory-category_Y)").hide();
|
460 |
+
$j("#content1").hide();
|
461 |
+
$j("#content2").hide();
|
462 |
+
$j("#content_sale").hide();
|
463 |
+
}
|
464 |
+
|
465 |
+
});
|
466 |
+
$j('.Z').click(function(){
|
467 |
+
var check = $j(".brand-directory-category_Z").text();
|
468 |
+
if(check == ""){
|
469 |
+
$j("#content1").html("No Products For Brand Z").show();
|
470 |
+
$j("#content").hide();
|
471 |
+
$j("#content2").hide();
|
472 |
+
$j("#content_sale").hide();
|
473 |
+
}else{
|
474 |
+
$j("#content").show();
|
475 |
+
$j("#content").children().filter(".brand-directory-category_Z").show();
|
476 |
+
$j("#content").children().filter(":not(.brand-directory-category_Z)").hide();
|
477 |
+
$j("#content1").hide();
|
478 |
+
$j("#content2").hide();
|
479 |
+
$j("#content_sale").hide();
|
480 |
+
}
|
481 |
+
|
482 |
+
});
|
483 |
+
});
|
484 |
+
|
js/brand/jquery-1.7.2.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*! jQuery v1.7.2 jquery.com | jquery.org/license */
|
2 |
+
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},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(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
|
3 |
+
a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
|
4 |
+
.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
|
js/brand/jquery.contentcarousel.js
ADDED
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($) {
|
2 |
+
var aux = {
|
3 |
+
// navigates left / right
|
4 |
+
navigate : function( dir, $el, $wrapper, opts, cache ) {
|
5 |
+
|
6 |
+
var scroll = opts.scroll,
|
7 |
+
factor = 1,
|
8 |
+
idxClicked = 0;
|
9 |
+
|
10 |
+
if( cache.expanded ) {
|
11 |
+
scroll = 1; // scroll is always 1 in full mode
|
12 |
+
factor = 3; // the width of the expanded item will be 3 times bigger than 1 collapsed item
|
13 |
+
idxClicked = cache.idxClicked; // the index of the clicked item
|
14 |
+
}
|
15 |
+
|
16 |
+
// clone the elements on the right / left and append / prepend them according to dir and scroll
|
17 |
+
if( dir === 1 ) {
|
18 |
+
$wrapper.find('div.ca-item:lt(' + scroll + ')').each(function(i) {
|
19 |
+
$(this).clone(true).css( 'left', ( cache.totalItems - idxClicked + i ) * cache.itemW * factor + 'px' ).appendTo( $wrapper );
|
20 |
+
});
|
21 |
+
}
|
22 |
+
else {
|
23 |
+
var $first = $wrapper.children().eq(0);
|
24 |
+
|
25 |
+
$wrapper.find('div.ca-item:gt(' + ( cache.totalItems - 1 - scroll ) + ')').each(function(i) {
|
26 |
+
// insert before $first so they stay in the right order
|
27 |
+
$(this).clone(true).css( 'left', - ( scroll - i + idxClicked ) * cache.itemW * factor + 'px' ).insertBefore( $first );
|
28 |
+
});
|
29 |
+
}
|
30 |
+
|
31 |
+
// animate the left of each item
|
32 |
+
// the calculations are dependent on dir and on the cache.expanded value
|
33 |
+
$wrapper.find('div.ca-item').each(function(i) {
|
34 |
+
var $item = $(this);
|
35 |
+
$item.stop().animate({
|
36 |
+
left : ( dir === 1 ) ? '-=' + ( cache.itemW * factor * scroll ) + 'px' : '+=' + ( cache.itemW * factor * scroll ) + 'px'
|
37 |
+
}, opts.sliderSpeed, opts.sliderEasing, function() {
|
38 |
+
if( ( dir === 1 && $item.position().left < - idxClicked * cache.itemW * factor ) || ( dir === -1 && $item.position().left > ( ( cache.totalItems - 1 - idxClicked ) * cache.itemW * factor ) ) ) {
|
39 |
+
// remove the item that was cloned
|
40 |
+
$item.remove();
|
41 |
+
}
|
42 |
+
cache.isAnimating = false;
|
43 |
+
});
|
44 |
+
});
|
45 |
+
|
46 |
+
},
|
47 |
+
// opens an item (animation) -> opens all the others
|
48 |
+
openItem : function( $wrapper, $item, opts, cache ) {
|
49 |
+
cache.idxClicked = $item.index();
|
50 |
+
// the item's position (1, 2, or 3) on the viewport (the visible items)
|
51 |
+
cache.winpos = aux.getWinPos( $item.position().left, cache );
|
52 |
+
$wrapper.find('div.ca-item').not( $item ).hide();
|
53 |
+
$item.find('div.ca-content-wrapper').css( 'left', cache.itemW + 'px' ).stop().animate({
|
54 |
+
width : cache.itemW * 2 + 'px',
|
55 |
+
left : cache.itemW + 'px'
|
56 |
+
}, opts.itemSpeed, opts.itemEasing)
|
57 |
+
.end()
|
58 |
+
.stop()
|
59 |
+
.animate({
|
60 |
+
left : '0px'
|
61 |
+
}, opts.itemSpeed, opts.itemEasing, function() {
|
62 |
+
cache.isAnimating = false;
|
63 |
+
cache.expanded = true;
|
64 |
+
|
65 |
+
aux.openItems( $wrapper, $item, opts, cache );
|
66 |
+
});
|
67 |
+
|
68 |
+
},
|
69 |
+
// opens all the items
|
70 |
+
openItems : function( $wrapper, $openedItem, opts, cache ) {
|
71 |
+
var openedIdx = $openedItem.index();
|
72 |
+
|
73 |
+
$wrapper.find('div.ca-item').each(function(i) {
|
74 |
+
var $item = $(this),
|
75 |
+
idx = $item.index();
|
76 |
+
|
77 |
+
if( idx !== openedIdx ) {
|
78 |
+
$item.css( 'left', - ( openedIdx - idx ) * ( cache.itemW * 3 ) + 'px' ).show().find('div.ca-content-wrapper').css({
|
79 |
+
left : cache.itemW + 'px',
|
80 |
+
width : cache.itemW * 2 + 'px'
|
81 |
+
});
|
82 |
+
|
83 |
+
// hide more link
|
84 |
+
aux.toggleMore( $item, false );
|
85 |
+
}
|
86 |
+
});
|
87 |
+
},
|
88 |
+
// show / hide the item's more button
|
89 |
+
toggleMore : function( $item, show ) {
|
90 |
+
( show ) ? $item.find('a.ca-more').show() : $item.find('a.ca-more').hide();
|
91 |
+
},
|
92 |
+
// close all the items
|
93 |
+
// the current one is animated
|
94 |
+
closeItems : function( $wrapper, $openedItem, opts, cache ) {
|
95 |
+
var openedIdx = $openedItem.index();
|
96 |
+
|
97 |
+
$openedItem.find('div.ca-content-wrapper').stop().animate({
|
98 |
+
width : '0px'
|
99 |
+
}, opts.itemSpeed, opts.itemEasing)
|
100 |
+
.end()
|
101 |
+
.stop()
|
102 |
+
.animate({
|
103 |
+
left : cache.itemW * ( cache.winpos - 1 ) + 'px'
|
104 |
+
}, opts.itemSpeed, opts.itemEasing, function() {
|
105 |
+
cache.isAnimating = false;
|
106 |
+
cache.expanded = false;
|
107 |
+
});
|
108 |
+
|
109 |
+
// show more link
|
110 |
+
aux.toggleMore( $openedItem, true );
|
111 |
+
|
112 |
+
$wrapper.find('div.ca-item').each(function(i) {
|
113 |
+
var $item = $(this),
|
114 |
+
idx = $item.index();
|
115 |
+
|
116 |
+
if( idx !== openedIdx ) {
|
117 |
+
$item.find('div.ca-content-wrapper').css({
|
118 |
+
width : '0px'
|
119 |
+
})
|
120 |
+
.end()
|
121 |
+
.css( 'left', ( ( cache.winpos - 1 ) - ( openedIdx - idx ) ) * cache.itemW + 'px' )
|
122 |
+
.show();
|
123 |
+
|
124 |
+
// show more link
|
125 |
+
aux.toggleMore( $item, true );
|
126 |
+
}
|
127 |
+
});
|
128 |
+
},
|
129 |
+
// gets the item's position (1, 2, or 3) on the viewport (the visible items)
|
130 |
+
// val is the left of the item
|
131 |
+
getWinPos : function( val, cache ) {
|
132 |
+
switch( val ) {
|
133 |
+
case 0 : return 1; break;
|
134 |
+
case cache.itemW : return 2; break;
|
135 |
+
case cache.itemW * 2 : return 3; break;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
},
|
139 |
+
methods = {
|
140 |
+
init : function( options ) {
|
141 |
+
|
142 |
+
if( this.length ) {
|
143 |
+
|
144 |
+
var settings = {
|
145 |
+
sliderSpeed : 500, // speed for the sliding animation
|
146 |
+
sliderEasing : 'easeOutExpo',// easing for the sliding animation
|
147 |
+
itemSpeed : 500, // speed for the item animation (open / close)
|
148 |
+
itemEasing : 'easeOutExpo',// easing for the item animation (open / close)
|
149 |
+
scroll : 1 // number of items to scroll at a time
|
150 |
+
};
|
151 |
+
|
152 |
+
return this.each(function() {
|
153 |
+
|
154 |
+
// if options exist, lets merge them with our default settings
|
155 |
+
if ( options ) {
|
156 |
+
$.extend( settings, options );
|
157 |
+
}
|
158 |
+
|
159 |
+
var $el = $(this),
|
160 |
+
$wrapper = $el.find('div.ca-wrapper'),
|
161 |
+
$items = $wrapper.children('div.ca-item'),
|
162 |
+
cache = {};
|
163 |
+
|
164 |
+
// save the with of one item
|
165 |
+
cache.itemW = $items.width();
|
166 |
+
// save the number of total items
|
167 |
+
cache.totalItems = $items.length;
|
168 |
+
|
169 |
+
// add navigation buttons
|
170 |
+
if( cache.totalItems > 3 )
|
171 |
+
$el.prepend('<div class="ca-nav"><span class="ca-nav-prev">Previous</span><span class="ca-nav-next">Next</span></div>')
|
172 |
+
|
173 |
+
// control the scroll value
|
174 |
+
if( settings.scroll < 1 )
|
175 |
+
settings.scroll = 1;
|
176 |
+
else if( settings.scroll > 3 )
|
177 |
+
settings.scroll = 3;
|
178 |
+
|
179 |
+
var $navPrev = $el.find('span.ca-nav-prev'),
|
180 |
+
$navNext = $el.find('span.ca-nav-next');
|
181 |
+
|
182 |
+
// hide the items except the first 3
|
183 |
+
$wrapper.css( 'overflow', 'hidden' );
|
184 |
+
|
185 |
+
// the items will have position absolute
|
186 |
+
// calculate the left of each item
|
187 |
+
$items.each(function(i) {
|
188 |
+
$(this).css({
|
189 |
+
position : 'absolute',
|
190 |
+
left : i * cache.itemW + 'px'
|
191 |
+
});
|
192 |
+
});
|
193 |
+
|
194 |
+
// click to open the item(s)
|
195 |
+
$el.find('a.ca-more').live('click.contentcarousel', function( event ) {
|
196 |
+
if( cache.isAnimating ) return false;
|
197 |
+
cache.isAnimating = true;
|
198 |
+
$(this).hide();
|
199 |
+
var $item = $(this).closest('div.ca-item');
|
200 |
+
aux.openItem( $wrapper, $item, settings, cache );
|
201 |
+
return false;
|
202 |
+
});
|
203 |
+
|
204 |
+
// click to close the item(s)
|
205 |
+
$el.find('a.ca-close').live('click.contentcarousel', function( event ) {
|
206 |
+
if( cache.isAnimating ) return false;
|
207 |
+
cache.isAnimating = true;
|
208 |
+
var $item = $(this).closest('div.ca-item');
|
209 |
+
aux.closeItems( $wrapper, $item, settings, cache );
|
210 |
+
return false;
|
211 |
+
});
|
212 |
+
|
213 |
+
// navigate left
|
214 |
+
$navPrev.bind('click.contentcarousel', function( event ) {
|
215 |
+
if( cache.isAnimating ) return false;
|
216 |
+
cache.isAnimating = true;
|
217 |
+
aux.navigate( -1, $el, $wrapper, settings, cache );
|
218 |
+
});
|
219 |
+
|
220 |
+
// navigate right
|
221 |
+
$navNext.bind('click.contentcarousel', function( event ) {
|
222 |
+
if( cache.isAnimating ) return false;
|
223 |
+
cache.isAnimating = true;
|
224 |
+
aux.navigate( 1, $el, $wrapper, settings, cache );
|
225 |
+
});
|
226 |
+
|
227 |
+
// adds events to the mouse
|
228 |
+
$el.bind('mousewheel.contentcarousel', function(e, delta) {
|
229 |
+
if(delta > 0) {
|
230 |
+
if( cache.isAnimating ) return false;
|
231 |
+
cache.isAnimating = true;
|
232 |
+
aux.navigate( -1, $el, $wrapper, settings, cache );
|
233 |
+
}
|
234 |
+
else {
|
235 |
+
if( cache.isAnimating ) return false;
|
236 |
+
cache.isAnimating = true;
|
237 |
+
aux.navigate( 1, $el, $wrapper, settings, cache );
|
238 |
+
}
|
239 |
+
return false;
|
240 |
+
});
|
241 |
+
|
242 |
+
});
|
243 |
+
}
|
244 |
+
}
|
245 |
+
};
|
246 |
+
|
247 |
+
$.fn.contentcarousel = function(method) {
|
248 |
+
if ( methods[method] ) {
|
249 |
+
return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
|
250 |
+
} else if ( typeof method === 'object' || ! method ) {
|
251 |
+
return methods.init.apply( this, arguments );
|
252 |
+
} else {
|
253 |
+
$.error( 'Method ' + method + ' does not exist on jQuery.contentcarousel' );
|
254 |
+
}
|
255 |
+
};
|
256 |
+
|
257 |
+
})(jQuery);
|
js/brand/jquery.easing.1.3.js
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
3 |
+
*
|
4 |
+
* Uses the built in easing capabilities added In jQuery 1.1
|
5 |
+
* to offer multiple easing options
|
6 |
+
*
|
7 |
+
* TERMS OF USE - jQuery Easing
|
8 |
+
*
|
9 |
+
* Open source under the BSD License.
|
10 |
+
*
|
11 |
+
* Copyright © 2008 George McGinley Smith
|
12 |
+
* All rights reserved.
|
13 |
+
*
|
14 |
+
* Redistribution and use in source and binary forms, with or without modification,
|
15 |
+
* are permitted provided that the following conditions are met:
|
16 |
+
*
|
17 |
+
* Redistributions of source code must retain the above copyright notice, this list of
|
18 |
+
* conditions and the following disclaimer.
|
19 |
+
* Redistributions in binary form must reproduce the above copyright notice, this list
|
20 |
+
* of conditions and the following disclaimer in the documentation and/or other materials
|
21 |
+
* provided with the distribution.
|
22 |
+
*
|
23 |
+
* Neither the name of the author nor the names of contributors may be used to endorse
|
24 |
+
* or promote products derived from this software without specific prior written permission.
|
25 |
+
*
|
26 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
27 |
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
28 |
+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
29 |
+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
30 |
+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
31 |
+
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
32 |
+
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
33 |
+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
34 |
+
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
35 |
+
*
|
36 |
+
*/
|
37 |
+
|
38 |
+
// t: current time, b: begInnIng value, c: change In value, d: duration
|
39 |
+
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
40 |
+
|
41 |
+
jQuery.extend( jQuery.easing,
|
42 |
+
{
|
43 |
+
def: 'easeOutQuad',
|
44 |
+
swing: function (x, t, b, c, d) {
|
45 |
+
//alert(jQuery.easing.default);
|
46 |
+
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
47 |
+
},
|
48 |
+
easeInQuad: function (x, t, b, c, d) {
|
49 |
+
return c*(t/=d)*t + b;
|
50 |
+
},
|
51 |
+
easeOutQuad: function (x, t, b, c, d) {
|
52 |
+
return -c *(t/=d)*(t-2) + b;
|
53 |
+
},
|
54 |
+
easeInOutQuad: function (x, t, b, c, d) {
|
55 |
+
if ((t/=d/2) < 1) return c/2*t*t + b;
|
56 |
+
return -c/2 * ((--t)*(t-2) - 1) + b;
|
57 |
+
},
|
58 |
+
easeInCubic: function (x, t, b, c, d) {
|
59 |
+
return c*(t/=d)*t*t + b;
|
60 |
+
},
|
61 |
+
easeOutCubic: function (x, t, b, c, d) {
|
62 |
+
return c*((t=t/d-1)*t*t + 1) + b;
|
63 |
+
},
|
64 |
+
easeInOutCubic: function (x, t, b, c, d) {
|
65 |
+
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
66 |
+
return c/2*((t-=2)*t*t + 2) + b;
|
67 |
+
},
|
68 |
+
easeInQuart: function (x, t, b, c, d) {
|
69 |
+
return c*(t/=d)*t*t*t + b;
|
70 |
+
},
|
71 |
+
easeOutQuart: function (x, t, b, c, d) {
|
72 |
+
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
73 |
+
},
|
74 |
+
easeInOutQuart: function (x, t, b, c, d) {
|
75 |
+
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
76 |
+
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
77 |
+
},
|
78 |
+
easeInQuint: function (x, t, b, c, d) {
|
79 |
+
return c*(t/=d)*t*t*t*t + b;
|
80 |
+
},
|
81 |
+
easeOutQuint: function (x, t, b, c, d) {
|
82 |
+
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
83 |
+
},
|
84 |
+
easeInOutQuint: function (x, t, b, c, d) {
|
85 |
+
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
86 |
+
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
87 |
+
},
|
88 |
+
easeInSine: function (x, t, b, c, d) {
|
89 |
+
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
90 |
+
},
|
91 |
+
easeOutSine: function (x, t, b, c, d) {
|
92 |
+
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
93 |
+
},
|
94 |
+
easeInOutSine: function (x, t, b, c, d) {
|
95 |
+
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
96 |
+
},
|
97 |
+
easeInExpo: function (x, t, b, c, d) {
|
98 |
+
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
99 |
+
},
|
100 |
+
easeOutExpo: function (x, t, b, c, d) {
|
101 |
+
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
102 |
+
},
|
103 |
+
easeInOutExpo: function (x, t, b, c, d) {
|
104 |
+
if (t==0) return b;
|
105 |
+
if (t==d) return b+c;
|
106 |
+
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
107 |
+
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
108 |
+
},
|
109 |
+
easeInCirc: function (x, t, b, c, d) {
|
110 |
+
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
111 |
+
},
|
112 |
+
easeOutCirc: function (x, t, b, c, d) {
|
113 |
+
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
114 |
+
},
|
115 |
+
easeInOutCirc: function (x, t, b, c, d) {
|
116 |
+
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
117 |
+
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
118 |
+
},
|
119 |
+
easeInElastic: function (x, t, b, c, d) {
|
120 |
+
var s=1.70158;var p=0;var a=c;
|
121 |
+
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
122 |
+
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
123 |
+
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
124 |
+
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
125 |
+
},
|
126 |
+
easeOutElastic: function (x, t, b, c, d) {
|
127 |
+
var s=1.70158;var p=0;var a=c;
|
128 |
+
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
129 |
+
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
130 |
+
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
131 |
+
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
132 |
+
},
|
133 |
+
easeInOutElastic: function (x, t, b, c, d) {
|
134 |
+
var s=1.70158;var p=0;var a=c;
|
135 |
+
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
136 |
+
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
137 |
+
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
138 |
+
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
139 |
+
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
140 |
+
},
|
141 |
+
easeInBack: function (x, t, b, c, d, s) {
|
142 |
+
if (s == undefined) s = 1.70158;
|
143 |
+
return c*(t/=d)*t*((s+1)*t - s) + b;
|
144 |
+
},
|
145 |
+
easeOutBack: function (x, t, b, c, d, s) {
|
146 |
+
if (s == undefined) s = 1.70158;
|
147 |
+
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
148 |
+
},
|
149 |
+
easeInOutBack: function (x, t, b, c, d, s) {
|
150 |
+
if (s == undefined) s = 1.70158;
|
151 |
+
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
152 |
+
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
153 |
+
},
|
154 |
+
easeInBounce: function (x, t, b, c, d) {
|
155 |
+
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
156 |
+
},
|
157 |
+
easeOutBounce: function (x, t, b, c, d) {
|
158 |
+
if ((t/=d) < (1/2.75)) {
|
159 |
+
return c*(7.5625*t*t) + b;
|
160 |
+
} else if (t < (2/2.75)) {
|
161 |
+
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
162 |
+
} else if (t < (2.5/2.75)) {
|
163 |
+
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
164 |
+
} else {
|
165 |
+
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
166 |
+
}
|
167 |
+
},
|
168 |
+
easeInOutBounce: function (x, t, b, c, d) {
|
169 |
+
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
170 |
+
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
171 |
+
}
|
172 |
+
});
|
173 |
+
|
174 |
+
/*
|
175 |
+
*
|
176 |
+
* TERMS OF USE - EASING EQUATIONS
|
177 |
+
*
|
178 |
+
* Open source under the BSD License.
|
179 |
+
*
|
180 |
+
* Copyright © 2001 Robert Penner
|
181 |
+
* All rights reserved.
|
182 |
+
*
|
183 |
+
* Redistribution and use in source and binary forms, with or without modification,
|
184 |
+
* are permitted provided that the following conditions are met:
|
185 |
+
*
|
186 |
+
* Redistributions of source code must retain the above copyright notice, this list of
|
187 |
+
* conditions and the following disclaimer.
|
188 |
+
* Redistributions in binary form must reproduce the above copyright notice, this list
|
189 |
+
* of conditions and the following disclaimer in the documentation and/or other materials
|
190 |
+
* provided with the distribution.
|
191 |
+
*
|
192 |
+
* Neither the name of the author nor the names of contributors may be used to endorse
|
193 |
+
* or promote products derived from this software without specific prior written permission.
|
194 |
+
*
|
195 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
196 |
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
197 |
+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
198 |
+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
199 |
+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
200 |
+
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
201 |
+
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
202 |
+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
203 |
+
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
204 |
+
*
|
205 |
+
*/
|
js/brand/jquery.mousewheel.js
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
|
2 |
+
* Licensed under the MIT License (LICENSE.txt).
|
3 |
+
*
|
4 |
+
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
5 |
+
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
6 |
+
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
7 |
+
*
|
8 |
+
* Version: 3.0.4
|
9 |
+
*
|
10 |
+
* Requires: 1.2.2+
|
11 |
+
*/
|
12 |
+
|
13 |
+
(function($) {
|
14 |
+
|
15 |
+
var types = ['DOMMouseScroll', 'mousewheel'];
|
16 |
+
|
17 |
+
$.event.special.mousewheel = {
|
18 |
+
setup: function() {
|
19 |
+
if ( this.addEventListener ) {
|
20 |
+
for ( var i=types.length; i; ) {
|
21 |
+
this.addEventListener( types[--i], handler, false );
|
22 |
+
}
|
23 |
+
} else {
|
24 |
+
this.onmousewheel = handler;
|
25 |
+
}
|
26 |
+
},
|
27 |
+
|
28 |
+
teardown: function() {
|
29 |
+
if ( this.removeEventListener ) {
|
30 |
+
for ( var i=types.length; i; ) {
|
31 |
+
this.removeEventListener( types[--i], handler, false );
|
32 |
+
}
|
33 |
+
} else {
|
34 |
+
this.onmousewheel = null;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
};
|
38 |
+
|
39 |
+
$.fn.extend({
|
40 |
+
mousewheel: function(fn) {
|
41 |
+
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
|
42 |
+
},
|
43 |
+
|
44 |
+
unmousewheel: function(fn) {
|
45 |
+
return this.unbind("mousewheel", fn);
|
46 |
+
}
|
47 |
+
});
|
48 |
+
|
49 |
+
|
50 |
+
function handler(event) {
|
51 |
+
var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
|
52 |
+
event = $.event.fix(orgEvent);
|
53 |
+
event.type = "mousewheel";
|
54 |
+
|
55 |
+
// Old school scrollwheel delta
|
56 |
+
if ( event.wheelDelta ) { delta = event.wheelDelta/120; }
|
57 |
+
if ( event.detail ) { delta = -event.detail/3; }
|
58 |
+
|
59 |
+
// New school multidimensional scroll (touchpads) deltas
|
60 |
+
deltaY = delta;
|
61 |
+
|
62 |
+
// Gecko
|
63 |
+
if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
|
64 |
+
deltaY = 0;
|
65 |
+
deltaX = -1*delta;
|
66 |
+
}
|
67 |
+
|
68 |
+
// Webkit
|
69 |
+
if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
|
70 |
+
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
|
71 |
+
|
72 |
+
// Add event and delta to the front of the arguments
|
73 |
+
args.unshift(event, delta, deltaX, deltaY);
|
74 |
+
|
75 |
+
return $.event.handle.apply(this, args);
|
76 |
+
}
|
77 |
+
|
78 |
+
})(jQuery);
|
js/brand/noconflict.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.noConflict();
|
js/brand/smoothdivscroll/jquery-ui-1.8.23.custom.min.js
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! jQuery UI - v1.8.23 - 2012-08-15
|
2 |
+
* https://github.com/jquery/jquery-ui
|
3 |
+
* Includes: jquery.ui.widget.js
|
4 |
+
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
|
5 |
+
(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
|
6 |
+
* https://github.com/jquery/jquery-ui
|
7 |
+
* Includes: jquery.effects.core.js
|
8 |
+
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
|
9 |
+
jQuery.effects||function(a,b){function c(b){var c;return b&&b.constructor==Array&&b.length==3?b:(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))?[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)]:(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))?[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55]:(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))?[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)]:(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))?[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]:(c=/rgba\(0, 0, 0, 0\)/.exec(b))?e.transparent:e[a.trim(b).toLowerCase()]}function d(b,d){var e;do{e=(a.curCSS||a.css)(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};return a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete,[b,c,d,e]}function l(b){return!b||typeof b=="number"||a.fx.speeds[b]?!0:typeof b=="string"&&!a.effects[b]?!0:!1}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){return a.isFunction(d)&&(e=d,d=null),this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class")||"";a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.23",save:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){return b=="toggle"&&(b=a.is(":hidden")?"show":"hide"),b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;try{e.id}catch(f){e=document.body}return b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;return b.parent().is(".ui-effects-wrapper")?(c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus(),c):b},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){var f=b.cssUnit(c);f[0]>0&&(e[c]=f[0]*d+f[1])}),e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];return a.fx.off||!i?h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)}):i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="show",this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="hide",this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);return c[1].mode="toggle",this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d}});var m={};a.each(["Quad","Cubic","Quart","Quint","Expo"],function(a,b){m[b]=function(b){return Math.pow(b,a+2)}}),a.extend(m,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return a===0||a===1?a:-Math.pow(2,8*(a-1))*Math.sin(((a-1)*80-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){var b,c=4;while(a<((b=Math.pow(2,--c))-1)/11);return 1/Math.pow(4,3-c)-7.5625*Math.pow((b*3-2)/22-a,2)}}),a.each(m,function(b,c){a.easing["easeIn"+b]=c,a.easing["easeOut"+b]=function(a){return 1-c(1-a)},a.easing["easeInOut"+b]=function(a){return a<.5?c(a*2)/2:c(a*-2+2)/-2+1}})}(jQuery);;
|
js/brand/smoothdivscroll/jquery.kinetic.js
ADDED
@@ -0,0 +1,388 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
jQuery.kinetic v1.5
|
3 |
+
Dave Taylor http://the-taylors.org/jquery.kinetic
|
4 |
+
|
5 |
+
The MIT License (MIT)
|
6 |
+
Copyright (c) <2011> <Dave Taylor http://the-taylors.org>
|
7 |
+
*/
|
8 |
+
/*global define,require */
|
9 |
+
(function ($) {
|
10 |
+
'use strict';
|
11 |
+
|
12 |
+
var DEFAULT_SETTINGS = { decelerate: true
|
13 |
+
, triggerHardware: false
|
14 |
+
, y: true
|
15 |
+
, x: true
|
16 |
+
, slowdown: 0.9
|
17 |
+
, maxvelocity: 40
|
18 |
+
, throttleFPS: 60
|
19 |
+
, movingClass: {
|
20 |
+
up: 'kinetic-moving-up'
|
21 |
+
, down: 'kinetic-moving-down'
|
22 |
+
, left: 'kinetic-moving-left'
|
23 |
+
, right: 'kinetic-moving-right'
|
24 |
+
}
|
25 |
+
, deceleratingClass: {
|
26 |
+
up: 'kinetic-decelerating-up'
|
27 |
+
, down: 'kinetic-decelerating-down'
|
28 |
+
, left: 'kinetic-decelerating-left'
|
29 |
+
, right: 'kinetic-decelerating-right'
|
30 |
+
}
|
31 |
+
},
|
32 |
+
SETTINGS_KEY = 'kinetic-settings',
|
33 |
+
ACTIVE_CLASS = 'kinetic-active';
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Provides requestAnimationFrame in a cross browser way.
|
37 |
+
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
38 |
+
*/
|
39 |
+
if (!window.requestAnimationFrame) {
|
40 |
+
|
41 |
+
window.requestAnimationFrame = (function () {
|
42 |
+
|
43 |
+
return window.webkitRequestAnimationFrame ||
|
44 |
+
window.mozRequestAnimationFrame ||
|
45 |
+
window.oRequestAnimationFrame ||
|
46 |
+
window.msRequestAnimationFrame ||
|
47 |
+
function ( /* function FrameRequestCallback */callback, /* DOMElement Element */element) {
|
48 |
+
window.setTimeout(callback, 1000 / 60);
|
49 |
+
};
|
50 |
+
|
51 |
+
} ());
|
52 |
+
|
53 |
+
}
|
54 |
+
|
55 |
+
// add touch checker to jQuery.support
|
56 |
+
$.support = $.support || {};
|
57 |
+
$.extend($.support, {
|
58 |
+
touch: "ontouchend" in document
|
59 |
+
});
|
60 |
+
var selectStart = function () { return false; };
|
61 |
+
|
62 |
+
var decelerateVelocity = function (velocity, slowdown) {
|
63 |
+
return Math.floor(Math.abs(velocity)) === 0 ? 0 // is velocity less than 1?
|
64 |
+
: velocity * slowdown; // reduce slowdown
|
65 |
+
};
|
66 |
+
|
67 |
+
var capVelocity = function (velocity, max) {
|
68 |
+
var newVelocity = velocity;
|
69 |
+
if (velocity > 0) {
|
70 |
+
if (velocity > max) {
|
71 |
+
newVelocity = max;
|
72 |
+
}
|
73 |
+
} else {
|
74 |
+
if (velocity < (0 - max)) {
|
75 |
+
newVelocity = (0 - max);
|
76 |
+
}
|
77 |
+
}
|
78 |
+
return newVelocity;
|
79 |
+
};
|
80 |
+
|
81 |
+
var setMoveClasses = function (settings, classes) {
|
82 |
+
this.removeClass(settings.movingClass.up)
|
83 |
+
.removeClass(settings.movingClass.down)
|
84 |
+
.removeClass(settings.movingClass.left)
|
85 |
+
.removeClass(settings.movingClass.right)
|
86 |
+
.removeClass(settings.deceleratingClass.up)
|
87 |
+
.removeClass(settings.deceleratingClass.down)
|
88 |
+
.removeClass(settings.deceleratingClass.left)
|
89 |
+
.removeClass(settings.deceleratingClass.right);
|
90 |
+
|
91 |
+
if (settings.velocity > 0) {
|
92 |
+
this.addClass(classes.right);
|
93 |
+
}
|
94 |
+
if (settings.velocity < 0) {
|
95 |
+
this.addClass(classes.left);
|
96 |
+
}
|
97 |
+
if (settings.velocityY > 0) {
|
98 |
+
this.addClass(classes.down);
|
99 |
+
}
|
100 |
+
if (settings.velocityY < 0) {
|
101 |
+
this.addClass(classes.up);
|
102 |
+
}
|
103 |
+
|
104 |
+
};
|
105 |
+
|
106 |
+
var stop = function ($scroller, settings) {
|
107 |
+
if (typeof settings.stopped === 'function') {
|
108 |
+
settings.stopped.call($scroller, settings);
|
109 |
+
}
|
110 |
+
};
|
111 |
+
|
112 |
+
/** do the actual kinetic movement */
|
113 |
+
var move = function ($scroller, settings) {
|
114 |
+
var scroller = $scroller[0];
|
115 |
+
// set scrollLeft
|
116 |
+
if (settings.x && scroller.scrollWidth > 0) {
|
117 |
+
scroller.scrollLeft = settings.scrollLeft = scroller.scrollLeft + settings.velocity;
|
118 |
+
if (Math.abs(settings.velocity) > 0) {
|
119 |
+
settings.velocity = settings.decelerate ?
|
120 |
+
decelerateVelocity(settings.velocity, settings.slowdown) : settings.velocity;
|
121 |
+
}
|
122 |
+
} else {
|
123 |
+
settings.velocity = 0;
|
124 |
+
}
|
125 |
+
|
126 |
+
// set scrollTop
|
127 |
+
if (settings.y && scroller.scrollHeight > 0) {
|
128 |
+
scroller.scrollTop = settings.scrollTop = scroller.scrollTop + settings.velocityY;
|
129 |
+
if (Math.abs(settings.velocityY) > 0) {
|
130 |
+
settings.velocityY = settings.decelerate ?
|
131 |
+
decelerateVelocity(settings.velocityY, settings.slowdown) : settings.velocityY;
|
132 |
+
}
|
133 |
+
} else {
|
134 |
+
settings.velocityY = 0;
|
135 |
+
}
|
136 |
+
|
137 |
+
setMoveClasses.call($scroller, settings, settings.deceleratingClass);
|
138 |
+
|
139 |
+
if (typeof settings.moved === 'function') {
|
140 |
+
settings.moved.call($scroller, settings);
|
141 |
+
}
|
142 |
+
|
143 |
+
if (Math.abs(settings.velocity) > 0 || Math.abs(settings.velocityY) > 0) {
|
144 |
+
// tick for next movement
|
145 |
+
window.requestAnimationFrame(function () { move($scroller, settings); });
|
146 |
+
} else {
|
147 |
+
stop($scroller, settings);
|
148 |
+
}
|
149 |
+
};
|
150 |
+
|
151 |
+
var callOption = function (method, options) {
|
152 |
+
var methodFn = $.kinetic.callMethods[method]
|
153 |
+
, args = Array.prototype.slice.call(arguments)
|
154 |
+
;
|
155 |
+
if (methodFn) {
|
156 |
+
this.each(function () {
|
157 |
+
var opts = args.slice(1), settings = $(this).data(SETTINGS_KEY);
|
158 |
+
opts.unshift(settings);
|
159 |
+
methodFn.apply(this, opts);
|
160 |
+
});
|
161 |
+
}
|
162 |
+
};
|
163 |
+
|
164 |
+
var attachListeners = function ($this, settings) {
|
165 |
+
var element = $this[0];
|
166 |
+
if ($.support.touch) {
|
167 |
+
element.addEventListener('touchstart', settings.events.touchStart, false);
|
168 |
+
element.addEventListener('touchend', settings.events.inputEnd, false);
|
169 |
+
element.addEventListener('touchmove', settings.events.touchMove, false);
|
170 |
+
} else {
|
171 |
+
$this
|
172 |
+
.mousedown(settings.events.inputDown)
|
173 |
+
.mouseup(settings.events.inputEnd)
|
174 |
+
.mousemove(settings.events.inputMove);
|
175 |
+
}
|
176 |
+
$this.click(settings.events.inputClick)
|
177 |
+
.bind("selectstart", selectStart); // prevent selection when dragging
|
178 |
+
$this.bind('dragstart', settings.events.dragStart);
|
179 |
+
};
|
180 |
+
var detachListeners = function ($this, settings) {
|
181 |
+
var element = $this[0];
|
182 |
+
if ($.support.touch) {
|
183 |
+
element.removeEventListener('touchstart', settings.events.touchStart, false);
|
184 |
+
element.removeEventListener('touchend', settings.events.inputEnd, false);
|
185 |
+
element.removeEventListener('touchmove', settings.events.touchMove, false);
|
186 |
+
} else {
|
187 |
+
$this
|
188 |
+
.unbind('mousedown', settings.events.inputDown)
|
189 |
+
.unbind('mouseup', settings.events.inputEnd)
|
190 |
+
.unbind('mousemove', settings.events.inputMove);
|
191 |
+
}
|
192 |
+
$this.unbind('click', settings.events.inputClick)
|
193 |
+
.unbind("selectstart", selectStart); // prevent selection when dragging
|
194 |
+
$this.unbind('dragstart', settings.events.dragStart);
|
195 |
+
};
|
196 |
+
|
197 |
+
var initElements = function (options) {
|
198 |
+
this
|
199 |
+
.addClass(ACTIVE_CLASS)
|
200 |
+
.each(function () {
|
201 |
+
|
202 |
+
var settings = $.extend({}, DEFAULT_SETTINGS, options);
|
203 |
+
|
204 |
+
var self = this
|
205 |
+
, $this = $(this)
|
206 |
+
, xpos
|
207 |
+
, prevXPos = false
|
208 |
+
, ypos
|
209 |
+
, prevYPos = false
|
210 |
+
, mouseDown = false
|
211 |
+
, scrollLeft
|
212 |
+
, scrollTop
|
213 |
+
, throttleTimeout = 1000 / settings.throttleFPS
|
214 |
+
, lastMove
|
215 |
+
, elementFocused
|
216 |
+
;
|
217 |
+
|
218 |
+
settings.velocity = 0;
|
219 |
+
settings.velocityY = 0;
|
220 |
+
|
221 |
+
// make sure we reset everything when mouse up
|
222 |
+
var resetMouse = function () {
|
223 |
+
xpos = false;
|
224 |
+
ypos = false;
|
225 |
+
mouseDown = false;
|
226 |
+
};
|
227 |
+
$(document).mouseup(resetMouse).click(resetMouse);
|
228 |
+
|
229 |
+
var calculateVelocities = function () {
|
230 |
+
settings.velocity = capVelocity(prevXPos - xpos, settings.maxvelocity);
|
231 |
+
settings.velocityY = capVelocity(prevYPos - ypos, settings.maxvelocity);
|
232 |
+
};
|
233 |
+
var useTarget = function (target) {
|
234 |
+
if ($.isFunction(settings.filterTarget)) {
|
235 |
+
return settings.filterTarget.call(self, target) !== false;
|
236 |
+
}
|
237 |
+
return true;
|
238 |
+
};
|
239 |
+
var start = function (clientX, clientY) {
|
240 |
+
mouseDown = true;
|
241 |
+
settings.velocity = prevXPos = 0;
|
242 |
+
settings.velocityY = prevYPos = 0;
|
243 |
+
xpos = clientX;
|
244 |
+
ypos = clientY;
|
245 |
+
};
|
246 |
+
var end = function () {
|
247 |
+
if (xpos && prevXPos && settings.decelerate === false) {
|
248 |
+
settings.decelerate = true;
|
249 |
+
calculateVelocities();
|
250 |
+
xpos = prevXPos = mouseDown = false;
|
251 |
+
move($this, settings);
|
252 |
+
}
|
253 |
+
};
|
254 |
+
var inputmove = function (clientX, clientY) {
|
255 |
+
if (!lastMove || new Date() > new Date(lastMove.getTime() + throttleTimeout)) {
|
256 |
+
lastMove = new Date();
|
257 |
+
|
258 |
+
if (mouseDown && (xpos || ypos)) {
|
259 |
+
if (elementFocused) {
|
260 |
+
$(elementFocused).blur();
|
261 |
+
elementFocused = null;
|
262 |
+
$this.focus();
|
263 |
+
}
|
264 |
+
settings.decelerate = false;
|
265 |
+
settings.velocity = settings.velocityY = 0;
|
266 |
+
$this[0].scrollLeft = settings.scrollLeft = settings.x ? $this[0].scrollLeft - (clientX - xpos) : $this[0].scrollLeft;
|
267 |
+
$this[0].scrollTop = settings.scrollTop = settings.y ? $this[0].scrollTop - (clientY - ypos) : $this[0].scrollTop;
|
268 |
+
prevXPos = xpos;
|
269 |
+
prevYPos = ypos;
|
270 |
+
xpos = clientX;
|
271 |
+
ypos = clientY;
|
272 |
+
|
273 |
+
calculateVelocities();
|
274 |
+
setMoveClasses.call($this, settings, settings.movingClass);
|
275 |
+
|
276 |
+
if (typeof settings.moved === 'function') {
|
277 |
+
settings.moved.call($this, settings);
|
278 |
+
}
|
279 |
+
}
|
280 |
+
}
|
281 |
+
};
|
282 |
+
|
283 |
+
// Events
|
284 |
+
settings.events = {
|
285 |
+
touchStart: function (e) {
|
286 |
+
if (useTarget(e.target)) {
|
287 |
+
start(e.touches[0].clientX, e.touches[0].clientY);
|
288 |
+
e.stopPropagation();
|
289 |
+
}
|
290 |
+
},
|
291 |
+
touchMove: function (e) {
|
292 |
+
if (mouseDown) {
|
293 |
+
inputmove(e.touches[0].clientX, e.touches[0].clientY);
|
294 |
+
if (e.preventDefault) { e.preventDefault(); }
|
295 |
+
}
|
296 |
+
},
|
297 |
+
inputDown: function (e) {
|
298 |
+
if (useTarget(e.target)) {
|
299 |
+
start(e.clientX, e.clientY);
|
300 |
+
elementFocused = e.target;
|
301 |
+
if (e.target.nodeName === 'IMG') {
|
302 |
+
e.preventDefault();
|
303 |
+
}
|
304 |
+
e.stopPropagation();
|
305 |
+
}
|
306 |
+
},
|
307 |
+
inputEnd: function (e) {
|
308 |
+
end();
|
309 |
+
elementFocused = null;
|
310 |
+
if (e.preventDefault) { e.preventDefault(); }
|
311 |
+
},
|
312 |
+
inputMove: function (e) {
|
313 |
+
if (mouseDown) {
|
314 |
+
inputmove(e.clientX, e.clientY);
|
315 |
+
if (e.preventDefault) { e.preventDefault(); }
|
316 |
+
}
|
317 |
+
},
|
318 |
+
inputClick: function (e) {
|
319 |
+
if (Math.abs(settings.velocity) > 0) {
|
320 |
+
e.preventDefault();
|
321 |
+
return false;
|
322 |
+
}
|
323 |
+
},
|
324 |
+
// prevent drag and drop images in ie
|
325 |
+
dragStart: function (e) {
|
326 |
+
if (elementFocused) {
|
327 |
+
return false;
|
328 |
+
}
|
329 |
+
}
|
330 |
+
};
|
331 |
+
|
332 |
+
attachListeners($this, settings);
|
333 |
+
$this.data(SETTINGS_KEY, settings).css("cursor", "move");
|
334 |
+
|
335 |
+
if (settings.triggerHardware) {
|
336 |
+
$this.css('-webkit-transform', 'translate3d(0,0,0)');
|
337 |
+
}
|
338 |
+
});
|
339 |
+
};
|
340 |
+
|
341 |
+
$.kinetic = {
|
342 |
+
settingsKey: SETTINGS_KEY,
|
343 |
+
callMethods: {
|
344 |
+
start: function (settings, options) {
|
345 |
+
var $this = $(this);
|
346 |
+
settings = $.extend(settings, options);
|
347 |
+
if (settings) {
|
348 |
+
settings.decelerate = false;
|
349 |
+
move($this, settings);
|
350 |
+
}
|
351 |
+
},
|
352 |
+
end: function (settings, options) {
|
353 |
+
var $this = $(this);
|
354 |
+
if (settings) {
|
355 |
+
settings.decelerate = true;
|
356 |
+
}
|
357 |
+
},
|
358 |
+
stop: function (settings, options) {
|
359 |
+
settings.velocity = 0;
|
360 |
+
settings.velocityY = 0;
|
361 |
+
settings.decelerate = true;
|
362 |
+
},
|
363 |
+
detach: function (settings, options) {
|
364 |
+
var $this = $(this);
|
365 |
+
detachListeners($this, settings);
|
366 |
+
$this
|
367 |
+
.removeClass(ACTIVE_CLASS)
|
368 |
+
.css("cursor", "");
|
369 |
+
},
|
370 |
+
attach: function (settings, options) {
|
371 |
+
var $this = $(this);
|
372 |
+
attachListeners($this, settings);
|
373 |
+
$this
|
374 |
+
.addClass(ACTIVE_CLASS)
|
375 |
+
.css("cursor", "move");
|
376 |
+
}
|
377 |
+
}
|
378 |
+
};
|
379 |
+
$.fn.kinetic = function (options) {
|
380 |
+
if (typeof options === 'string') {
|
381 |
+
callOption.apply(this, arguments);
|
382 |
+
} else {
|
383 |
+
initElements.call(this, options);
|
384 |
+
}
|
385 |
+
return this;
|
386 |
+
};
|
387 |
+
|
388 |
+
} (window.jQuery || window.Zepto));
|
js/brand/smoothdivscroll/jquery.mousewheel.min.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
|
2 |
+
* Licensed under the MIT License (LICENSE.txt).
|
3 |
+
*
|
4 |
+
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
5 |
+
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
6 |
+
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
7 |
+
*
|
8 |
+
* Version: 3.0.6
|
9 |
+
*
|
10 |
+
* Requires: 1.2.2+
|
11 |
+
*/
|
12 |
+
(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery)
|
js/brand/smoothdivscroll/jquery.smoothDivScroll-1.3.js
ADDED
@@ -0,0 +1,1298 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery SmoothDivScroll 1.3
|
3 |
+
*
|
4 |
+
* Copyright (c) 2012 Thomas Kahn
|
5 |
+
* Licensed under the GPL license.
|
6 |
+
*
|
7 |
+
* http://www.smoothdivscroll.com/
|
8 |
+
*
|
9 |
+
* Depends:
|
10 |
+
* jquery-1.8.x.min.js
|
11 |
+
Please use https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js
|
12 |
+
...or later
|
13 |
+
|
14 |
+
* jquery.ui.widget.js
|
15 |
+
* jquery.ui.effects.min.js
|
16 |
+
Make your own custom download at http://jqueryui.com/download.
|
17 |
+
First deselect all components. Then check just "Widget" and "Effects Core".
|
18 |
+
Download the file and put it in your javascript folder.
|
19 |
+
|
20 |
+
* jquery.mousewheel.min.js
|
21 |
+
Used for mousewheel functionality.
|
22 |
+
Download the latest version at http://brandonaaron.net/code/mousewheel/demos
|
23 |
+
*
|
24 |
+
|
25 |
+
* jquery.kinetic.js
|
26 |
+
Used for scrolling by dragging, mainly used on touch devices.
|
27 |
+
Download the latest version at https://github.com/davetayls/jquery.kinetic
|
28 |
+
*
|
29 |
+
*/
|
30 |
+
(function ($) {
|
31 |
+
|
32 |
+
$.widget("thomaskahn.smoothDivScroll", {
|
33 |
+
// Default options
|
34 |
+
options: {
|
35 |
+
// Classes for elements added by Smooth Div Scroll
|
36 |
+
scrollingHotSpotLeftClass: "scrollingHotSpotLeft", // String
|
37 |
+
scrollingHotSpotRightClass: "scrollingHotSpotRight", // String
|
38 |
+
scrollableAreaClass: "scrollableArea", // String
|
39 |
+
scrollWrapperClass: "scrollWrapper", // String
|
40 |
+
|
41 |
+
// Misc settings
|
42 |
+
hiddenOnStart: false, // Boolean
|
43 |
+
getContentOnLoad: {}, // Object
|
44 |
+
countOnlyClass: "", // String
|
45 |
+
startAtElementId: "", // String
|
46 |
+
|
47 |
+
// Hotspot scrolling
|
48 |
+
hotSpotScrolling: true, // Boolean
|
49 |
+
hotSpotScrollingStep: 15, // Pixels
|
50 |
+
hotSpotScrollingInterval: 10, // Milliseconds
|
51 |
+
hotSpotMouseDownSpeedBooster: 3, // Integer
|
52 |
+
visibleHotSpotBackgrounds: "hover", // always, onStart, hover or empty (no visible hotspots)
|
53 |
+
hotSpotsVisibleTime: 5000, // Milliseconds
|
54 |
+
easingAfterHotSpotScrolling: true, // Boolean
|
55 |
+
easingAfterHotSpotScrollingDistance: 10, // Pixels
|
56 |
+
easingAfterHotSpotScrollingDuration: 300, // Milliseconds
|
57 |
+
easingAfterHotSpotScrollingFunction: "easeOutQuart", // String
|
58 |
+
|
59 |
+
// Mousewheel scrolling
|
60 |
+
mousewheelScrolling: "", // vertical, horizontal, allDirections or empty (no mousewheel scrolling) String
|
61 |
+
mousewheelScrollingStep: 70, // Pixels
|
62 |
+
easingAfterMouseWheelScrolling: true, // Boolean
|
63 |
+
easingAfterMouseWheelScrollingDuration: 300, // Milliseconds
|
64 |
+
easingAfterMouseWheelScrollingFunction: "easeOutQuart", // String
|
65 |
+
|
66 |
+
// Manual scrolling (hotspot and/or mousewheel scrolling)
|
67 |
+
manualContinuousScrolling: false, // Boolean
|
68 |
+
|
69 |
+
// Autoscrolling
|
70 |
+
autoScrollingMode: "", // always, onStart or empty (no auto scrolling) String
|
71 |
+
autoScrollingDirection: "endlessLoopRight", // right, left, backAndForth, endlessLoopRight, endlessLoopLeft String
|
72 |
+
autoScrollingStep: 1, // Pixels
|
73 |
+
autoScrollingInterval: 10, // Milliseconds
|
74 |
+
|
75 |
+
// Touch scrolling
|
76 |
+
touchScrolling: false,
|
77 |
+
|
78 |
+
// Easing for when the scrollToElement method is used
|
79 |
+
scrollToAnimationDuration: 1000, // Milliseconds
|
80 |
+
scrollToEasingFunction: "easeOutQuart" // String
|
81 |
+
},
|
82 |
+
_create: function () {
|
83 |
+
var self = this, o = this.options, el = this.element;
|
84 |
+
|
85 |
+
// Create variables for any existing or not existing
|
86 |
+
// scroller elements on the page.
|
87 |
+
el.data("scrollWrapper", el.find("." + o.scrollWrapperClass));
|
88 |
+
el.data("scrollingHotSpotRight", el.find("." + o.scrollingHotSpotRightClass));
|
89 |
+
el.data("scrollingHotSpotLeft", el.find("." + o.scrollingHotSpotLeftClass));
|
90 |
+
el.data("scrollableArea", el.find("." + o.scrollableAreaClass));
|
91 |
+
|
92 |
+
// Check which elements are already present on the page.
|
93 |
+
// Create any elements needed by the plugin if
|
94 |
+
// the user hasn't already created them.
|
95 |
+
|
96 |
+
// First detach any present hot spots
|
97 |
+
if (el.data("scrollingHotSpotRight").length > 0) {
|
98 |
+
|
99 |
+
el.data("scrollingHotSpotRight").detach();
|
100 |
+
}
|
101 |
+
if (el.data("scrollingHotSpotLeft").length > 0) {
|
102 |
+
|
103 |
+
el.data("scrollingHotSpotLeft").detach();
|
104 |
+
}
|
105 |
+
|
106 |
+
// Both the scrollable area and the wrapper are missing
|
107 |
+
if (el.data("scrollableArea").length === 0 && el.data("scrollWrapper").length === 0) {
|
108 |
+
el.wrapInner("<div class='" + o.scrollableAreaClass + "'>").wrapInner("<div class='" + o.scrollWrapperClass + "'>");
|
109 |
+
|
110 |
+
el.data("scrollWrapper", el.find("." + o.scrollWrapperClass));
|
111 |
+
el.data("scrollableArea", el.find("." + o.scrollableAreaClass));
|
112 |
+
}
|
113 |
+
// Only the wrapper is missing
|
114 |
+
else if (el.data("scrollWrapper").length === 0) {
|
115 |
+
el.wrapInner("<div class='" + o.scrollWrapperClass + "'>");
|
116 |
+
el.data("scrollWrapper", el.find("." + o.scrollWrapperClass));
|
117 |
+
}
|
118 |
+
// Only the scrollable area is missing
|
119 |
+
else if (el.data("scrollableArea").length === 0) {
|
120 |
+
el.data("scrollWrapper").wrapInner("<div class='" + o.scrollableAreaClass + "'>");
|
121 |
+
el.data("scrollableArea", el.find("." + o.scrollableAreaClass));
|
122 |
+
}
|
123 |
+
|
124 |
+
// Put the right and left hot spot back into the scroller again
|
125 |
+
// or create them if they where not present from the beginning.
|
126 |
+
if (el.data("scrollingHotSpotRight").length === 0) {
|
127 |
+
el.prepend("<div class='" + o.scrollingHotSpotRightClass + "'></div>");
|
128 |
+
el.data("scrollingHotSpotRight", el.find("." + o.scrollingHotSpotRightClass));
|
129 |
+
} else {
|
130 |
+
el.prepend(el.data("scrollingHotSpotRight"));
|
131 |
+
}
|
132 |
+
|
133 |
+
if (el.data("scrollingHotSpotLeft").length === 0) {
|
134 |
+
el.prepend("<div class='" + o.scrollingHotSpotLeftClass + "'></div>");
|
135 |
+
el.data("scrollingHotSpotLeft", el.find("." + o.scrollingHotSpotLeftClass));
|
136 |
+
} else {
|
137 |
+
el.prepend(el.data("scrollingHotSpotLeft"));
|
138 |
+
}
|
139 |
+
|
140 |
+
|
141 |
+
// Create variables in the element data storage
|
142 |
+
el.data("speedBooster", 1);
|
143 |
+
el.data("scrollXPos", 0);
|
144 |
+
el.data("hotSpotWidth", el.data("scrollingHotSpotLeft").innerWidth());
|
145 |
+
el.data("scrollableAreaWidth", 0);
|
146 |
+
el.data("startingPosition", 0);
|
147 |
+
el.data("rightScrollingInterval", null);
|
148 |
+
el.data("leftScrollingInterval", null);
|
149 |
+
el.data("autoScrollingInterval", null);
|
150 |
+
el.data("hideHotSpotBackgroundsInterval", null);
|
151 |
+
el.data("previousScrollLeft", 0);
|
152 |
+
el.data("pingPongDirection", "right");
|
153 |
+
el.data("getNextElementWidth", true);
|
154 |
+
el.data("swapAt", null);
|
155 |
+
el.data("startAtElementHasNotPassed", true);
|
156 |
+
el.data("swappedElement", null);
|
157 |
+
el.data("originalElements", el.data("scrollableArea").children(o.countOnlyClass));
|
158 |
+
el.data("visible", true);
|
159 |
+
el.data("enabled", true);
|
160 |
+
el.data("scrollableAreaHeight", el.data("scrollableArea").height());
|
161 |
+
el.data("scrollerOffset", el.offset());
|
162 |
+
|
163 |
+
/*****************************************
|
164 |
+
SET UP EVENTS FOR TOUCH SCROLLING
|
165 |
+
*****************************************/
|
166 |
+
if (o.touchScrolling && el.data("enabled")) {
|
167 |
+
// Use jquery.kinetic.js for touch scrolling
|
168 |
+
// Vertical scrolling disabled
|
169 |
+
el.data("scrollWrapper").kinetic({
|
170 |
+
y: false,
|
171 |
+
moved: function (settings) {
|
172 |
+
if (o.manualContinuousScrolling) {
|
173 |
+
if (el.data("scrollWrapper").scrollLeft() <= 0) {
|
174 |
+
self._checkContinuousSwapLeft();
|
175 |
+
} else {
|
176 |
+
self._checkContinuousSwapRight();
|
177 |
+
}
|
178 |
+
}
|
179 |
+
},
|
180 |
+
stopped: function (settings) {
|
181 |
+
// Stop any ongoing animations
|
182 |
+
el.data("scrollWrapper").stop(true, false);
|
183 |
+
|
184 |
+
// Stop any ongoing auto scrolling
|
185 |
+
self.stopAutoScrolling();
|
186 |
+
}
|
187 |
+
});
|
188 |
+
}
|
189 |
+
|
190 |
+
/*****************************************
|
191 |
+
SET UP EVENTS FOR SCROLLING RIGHT
|
192 |
+
*****************************************/
|
193 |
+
// Check the mouse X position and calculate
|
194 |
+
// the relative X position inside the right hotspot
|
195 |
+
el.data("scrollingHotSpotRight").bind("mousemove", function (e) {
|
196 |
+
if (o.hotSpotScrolling) {
|
197 |
+
var x = e.pageX - (this.offsetLeft + el.data("scrollerOffset").left);
|
198 |
+
el.data("scrollXPos", Math.round((x / el.data("hotSpotWidth")) * o.hotSpotScrollingStep));
|
199 |
+
|
200 |
+
// If the position is less then 1, it's set to 1
|
201 |
+
if (el.data("scrollXPos") === Infinity || el.data("scrollXPos") < 1) {
|
202 |
+
el.data("scrollXPos", 1);
|
203 |
+
}
|
204 |
+
}
|
205 |
+
});
|
206 |
+
|
207 |
+
// Mouseover right hotspot - scrolling
|
208 |
+
el.data("scrollingHotSpotRight").bind("mouseover", function () {
|
209 |
+
if (o.hotSpotScrolling) {
|
210 |
+
// Stop any ongoing animations
|
211 |
+
el.data("scrollWrapper").stop(true, false);
|
212 |
+
|
213 |
+
// Stop any ongoing auto scrolling
|
214 |
+
self.stopAutoScrolling();
|
215 |
+
|
216 |
+
// Start the scrolling interval
|
217 |
+
el.data("rightScrollingInterval", setInterval(function () {
|
218 |
+
if (el.data("scrollXPos") > 0 && el.data("enabled")) {
|
219 |
+
el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft() + (el.data("scrollXPos") * el.data("speedBooster")));
|
220 |
+
|
221 |
+
if (o.manualContinuousScrolling) {
|
222 |
+
self._checkContinuousSwapRight();
|
223 |
+
}
|
224 |
+
|
225 |
+
self._showHideHotSpots();
|
226 |
+
}
|
227 |
+
}, o.hotSpotScrollingInterval));
|
228 |
+
|
229 |
+
// Callback
|
230 |
+
self._trigger("mouseOverRightHotSpot");
|
231 |
+
}
|
232 |
+
});
|
233 |
+
|
234 |
+
// Mouseout right hotspot - stop scrolling
|
235 |
+
el.data("scrollingHotSpotRight").bind("mouseout", function () {
|
236 |
+
if (o.hotSpotScrolling) {
|
237 |
+
clearInterval(el.data("rightScrollingInterval"));
|
238 |
+
el.data("scrollXPos", 0);
|
239 |
+
|
240 |
+
// Easing out after scrolling
|
241 |
+
if (o.easingAfterHotSpotScrolling && el.data("enabled")) {
|
242 |
+
el.data("scrollWrapper").animate({ scrollLeft: el.data("scrollWrapper").scrollLeft() + o.easingAfterHotSpotScrollingDistance }, { duration: o.easingAfterHotSpotScrollingDuration, easing: o.easingAfterHotSpotScrollingFunction });
|
243 |
+
}
|
244 |
+
}
|
245 |
+
});
|
246 |
+
|
247 |
+
|
248 |
+
// mousedown right hotspot (add scrolling speed booster)
|
249 |
+
el.data("scrollingHotSpotRight").bind("mousedown", function () {
|
250 |
+
el.data("speedBooster", o.hotSpotMouseDownSpeedBooster);
|
251 |
+
});
|
252 |
+
|
253 |
+
// mouseup anywhere (stop boosting the scrolling speed)
|
254 |
+
$("body").bind("mouseup", function () {
|
255 |
+
el.data("speedBooster", 1);
|
256 |
+
});
|
257 |
+
|
258 |
+
/*****************************************
|
259 |
+
SET UP EVENTS FOR SCROLLING LEFT
|
260 |
+
*****************************************/
|
261 |
+
// Check the mouse X position and calculate
|
262 |
+
// the relative X position inside the left hotspot
|
263 |
+
el.data("scrollingHotSpotLeft").bind("mousemove", function (e) {
|
264 |
+
if (o.hotSpotScrolling) {
|
265 |
+
var x = ((this.offsetLeft + el.data("scrollerOffset").left + el.data("hotSpotWidth")) - e.pageX);
|
266 |
+
|
267 |
+
el.data("scrollXPos", Math.round((x / el.data("hotSpotWidth")) * o.hotSpotScrollingStep));
|
268 |
+
|
269 |
+
// If the position is less then 1, it's set to 1
|
270 |
+
if (el.data("scrollXPos") === Infinity || el.data("scrollXPos") < 1) {
|
271 |
+
el.data("scrollXPos", 1);
|
272 |
+
}
|
273 |
+
}
|
274 |
+
});
|
275 |
+
|
276 |
+
// Mouseover left hotspot
|
277 |
+
el.data("scrollingHotSpotLeft").bind("mouseover", function () {
|
278 |
+
if (o.hotSpotScrolling) {
|
279 |
+
// Stop any ongoing animations
|
280 |
+
el.data("scrollWrapper").stop(true, false);
|
281 |
+
|
282 |
+
// Stop any ongoing auto scrolling
|
283 |
+
self.stopAutoScrolling();
|
284 |
+
|
285 |
+
el.data("leftScrollingInterval", setInterval(function () {
|
286 |
+
if (el.data("scrollXPos") > 0 && el.data("enabled")) {
|
287 |
+
el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft() - (el.data("scrollXPos") * el.data("speedBooster")));
|
288 |
+
|
289 |
+
if (o.manualContinuousScrolling) {
|
290 |
+
self._checkContinuousSwapLeft();
|
291 |
+
}
|
292 |
+
|
293 |
+
self._showHideHotSpots();
|
294 |
+
}
|
295 |
+
}, o.hotSpotScrollingInterval));
|
296 |
+
|
297 |
+
// Callback
|
298 |
+
self._trigger("mouseOverLeftHotSpot");
|
299 |
+
}
|
300 |
+
});
|
301 |
+
|
302 |
+
// mouseout left hotspot
|
303 |
+
el.data("scrollingHotSpotLeft").bind("mouseout", function () {
|
304 |
+
if (o.hotSpotScrolling) {
|
305 |
+
clearInterval(el.data("leftScrollingInterval"));
|
306 |
+
el.data("scrollXPos", 0);
|
307 |
+
|
308 |
+
// Easing out after scrolling
|
309 |
+
if (o.easingAfterHotSpotScrolling && el.data("enabled")) {
|
310 |
+
el.data("scrollWrapper").animate({ scrollLeft: el.data("scrollWrapper").scrollLeft() - o.easingAfterHotSpotScrollingDistance }, { duration: o.easingAfterHotSpotScrollingDuration, easing: o.easingAfterHotSpotScrollingFunction });
|
311 |
+
}
|
312 |
+
}
|
313 |
+
});
|
314 |
+
|
315 |
+
// mousedown left hotspot (add scrolling speed booster)
|
316 |
+
el.data("scrollingHotSpotLeft").bind("mousedown", function () {
|
317 |
+
el.data("speedBooster", o.hotSpotMouseDownSpeedBooster);
|
318 |
+
});
|
319 |
+
|
320 |
+
/*****************************************
|
321 |
+
SET UP EVENT FOR MOUSEWHEEL SCROLLING
|
322 |
+
*****************************************/
|
323 |
+
el.data("scrollableArea").mousewheel(function (event, delta, deltaX, deltaY) {
|
324 |
+
|
325 |
+
if (el.data("enabled") && o.mousewheelScrolling.length > 0) {
|
326 |
+
var pixels;
|
327 |
+
|
328 |
+
// Can be either positive or negative
|
329 |
+
// Is multiplied/inverted by minus one since you want it to scroll
|
330 |
+
// left when moving the wheel down/right and right when moving the wheel up/left
|
331 |
+
if (o.mousewheelScrolling === "vertical" && deltaY !== 0) {
|
332 |
+
// Stop any ongoing auto scrolling if it's running
|
333 |
+
self.stopAutoScrolling();
|
334 |
+
event.preventDefault();
|
335 |
+
pixels = Math.round((o.mousewheelScrollingStep * deltaY) * -1);
|
336 |
+
self.move(pixels);
|
337 |
+
} else if (o.mousewheelScrolling === "horizontal" && deltaX !== 0) {
|
338 |
+
// Stop any ongoing auto scrolling if it's running
|
339 |
+
self.stopAutoScrolling();
|
340 |
+
event.preventDefault();
|
341 |
+
pixels = Math.round((o.mousewheelScrollingStep * deltaX) * -1);
|
342 |
+
self.move(pixels);
|
343 |
+
} else if (o.mousewheelScrolling === "allDirections") {
|
344 |
+
// Stop any ongoing auto scrolling if it's running
|
345 |
+
self.stopAutoScrolling();
|
346 |
+
event.preventDefault();
|
347 |
+
pixels = Math.round((o.mousewheelScrollingStep * delta) * -1);
|
348 |
+
self.move(pixels);
|
349 |
+
}
|
350 |
+
|
351 |
+
|
352 |
+
}
|
353 |
+
});
|
354 |
+
|
355 |
+
// Capture and disable mousewheel events when the pointer
|
356 |
+
// is over any of the hotspots
|
357 |
+
if (o.mousewheelScrolling) {
|
358 |
+
el.data("scrollingHotSpotLeft").add(el.data("scrollingHotSpotRight")).mousewheel(function (event) {
|
359 |
+
event.preventDefault();
|
360 |
+
});
|
361 |
+
}
|
362 |
+
|
363 |
+
/*****************************************
|
364 |
+
SET UP EVENT FOR RESIZING THE BROWSER WINDOW
|
365 |
+
*****************************************/
|
366 |
+
$(window).bind("resize", function () {
|
367 |
+
self._showHideHotSpots();
|
368 |
+
self._trigger("windowResized");
|
369 |
+
});
|
370 |
+
|
371 |
+
/*****************************************
|
372 |
+
FETCHING CONTENT ON INITIALIZATION
|
373 |
+
*****************************************/
|
374 |
+
// If getContentOnLoad is present in the options,
|
375 |
+
// sort out the method and parameters and get the content
|
376 |
+
|
377 |
+
if (!(jQuery.isEmptyObject(o.getContentOnLoad))) {
|
378 |
+
self[o.getContentOnLoad.method](o.getContentOnLoad.content, o.getContentOnLoad.manipulationMethod, o.getContentOnLoad.addWhere, o.getContentOnLoad.filterTag);
|
379 |
+
}
|
380 |
+
|
381 |
+
// Should it be hidden on start?
|
382 |
+
if (o.hiddenOnStart) {
|
383 |
+
self.hide();
|
384 |
+
}
|
385 |
+
|
386 |
+
/*****************************************
|
387 |
+
AUTOSCROLLING
|
388 |
+
*****************************************/
|
389 |
+
// The $(window).load event handler is used because the width of the elements are not calculated
|
390 |
+
// properly until then, at least not in Google Chrome. The start of the auto scrolling and the
|
391 |
+
// setting of the hotspot backgrounds is started here as well for the same reason.
|
392 |
+
// If the auto scrolling is not started in $(window).load, it won't start because it
|
393 |
+
// will interpret the scrollable areas as too short.
|
394 |
+
$(window).load(function () {
|
395 |
+
|
396 |
+
// If scroller is not hidden, recalculate the scrollable area
|
397 |
+
if (!(o.hiddenOnStart)) {
|
398 |
+
self.recalculateScrollableArea();
|
399 |
+
}
|
400 |
+
|
401 |
+
// Autoscrolling is active
|
402 |
+
if ((o.autoScrollingMode.length > 0) && !(o.hiddenOnStart)) {
|
403 |
+
self.startAutoScrolling();
|
404 |
+
}
|
405 |
+
|
406 |
+
// If the user wants to have visible hotspot backgrounds,
|
407 |
+
// here is where it's taken care of
|
408 |
+
if (o.autoScrollingMode !== "always") {
|
409 |
+
|
410 |
+
switch (o.visibleHotSpotBackgrounds) {
|
411 |
+
case "always":
|
412 |
+
self.showHotSpotBackgrounds();
|
413 |
+
break;
|
414 |
+
case "onStart":
|
415 |
+
self.showHotSpotBackgrounds();
|
416 |
+
el.data("hideHotSpotBackgroundsInterval", setTimeout(function () {
|
417 |
+
self.hideHotSpotBackgrounds(250);
|
418 |
+
}, o.hotSpotsVisibleTime));
|
419 |
+
break;
|
420 |
+
case "hover":
|
421 |
+
el.mouseenter(function (event) {
|
422 |
+
if (o.hotSpotScrolling) {
|
423 |
+
event.stopPropagation();
|
424 |
+
self.showHotSpotBackgrounds(250);
|
425 |
+
}
|
426 |
+
}).mouseleave(function (event) {
|
427 |
+
if (o.hotSpotScrolling) {
|
428 |
+
event.stopPropagation();
|
429 |
+
self.hideHotSpotBackgrounds(250);
|
430 |
+
}
|
431 |
+
});
|
432 |
+
break;
|
433 |
+
default:
|
434 |
+
break;
|
435 |
+
}
|
436 |
+
}
|
437 |
+
|
438 |
+
self._showHideHotSpots();
|
439 |
+
|
440 |
+
self._trigger("setupComplete");
|
441 |
+
|
442 |
+
});
|
443 |
+
|
444 |
+
},
|
445 |
+
/**********************************************************
|
446 |
+
Override _setOption and handle altered options
|
447 |
+
**********************************************************/
|
448 |
+
_setOption: function (key, value) {
|
449 |
+
var self = this, o = this.options, el = this.element;
|
450 |
+
|
451 |
+
// Update option
|
452 |
+
o[key] = value;
|
453 |
+
|
454 |
+
if (key === "hotSpotScrolling") {
|
455 |
+
// Handler if the option hotSpotScrolling is altered
|
456 |
+
if (value === true) {
|
457 |
+
self._showHideHotSpots();
|
458 |
+
} else {
|
459 |
+
el.data("scrollingHotSpotLeft").hide();
|
460 |
+
el.data("scrollingHotSpotRight").hide();
|
461 |
+
}
|
462 |
+
} else if (key === "autoScrollingStep" ||
|
463 |
+
// Make sure that certain values are integers, otherwise
|
464 |
+
// they will summon bad spirits in the plugin
|
465 |
+
key === "easingAfterHotSpotScrollingDistance" ||
|
466 |
+
key === "easingAfterHotSpotScrollingDuration" ||
|
467 |
+
key === "easingAfterMouseWheelScrollingDuration") {
|
468 |
+
o[key] = parseInt(value, 10);
|
469 |
+
} else if (key === "autoScrollingInterval") {
|
470 |
+
// Handler if the autoScrollingInterval is altered
|
471 |
+
o[key] = parseInt(value, 10);
|
472 |
+
self.startAutoScrolling();
|
473 |
+
}
|
474 |
+
|
475 |
+
},
|
476 |
+
/**********************************************************
|
477 |
+
Hotspot functions
|
478 |
+
**********************************************************/
|
479 |
+
showHotSpotBackgrounds: function (fadeSpeed) {
|
480 |
+
|
481 |
+
// Alter the CSS (SmoothDivScroll.css) if you want to customize
|
482 |
+
// the look'n'feel of the visible hotspots
|
483 |
+
var self = this, el = this.element, o = this.option;
|
484 |
+
|
485 |
+
|
486 |
+
// Fade in the hotspot backgrounds
|
487 |
+
if (fadeSpeed !== undefined) {
|
488 |
+
// Before the fade-in starts, we need to make sure the opacity is zero
|
489 |
+
//el.data("scrollingHotSpotLeft").add(el.data("scrollingHotSpotRight")).css("opacity", "0.0");
|
490 |
+
|
491 |
+
el.data("scrollingHotSpotLeft").addClass("scrollingHotSpotLeftVisible");
|
492 |
+
el.data("scrollingHotSpotRight").addClass("scrollingHotSpotRightVisible");
|
493 |
+
|
494 |
+
// Fade in the hotspots
|
495 |
+
el.data("scrollingHotSpotLeft").add(el.data("scrollingHotSpotRight")).fadeTo(fadeSpeed, 0.35);
|
496 |
+
}
|
497 |
+
// Don't fade, just show them
|
498 |
+
else {
|
499 |
+
|
500 |
+
// The left hotspot
|
501 |
+
el.data("scrollingHotSpotLeft").addClass("scrollingHotSpotLeftVisible");
|
502 |
+
el.data("scrollingHotSpotLeft").removeAttr("style");
|
503 |
+
|
504 |
+
// The right hotspot
|
505 |
+
el.data("scrollingHotSpotRight").addClass("scrollingHotSpotRightVisible");
|
506 |
+
el.data("scrollingHotSpotRight").removeAttr("style");
|
507 |
+
}
|
508 |
+
|
509 |
+
self._showHideHotSpots();
|
510 |
+
|
511 |
+
},
|
512 |
+
hideHotSpotBackgrounds: function (fadeSpeed) {
|
513 |
+
var el = this.element, o = this.option;
|
514 |
+
|
515 |
+
// Fade out the hotspot backgrounds
|
516 |
+
if (fadeSpeed !== undefined) {
|
517 |
+
|
518 |
+
// Fade out the left hotspot
|
519 |
+
el.data("scrollingHotSpotLeft").fadeTo(fadeSpeed, 0.0, function () {
|
520 |
+
el.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible");
|
521 |
+
});
|
522 |
+
|
523 |
+
// Fade out the right hotspot
|
524 |
+
el.data("scrollingHotSpotRight").fadeTo(fadeSpeed, 0.0, function () {
|
525 |
+
el.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible");
|
526 |
+
});
|
527 |
+
|
528 |
+
}
|
529 |
+
// Don't fade, just hide them
|
530 |
+
else {
|
531 |
+
el.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible").removeAttr("style");
|
532 |
+
el.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible").removeAttr("style");
|
533 |
+
}
|
534 |
+
|
535 |
+
},
|
536 |
+
// Function for showing and hiding hotspots depending on the
|
537 |
+
// offset of the scrolling
|
538 |
+
_showHideHotSpots: function () {
|
539 |
+
var self = this, el = this.element, o = this.options;
|
540 |
+
|
541 |
+
// Hot spot scrolling is not enabled so show no hot spots
|
542 |
+
if (!(o.hotSpotScrolling)) {
|
543 |
+
el.data("scrollingHotSpotLeft").hide();
|
544 |
+
el.data("scrollingHotSpotRight").hide();
|
545 |
+
} else {
|
546 |
+
|
547 |
+
// If the manual continuous scrolling option is set show both
|
548 |
+
if (o.manualContinuousScrolling && o.hotSpotScrolling && o.autoScrollingMode !== "always") {
|
549 |
+
el.data("scrollingHotSpotLeft").show();
|
550 |
+
el.data("scrollingHotSpotRight").show();
|
551 |
+
}
|
552 |
+
// Autoscrolling not set to always and hotspot scrolling enabled.
|
553 |
+
// Regular hot spot scrolling.
|
554 |
+
else if (o.autoScrollingMode !== "always" && o.hotSpotScrolling) {
|
555 |
+
// If the scrollable area is shorter than the scroll wrapper, both hotspots
|
556 |
+
// should be hidden
|
557 |
+
if (el.data("scrollableAreaWidth") <= (el.data("scrollWrapper").innerWidth())) {
|
558 |
+
el.data("scrollingHotSpotLeft").hide();
|
559 |
+
el.data("scrollingHotSpotRight").hide();
|
560 |
+
}
|
561 |
+
// When you can't scroll further left the left scroll hotspot should be hidden
|
562 |
+
// and the right hotspot visible.
|
563 |
+
else if (el.data("scrollWrapper").scrollLeft() === 0) {
|
564 |
+
el.data("scrollingHotSpotLeft").hide();
|
565 |
+
el.data("scrollingHotSpotRight").show();
|
566 |
+
// Callback
|
567 |
+
self._trigger("scrollerLeftLimitReached");
|
568 |
+
// Clear interval
|
569 |
+
clearInterval(el.data("leftScrollingInterval"));
|
570 |
+
el.data("leftScrollingInterval", null);
|
571 |
+
}
|
572 |
+
// When you can't scroll further right
|
573 |
+
// the right scroll hotspot should be hidden
|
574 |
+
// and the left hotspot visible
|
575 |
+
else if (el.data("scrollableAreaWidth") <= (el.data("scrollWrapper").innerWidth() + el.data("scrollWrapper").scrollLeft())) {
|
576 |
+
el.data("scrollingHotSpotLeft").show();
|
577 |
+
el.data("scrollingHotSpotRight").hide();
|
578 |
+
// Callback
|
579 |
+
self._trigger("scrollerRightLimitReached");
|
580 |
+
// Clear interval
|
581 |
+
clearInterval(el.data("rightScrollingInterval"));
|
582 |
+
el.data("rightScrollingInterval", null);
|
583 |
+
}
|
584 |
+
// If you are somewhere in the middle of your
|
585 |
+
// scrolling, both hotspots should be visible
|
586 |
+
else {
|
587 |
+
el.data("scrollingHotSpotLeft").show();
|
588 |
+
el.data("scrollingHotSpotRight").show();
|
589 |
+
}
|
590 |
+
}
|
591 |
+
// If auto scrolling is set to always, there should be no hotspots
|
592 |
+
else {
|
593 |
+
el.data("scrollingHotSpotLeft").hide();
|
594 |
+
el.data("scrollingHotSpotRight").hide();
|
595 |
+
}
|
596 |
+
}
|
597 |
+
|
598 |
+
|
599 |
+
|
600 |
+
},
|
601 |
+
// Function for calculating the scroll position of a certain element
|
602 |
+
_setElementScrollPosition: function (method, element) {
|
603 |
+
var el = this.element, o = this.options, tempScrollPosition = 0;
|
604 |
+
|
605 |
+
switch (method) {
|
606 |
+
case "first":
|
607 |
+
el.data("scrollXPos", 0);
|
608 |
+
return true;
|
609 |
+
case "start":
|
610 |
+
// Check to see if there is a specified start element in the options
|
611 |
+
// and that the element exists in the DOM
|
612 |
+
if (o.startAtElementId !== "") {
|
613 |
+
if (el.data("scrollableArea").has("#" + o.startAtElementId)) {
|
614 |
+
tempScrollPosition = $("#" + o.startAtElementId).position().left;
|
615 |
+
el.data("scrollXPos", tempScrollPosition);
|
616 |
+
return true;
|
617 |
+
}
|
618 |
+
}
|
619 |
+
return false;
|
620 |
+
case "last":
|
621 |
+
el.data("scrollXPos", (el.data("scrollableAreaWidth") - el.data("scrollWrapper").innerWidth()));
|
622 |
+
return true;
|
623 |
+
case "number":
|
624 |
+
// Check to see that an element number is passed
|
625 |
+
if (!(isNaN(element))) {
|
626 |
+
tempScrollPosition = el.data("scrollableArea").children(o.countOnlyClass).eq(element - 1).position().left;
|
627 |
+
el.data("scrollXPos", tempScrollPosition);
|
628 |
+
return true;
|
629 |
+
}
|
630 |
+
return false;
|
631 |
+
case "id":
|
632 |
+
// Check that an element id is passed and that the element exists in the DOM
|
633 |
+
if (element.length > 0) {
|
634 |
+
if (el.data("scrollableArea").has("#" + element)) {
|
635 |
+
tempScrollPosition = $("#" + element).position().left;
|
636 |
+
el.data("scrollXPos", tempScrollPosition);
|
637 |
+
return true;
|
638 |
+
}
|
639 |
+
}
|
640 |
+
return false;
|
641 |
+
default:
|
642 |
+
return false;
|
643 |
+
}
|
644 |
+
|
645 |
+
|
646 |
+
},
|
647 |
+
/**********************************************************
|
648 |
+
Jumping to a certain element
|
649 |
+
**********************************************************/
|
650 |
+
jumpToElement: function (jumpTo, element) {
|
651 |
+
var self = this, el = this.element;
|
652 |
+
|
653 |
+
// Check to see that the scroller is enabled
|
654 |
+
if (el.data("enabled")) {
|
655 |
+
// Get the position of the element to scroll to
|
656 |
+
if (self._setElementScrollPosition(jumpTo, element)) {
|
657 |
+
// Jump to the element
|
658 |
+
el.data("scrollWrapper").scrollLeft(el.data("scrollXPos"));
|
659 |
+
// Check the hotspots
|
660 |
+
self._showHideHotSpots();
|
661 |
+
// Trigger the right callback
|
662 |
+
switch (jumpTo) {
|
663 |
+
case "first":
|
664 |
+
self._trigger("jumpedToFirstElement");
|
665 |
+
break;
|
666 |
+
case "start":
|
667 |
+
self._trigger("jumpedToStartElement");
|
668 |
+
break;
|
669 |
+
case "last":
|
670 |
+
self._trigger("jumpedToLastElement");
|
671 |
+
break;
|
672 |
+
case "number":
|
673 |
+
self._trigger("jumpedToElementNumber", null, { "elementNumber": element });
|
674 |
+
break;
|
675 |
+
case "id":
|
676 |
+
self._trigger("jumpedToElementId", null, { "elementId": element });
|
677 |
+
break;
|
678 |
+
default:
|
679 |
+
break;
|
680 |
+
}
|
681 |
+
|
682 |
+
}
|
683 |
+
}
|
684 |
+
},
|
685 |
+
/**********************************************************
|
686 |
+
Scrolling to a certain element
|
687 |
+
**********************************************************/
|
688 |
+
scrollToElement: function (scrollTo, element) {
|
689 |
+
var self = this, el = this.element, o = this.options, autoscrollingWasRunning = false;
|
690 |
+
|
691 |
+
if (el.data("enabled")) {
|
692 |
+
// Get the position of the element to scroll to
|
693 |
+
if (self._setElementScrollPosition(scrollTo, element)) {
|
694 |
+
// Stop any ongoing auto scrolling
|
695 |
+
if (el.data("autoScrollingInterval") !== null) {
|
696 |
+
self.stopAutoScrolling();
|
697 |
+
autoscrollingWasRunning = true;
|
698 |
+
}
|
699 |
+
|
700 |
+
// Stop any other running animations
|
701 |
+
// (clear queue but don't jump to the end)
|
702 |
+
el.data("scrollWrapper").stop(true, false);
|
703 |
+
|
704 |
+
// Do the scolling animation
|
705 |
+
el.data("scrollWrapper").animate({
|
706 |
+
scrollLeft: el.data("scrollXPos")
|
707 |
+
}, { duration: o.scrollToAnimationDuration, easing: o.scrollToEasingFunction, complete: function () {
|
708 |
+
// If auto scrolling was running before, start it again
|
709 |
+
if (autoscrollingWasRunning) {
|
710 |
+
self.startAutoScrolling();
|
711 |
+
}
|
712 |
+
|
713 |
+
self._showHideHotSpots();
|
714 |
+
|
715 |
+
// Trigger the right callback
|
716 |
+
switch (scrollTo) {
|
717 |
+
case "first":
|
718 |
+
self._trigger("scrolledToFirstElement");
|
719 |
+
break;
|
720 |
+
case "start":
|
721 |
+
self._trigger("scrolledToStartElement");
|
722 |
+
break;
|
723 |
+
case "last":
|
724 |
+
self._trigger("scrolledToLastElement");
|
725 |
+
break;
|
726 |
+
case "number":
|
727 |
+
self._trigger("scrolledToElementNumber", null, { "elementNumber": element });
|
728 |
+
break;
|
729 |
+
case "id":
|
730 |
+
self._trigger("scrolledToElementId", null, { "elementId": element });
|
731 |
+
break;
|
732 |
+
default:
|
733 |
+
break;
|
734 |
+
}
|
735 |
+
}
|
736 |
+
});
|
737 |
+
}
|
738 |
+
}
|
739 |
+
|
740 |
+
},
|
741 |
+
move: function (pixels) {
|
742 |
+
var self = this, el = this.element, o = this.options;
|
743 |
+
// clear queue, move to end
|
744 |
+
el.data("scrollWrapper").stop(true, true);
|
745 |
+
|
746 |
+
// Only run this code if it's possible to scroll left or right,
|
747 |
+
if ((pixels < 0 && el.data("scrollWrapper").scrollLeft() > 0) || (pixels > 0 && el.data("scrollableAreaWidth") > (el.data("scrollWrapper").innerWidth() + el.data("scrollWrapper").scrollLeft()))) {
|
748 |
+
if (o.easingAfterMouseWheelScrolling) {
|
749 |
+
el.data("scrollWrapper").animate({ scrollLeft: el.data("scrollWrapper").scrollLeft() + pixels }, { duration: o.easingAfterMouseWheelScrollingDuration, easing: o.easingAfterMouseWheelFunction, complete: function () {
|
750 |
+
self._showHideHotSpots();
|
751 |
+
if (o.manualContinuousScrolling) {
|
752 |
+
if (pixels > 0) {
|
753 |
+
self._checkContinuousSwapRight();
|
754 |
+
} else {
|
755 |
+
self._checkContinuousSwapLeft();
|
756 |
+
}
|
757 |
+
}
|
758 |
+
}
|
759 |
+
});
|
760 |
+
} else {
|
761 |
+
el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft() + pixels);
|
762 |
+
self._showHideHotSpots();
|
763 |
+
|
764 |
+
if (o.manualContinuousScrolling) {
|
765 |
+
if (pixels > 0) {
|
766 |
+
self._checkContinuousSwapRight();
|
767 |
+
} else {
|
768 |
+
self._checkContinuousSwapLeft();
|
769 |
+
}
|
770 |
+
}
|
771 |
+
}
|
772 |
+
}
|
773 |
+
|
774 |
+
|
775 |
+
},
|
776 |
+
/**********************************************************
|
777 |
+
Adding or replacing content
|
778 |
+
**********************************************************/
|
779 |
+
/* Arguments are:
|
780 |
+
content - a valid URL to a Flickr feed - string
|
781 |
+
manipulationMethod - addFirst, addLast or replace (default) - string
|
782 |
+
*/
|
783 |
+
getFlickrContent: function (content, manipulationMethod) {
|
784 |
+
var self = this, el = this.element;
|
785 |
+
|
786 |
+
$.getJSON(content, function (data) {
|
787 |
+
// small square - size is 75x75
|
788 |
+
// thumbnail -> large - size is the longest side
|
789 |
+
var flickrImageSizes = [{ size: "small square", pixels: 75, letter: "_s" },
|
790 |
+
{ size: "thumbnail", pixels: 100, letter: "_t" },
|
791 |
+
{ size: "small", pixels: 240, letter: "_m" },
|
792 |
+
{ size: "medium", pixels: 500, letter: "" },
|
793 |
+
{ size: "medium 640", pixels: 640, letter: "_z" },
|
794 |
+
{ size: "large", pixels: 1024, letter: "_b"}];
|
795 |
+
var loadedFlickrImages = [];
|
796 |
+
var imageIdStringBuffer = [];
|
797 |
+
var startingIndex;
|
798 |
+
var numberOfFlickrItems = data.items.length;
|
799 |
+
var loadedFlickrImagesCounter = 0;
|
800 |
+
|
801 |
+
// Determine a plausible starting value for the
|
802 |
+
// image height
|
803 |
+
if (el.data("scrollableAreaHeight") <= 75) {
|
804 |
+
startingIndex = 0;
|
805 |
+
} else if (el.data("scrollableAreaHeight") <= 100) {
|
806 |
+
startingIndex = 1;
|
807 |
+
} else if (el.data("scrollableAreaHeight") <= 240) {
|
808 |
+
startingIndex = 2;
|
809 |
+
} else if (el.data("scrollableAreaHeight") <= 500) {
|
810 |
+
startingIndex = 3;
|
811 |
+
} else if (el.data("scrollableAreaHeight") <= 640) {
|
812 |
+
startingIndex = 4;
|
813 |
+
} else {
|
814 |
+
startingIndex = 5;
|
815 |
+
}
|
816 |
+
|
817 |
+
// Put all items from the feed in an array.
|
818 |
+
// This is necessary
|
819 |
+
$.each(data.items, function (index, item) {
|
820 |
+
loadFlickrImage(item, startingIndex);
|
821 |
+
});
|
822 |
+
|
823 |
+
function loadFlickrImage(item, sizeIndex) {
|
824 |
+
var path = item.media.m;
|
825 |
+
var imgSrc = path.replace("_m", flickrImageSizes[sizeIndex].letter);
|
826 |
+
var tempImg = $("<img />").attr("src", imgSrc);
|
827 |
+
|
828 |
+
tempImg.load(function () {
|
829 |
+
// Is it still smaller? Load next size
|
830 |
+
if (this.height < el.data("scrollableAreaHeight")) {
|
831 |
+
// Load a bigger image, if possible
|
832 |
+
if ((sizeIndex + 1) < flickrImageSizes.length) {
|
833 |
+
loadFlickrImage(item, sizeIndex + 1);
|
834 |
+
} else {
|
835 |
+
addImageToLoadedImages(this);
|
836 |
+
}
|
837 |
+
}
|
838 |
+
else {
|
839 |
+
addImageToLoadedImages(this);
|
840 |
+
}
|
841 |
+
|
842 |
+
// Finishing stuff to do when all images have been loaded
|
843 |
+
if (loadedFlickrImagesCounter === numberOfFlickrItems) {
|
844 |
+
switch (manipulationMethod) {
|
845 |
+
case "addFirst":
|
846 |
+
// Add the loaded content first in the scrollable area
|
847 |
+
el.data("scrollableArea").children(":first").before(loadedFlickrImages);
|
848 |
+
break;
|
849 |
+
case "addLast":
|
850 |
+
// Add the loaded content last in the scrollable area
|
851 |
+
el.data("scrollableArea").children(":last").after(loadedFlickrImages);
|
852 |
+
break;
|
853 |
+
default:
|
854 |
+
// Replace the content in the scrollable area
|
855 |
+
el.data("scrollableArea").html(loadedFlickrImages);
|
856 |
+
break;
|
857 |
+
}
|
858 |
+
|
859 |
+
// Recalculate the total width of the elements inside the scrollable area
|
860 |
+
self.recalculateScrollableArea();
|
861 |
+
|
862 |
+
// Determine which hotspots to show
|
863 |
+
self._showHideHotSpots();
|
864 |
+
|
865 |
+
// Trigger callback
|
866 |
+
self._trigger("addedFlickrContent", null, { "addedElementIds": imageIdStringBuffer });
|
867 |
+
}
|
868 |
+
|
869 |
+
});
|
870 |
+
}
|
871 |
+
|
872 |
+
// Add the loaded content first or last in the scrollable area
|
873 |
+
function addImageToLoadedImages(imageObj) {
|
874 |
+
// Calculate the scaled width
|
875 |
+
var widthScalingFactor = el.data("scrollableAreaHeight") / imageObj.height;
|
876 |
+
var tempWidth = Math.round(imageObj.width * widthScalingFactor);
|
877 |
+
// Set an id for the image - the filename is used as an id
|
878 |
+
var tempIdArr = $(imageObj).attr("src").split("/");
|
879 |
+
var lastElemIndex = (tempIdArr.length - 1);
|
880 |
+
tempIdArr = tempIdArr[lastElemIndex].split(".");
|
881 |
+
$(imageObj).attr("id", tempIdArr[0]);
|
882 |
+
// Set the height of the image to the height of the scrollable area and add the width
|
883 |
+
$(imageObj).css({ "height": el.data("scrollableAreaHeight"), "width": tempWidth });
|
884 |
+
// Add the id of the image to the array of id's - this
|
885 |
+
// is used as a parameter when the callback is triggered
|
886 |
+
imageIdStringBuffer.push(tempIdArr[0]);
|
887 |
+
// Add the image to the array of loaded images
|
888 |
+
loadedFlickrImages.push(imageObj);
|
889 |
+
|
890 |
+
// Increment counter for loaded images
|
891 |
+
loadedFlickrImagesCounter++;
|
892 |
+
}
|
893 |
+
|
894 |
+
});
|
895 |
+
},
|
896 |
+
/* Arguments are:
|
897 |
+
content - a valid URL to an AJAX content source - string
|
898 |
+
manipulationMethod - addFirst, addLast or replace (default) - string
|
899 |
+
filterTag - a jQuery selector that matches the elements from the AJAX content
|
900 |
+
source that you want, for example ".myClass" or "#thisDiv" or "div" - string
|
901 |
+
*/
|
902 |
+
getAjaxContent: function (content, manipulationMethod, filterTag) {
|
903 |
+
var self = this, el = this.element;
|
904 |
+
$.ajaxSetup({ cache: false });
|
905 |
+
|
906 |
+
$.get(content, function (data) {
|
907 |
+
var filteredContent;
|
908 |
+
|
909 |
+
if (filterTag !== undefined) {
|
910 |
+
if (filterTag.length > 0) {
|
911 |
+
// A bit of a hack since I can't know if the element
|
912 |
+
// that the user wants is a direct child of body (= use filter)
|
913 |
+
// or other types of elements (= use find)
|
914 |
+
filteredContent = $("<div>").html(data).find(filterTag);
|
915 |
+
} else {
|
916 |
+
filteredContent = content;
|
917 |
+
}
|
918 |
+
} else {
|
919 |
+
filteredContent = data;
|
920 |
+
}
|
921 |
+
|
922 |
+
switch (manipulationMethod) {
|
923 |
+
case "addFirst":
|
924 |
+
// Add the loaded content first in the scrollable area
|
925 |
+
el.data("scrollableArea").children(":first").before(filteredContent);
|
926 |
+
break;
|
927 |
+
case "addLast":
|
928 |
+
// Add the loaded content last in the scrollable area
|
929 |
+
el.data("scrollableArea").children(":last").after(filteredContent);
|
930 |
+
break;
|
931 |
+
default:
|
932 |
+
// Replace the content in the scrollable area
|
933 |
+
el.data("scrollableArea").html(filteredContent);
|
934 |
+
break;
|
935 |
+
}
|
936 |
+
|
937 |
+
// Recalculate the total width of the elements inside the scrollable area
|
938 |
+
self.recalculateScrollableArea();
|
939 |
+
|
940 |
+
// Determine which hotspots to show
|
941 |
+
self._showHideHotSpots();
|
942 |
+
|
943 |
+
// Trigger callback
|
944 |
+
self._trigger("addedAjaxContent");
|
945 |
+
|
946 |
+
});
|
947 |
+
},
|
948 |
+
getHtmlContent: function (content, manipulationMethod, filterTag) {
|
949 |
+
var self = this, el = this.element;
|
950 |
+
|
951 |
+
// No AJAX involved at all - just add raw HTML-content
|
952 |
+
/* Arguments are:
|
953 |
+
content - any raw HTML that you want - string
|
954 |
+
manipulationMethod - addFirst, addLast or replace (default) - string
|
955 |
+
filterTag - a jQuery selector that matches the elements from the AJAX content
|
956 |
+
source that you want, for example ".myClass" or "#thisDiv" or "div" - string
|
957 |
+
*/
|
958 |
+
var filteredContent;
|
959 |
+
if (filterTag !== undefined) {
|
960 |
+
if (filterTag.length > 0) {
|
961 |
+
// A bit of a hack since I can't know if the element
|
962 |
+
// that the user wants is a direct child of body (= use filter)
|
963 |
+
// or other types of elements (= use find)
|
964 |
+
filteredContent = $("<div>").html(content).find(filterTag);
|
965 |
+
} else {
|
966 |
+
filteredContent = content;
|
967 |
+
}
|
968 |
+
} else {
|
969 |
+
filteredContent = content;
|
970 |
+
}
|
971 |
+
|
972 |
+
switch (manipulationMethod) {
|
973 |
+
case "addFirst":
|
974 |
+
// Add the loaded content first in the scrollable area
|
975 |
+
el.data("scrollableArea").children(":first").before(filteredContent);
|
976 |
+
break;
|
977 |
+
case "addLast":
|
978 |
+
// Add the loaded content last in the scrollable area
|
979 |
+
el.data("scrollableArea").children(":last").after(filteredContent);
|
980 |
+
break;
|
981 |
+
default:
|
982 |
+
// Replace the content in the scrollable area
|
983 |
+
el.data("scrollableArea").html(filteredContent);
|
984 |
+
break;
|
985 |
+
}
|
986 |
+
|
987 |
+
// Recalculate the total width of the elements inside the scrollable area
|
988 |
+
self.recalculateScrollableArea();
|
989 |
+
|
990 |
+
// Determine which hotspots to show
|
991 |
+
self._showHideHotSpots();
|
992 |
+
|
993 |
+
// Trigger callback
|
994 |
+
self._trigger("addedHtmlContent");
|
995 |
+
|
996 |
+
},
|
997 |
+
/**********************************************************
|
998 |
+
Recalculate the scrollable area
|
999 |
+
**********************************************************/
|
1000 |
+
recalculateScrollableArea: function () {
|
1001 |
+
|
1002 |
+
var tempScrollableAreaWidth = 0, foundStartAtElement = false, o = this.options, el = this.element;
|
1003 |
+
|
1004 |
+
// Add up the total width of all the items inside the scrollable area
|
1005 |
+
el.data("scrollableArea").children(o.countOnlyClass).each(function () {
|
1006 |
+
// Check to see if the current element in the loop is the one where the scrolling should start
|
1007 |
+
if ((o.startAtElementId.length > 0) && (($(this).attr("id")) === o.startAtElementId)) {
|
1008 |
+
el.data("startingPosition", tempScrollableAreaWidth);
|
1009 |
+
foundStartAtElement = true;
|
1010 |
+
}
|
1011 |
+
tempScrollableAreaWidth = tempScrollableAreaWidth + $(this).outerWidth(true);
|
1012 |
+
|
1013 |
+
});
|
1014 |
+
|
1015 |
+
// If the element with the ID specified by startAtElementId
|
1016 |
+
// is not found, reset it
|
1017 |
+
if (!(foundStartAtElement)) {
|
1018 |
+
el.data("startAtElementId", "");
|
1019 |
+
}
|
1020 |
+
|
1021 |
+
// Set the width of the scrollable area
|
1022 |
+
el.data("scrollableAreaWidth", tempScrollableAreaWidth);
|
1023 |
+
el.data("scrollableArea").width(el.data("scrollableAreaWidth"));
|
1024 |
+
|
1025 |
+
// Move to the starting position
|
1026 |
+
el.data("scrollWrapper").scrollLeft(el.data("startingPosition"));
|
1027 |
+
el.data("scrollXPos", el.data("startingPosition"));
|
1028 |
+
},
|
1029 |
+
/**********************************************************
|
1030 |
+
Get current scrolling left offset
|
1031 |
+
**********************************************************/
|
1032 |
+
getScrollerOffset: function () {
|
1033 |
+
var el = this.element;
|
1034 |
+
|
1035 |
+
// Returns the current left offset
|
1036 |
+
// Please remember that if the scroller is in continuous
|
1037 |
+
// mode, the offset is not that relevant anymore since
|
1038 |
+
// the plugin will swap the elements inside the scroller
|
1039 |
+
// around and manipulate the offset in this process.
|
1040 |
+
return el.data("scrollWrapper").scrollLeft();
|
1041 |
+
},
|
1042 |
+
/**********************************************************
|
1043 |
+
Stopping, starting and doing the auto scrolling
|
1044 |
+
**********************************************************/
|
1045 |
+
stopAutoScrolling: function () {
|
1046 |
+
var self = this, el = this.element;
|
1047 |
+
|
1048 |
+
if (el.data("autoScrollingInterval") !== null) {
|
1049 |
+
clearInterval(el.data("autoScrollingInterval"));
|
1050 |
+
el.data("autoScrollingInterval", null);
|
1051 |
+
|
1052 |
+
// Check to see which hotspots should be active
|
1053 |
+
// in the position where the scroller has stopped
|
1054 |
+
self._showHideHotSpots();
|
1055 |
+
|
1056 |
+
self._trigger("autoScrollingStopped");
|
1057 |
+
}
|
1058 |
+
},
|
1059 |
+
/**********************************************************
|
1060 |
+
Start Autoscrolling
|
1061 |
+
**********************************************************/
|
1062 |
+
startAutoScrolling: function () {
|
1063 |
+
var self = this, el = this.element, o = this.options;
|
1064 |
+
|
1065 |
+
if (el.data("enabled")) {
|
1066 |
+
self._showHideHotSpots();
|
1067 |
+
|
1068 |
+
// Stop any running interval
|
1069 |
+
clearInterval(el.data("autoScrollingInterval"));
|
1070 |
+
el.data("autoScrollingInterval", null);
|
1071 |
+
|
1072 |
+
// Callback
|
1073 |
+
self._trigger("autoScrollingStarted");
|
1074 |
+
|
1075 |
+
// Start interval
|
1076 |
+
el.data("autoScrollingInterval", setInterval(function () {
|
1077 |
+
|
1078 |
+
// If the scroller is not visible or
|
1079 |
+
// if the scrollable area is shorter than the scroll wrapper
|
1080 |
+
// any running auto scroll interval should stop.
|
1081 |
+
if (!(el.data("visible")) || (el.data("scrollableAreaWidth") <= (el.data("scrollWrapper").innerWidth()))) {
|
1082 |
+
// Stop any running interval
|
1083 |
+
clearInterval(el.data("autoScrollingInterval"));
|
1084 |
+
el.data("autoScrollingInterval", null);
|
1085 |
+
|
1086 |
+
}
|
1087 |
+
else {
|
1088 |
+
|
1089 |
+
// Store the old scrollLeft value to see if the scrolling has reached the end
|
1090 |
+
el.data("previousScrollLeft", el.data("scrollWrapper").scrollLeft());
|
1091 |
+
|
1092 |
+
switch (o.autoScrollingDirection) {
|
1093 |
+
case "right":
|
1094 |
+
|
1095 |
+
el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft() + o.autoScrollingStep);
|
1096 |
+
if (el.data("previousScrollLeft") === el.data("scrollWrapper").scrollLeft()) {
|
1097 |
+
self._trigger("autoScrollingRightLimitReached");
|
1098 |
+
clearInterval(el.data("autoScrollingInterval"));
|
1099 |
+
el.data("autoScrollingInterval", null);
|
1100 |
+
self._trigger("autoScrollingIntervalStopped");
|
1101 |
+
}
|
1102 |
+
break;
|
1103 |
+
|
1104 |
+
case "left":
|
1105 |
+
el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft() - o.autoScrollingStep);
|
1106 |
+
if (el.data("previousScrollLeft") === el.data("scrollWrapper").scrollLeft()) {
|
1107 |
+
self._trigger("autoScrollingLeftLimitReached");
|
1108 |
+
clearInterval(el.data("autoScrollingInterval"));
|
1109 |
+
el.data("autoScrollingInterval", null);
|
1110 |
+
self._trigger("autoScrollingIntervalStopped");
|
1111 |
+
}
|
1112 |
+
break;
|
1113 |
+
|
1114 |
+
case "backAndForth":
|
1115 |
+
if (el.data("pingPongDirection") === "right") {
|
1116 |
+
el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft() + (o.autoScrollingStep));
|
1117 |
+
}
|
1118 |
+
else {
|
1119 |
+
el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft() - (o.autoScrollingStep));
|
1120 |
+
}
|
1121 |
+
|
1122 |
+
// If the scrollLeft hasnt't changed it means that the scrolling has reached
|
1123 |
+
// the end and the direction should be switched
|
1124 |
+
if (el.data("previousScrollLeft") === el.data("scrollWrapper").scrollLeft()) {
|
1125 |
+
if (el.data("pingPongDirection") === "right") {
|
1126 |
+
el.data("pingPongDirection", "left");
|
1127 |
+
self._trigger("autoScrollingRightLimitReached");
|
1128 |
+
}
|
1129 |
+
else {
|
1130 |
+
el.data("pingPongDirection", "right");
|
1131 |
+
self._trigger("autoScrollingLeftLimitReached");
|
1132 |
+
}
|
1133 |
+
}
|
1134 |
+
break;
|
1135 |
+
|
1136 |
+
case "endlessLoopRight":
|
1137 |
+
|
1138 |
+
// Do the auto scrolling
|
1139 |
+
el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft() + o.autoScrollingStep);
|
1140 |
+
|
1141 |
+
self._checkContinuousSwapRight();
|
1142 |
+
break;
|
1143 |
+
case "endlessLoopLeft":
|
1144 |
+
|
1145 |
+
// Do the auto scrolling
|
1146 |
+
el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft() - o.autoScrollingStep);
|
1147 |
+
|
1148 |
+
self._checkContinuousSwapLeft();
|
1149 |
+
break;
|
1150 |
+
default:
|
1151 |
+
break;
|
1152 |
+
|
1153 |
+
}
|
1154 |
+
}
|
1155 |
+
}, o.autoScrollingInterval));
|
1156 |
+
}
|
1157 |
+
},
|
1158 |
+
/**********************************************************
|
1159 |
+
Check Continuos Swap Right
|
1160 |
+
**********************************************************/
|
1161 |
+
_checkContinuousSwapRight: function () {
|
1162 |
+
var el = this.element, o = this.options;
|
1163 |
+
|
1164 |
+
// Get the width of the first element. When it has scrolled out of view,
|
1165 |
+
// the element swapping should be executed. A true/false variable is used
|
1166 |
+
// as a flag variable so the swapAt value doesn't have to be recalculated
|
1167 |
+
// in each loop.
|
1168 |
+
if (el.data("getNextElementWidth")) {
|
1169 |
+
|
1170 |
+
if ((o.startAtElementId.length > 0) && (el.data("startAtElementHasNotPassed"))) {
|
1171 |
+
// If the user has set a certain element to start at, set swapAt
|
1172 |
+
// to that element width. This happens once.
|
1173 |
+
el.data("swapAt", $("#" + o.startAtElementId).outerWidth(true));
|
1174 |
+
el.data("startAtElementHasNotPassed", false);
|
1175 |
+
}
|
1176 |
+
else {
|
1177 |
+
// Set swapAt to the first element in the scroller
|
1178 |
+
el.data("swapAt", el.data("scrollableArea").children(":first").outerWidth(true));
|
1179 |
+
}
|
1180 |
+
el.data("getNextElementWidth", false);
|
1181 |
+
}
|
1182 |
+
|
1183 |
+
|
1184 |
+
// Check to see if the swap should be done
|
1185 |
+
if (el.data("swapAt") <= el.data("scrollWrapper").scrollLeft()) {
|
1186 |
+
el.data("swappedElement", el.data("scrollableArea").children(":first").detach());
|
1187 |
+
el.data("scrollableArea").append(el.data("swappedElement"));
|
1188 |
+
var wrapperLeft = el.data("scrollWrapper").scrollLeft();
|
1189 |
+
el.data("scrollWrapper").scrollLeft(wrapperLeft - el.data("swappedElement").outerWidth(true));
|
1190 |
+
el.data("getNextElementWidth", true);
|
1191 |
+
}
|
1192 |
+
},
|
1193 |
+
/**********************************************************
|
1194 |
+
Check Continuos Swap Left
|
1195 |
+
**********************************************************/
|
1196 |
+
_checkContinuousSwapLeft: function () {
|
1197 |
+
var el = this.element, o = this.options;
|
1198 |
+
|
1199 |
+
// Get the width of the first element. When it has scrolled out of view,
|
1200 |
+
// the element swapping should be executed. A true/false variable is used
|
1201 |
+
// as a flag variable so the swapAt value doesn't have to be recalculated
|
1202 |
+
// in each loop.
|
1203 |
+
|
1204 |
+
if (el.data("getNextElementWidth")) {
|
1205 |
+
if ((o.startAtElementId.length > 0) && (el.data("startAtElementHasNotPassed"))) {
|
1206 |
+
el.data("swapAt", $("#" + o.startAtElementId).outerWidth(true));
|
1207 |
+
el.data("startAtElementHasNotPassed", false);
|
1208 |
+
}
|
1209 |
+
else {
|
1210 |
+
el.data("swapAt", el.data("scrollableArea").children(":first").outerWidth(true));
|
1211 |
+
}
|
1212 |
+
|
1213 |
+
el.data("getNextElementWidth", false);
|
1214 |
+
}
|
1215 |
+
|
1216 |
+
// Check to see if the swap should be done
|
1217 |
+
if (el.data("scrollWrapper").scrollLeft() === 0) {
|
1218 |
+
el.data("swappedElement", el.data("scrollableArea").children(":last").detach());
|
1219 |
+
el.data("scrollableArea").prepend(el.data("swappedElement"));
|
1220 |
+
el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft() + el.data("swappedElement").outerWidth(true));
|
1221 |
+
el.data("getNextElementWidth", true);
|
1222 |
+
}
|
1223 |
+
|
1224 |
+
},
|
1225 |
+
restoreOriginalElements: function () {
|
1226 |
+
var self = this, el = this.element;
|
1227 |
+
|
1228 |
+
// Restore the original content of the scrollable area
|
1229 |
+
el.data("scrollableArea").html(el.data("originalElements"));
|
1230 |
+
self.recalculateScrollableArea();
|
1231 |
+
self.jumpToElement("first");
|
1232 |
+
},
|
1233 |
+
show: function () {
|
1234 |
+
var el = this.element;
|
1235 |
+
el.data("visible", true);
|
1236 |
+
el.show();
|
1237 |
+
},
|
1238 |
+
hide: function () {
|
1239 |
+
var el = this.element;
|
1240 |
+
el.data("visible", false);
|
1241 |
+
el.hide();
|
1242 |
+
},
|
1243 |
+
enable: function () {
|
1244 |
+
var el = this.element;
|
1245 |
+
|
1246 |
+
// Set enabled to true
|
1247 |
+
el.data("enabled", true);
|
1248 |
+
},
|
1249 |
+
disable: function () {
|
1250 |
+
var self = this, el = this.element;
|
1251 |
+
|
1252 |
+
// Clear all running intervals
|
1253 |
+
self.stopAutoScrolling();
|
1254 |
+
clearInterval(el.data("rightScrollingInterval"));
|
1255 |
+
clearInterval(el.data("leftScrollingInterval"));
|
1256 |
+
clearInterval(el.data("hideHotSpotBackgroundsInterval"));
|
1257 |
+
|
1258 |
+
// Set enabled to false
|
1259 |
+
el.data("enabled", false);
|
1260 |
+
},
|
1261 |
+
destroy: function () {
|
1262 |
+
var self = this, el = this.element;
|
1263 |
+
|
1264 |
+
// Clear all running intervals
|
1265 |
+
self.stopAutoScrolling();
|
1266 |
+
clearInterval(el.data("rightScrollingInterval"));
|
1267 |
+
clearInterval(el.data("leftScrollingInterval"));
|
1268 |
+
clearInterval(el.data("hideHotSpotBackgroundsInterval"));
|
1269 |
+
|
1270 |
+
// Remove all element specific events
|
1271 |
+
el.data("scrollingHotSpotRight").unbind("mouseover");
|
1272 |
+
el.data("scrollingHotSpotRight").unbind("mouseout");
|
1273 |
+
el.data("scrollingHotSpotRight").unbind("mousedown");
|
1274 |
+
|
1275 |
+
el.data("scrollingHotSpotLeft").unbind("mouseover");
|
1276 |
+
el.data("scrollingHotSpotLeft").unbind("mouseout");
|
1277 |
+
el.data("scrollingHotSpotLeft").unbind("mousedown");
|
1278 |
+
|
1279 |
+
el.unbind("mousenter");
|
1280 |
+
el.unbind("mouseleave");
|
1281 |
+
|
1282 |
+
// Remove all elements created by the plugin
|
1283 |
+
el.data("scrollingHotSpotRight").remove();
|
1284 |
+
el.data("scrollingHotSpotLeft").remove();
|
1285 |
+
el.data("scrollableArea").remove();
|
1286 |
+
el.data("scrollWrapper").remove();
|
1287 |
+
|
1288 |
+
// Restore the original content of the scrollable area
|
1289 |
+
el.html(el.data("originalElements"));
|
1290 |
+
|
1291 |
+
// Call the base destroy function
|
1292 |
+
$.Widget.prototype.destroy.apply(this, arguments);
|
1293 |
+
|
1294 |
+
}
|
1295 |
+
|
1296 |
+
|
1297 |
+
});
|
1298 |
+
})(jQuery);
|
js/brand/smoothdivscroll/jquery.smoothdivscroll-1.3-min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(e){e.widget("thomaskahn.smoothDivScroll",{options:{scrollingHotSpotLeftClass:"scrollingHotSpotLeft",scrollingHotSpotRightClass:"scrollingHotSpotRight",scrollableAreaClass:"scrollableArea",scrollWrapperClass:"scrollWrapper",hiddenOnStart:!1,getContentOnLoad:{},countOnlyClass:"",startAtElementId:"",hotSpotScrolling:!0,hotSpotScrollingStep:15,hotSpotScrollingInterval:10,hotSpotMouseDownSpeedBooster:3,visibleHotSpotBackgrounds:"hover",hotSpotsVisibleTime:5e3,easingAfterHotSpotScrolling:!0,easingAfterHotSpotScrollingDistance:10,easingAfterHotSpotScrollingDuration:300,easingAfterHotSpotScrollingFunction:"easeOutQuart",mousewheelScrolling:"",mousewheelScrollingStep:70,easingAfterMouseWheelScrolling:!0,easingAfterMouseWheelScrollingDuration:300,easingAfterMouseWheelScrollingFunction:"easeOutQuart",manualContinuousScrolling:!1,autoScrollingMode:"",autoScrollingDirection:"endlessLoopRight",autoScrollingStep:1,autoScrollingInterval:10,touchScrolling:!1,scrollToAnimationDuration:1e3,scrollToEasingFunction:"easeOutQuart"},_create:function(){var t=this,n=this.options,r=this.element;r.data("scrollWrapper",r.find("."+n.scrollWrapperClass)),r.data("scrollingHotSpotRight",r.find("."+n.scrollingHotSpotRightClass)),r.data("scrollingHotSpotLeft",r.find("."+n.scrollingHotSpotLeftClass)),r.data("scrollableArea",r.find("."+n.scrollableAreaClass)),r.data("scrollingHotSpotRight").length>0&&r.data("scrollingHotSpotRight").detach(),r.data("scrollingHotSpotLeft").length>0&&r.data("scrollingHotSpotLeft").detach(),r.data("scrollableArea").length===0&&r.data("scrollWrapper").length===0?(r.wrapInner("<div class='"+n.scrollableAreaClass+"'>").wrapInner("<div class='"+n.scrollWrapperClass+"'>"),r.data("scrollWrapper",r.find("."+n.scrollWrapperClass)),r.data("scrollableArea",r.find("."+n.scrollableAreaClass))):r.data("scrollWrapper").length===0?(r.wrapInner("<div class='"+n.scrollWrapperClass+"'>"),r.data("scrollWrapper",r.find("."+n.scrollWrapperClass))):r.data("scrollableArea").length===0&&(r.data("scrollWrapper").wrapInner("<div class='"+n.scrollableAreaClass+"'>"),r.data("scrollableArea",r.find("."+n.scrollableAreaClass))),r.data("scrollingHotSpotRight").length===0?(r.prepend("<div class='"+n.scrollingHotSpotRightClass+"'></div>"),r.data("scrollingHotSpotRight",r.find("."+n.scrollingHotSpotRightClass))):r.prepend(r.data("scrollingHotSpotRight")),r.data("scrollingHotSpotLeft").length===0?(r.prepend("<div class='"+n.scrollingHotSpotLeftClass+"'></div>"),r.data("scrollingHotSpotLeft",r.find("."+n.scrollingHotSpotLeftClass))):r.prepend(r.data("scrollingHotSpotLeft")),r.data("speedBooster",1),r.data("scrollXPos",0),r.data("hotSpotWidth",r.data("scrollingHotSpotLeft").innerWidth()),r.data("scrollableAreaWidth",0),r.data("startingPosition",0),r.data("rightScrollingInterval",null),r.data("leftScrollingInterval",null),r.data("autoScrollingInterval",null),r.data("hideHotSpotBackgroundsInterval",null),r.data("previousScrollLeft",0),r.data("pingPongDirection","right"),r.data("getNextElementWidth",!0),r.data("swapAt",null),r.data("startAtElementHasNotPassed",!0),r.data("swappedElement",null),r.data("originalElements",r.data("scrollableArea").children(n.countOnlyClass)),r.data("visible",!0),r.data("enabled",!0),r.data("scrollableAreaHeight",r.data("scrollableArea").height()),r.data("scrollerOffset",r.offset()),n.touchScrolling&&r.data("enabled")&&r.data("scrollWrapper").kinetic({y:!1,moved:function(e){n.manualContinuousScrolling&&(r.data("scrollWrapper").scrollLeft()<=0?t._checkContinuousSwapLeft():t._checkContinuousSwapRight())},stopped:function(e){r.data("scrollWrapper").stop(!0,!1),t.stopAutoScrolling()}}),r.data("scrollingHotSpotRight").bind("mousemove",function(e){if(n.hotSpotScrolling){var t=e.pageX-(this.offsetLeft+r.data("scrollerOffset").left);r.data("scrollXPos",Math.round(t/r.data("hotSpotWidth")*n.hotSpotScrollingStep)),(r.data("scrollXPos")===Infinity||r.data("scrollXPos")<1)&&r.data("scrollXPos",1)}}),r.data("scrollingHotSpotRight").bind("mouseover",function(){n.hotSpotScrolling&&(r.data("scrollWrapper").stop(!0,!1),t.stopAutoScrolling(),r.data("rightScrollingInterval",setInterval(function(){r.data("scrollXPos")>0&&r.data("enabled")&&(r.data("scrollWrapper").scrollLeft(r.data("scrollWrapper").scrollLeft()+r.data("scrollXPos")*r.data("speedBooster")),n.manualContinuousScrolling&&t._checkContinuousSwapRight(),t._showHideHotSpots())},n.hotSpotScrollingInterval)),t._trigger("mouseOverRightHotSpot"))}),r.data("scrollingHotSpotRight").bind("mouseout",function(){n.hotSpotScrolling&&(clearInterval(r.data("rightScrollingInterval")),r.data("scrollXPos",0),n.easingAfterHotSpotScrolling&&r.data("enabled")&&r.data("scrollWrapper").animate({scrollLeft:r.data("scrollWrapper").scrollLeft()+n.easingAfterHotSpotScrollingDistance},{duration:n.easingAfterHotSpotScrollingDuration,easing:n.easingAfterHotSpotScrollingFunction}))}),r.data("scrollingHotSpotRight").bind("mousedown",function(){r.data("speedBooster",n.hotSpotMouseDownSpeedBooster)}),e("body").bind("mouseup",function(){r.data("speedBooster",1)}),r.data("scrollingHotSpotLeft").bind("mousemove",function(e){if(n.hotSpotScrolling){var t=this.offsetLeft+r.data("scrollerOffset").left+r.data("hotSpotWidth")-e.pageX;r.data("scrollXPos",Math.round(t/r.data("hotSpotWidth")*n.hotSpotScrollingStep)),(r.data("scrollXPos")===Infinity||r.data("scrollXPos")<1)&&r.data("scrollXPos",1)}}),r.data("scrollingHotSpotLeft").bind("mouseover",function(){n.hotSpotScrolling&&(r.data("scrollWrapper").stop(!0,!1),t.stopAutoScrolling(),r.data("leftScrollingInterval",setInterval(function(){r.data("scrollXPos")>0&&r.data("enabled")&&(r.data("scrollWrapper").scrollLeft(r.data("scrollWrapper").scrollLeft()-r.data("scrollXPos")*r.data("speedBooster")),n.manualContinuousScrolling&&t._checkContinuousSwapLeft(),t._showHideHotSpots())},n.hotSpotScrollingInterval)),t._trigger("mouseOverLeftHotSpot"))}),r.data("scrollingHotSpotLeft").bind("mouseout",function(){n.hotSpotScrolling&&(clearInterval(r.data("leftScrollingInterval")),r.data("scrollXPos",0),n.easingAfterHotSpotScrolling&&r.data("enabled")&&r.data("scrollWrapper").animate({scrollLeft:r.data("scrollWrapper").scrollLeft()-n.easingAfterHotSpotScrollingDistance},{duration:n.easingAfterHotSpotScrollingDuration,easing:n.easingAfterHotSpotScrollingFunction}))}),r.data("scrollingHotSpotLeft").bind("mousedown",function(){r.data("speedBooster",n.hotSpotMouseDownSpeedBooster)}),r.data("scrollableArea").mousewheel(function(e,i,s,u){if(r.data("enabled")&&n.mousewheelScrolling.length>0){var a;n.mousewheelScrolling==="vertical"&&u!==0?(t.stopAutoScrolling(),e.preventDefault(),a=Math.round(n.mousewheelScrollingStep*u*-1),t.move(a)):n.mousewheelScrolling==="horizontal"&&s!==0?(t.stopAutoScrolling(),e.preventDefault(),a=Math.round(n.mousewheelScrollingStep*s*-1),t.move(a)):n.mousewheelScrolling==="allDirections"&&(t.stopAutoScrolling(),e.preventDefault(),a=Math.round(n.mousewheelScrollingStep*i*-1),t.move(a))}}),n.mousewheelScrolling&&r.data("scrollingHotSpotLeft").add(r.data("scrollingHotSpotRight")).mousewheel(function(e){e.preventDefault()}),e(window).bind("resize",function(){t._showHideHotSpots(),t._trigger("windowResized")}),jQuery.isEmptyObject(n.getContentOnLoad)||t[n.getContentOnLoad.method](n.getContentOnLoad.content,n.getContentOnLoad.manipulationMethod,n.getContentOnLoad.addWhere,n.getContentOnLoad.filterTag),n.hiddenOnStart&&t.hide(),e(window).load(function(){n.hiddenOnStart||t.recalculateScrollableArea(),n.autoScrollingMode.length>0&&!n.hiddenOnStart&&t.startAutoScrolling();if(n.autoScrollingMode!=="always")switch(n.visibleHotSpotBackgrounds){case"always":t.showHotSpotBackgrounds();break;case"onStart":t.showHotSpotBackgrounds(),r.data("hideHotSpotBackgroundsInterval",setTimeout(function(){t.hideHotSpotBackgrounds(250)},n.hotSpotsVisibleTime));break;case"hover":r.mouseenter(function(e){n.hotSpotScrolling&&(e.stopPropagation(),t.showHotSpotBackgrounds(250))}).mouseleave(function(e){n.hotSpotScrolling&&(e.stopPropagation(),t.hideHotSpotBackgrounds(250))});break;default:}t._showHideHotSpots(),t._trigger("setupComplete")})},_setOption:function(e,t){var n=this,r=this.options,i=this.element;r[e]=t,e==="hotSpotScrolling"?t===!0?n._showHideHotSpots():(i.data("scrollingHotSpotLeft").hide(),i.data("scrollingHotSpotRight").hide()):e==="autoScrollingStep"||e==="easingAfterHotSpotScrollingDistance"||e==="easingAfterHotSpotScrollingDuration"||e==="easingAfterMouseWheelScrollingDuration"?r[e]=parseInt(t,10):e==="autoScrollingInterval"&&(r[e]=parseInt(t,10),n.startAutoScrolling())},showHotSpotBackgrounds:function(e){var t=this,n=this.element,r=this.option;e!==undefined?(n.data("scrollingHotSpotLeft").addClass("scrollingHotSpotLeftVisible"),n.data("scrollingHotSpotRight").addClass("scrollingHotSpotRightVisible"),n.data("scrollingHotSpotLeft").add(n.data("scrollingHotSpotRight")).fadeTo(e,.35)):(n.data("scrollingHotSpotLeft").addClass("scrollingHotSpotLeftVisible"),n.data("scrollingHotSpotLeft").removeAttr("style"),n.data("scrollingHotSpotRight").addClass("scrollingHotSpotRightVisible"),n.data("scrollingHotSpotRight").removeAttr("style")),t._showHideHotSpots()},hideHotSpotBackgrounds:function(e){var t=this.element,n=this.option;e!==undefined?(t.data("scrollingHotSpotLeft").fadeTo(e,0,function(){t.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible")}),t.data("scrollingHotSpotRight").fadeTo(e,0,function(){t.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible")})):(t.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible").removeAttr("style"),t.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible").removeAttr("style"))},_showHideHotSpots:function(){var e=this,t=this.element,n=this.options;n.hotSpotScrolling?n.manualContinuousScrolling&&n.hotSpotScrolling&&n.autoScrollingMode!=="always"?(t.data("scrollingHotSpotLeft").show(),t.data("scrollingHotSpotRight").show()):n.autoScrollingMode!=="always"&&n.hotSpotScrolling?t.data("scrollableAreaWidth")<=t.data("scrollWrapper").innerWidth()?(t.data("scrollingHotSpotLeft").hide(),t.data("scrollingHotSpotRight").hide()):t.data("scrollWrapper").scrollLeft()===0?(t.data("scrollingHotSpotLeft").hide(),t.data("scrollingHotSpotRight").show(),e._trigger("scrollerLeftLimitReached"),clearInterval(t.data("leftScrollingInterval")),t.data("leftScrollingInterval",null)):t.data("scrollableAreaWidth")<=t.data("scrollWrapper").innerWidth()+t.data("scrollWrapper").scrollLeft()?(t.data("scrollingHotSpotLeft").show(),t.data("scrollingHotSpotRight").hide(),e._trigger("scrollerRightLimitReached"),clearInterval(t.data("rightScrollingInterval")),t.data("rightScrollingInterval",null)):(t.data("scrollingHotSpotLeft").show(),t.data("scrollingHotSpotRight").show()):(t.data("scrollingHotSpotLeft").hide(),t.data("scrollingHotSpotRight").hide()):(t.data("scrollingHotSpotLeft").hide(),t.data("scrollingHotSpotRight").hide())},_setElementScrollPosition:function(t,n){var r=this.element,i=this.options,s=0;switch(t){case"first":return r.data("scrollXPos",0),!0;case"start":if(i.startAtElementId!==""&&r.data("scrollableArea").has("#"+i.startAtElementId))return s=e("#"+i.startAtElementId).position().left,r.data("scrollXPos",s),!0;return!1;case"last":return r.data("scrollXPos",r.data("scrollableAreaWidth")-r.data("scrollWrapper").innerWidth()),!0;case"number":if(!isNaN(n))return s=r.data("scrollableArea").children(i.countOnlyClass).eq(n-1).position().left,r.data("scrollXPos",s),!0;return!1;case"id":if(n.length>0&&r.data("scrollableArea").has("#"+n))return s=e("#"+n).position().left,r.data("scrollXPos",s),!0;return!1;default:return!1}},jumpToElement:function(e,t){var n=this,r=this.element;if(r.data("enabled")&&n._setElementScrollPosition(e,t)){r.data("scrollWrapper").scrollLeft(r.data("scrollXPos")),n._showHideHotSpots();switch(e){case"first":n._trigger("jumpedToFirstElement");break;case"start":n._trigger("jumpedToStartElement");break;case"last":n._trigger("jumpedToLastElement");break;case"number":n._trigger("jumpedToElementNumber",null,{elementNumber:t});break;case"id":n._trigger("jumpedToElementId",null,{elementId:t});break;default:}}},scrollToElement:function(e,t){var n=this,r=this.element,i=this.options,s=!1;r.data("enabled")&&n._setElementScrollPosition(e,t)&&(r.data("autoScrollingInterval")!==null&&(n.stopAutoScrolling(),s=!0),r.data("scrollWrapper").stop(!0,!1),r.data("scrollWrapper").animate({scrollLeft:r.data("scrollXPos")},{duration:i.scrollToAnimationDuration,easing:i.scrollToEasingFunction,complete:function(){s&&n.startAutoScrolling(),n._showHideHotSpots();switch(e){case"first":n._trigger("scrolledToFirstElement");break;case"start":n._trigger("scrolledToStartElement");break;case"last":n._trigger("scrolledToLastElement");break;case"number":n._trigger("scrolledToElementNumber",null,{elementNumber:t});break;case"id":n._trigger("scrolledToElementId",null,{elementId:t});break;default:}}}))},move:function(e){var t=this,n=this.element,r=this.options;n.data("scrollWrapper").stop(!0,!0);if(e<0&&n.data("scrollWrapper").scrollLeft()>0||e>0&&n.data("scrollableAreaWidth")>n.data("scrollWrapper").innerWidth()+n.data("scrollWrapper").scrollLeft())r.easingAfterMouseWheelScrolling?n.data("scrollWrapper").animate({scrollLeft:n.data("scrollWrapper").scrollLeft()+e},{duration:r.easingAfterMouseWheelScrollingDuration,easing:r.easingAfterMouseWheelFunction,complete:function(){t._showHideHotSpots(),r.manualContinuousScrolling&&(e>0?t._checkContinuousSwapRight():t._checkContinuousSwapLeft())}}):(n.data("scrollWrapper").scrollLeft(n.data("scrollWrapper").scrollLeft()+e),t._showHideHotSpots(),r.manualContinuousScrolling&&(e>0?t._checkContinuousSwapRight():t._checkContinuousSwapLeft()))},getFlickrContent:function(t,n){var r=this,i=this.element;e.getJSON(t,function(t){function c(t,a){var p=t.media.m,d=p.replace("_m",s[a].letter),v=e("<img />").attr("src",d);v.load(function(){this.height<i.data("scrollableAreaHeight")?a+1<s.length?c(t,a+1):h(this):h(this);if(l===f){switch(n){case"addFirst":i.data("scrollableArea").children(":first").before(o);break;case"addLast":i.data("scrollableArea").children(":last").after(o);break;default:i.data("scrollableArea").html(o)}r.recalculateScrollableArea(),r._showHideHotSpots(),r._trigger("addedFlickrContent",null,{addedElementIds:u})}})}function h(t){var n=i.data("scrollableAreaHeight")/t.height,r=Math.round(t.width*n),s=e(t).attr("src").split("/"),a=s.length-1;s=s[a].split("."),e(t).attr("id",s[0]),e(t).css({height:i.data("scrollableAreaHeight"),width:r}),u.push(s[0]),o.push(t),l++}var s=[{size:"small square",pixels:75,letter:"_s"},{size:"thumbnail",pixels:100,letter:"_t"},{size:"small",pixels:240,letter:"_m"},{size:"medium",pixels:500,letter:""},{size:"medium 640",pixels:640,letter:"_z"},{size:"large",pixels:1024,letter:"_b"}],o=[],u=[],a,f=t.items.length,l=0;i.data("scrollableAreaHeight")<=75?a=0:i.data("scrollableAreaHeight")<=100?a=1:i.data("scrollableAreaHeight")<=240?a=2:i.data("scrollableAreaHeight")<=500?a=3:i.data("scrollableAreaHeight")<=640?a=4:a=5,e.each(t.items,function(e,t){c(t,a)})})},getAjaxContent:function(t,n,r){var i=this,s=this.element;e.ajaxSetup({cache:!1}),e.get(t,function(o){var u;r!==undefined?r.length>0?u=e("<div>").html(o).find(r):u=t:u=o;switch(n){case"addFirst":s.data("scrollableArea").children(":first").before(u);break;case"addLast":s.data("scrollableArea").children(":last").after(u);break;default:s.data("scrollableArea").html(u)}i.recalculateScrollableArea(),i._showHideHotSpots(),i._trigger("addedAjaxContent")})},getHtmlContent:function(t,n,r){var i=this,s=this.element,o;r!==undefined?r.length>0?o=e("<div>").html(t).find(r):o=t:o=t;switch(n){case"addFirst":s.data("scrollableArea").children(":first").before(o);break;case"addLast":s.data("scrollableArea").children(":last").after(o);break;default:s.data("scrollableArea").html(o)}i.recalculateScrollableArea(),i._showHideHotSpots(),i._trigger("addedHtmlContent")},recalculateScrollableArea:function(){var t=0,n=!1,r=this.options,i=this.element;i.data("scrollableArea").children(r.countOnlyClass).each(function(){r.startAtElementId.length>0&&e(this).attr("id")===r.startAtElementId&&(i.data("startingPosition",t),n=!0),t+=e(this).outerWidth(!0)}),n||i.data("startAtElementId",""),i.data("scrollableAreaWidth",t),i.data("scrollableArea").width(i.data("scrollableAreaWidth")),i.data("scrollWrapper").scrollLeft(i.data("startingPosition")),i.data("scrollXPos",i.data("startingPosition"))},getScrollerOffset:function(){var e=this.element;return e.data("scrollWrapper").scrollLeft()},stopAutoScrolling:function(){var e=this,t=this.element;t.data("autoScrollingInterval")!==null&&(clearInterval(t.data("autoScrollingInterval")),t.data("autoScrollingInterval",null),e._showHideHotSpots(),e._trigger("autoScrollingStopped"))},startAutoScrolling:function(){var e=this,t=this.element,n=this.options;t.data("enabled")&&(e._showHideHotSpots(),clearInterval(t.data("autoScrollingInterval")),t.data("autoScrollingInterval",null),e._trigger("autoScrollingStarted"),t.data("autoScrollingInterval",setInterval(function(){if(!t.data("visible")||t.data("scrollableAreaWidth")<=t.data("scrollWrapper").innerWidth())clearInterval(t.data("autoScrollingInterval")),t.data("autoScrollingInterval",null);else{t.data("previousScrollLeft",t.data("scrollWrapper").scrollLeft());switch(n.autoScrollingDirection){case"right":t.data("scrollWrapper").scrollLeft(t.data("scrollWrapper").scrollLeft()+n.autoScrollingStep),t.data("previousScrollLeft")===t.data("scrollWrapper").scrollLeft()&&(e._trigger("autoScrollingRightLimitReached"),clearInterval(t.data("autoScrollingInterval")),t.data("autoScrollingInterval",null),e._trigger("autoScrollingIntervalStopped"));break;case"left":t.data("scrollWrapper").scrollLeft(t.data("scrollWrapper").scrollLeft()-n.autoScrollingStep),t.data("previousScrollLeft")===t.data("scrollWrapper").scrollLeft()&&(e._trigger("autoScrollingLeftLimitReached"),clearInterval(t.data("autoScrollingInterval")),t.data("autoScrollingInterval",null),e._trigger("autoScrollingIntervalStopped"));break;case"backAndForth":t.data("pingPongDirection")==="right"?t.data("scrollWrapper").scrollLeft(t.data("scrollWrapper").scrollLeft()+n.autoScrollingStep):t.data("scrollWrapper").scrollLeft(t.data("scrollWrapper").scrollLeft()-n.autoScrollingStep),t.data("previousScrollLeft")===t.data("scrollWrapper").scrollLeft()&&(t.data("pingPongDirection")==="right"?(t.data("pingPongDirection","left"),e._trigger("autoScrollingRightLimitReached")):(t.data("pingPongDirection","right"),e._trigger("autoScrollingLeftLimitReached")));break;case"endlessLoopRight":t.data("scrollWrapper").scrollLeft(t.data("scrollWrapper").scrollLeft()+n.autoScrollingStep),e._checkContinuousSwapRight();break;case"endlessLoopLeft":t.data("scrollWrapper").scrollLeft(t.data("scrollWrapper").scrollLeft()-n.autoScrollingStep),e._checkContinuousSwapLeft();break;default:}}},n.autoScrollingInterval)))},_checkContinuousSwapRight:function(){var t=this.element,n=this.options;t.data("getNextElementWidth")&&(n.startAtElementId.length>0&&t.data("startAtElementHasNotPassed")?(t.data("swapAt",e("#"+n.startAtElementId).outerWidth(!0)),t.data("startAtElementHasNotPassed",!1)):t.data("swapAt",t.data("scrollableArea").children(":first").outerWidth(!0)),t.data("getNextElementWidth",!1));if(t.data("swapAt")<=t.data("scrollWrapper").scrollLeft()){t.data("swappedElement",t.data("scrollableArea").children(":first").detach()),t.data("scrollableArea").append(t.data("swappedElement"));var r=t.data("scrollWrapper").scrollLeft();t.data("scrollWrapper").scrollLeft(r-t.data("swappedElement").outerWidth(!0)),t.data("getNextElementWidth",!0)}},_checkContinuousSwapLeft:function(){var t=this.element,n=this.options;t.data("getNextElementWidth")&&(n.startAtElementId.length>0&&t.data("startAtElementHasNotPassed")?(t.data("swapAt",e("#"+n.startAtElementId).outerWidth(!0)),t.data("startAtElementHasNotPassed",!1)):t.data("swapAt",t.data("scrollableArea").children(":first").outerWidth(!0)),t.data("getNextElementWidth",!1)),t.data("scrollWrapper").scrollLeft()===0&&(t.data("swappedElement",t.data("scrollableArea").children(":last").detach()),t.data("scrollableArea").prepend(t.data("swappedElement")),t.data("scrollWrapper").scrollLeft(t.data("scrollWrapper").scrollLeft()+t.data("swappedElement").outerWidth(!0)),t.data("getNextElementWidth",!0))},restoreOriginalElements:function(){var e=this,t=this.element;t.data("scrollableArea").html(t.data("originalElements")),e.recalculateScrollableArea(),e.jumpToElement("first")},show:function(){var e=this.element;e.data("visible",!0),e.show()},hide:function(){var e=this.element;e.data("visible",!1),e.hide()},enable:function(){var e=this.element;e.data("enabled",!0)},disable:function(){var e=this,t=this.element;e.stopAutoScrolling(),clearInterval(t.data("rightScrollingInterval")),clearInterval(t.data("leftScrollingInterval")),clearInterval(t.data("hideHotSpotBackgroundsInterval")),t.data("enabled",!1)},destroy:function(){var t=this,n=this.element;t.stopAutoScrolling(),clearInterval(n.data("rightScrollingInterval")),clearInterval(n.data("leftScrollingInterval")),clearInterval(n.data("hideHotSpotBackgroundsInterval")),n.data("scrollingHotSpotRight").unbind("mouseover"),n.data("scrollingHotSpotRight").unbind("mouseout"),n.data("scrollingHotSpotRight").unbind("mousedown"),n.data("scrollingHotSpotLeft").unbind("mouseover"),n.data("scrollingHotSpotLeft").unbind("mouseout"),n.data("scrollingHotSpotLeft").unbind("mousedown"),n.unbind("mousenter"),n.unbind("mouseleave"),n.data("scrollingHotSpotRight").remove(),n.data("scrollingHotSpotLeft").remove(),n.data("scrollableArea").remove(),n.data("scrollWrapper").remove(),n.html(n.data("originalElements")),e.Widget.prototype.destroy.apply(this,arguments)}})})(jQuery)
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Ktree_Brand</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>devel</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSLv3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Ktree Brand Extension. By this we can enable shopping based on brands</summary>
|
10 |
+
<description>Ktree Brand Extension. By this we can enable shopping based on brands</description>
|
11 |
+
<notes>Ktree Brand Extension. By this we can enable shopping based on brands</notes>
|
12 |
+
<authors><author><name>KTree</name><user>KT097</user><email>alma.rajkumar@goktree.com</email></author></authors>
|
13 |
+
<date>2013-05-13</date>
|
14 |
+
<time>07:39:53</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Ktree"><dir name="Brand"><dir name="Block"><dir name="Adminhtml"><dir name="Brand"><dir name="Edit"><file name="Form.php" hash="29bc2d340a6eabe0b03dae943fd68f9f"/><dir name="Tab"><file name="Form.php" hash="13ae5e0175b81b0e3e244feba002ec0a"/></dir><file name="Tabs.php" hash="d564f9796065f9a01e49d0e9160882ab"/></dir><file name="Edit.php" hash="4a31a6369c532eef27215d5d11041ce2"/><dir name="Grid"><dir name="Renderer"><file name="Arrange.php" hash="17859146e9314995c8b04b0eb21e9295"/><file name="Image.php" hash="5d25f8acb3dcfeaf1e9a0f1a3d6c6e77"/></dir></dir><file name="Grid.php" hash="0704dee113e4817027defa39aef64973"/></dir><file name="Brand.php" hash="f3992d4d75615335fb05b85c7be94b08"/><dir name="Tab"><dir name="Brand"><dir name="Renderer"><file name="Checkbox.php" hash="f923a78f351fa1c9f3e0f95854be2242"/></dir></dir><file name="Brand.php" hash="0fe5f1bc473536893f31c686fd73d032"/></dir><file name="Tabs.php" hash="2d11c1c9d226703109bfe283665f33ed"/></dir><file name="Brand.php" hash="5279e4742df96bde5656f7223d6a238e"/><file name="Brandcategories.php" hash="d6099bd0a498d04a34f6590e2c690dc0"/><file name="Brandinfo.php" hash="21bd4a13519a95bd4ab961d2413f463d"/><file name="Category.php" hash="79d2138c021b51fbec014a6d6dbc9487"/><file name="Onbrand.php" hash="9e28f838a246cbfb18c571183006912f"/><file name="Onbrandcategory.php" hash="9ae55d815d0819a4c1c878006811e62a"/><file name="Onbrandcategoryproduct.php" hash="17684bf577cfff24433cd4e21b1bd806"/></dir><dir name="Helper"><file name="Data.php" hash="103350f3f8a1daaa36a8831bc7e31604"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Brand"><file name="Branddata.php" hash="f17af121190984c95c693113eb84f107"/></dir></dir><dir name="Source"><dir name="Brand"><file name="Brand.php" hash="8af3fb4b7d6ec67cda0d1dccb4cbe32e"/></dir></dir></dir></dir></dir><file name="Brand.php" hash="2d08d55d15d504d4b345c635f32bfd03"/><file name="Category.php" hash="929424e7c67fe37ae3ed72ebdfa3cb30"/><file name="Categoryname.php" hash="ec1f2346cf738d9fd811278306ed1198"/><dir name="Mysql4"><dir name="Brand"><file name="Collection.php" hash="eab7431e0ddb67caa527a08cc631b515"/></dir><file name="Brand.php" hash="385fb3b4b5fa0ac5621c4cba3657ae9c"/><dir name="Category"><file name="Collection.php" hash="d39cebdbc5323be6286b3e6673feebcf"/></dir><file name="Category.php" hash="a57d1d96935fc36570c01c2839029148"/><file name="Setup.php" hash="9c4b1756d5e5a8288781a88a24eb762e"/></dir><file name="Observer.php" hash="018c868f703964d75fd99ad4fbfe0ef5"/><file name="Resizeimage.php" hash="a66048e053c93e8e2df167989410fb4c"/><file name="Status.php" hash="e5d1a21a6f5ca3e2f3d7351dc721b084"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BrandController.php" hash="8ed2ebef728b6845e1b33b2d7febe756"/></dir><dir name="Catalog"><file name="CategoryController.php" hash="d369eca4c0d98410a427cc3e136871b3"/></dir><dir name="CatalogSearch"><file name="ResultController.php" hash="0014a3ba16f5954c4114607069d971a1"/></dir><file name="CategoryController.php" hash="16271ea4de533c56ee33fc134aeeaf6e"/><file name="IndexController.php" hash="cec65449ea4f445efe013960bfa4649b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="67cbe4315de64cd43a7a95266920ce1f"/><file name="config.xml" hash="f73a39f1b385b46cac1cda716b885514"/><file name="system.xml" hash="a4151207ac6611a97ebb5e46ac863012"/></dir><dir name="sql"><dir name="brand_setup"><file name="mysql4-install-0.1.0.php" hash="c5bb7394c78c1bcb86cd16dd218c7079"/><file name="mysql4-upgrade-0.1.0-1.0.0.php" hash="2e4323505a9c9dbdf99b39ee98df49d0"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ktree_Brand.xml" hash="c2a467c4351233b313f42fbf45a907ff"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="brand.xml" hash="b4411f55825b5675752bcdebbe761443"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="brand"><file name="brand_categories.phtml" hash="90c3a07fe0fd21606ac715096a6c9f92"/><file name="brand_info.phtml" hash="d4573dbfa8f4637e27ae032702f07e20"/><file name="brands.phtml" hash="24d20bc553ead3062e4d676e9dbfd38a"/><file name="categorybrand.phtml" hash="74177ee286c78fb015fe0ef012a3d3f6"/><file name="featured.phtml" hash="3f495e8a118711deadee5072ff91e690"/><file name="featuredbrands.phtml" hash="0665047d7f0a5c896e89551f698ab824"/></dir></dir><dir name="layout"><file name="brand.xml" hash="81bdd9c9070d227cf33af1ea3371ae55"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="brand"><file name="brand.js" hash="325e83611a94e4b5bfe8b360cefc21ea"/><file name="jquery-1.7.2.min.js" hash="b8d64d0bc142b3f670cc0611b0aebcae"/><file name="jquery.contentcarousel.js" hash="9c6ef99bfcaa9c1f6d1b99a9e3549198"/><file name="jquery.easing.1.3.js" hash="6516449ed5089677ed3d7e2f11fc8942"/><file name="jquery.mousewheel.js" hash="ec36bff2abcac4c2266a6442bf71d3d1"/><file name="noconflict.js" hash="e2060c4e5e5955c824723b13a212d3ec"/><dir name="smoothdivscroll"><file name="jquery-ui-1.8.23.custom.min.js" hash="41e6ea1c161b68a137096d35e24deb26"/><file name="jquery.kinetic.js" hash="79288331a6e2abd833093970b21749b9"/><file name="jquery.mousewheel.min.js" hash="25db04e9daee1c00f6ca337537c32c01"/><file name="jquery.smoothDivScroll-1.3.js" hash="e1d891ab6072b58b852c36be7ef001be"/><file name="jquery.smoothdivscroll-1.3-min.js" hash="1cc3655fbb22daad7896b3089e8384b8"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="images"><file name="ajax_loader.gif" hash="394bafc3cc4dfb3a0ee48c1f54669539"/><file name="no_image_available.jpg" hash="04eeceb1babbd4cc794436b1ae60d917"/><dir name="smoothdivscroll"><file name="arrow_left.gif" hash="d9a7075ff5d15553f30365dd1247a2e9"/><file name="arrow_left.png" hash="3718538d2df8cd3214a5230b2af7dee4"/><file name="arrow_right.gif" hash="de758cb44e95473edaacfa8e107a9a85"/><file name="arrow_right.png" hash="d114d62775c5b1970cca677feee36786"/><file name="bg_direction_left_ar.png" hash="83ce382d45b30395e1064f6e9bd15300"/><file name="bg_direction_right_arr.png" hash="23f90418af7443316851f6ccebffdb6e"/><file name="big_transparent.gif" hash="01f1d138092d33d4ab9239161f3e3e7f"/><file name="cursor_arrow_left.png" hash="49d419e3ef1c0e459ae512f29da28022"/><file name="cursor_arrow_right.png" hash="f4033d5a29b939f63c556553b7354190"/><dir name="cursors"><file name="cursor_arrow_left.cur" hash="1d48195b47192f315abff6aa766b9c67"/><file name="cursor_arrow_left.gif" hash="bcb6a7ea67ff5ef40709bd80e0c0028f"/><file name="cursor_arrow_left.png" hash="49d419e3ef1c0e459ae512f29da28022"/><file name="cursor_arrow_right.cur" hash="ebb9c314602cbb9ed4ee74e4d06b2310"/><file name="cursor_arrow_right.gif" hash="8c27d6ffc14cf46e742170f803764f97"/><file name="cursor_arrow_right.png" hash="f4033d5a29b939f63c556553b7354190"/></dir></dir></dir><dir name="ktree"><file name="smoothDivScroll.css" hash="0cff0fbc48d21e173d377dcf3ccb215c"/><file name="style.css" hash="1ec42039cbd449d75cf7ed87ab2a6169"/><file name="style1234.css" hash="939df27e61b062e8169d827336f3c5b6"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/frontend/base/default/css/images/ajax_loader.gif
ADDED
Binary file
|
skin/frontend/base/default/css/images/no_image_available.jpg
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/arrow_left.gif
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/arrow_left.png
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/arrow_right.gif
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/arrow_right.png
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/bg_direction_left_ar.png
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/bg_direction_right_arr.png
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/big_transparent.gif
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/cursor_arrow_left.png
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/cursor_arrow_right.png
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_left.cur
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_left.gif
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_left.png
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_right.cur
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_right.gif
ADDED
Binary file
|
skin/frontend/base/default/css/images/smoothdivscroll/cursors/cursor_arrow_right.png
ADDED
Binary file
|
skin/frontend/base/default/css/ktree/smoothDivScroll.css
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* You can alter this CSS in order to give Smooth Div Scroll your own look'n'feel */
|
2 |
+
|
3 |
+
/* Invisible left hotspot */
|
4 |
+
div.scrollingHotSpotLeft
|
5 |
+
{
|
6 |
+
/* The hotspots have a minimum width of 100 pixels and if there is room the will grow
|
7 |
+
and occupy 15% of the scrollable area (30% combined). Adjust it to your own taste. */
|
8 |
+
min-width: 28px;
|
9 |
+
/*width: 10%;*/
|
10 |
+
height: 28%;
|
11 |
+
/* There is a big background image and it's used to solve some problems I experienced
|
12 |
+
in Internet Explorer 6. */
|
13 |
+
background-image: url('../images/smoothdivscroll/bg_direction_left_ar.png');
|
14 |
+
background-repeat: repeat;
|
15 |
+
background-position: center center;
|
16 |
+
position: absolute;
|
17 |
+
z-index: 200;
|
18 |
+
left: 20px;
|
19 |
+
top:31px;
|
20 |
+
cursor:pointer;
|
21 |
+
/* The first url is for Firefox and other browsers, the second is for Internet Explorer */
|
22 |
+
/*cursor: url('../images/smoothdivscroll/cursors/cursor_arrow_left.png'), url('../images/smoothdivscroll/cursors/cursor_arrow_left.cur'),w-resize;*/
|
23 |
+
}
|
24 |
+
|
25 |
+
/* Visible left hotspot */
|
26 |
+
div.scrollingHotSpotLeftVisible
|
27 |
+
{
|
28 |
+
background-image: url('../images/smoothdivscroll/bg_direction_left_ar.png');
|
29 |
+
/*background-color: ;
|
30 |
+
background-repeat: no-repeat;
|
31 |
+
opacity: 0.35; /* Standard CSS3 opacity setting */
|
32 |
+
/*-moz-opacity: 0.35; Opacity for really old versions of Mozilla Firefox (0.9 or older) */
|
33 |
+
/*filter: alpha(opacity = 35); /* Opacity for Internet Explorer. */
|
34 |
+
/*zoom: 1; /* Trigger "hasLayout" in Internet Explorer 6 or older versions */
|
35 |
+
}
|
36 |
+
|
37 |
+
/* Invisible right hotspot */
|
38 |
+
div.scrollingHotSpotRight
|
39 |
+
{
|
40 |
+
min-width: 28px;
|
41 |
+
/*width: 10%;*/
|
42 |
+
height: 28%;
|
43 |
+
background-image: url('../images/smoothdivscroll/bg_direction_right_arr.png');
|
44 |
+
background-repeat: repeat;
|
45 |
+
background-position: center center;
|
46 |
+
position: absolute;
|
47 |
+
z-index: 200;
|
48 |
+
right: 30px;
|
49 |
+
top:31px;
|
50 |
+
cursor: pointer;
|
51 |
+
/*cursor: url('../images/smoothdivscroll/cursors/cursor_arrow_right.png'), url('../images/smoothdivscroll/cursors/cursor_arrow_right.cur'),e-resize;*/
|
52 |
+
}
|
53 |
+
|
54 |
+
/* Visible right hotspot */
|
55 |
+
div.scrollingHotSpotRightVisible
|
56 |
+
{
|
57 |
+
background-image: url('../images/smoothdivscroll/bg_direction_right_arr.png');
|
58 |
+
background-color: ;
|
59 |
+
background-repeat: no-repeat;
|
60 |
+
opacity: 0.35;
|
61 |
+
filter: alpha(opacity = 35);
|
62 |
+
-moz-opacity: 0.35;
|
63 |
+
zoom: 1;
|
64 |
+
}
|
65 |
+
|
66 |
+
/* The scroll wrapper is always the same width and height as the containing element (div).
|
67 |
+
Overflow is hidden because you don't want to show all of the scrollable area.
|
68 |
+
*/
|
69 |
+
div.scrollWrapper
|
70 |
+
{
|
71 |
+
position: relative;
|
72 |
+
overflow: hidden;
|
73 |
+
width: 100%;
|
74 |
+
height: 100%; margin: 9px 0;
|
75 |
+
}
|
76 |
+
|
77 |
+
div.scrollableArea
|
78 |
+
{ background:none repeat scroll 0 0 #DCDCDC;
|
79 |
+
position: relative;
|
80 |
+
width: auto;
|
81 |
+
height: 100%;
|
82 |
+
}
|
83 |
+
#makeMeScrollable div.scrollableArea img {
|
84 |
+
background: none repeat scroll 0 0 #FFFFFF !important;
|
85 |
+
border: 2px solid #CCCCCC !important;
|
86 |
+
float: left !important;
|
87 |
+
height: 65px !important;
|
88 |
+
margin: 5px !important;
|
89 |
+
padding: 5px !important;
|
90 |
+
position: relative !important;
|
91 |
+
}
|
92 |
+
#makeMeScrollable {
|
93 |
+
height: 90px !important;
|
94 |
+
position: relative !important;
|
95 |
+
width: 100% !important;
|
96 |
+
}
|
skin/frontend/base/default/css/ktree/style.css
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.key_item { float: left; padding:6px 12px 8px; margin-left:2px; background:#27b4f5; color:#FFF; cursor:pointer;}
|
2 |
+
.navigation_char{ width:900px; float: left; margin-top:20px;}
|
3 |
+
.key_item a:hover{text-decoration: none;}
|
4 |
+
#galleryContainer{ /*float: left; width:900px;*/}
|
5 |
+
#dhtmlgoodies_slideshow{ /*width:900px!important;*/ float: left;}
|
6 |
+
#alphabet_filter, #category_filter{ background:#27b4f5!important; color:#FFF; cursor:pointer;}
|
7 |
+
#category_content{ padding-left:181px!important;}
|
8 |
+
#arrow_left{ background: url(../images/bg_direction_arrowes.png) left top no-repeat; width:28px; height:27px; cursor: pointer;position:absolute; top:47px; }
|
9 |
+
#arrow_right{ background: url(../images/bg_direction_arrowes.png) right top no-repeat; height:26px; width:28px; cursor: pointer; position:absolute; right:140px; top:47px;}
|
10 |
+
.cat-brands li { line-height: 25px; padding-left:8px;}
|
11 |
+
.bare-list a{ display: block;}
|
12 |
+
.title{ margin-bottom:0px!important;}
|
13 |
+
.cat-brands{background:#27b4f5; width:150px; border:1px solid #27b4f5;}
|
14 |
+
.brand-categories{border:1px solid #C4C1BC!important; background:none repeat scroll 0 0 #F8F7F5!important; margin-bottom:15px;}
|
15 |
+
.block-title { background: url("../images/bkg_block-title.gif") repeat-x scroll 0 0 transparent; border-bottom: 1px solid #DDDDDD; padding: 2px 9px;}
|
16 |
+
.block-title strong { background: url("../images/i_block-subscribe.gif") no-repeat scroll left top transparent; padding-left:20px;}
|
17 |
+
.cats-in-brand{ padding:5px 10px;}
|
18 |
+
.block-title span{ color:#E26703; text-transform: uppercase;}
|
19 |
+
.cat-brands li a{ color:#FFF;}
|
20 |
+
.cat-brands li a:hover{ color:#222;}
|
21 |
+
.cats-in-brand li {padding-left: 10px;}
|
22 |
+
|
skin/frontend/base/default/css/ktree/style1234.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.key_item { float: left; padding:5px; margin-left:2px; background:#eaeaea;}
|