Version Notes
This is a First Version of Ajax Cart With Wishlist
Download this release
Release Info
Developer | AmarInfotech |
Extension | Ajax_Addtocart |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 0.1.0 to 1.0.1
- app/code/community/Excel/AjaxWishlist/Block/Adminhtml/Info.php +29 -0
- app/code/community/Excel/AjaxWishlist/Block/Adminhtml/Url.php +91 -0
- app/code/community/Excel/AjaxWishlist/Block/AjaxWishlist.php +37 -0
- app/code/community/Excel/AjaxWishlist/Block/Customer/Wishlist.php +28 -0
- app/code/community/Excel/AjaxWishlist/Helper/Data.php +91 -0
- app/code/community/Excel/AjaxWishlist/Model/Observer.php +123 -0
- app/code/community/Excel/AjaxWishlist/Model/Response.php +100 -0
- app/code/community/Excel/AjaxWishlist/Model/System/Config/Backend/Validate.php +18 -0
- app/code/community/Excel/AjaxWishlist/Model/System/Config/Source/Dropdown/Sidebar.php +20 -0
- app/code/community/Excel/AjaxWishlist/controllers/Checkout/CartController.php +194 -0
- app/code/community/Excel/AjaxWishlist/controllers/IndexController.php +712 -0
- app/code/community/Excel/AjaxWishlist/etc/adminhtml.xml +48 -0
- app/code/community/Excel/AjaxWishlist/etc/config.xml +159 -0
- app/code/community/Excel/AjaxWishlist/etc/system.xml +207 -0
- app/code/local/Amar/Ajax/Block/Ajax.php +0 -17
- app/code/local/Amar/Ajax/Block/Cart/Sidebar.php +0 -18
- app/code/local/Amar/Ajax/Helper/Data.php +0 -6
- app/code/local/Amar/Ajax/Model/Ajax.php +0 -10
- app/code/local/Amar/Ajax/Model/Mysql4/Ajax.php +0 -10
- app/code/local/Amar/Ajax/Model/Mysql4/Ajax/Collection.php +0 -10
- app/code/local/Amar/Ajax/Model/Status.php +0 -15
- app/code/local/Amar/Ajax/controllers/IndexController.php +0 -108
- app/code/local/Amar/Ajax/etc/config.xml +0 -77
- app/design/frontend/base/default/layout/ajaxwishlist.xml +350 -0
- app/design/frontend/base/default/template/ajaxwishlist/ajaxcart/configurable_options.phtml +71 -0
- app/design/frontend/base/default/template/ajaxwishlist/ajaxcart/grouped_options.phtml +67 -0
- app/design/frontend/base/default/template/ajaxwishlist/catalog/product/compare/sidebar.phtml +72 -0
- app/design/frontend/base/default/template/ajaxwishlist/catalog/product/list.phtml +329 -0
- app/design/frontend/base/default/template/ajaxwishlist/catalog/product/list/related.phtml +189 -0
- app/design/frontend/base/default/template/ajaxwishlist/catalog/product/view/addto.phtml +177 -0
- app/design/frontend/base/default/template/ajaxwishlist/catalog/product/view/addto_jQ.phtml +57 -0
- app/design/frontend/base/default/template/ajaxwishlist/catalog/product/view/media.phtml +253 -0
- app/design/frontend/base/default/template/ajaxwishlist/common.phtml +20 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/button/share.phtml +30 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/button/tocart.phtml +31 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/button/update.phtml +30 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/column/cart.phtml +54 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/column/image.phtml +35 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/column/info.phtml +40 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/column/remove.phtml +29 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/column/remove_bk.phtml +29 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/configure/addto.phtml +39 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/list.phtml +64 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/sharing.phtml +86 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/sidebar.phtml +150 -0
- app/design/frontend/base/default/template/ajaxwishlist/wishlist/view.phtml +262 -0
- app/design/frontend/default/default/layout/ajax.xml +0 -103
- app/design/frontend/default/default/template/ajax/catalog/product/options.phtml +0 -109
- app/design/frontend/default/default/template/ajax/catalog/product/view.phtml +0 -146
- app/design/frontend/default/default/template/ajax/catalog/product/view/addtocart.phtml +0 -14
- app/design/frontend/default/default/template/ajax/catalog/product/view/list.phtml +0 -161
- app/design/frontend/default/default/template/ajax/checkout/cart/sidebar/default.phtml +0 -137
- app/design/frontend/default/default/template/ajax/checkout/cart/sidebar/default1.5.phtml +0 -153
- app/etc/modules/Amar_Ajax.xml +0 -9
- app/etc/modules/Excel_AjaxWishlist.xml +9 -0
- js/jquery/jquery-1.6.4.min.js +0 -4
- js/jquery/noconflict.js +0 -1
- package.xml +9 -9
- skin/frontend/base/default/css/ajaxwishlist/ajaxcart/growler.css +191 -0
- skin/frontend/base/default/css/ajaxwishlist/ajaxcart/modalbox.css +104 -0
- skin/frontend/base/default/css/ajaxwishlist/ajaxwishlist.css +197 -0
- skin/frontend/base/default/css/ajaxwishlist/lightview/lightviewyoung.css +483 -0
- skin/frontend/base/default/css/ajaxwishlist/lightview/lightviewyoung_.css +1 -0
- skin/frontend/base/default/images/ajaxWishlist/ajaxcart/btn_popup-close.png +0 -0
- skin/frontend/base/default/images/ajaxWishlist/ajaxcart/right.jpg +0 -0
- skin/frontend/base/default/images/ajaxWishlist/ajaxcart/spinner.gif +0 -0
- skin/frontend/base/default/images/ajaxWishlist/ajaxcart/wrong.jpg +0 -0
- skin/frontend/base/default/images/ajaxWishlist/opc-ajax-loader.gif +0 -0
- skin/frontend/base/default/images/ajaxWishlist/star_empty.png +0 -0
- skin/frontend/base/default/images/ajaxWishlist/star_select.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/ajaxcart/ajaxcart.js +510 -0
- skin/frontend/base/default/js/ajaxwishlist/ajaxcart/growler.js +167 -0
- skin/frontend/base/default/js/ajaxwishlist/ajaxcart/modalbox.js +450 -0
- skin/frontend/base/default/js/ajaxwishlist/ajaxwishlist.js +968 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/close_large.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/close_small.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/controller_close.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/controller_next.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/controller_prev.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/controller_slideshow_play.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/controller_slideshow_stop.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/icon-nav-right.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/icon-nav.gif +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/inner_next.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/inner_prev.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/inner_slideshow_play.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/inner_slideshow_stop.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/loading.gif +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/next.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/prev.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/product_img.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/product_img1.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/product_img2.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/images/lightview/topclose.png +0 -0
- skin/frontend/base/default/js/ajaxwishlist/lightview/builder.js +136 -0
- skin/frontend/base/default/js/ajaxwishlist/lightview/controls.js +965 -0
- skin/frontend/base/default/js/ajaxwishlist/lightview/dragdrop.js +974 -0
- skin/frontend/base/default/js/ajaxwishlist/lightview/effects.js +1123 -0
- skin/frontend/base/default/js/ajaxwishlist/lightview/lightview.js +181 -0
- skin/frontend/base/default/js/ajaxwishlist/lightview/prototype.js +6081 -0
- skin/frontend/base/default/js/ajaxwishlist/lightview/scriptaculous.js +68 -0
- skin/frontend/base/default/js/ajaxwishlist/lightview/slider.js +275 -0
- skin/frontend/base/default/js/ajaxwishlist/lightview/sound.js +59 -0
- skin/frontend/base/default/js/ajaxwishlist/lightview/unittest.js +568 -0
- skin/frontend/default/default/js/fancybox/blank.gif +0 -0
- skin/frontend/default/default/js/fancybox/fancy_close.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_loading.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_nav_left.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_nav_right.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_shadow_e.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_shadow_n.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_shadow_ne.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_shadow_nw.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_shadow_s.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_shadow_se.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_shadow_sw.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_shadow_w.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_title_left.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_title_main.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_title_over.png +0 -0
- skin/frontend/default/default/js/fancybox/fancy_title_right.png +0 -0
- skin/frontend/default/default/js/fancybox/fancybox-x.png +0 -0
- skin/frontend/default/default/js/fancybox/fancybox-y.png +0 -0
- skin/frontend/default/default/js/fancybox/fancybox.png +0 -0
- skin/frontend/default/default/js/fancybox/jquery.easing-1.3.pack.js +0 -72
- skin/frontend/default/default/js/fancybox/jquery.fancybox-1.3.4.css +0 -358
- skin/frontend/default/default/js/fancybox/jquery.fancybox-1.3.4.js +0 -1156
- skin/frontend/default/default/js/fancybox/jquery.fancybox-1.3.4.pack.js +0 -46
- skin/frontend/default/default/js/fancybox/jquery.mousewheel-3.0.4.pack.js +0 -14
app/code/community/Excel/AjaxWishlist/Block/Adminhtml/Info.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Excel_AjaxWishlist_Block_Adminhtml_Info extends Mage_Adminhtml_Block_System_Config_Form_Fieldset {
|
4 |
+
|
5 |
+
protected function _getInfo($content) {
|
6 |
+
$output = $this->_getStyle();
|
7 |
+
$output .= '<div class="creativestyle-info">';
|
8 |
+
$output .= $content;
|
9 |
+
$output .= '</div>';
|
10 |
+
return $output;
|
11 |
+
}
|
12 |
+
|
13 |
+
protected function _getStyle() {
|
14 |
+
$content = '<style>';
|
15 |
+
$content .= '.creativestyle-info { border: 1px solid #cccccc; background: #e7efef; margin-bottom: 10px; padding: 10px; height: auto; }';
|
16 |
+
$content .= '.creativestyle-info .creativestyle-logo { float: right; padding: 5px; }';
|
17 |
+
$content .= '.creativestyle-info .creativestyle-command { border: 1px solid #cccccc; background: #ffffff; padding: 15px; text-align: left; margin: 10px 0; font-weight: bold; }';
|
18 |
+
$content .= '.creativestyle-info h3 { color: #ea7601; }';
|
19 |
+
$content .= '.creativestyle-info h3 small { font-weight: normal; font-size: 80%; font-style: italic; }';
|
20 |
+
$content .= '</style>';
|
21 |
+
return $content;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function render(Varien_Data_Form_Element_Abstract $element) {
|
25 |
+
// $content = '<h3>' . $this->__('Ajaxcart & Ajax Wishlist documentation').'</h3>';
|
26 |
+
// return $this->_getInfo($content);
|
27 |
+
}
|
28 |
+
|
29 |
+
}
|
app/code/community/Excel/AjaxWishlist/Block/Adminhtml/Url.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Creativestyle
|
4 |
+
* @package Creativestyle_Varnish
|
5 |
+
* @copyright Copyright (c) 2011 creativestyle GmbH (http://www.creativestyle.de)
|
6 |
+
* @author Marek Zabrowarny / creativestyle GmbH <support@creativestyle.de>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Excel_AjaxWishlist_Block_Adminhtml_Url extends Mage_Adminhtml_Block_System_Config_Form_Field {
|
10 |
+
|
11 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
|
12 |
+
$this->setElement($element);
|
13 |
+
$output = '<script type="text/javascript">//<![CDATA[' . "\n";
|
14 |
+
$output .= ' var xml_form_template = \'' . str_replace("'", "\'", $this->_getRowEditHtml()) .'\';' . "\n";
|
15 |
+
$output .= '//]]></script>' . "\n";
|
16 |
+
$output .= '<input type="hidden" name="' . $this->getElement()->getName() . '" value="">';
|
17 |
+
$output .= '<table id="xml_container" style="border-collapse:collapse;"><tbody>';
|
18 |
+
$output .= $this->_getHeaderHtml();
|
19 |
+
if ($this->getElement()->getData('value')) {
|
20 |
+
foreach ($this->getElement()->getData('value/id') as $elementIndex => $elementName) {
|
21 |
+
$output .= $this->_getRowHtml($elementIndex);
|
22 |
+
}
|
23 |
+
}
|
24 |
+
$output .= '<tr><td colspan="2" style="padding: 4px 0;">';
|
25 |
+
$output .= $this->_getAddButtonHtml();
|
26 |
+
$output .= '</td></tr>';
|
27 |
+
$output .= '</tbody></table>';
|
28 |
+
return $output;
|
29 |
+
}
|
30 |
+
|
31 |
+
protected function _getHeaderHtml() {
|
32 |
+
$output = '<tr>';
|
33 |
+
$output .= '<th style="padding: 2px; text-align: center;">';
|
34 |
+
$output .= Mage::helper('ajaxwishlist')->__('ID/Class selector of block to be updated');
|
35 |
+
$output .= '</th>';
|
36 |
+
$output .= '<th style="padding: 2px; text-align: center;">';
|
37 |
+
$output .= Mage::helper('ajaxwishlist')->__('Layout Update Block name(should be same as in XML)');
|
38 |
+
$output .= '</th>';
|
39 |
+
$output .= '<th> </th>';
|
40 |
+
$output .= '</tr>';
|
41 |
+
return $output;
|
42 |
+
}
|
43 |
+
|
44 |
+
protected function _getRowHtml($index = 0) {
|
45 |
+
$output = '<tr>';
|
46 |
+
$output .= '<td style="padding: 2px 0;">';
|
47 |
+
$output .= '<input type="text" class="required-entry input-text" style="margin-right:10px" name="' . $this->getElement()->getName() . '[id][]" value="' . $this->getElement()->getData('value/id/' . $index) . '" />';
|
48 |
+
$output .= '</td>';
|
49 |
+
$output .= '<td style="padding: 2px 0;">';
|
50 |
+
$output .= '<input class="required-entry input-text" name="' . $this->getElement()->getName() . '[xml][]" value="'.$this->getElement()->getData('value/xml/' . $index) . '">';
|
51 |
+
$output .= '</td>';
|
52 |
+
$output .= '<td style="padding: 2px 4px;">';
|
53 |
+
$output .= $this->_getRemoveButtonHtml();
|
54 |
+
$output .= '</td>';
|
55 |
+
$output .= '</tr>';
|
56 |
+
return $output;
|
57 |
+
}
|
58 |
+
|
59 |
+
protected function _getRowEditHtml() {
|
60 |
+
$output = '<tr>';
|
61 |
+
$output .= '<td style="padding: 2px 0;">';
|
62 |
+
$output .= '<input class="required-entry input-text" style="margin-right:10px" name="' . $this->getElement()->getName() . '[id][]" />';
|
63 |
+
$output .= '</td>';
|
64 |
+
$output .= '<td style="padding: 2px 0;">';
|
65 |
+
$output .= '<input class="required-entry input-text" name="' . $this->getElement()->getName() . '[xml][]">';
|
66 |
+
$output .= '</td>';
|
67 |
+
$output .= '<td style="padding: 2px 4px;">';
|
68 |
+
$output .= $this->_getRemoveButtonHtml();
|
69 |
+
$output .= '</td>';
|
70 |
+
$output .= '</tr>';
|
71 |
+
return $output;
|
72 |
+
}
|
73 |
+
|
74 |
+
protected function _getAddButtonHtml() {
|
75 |
+
return $this->getLayout()->createBlock('adminhtml/widget_button')
|
76 |
+
->setType('button')
|
77 |
+
->setClass('add')
|
78 |
+
->setLabel($this->__('Add Layout Update Block'))
|
79 |
+
->setOnClick("Element.insert($(this).up('tr'), {before: xml_form_template})")
|
80 |
+
->toHtml();
|
81 |
+
}
|
82 |
+
|
83 |
+
protected function _getRemoveButtonHtml() {
|
84 |
+
return $this->getLayout()->createBlock('adminhtml/widget_button')
|
85 |
+
->setType('button')
|
86 |
+
->setClass('delete v-middle')
|
87 |
+
->setLabel($this->__('Delete'))
|
88 |
+
->setOnClick("Element.remove($(this).up('tr'))")
|
89 |
+
->toHtml();
|
90 |
+
}
|
91 |
+
}
|
app/code/community/Excel/AjaxWishlist/Block/AjaxWishlist.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Excel_AjaxWishlist_Block_AjaxWishlist extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
public function getAjaxWishlist()
|
10 |
+
{
|
11 |
+
if (!$this->hasData('ajaxwishlist')) {
|
12 |
+
$this->setData('ajaxwishlist', Mage::registry('ajaxwishlist'));
|
13 |
+
}
|
14 |
+
return $this->getData('ajaxwishlist');
|
15 |
+
|
16 |
+
}
|
17 |
+
|
18 |
+
|
19 |
+
public function ajaxTemplate($blockPath,$template)
|
20 |
+
{
|
21 |
+
|
22 |
+
if(Mage::getStoreConfig("ajaxwishlist/wishlist_general/wishlist_status"))
|
23 |
+
{
|
24 |
+
|
25 |
+
$block = $this->getLayout()
|
26 |
+
->createBlock($blockPath)
|
27 |
+
->setTemplate($template);
|
28 |
+
|
29 |
+
$this->getLayout()->getBlock('content')->append($block);
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Excel/AjaxWishlist/Block/Customer/Wishlist.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* To change this template, choose Tools | Templates
|
5 |
+
* and open the template in the editor.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Description of Wishlist
|
10 |
+
*
|
11 |
+
* @author root
|
12 |
+
*/
|
13 |
+
class Excel_Ajaxwishlist_Block_Customer_Wishlist extends Mage_Wishlist_Block_Customer_Wishlist
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Retrieve wishlist instance
|
17 |
+
*
|
18 |
+
* @return Mage_Wishlist_Model_Wishlist
|
19 |
+
*/
|
20 |
+
public function getWishlistInstance()
|
21 |
+
{
|
22 |
+
return $this->_getWishlist();
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
?>
|
app/code/community/Excel/AjaxWishlist/Helper/Data.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Excel_AjaxWishlist_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
public function getWishlistUrl() // Url of Ajax Wishlist popup
|
7 |
+
{
|
8 |
+
$baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
9 |
+
$wishlistUrl = Mage::getStoreConfig("ajaxwishlist/wishlist_general/wishlist_link");
|
10 |
+
|
11 |
+
return $baseUrl.$wishlistUrl;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function getWishlistAjaxMode()
|
15 |
+
{
|
16 |
+
return Mage::getStoreConfig("ajaxwishlist/wishlist_ajax/ajax_status");
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getWishlistPopupWidth()
|
20 |
+
{
|
21 |
+
|
22 |
+
if($this->getWishlistAjaxMode())
|
23 |
+
{
|
24 |
+
$width = Mage::getStoreConfig("ajaxwishlist/wishlist_ajax/ajax_popup_width");
|
25 |
+
|
26 |
+
if($width != null)
|
27 |
+
{
|
28 |
+
return $style = Mage::getStoreConfig("ajaxwishlist/wishlist_ajax/ajax_popup_width");
|
29 |
+
}
|
30 |
+
else
|
31 |
+
{
|
32 |
+
return $style = 800;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getWishlistPopupHeight()
|
39 |
+
{
|
40 |
+
|
41 |
+
if($this->getWishlistAjaxMode())
|
42 |
+
{
|
43 |
+
$height = Mage::getStoreConfig("ajaxwishlist/wishlist_ajax/ajax_popup_height");
|
44 |
+
|
45 |
+
if($height != null)
|
46 |
+
{
|
47 |
+
return $style = Mage::getStoreConfig("ajaxwishlist/wishlist_ajax/ajax_popup_height");
|
48 |
+
}
|
49 |
+
else
|
50 |
+
{
|
51 |
+
return $style = 600;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
public function getwishlistsidebar()
|
58 |
+
{
|
59 |
+
return Mage::getStoreConfig("ajaxwishlist/wishlist_sidebar/sidebar_status");
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
public function getWishlistSidebarPositionShow()
|
64 |
+
{
|
65 |
+
|
66 |
+
if($this->getwishlistsidebar())
|
67 |
+
{
|
68 |
+
return Mage::getStoreConfig("ajaxwishlist/wishlist_sidebar/wishlist_show");
|
69 |
+
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
public function getMarkerStatus()
|
74 |
+
{
|
75 |
+
return Mage::getStoreConfig("ajaxwishlist/wishlist_bookmark/bookmark_status");
|
76 |
+
|
77 |
+
}
|
78 |
+
|
79 |
+
public function func_wishlistVersion()
|
80 |
+
{
|
81 |
+
if (version_compare(Mage::getVersion(), '1.6.0.0', '<=')){
|
82 |
+
|
83 |
+
return true;
|
84 |
+
}
|
85 |
+
else
|
86 |
+
{
|
87 |
+
return false;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
}
|
app/code/community/Excel/AjaxWishlist/Model/Observer.php
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Excel_AjaxWishlist_Model_Observer {
|
4 |
+
|
5 |
+
public function addToCartEvent($observer) {
|
6 |
+
|
7 |
+
|
8 |
+
$request = Mage::app()->getFrontController()->getRequest();
|
9 |
+
|
10 |
+
if (!$request->getParam('in_cart') && !$request->getParam('is_checkout')) {
|
11 |
+
|
12 |
+
Mage::getSingleton('checkout/session')->setNoCartRedirect(true);
|
13 |
+
|
14 |
+
$_response = Mage::getModel('ajaxwishlist/response')
|
15 |
+
->setProductName($observer->getProduct()->getName())
|
16 |
+
->setMessage(Mage::helper('checkout')->__('%s was added into cart.', $observer->getProduct()->getName()));
|
17 |
+
|
18 |
+
//append updated blocks
|
19 |
+
$_response->addUpdatedBlocks($_response);
|
20 |
+
|
21 |
+
$_response->send();
|
22 |
+
}
|
23 |
+
if ($request->getParam('is_checkout')) {
|
24 |
+
|
25 |
+
Mage::getSingleton('checkout/session')->setNoCartRedirect(true);
|
26 |
+
|
27 |
+
$_response = Mage::getModel('ajaxwishlist/response')
|
28 |
+
->setProductName($observer->getProduct()->getName())
|
29 |
+
->setMessage(Mage::helper('checkout')->__('%s was added into cart.', $observer->getProduct()->getName()));
|
30 |
+
$_response->send();
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
public function updateItemEvent($observer) {
|
35 |
+
|
36 |
+
$request = Mage::app()->getFrontController()->getRequest();
|
37 |
+
|
38 |
+
if (!$request->getParam('in_cart') && !$request->getParam('is_checkout')) {
|
39 |
+
|
40 |
+
Mage::getSingleton('checkout/session')->setNoCartRedirect(true);
|
41 |
+
|
42 |
+
$_response = Mage::getModel('ajaxwishlist/response')
|
43 |
+
->setMessage(Mage::helper('checkout')->__('Item was updated.'));
|
44 |
+
|
45 |
+
//append updated blocks
|
46 |
+
$_response->addUpdatedBlocks($_response);
|
47 |
+
|
48 |
+
$_response->send();
|
49 |
+
}
|
50 |
+
if ($request->getParam('is_checkout')) {
|
51 |
+
|
52 |
+
Mage::getSingleton('checkout/session')->setNoCartRedirect(true);
|
53 |
+
|
54 |
+
$_response = Mage::getModel('ajaxwishlist/response')
|
55 |
+
->setMessage(Mage::helper('checkout')->__('Item was updated.'));
|
56 |
+
$_response->send();
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
public function getConfigurableOptions($observer) {
|
61 |
+
$is_ajax = Mage::app()->getFrontController()->getRequest()->getParam('ajax');
|
62 |
+
|
63 |
+
if($is_ajax) {
|
64 |
+
$_response = Mage::getModel('ajaxwishlist/response');
|
65 |
+
|
66 |
+
$product = Mage::registry('current_product');
|
67 |
+
if (!$product->isConfigurable() && !$product->getTypeId() == 'bundle'){return false;exit;}
|
68 |
+
|
69 |
+
//append configurable options block
|
70 |
+
$_response->addConfigurableOptionsBlock($_response);
|
71 |
+
$_response->send();
|
72 |
+
}
|
73 |
+
return;
|
74 |
+
}
|
75 |
+
|
76 |
+
public function getGroupProductOptions() {
|
77 |
+
$id = Mage::app()->getFrontController()->getRequest()->getParam('product');
|
78 |
+
$options = Mage::app()->getFrontController()->getRequest()->getParam('super_group');
|
79 |
+
|
80 |
+
if($id) {
|
81 |
+
$product = Mage::getModel('catalog/product')->load($id);
|
82 |
+
if($product->getData()) {
|
83 |
+
if($product->getTypeId() == 'grouped' && !$options) {
|
84 |
+
$_response = Mage::getModel('ajaxwishlist/response');
|
85 |
+
Mage::register('product', $product);
|
86 |
+
Mage::register('current_product', $product);
|
87 |
+
|
88 |
+
//add group product's items block
|
89 |
+
$_response->addGroupProductItemsBlock($_response);
|
90 |
+
$_response->send();
|
91 |
+
}
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
public function setWishlistLayoutPosition(Varien_Event_Observer $observer)
|
97 |
+
{
|
98 |
+
if (Mage::getStoreConfig('ajaxwishlist/wishlist_sidebar/sidebar_status'))
|
99 |
+
{
|
100 |
+
|
101 |
+
$position = Mage::getStoreConfig('ajaxwishlist/wishlist_sidebar/wishlist_show');
|
102 |
+
|
103 |
+
$action = $observer->getEvent()->getAction();
|
104 |
+
$fullActionName = $action->getFullActionName();
|
105 |
+
|
106 |
+
if($fullActionName != "wishlist_index_index"){
|
107 |
+
|
108 |
+
$sub_position = 'before="cart_sidebar"';
|
109 |
+
$layout = $observer->getEvent()->getLayout();
|
110 |
+
$myXml = '<reference name="left"><remove name="wishlist_sidebar" /></reference><reference name="right"><remove name="wishlist_sidebar" /></reference><reference name="'.$position.'">';
|
111 |
+
$myXml .= '<block type="wishlist/customer_sidebar" name="wishlist_my_sidebar" template="ajaxwishlist/wishlist/sidebar.phtml" '.$sub_position.' />';
|
112 |
+
$myXml .= '</reference>';
|
113 |
+
|
114 |
+
$layout->getUpdate()->addUpdate($myXml);
|
115 |
+
$layout->generateXml();
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
}
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
}
|
app/code/community/Excel/AjaxWishlist/Model/Response.php
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Excel_AjaxWishlist_Model_Response extends Mage_Catalog_Block_Product_Abstract {
|
4 |
+
|
5 |
+
public function send() {
|
6 |
+
Zend_Json::$useBuiltinEncoderDecoder = true;
|
7 |
+
if ($this->getError())
|
8 |
+
$this->setR('error');
|
9 |
+
else
|
10 |
+
$this->setR('success');
|
11 |
+
Mage::app()->getFrontController()->getResponse()->setHeader('Content-Type', 'text/plain')->setBody(Zend_Json::encode($this->getData()));
|
12 |
+
Mage::app()->getFrontController()->getResponse()->sendResponse();
|
13 |
+
die;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function addUpdatedBlocks(&$_response) {
|
17 |
+
$updated_blocks = unserialize(Mage::getStoreConfig('ajaxwishlist/general/update_blocks'));
|
18 |
+
|
19 |
+
if ($updated_blocks) {
|
20 |
+
$layout = Mage::getSingleton('core/layout');
|
21 |
+
$res = array();
|
22 |
+
|
23 |
+
foreach ($updated_blocks['id'] as $index => $block) {
|
24 |
+
$value = $layout->getBlock($updated_blocks['xml'][$index]);
|
25 |
+
|
26 |
+
if ($value) {
|
27 |
+
$tmp['key'] = $block;
|
28 |
+
$tmp['value'] = $value->toHtml();
|
29 |
+
$res[] = $tmp;
|
30 |
+
}
|
31 |
+
}
|
32 |
+
if (!empty($res)) {
|
33 |
+
$_response->setUpdateBlocks($res);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
public function addConfigurableOptionsBlock(&$_response) {
|
39 |
+
$layout = Mage::getSingleton('core/layout');
|
40 |
+
$res = '';
|
41 |
+
$_product = Mage::registry('current_product');
|
42 |
+
|
43 |
+
$layout->getUpdate()->addHandle('ajaxwishlist_configurable_options');
|
44 |
+
|
45 |
+
if ($_product->getTypeId() == 'bundle')
|
46 |
+
$layout->getUpdate()->addHandle('ajaxwishlist_bundle_options');
|
47 |
+
|
48 |
+
// set unique cache ID to bypass caching
|
49 |
+
$cacheId = 'LAYOUT_'.Mage::app()->getStore()->getId().md5(join('__', $layout->getUpdate()->getHandles()));
|
50 |
+
$layout->getUpdate()->setCacheId($cacheId);
|
51 |
+
|
52 |
+
$layout->getUpdate()->load();
|
53 |
+
$layout->generateXml();
|
54 |
+
$layout->generateBlocks();
|
55 |
+
|
56 |
+
$value = $layout->getBlock('ajaxcart.configurable.options');
|
57 |
+
|
58 |
+
if ($value) {
|
59 |
+
$res .= $value->toHtml();
|
60 |
+
}
|
61 |
+
|
62 |
+
if ($_product->getTypeId() == 'bundle') {
|
63 |
+
$value = $layout->getBlock('product.info.bundle');
|
64 |
+
|
65 |
+
if ($value) {
|
66 |
+
$res .= $value->toHtml();
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
if (!empty($res)) {
|
71 |
+
$_response->setConfigurableOptionsBlock($res);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
public function addGroupProductItemsBlock(&$_response) {
|
76 |
+
$layout = Mage::getSingleton('core/layout');
|
77 |
+
$res = '';
|
78 |
+
|
79 |
+
$layout->getUpdate()->addHandle('ajaxwishlist_grouped_options');
|
80 |
+
|
81 |
+
// set unique cache ID to bypass caching
|
82 |
+
$cacheId = 'LAYOUT_'.Mage::app()->getStore()->getId().md5(join('__', $layout->getUpdate()->getHandles()));
|
83 |
+
$layout->getUpdate()->setCacheId($cacheId);
|
84 |
+
|
85 |
+
$layout->getUpdate()->load();
|
86 |
+
$layout->generateXml();
|
87 |
+
$layout->generateBlocks();
|
88 |
+
|
89 |
+
$value = $layout->getBlock('ajaxcart.grouped.options');
|
90 |
+
|
91 |
+
if ($value) {
|
92 |
+
$res .= $value->toHtml();
|
93 |
+
}
|
94 |
+
|
95 |
+
if (!empty($res)) {
|
96 |
+
$_response->setConfigurableOptionsBlock($res);
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
}
|
app/code/community/Excel/AjaxWishlist/Model/System/Config/Backend/Validate.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* To change this template, choose Tools | Templates
|
5 |
+
* and open the template in the editor.
|
6 |
+
*/
|
7 |
+
|
8 |
+
class Excel_AjaxWishlist_Model_System_Config_Backend_Validate extends Mage_Core_Model_Config_Data
|
9 |
+
{
|
10 |
+
public function _afterSave()
|
11 |
+
{
|
12 |
+
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
?>
|
app/code/community/Excel/AjaxWishlist/Model/System/Config/Source/Dropdown/Sidebar.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Excel_AjaxWishlist_Model_System_Config_Source_Dropdown_Sidebar
|
3 |
+
{
|
4 |
+
|
5 |
+
|
6 |
+
public function toOptionArray()
|
7 |
+
{
|
8 |
+
return array(
|
9 |
+
array(
|
10 |
+
'value' => 'left',
|
11 |
+
'label' => 'Left',
|
12 |
+
),
|
13 |
+
array(
|
14 |
+
'value' => 'right',
|
15 |
+
'label' => 'Right',
|
16 |
+
),
|
17 |
+
);
|
18 |
+
}
|
19 |
+
}
|
20 |
+
?>
|
app/code/community/Excel/AjaxWishlist/controllers/Checkout/CartController.php
ADDED
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once 'Mage/Checkout/controllers/CartController.php';
|
4 |
+
|
5 |
+
class Excel_AjaxWishlist_Checkout_CartController extends Mage_Checkout_CartController {
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Add product to shopping cart action
|
9 |
+
*/
|
10 |
+
public function addAction() {
|
11 |
+
$cart = $this->_getCart();
|
12 |
+
$params = $this->getRequest()->getParams();
|
13 |
+
try {
|
14 |
+
if (isset($params['qty'])) {
|
15 |
+
$filter = new Zend_Filter_LocalizedToNormalized(
|
16 |
+
array('locale' => Mage::app()->getLocale()->getLocaleCode())
|
17 |
+
);
|
18 |
+
$params['qty'] = $filter->filter($params['qty']);
|
19 |
+
}
|
20 |
+
|
21 |
+
$product = $this->_initProduct();
|
22 |
+
$related = $this->getRequest()->getParam('related_product');
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Check product availability
|
26 |
+
*/
|
27 |
+
if (!$product) {
|
28 |
+
$this->_goBack();
|
29 |
+
return;
|
30 |
+
}
|
31 |
+
|
32 |
+
$cart->addProduct($product, $params);
|
33 |
+
if (!empty($related)) {
|
34 |
+
$cart->addProductsByIds(explode(',', $related));
|
35 |
+
}
|
36 |
+
|
37 |
+
$cart->save();
|
38 |
+
|
39 |
+
$this->_getSession()->setCartWasUpdated(true);
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @todo remove wishlist observer processAddToCart
|
43 |
+
*/
|
44 |
+
$this->getLayout()->getUpdate()->addHandle('ajaxwishlist');
|
45 |
+
$this->loadLayout();
|
46 |
+
|
47 |
+
Mage::dispatchEvent('checkout_cart_add_product_complete', array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())
|
48 |
+
);
|
49 |
+
|
50 |
+
if (!$this->_getSession()->getNoCartRedirect(true)) {
|
51 |
+
if (!$cart->getQuote()->getHasError()) {
|
52 |
+
$message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));
|
53 |
+
$this->_getSession()->addSuccess($message);
|
54 |
+
}
|
55 |
+
$this->_goBack();
|
56 |
+
}
|
57 |
+
} catch (Mage_Core_Exception $e) {
|
58 |
+
$_response = Mage::getModel('ajaxwishlist/response');
|
59 |
+
$_response->setError(true);
|
60 |
+
|
61 |
+
$messages = array_unique(explode("\n", $e->getMessage()));
|
62 |
+
$json_messages = array();
|
63 |
+
foreach ($messages as $message) {
|
64 |
+
$json_messages[] = Mage::helper('core')->escapeHtml($message);
|
65 |
+
}
|
66 |
+
|
67 |
+
$_response->setMessages($json_messages);
|
68 |
+
|
69 |
+
$url = $this->_getSession()->getRedirectUrl(true);
|
70 |
+
|
71 |
+
$_response->send();
|
72 |
+
} catch (Exception $e) {
|
73 |
+
$this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));
|
74 |
+
Mage::logException($e);
|
75 |
+
|
76 |
+
$_response = Mage::getModel('ajaxwishlist/response');
|
77 |
+
$_response->setError(true);
|
78 |
+
$_response->setMessage($this->__('Cannot add the item to shopping cart.'));
|
79 |
+
$_response->send();
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Update product configuration for a cart item
|
85 |
+
*/
|
86 |
+
public function updateItemOptionsAction() {
|
87 |
+
$cart = $this->_getCart();
|
88 |
+
$id = (int) $this->getRequest()->getParam('id');
|
89 |
+
$params = $this->getRequest()->getParams();
|
90 |
+
|
91 |
+
if (!isset($params['options'])) {
|
92 |
+
$params['options'] = array();
|
93 |
+
}
|
94 |
+
try {
|
95 |
+
if (isset($params['qty'])) {
|
96 |
+
$filter = new Zend_Filter_LocalizedToNormalized(
|
97 |
+
array('locale' => Mage::app()->getLocale()->getLocaleCode())
|
98 |
+
);
|
99 |
+
$params['qty'] = $filter->filter($params['qty']);
|
100 |
+
}
|
101 |
+
|
102 |
+
$quoteItem = $cart->getQuote()->getItemById($id);
|
103 |
+
if (!$quoteItem) {
|
104 |
+
Mage::throwException($this->__('Quote item is not found.'));
|
105 |
+
}
|
106 |
+
|
107 |
+
$item = $cart->updateItem($id, new Varien_Object($params));
|
108 |
+
if (is_string($item)) {
|
109 |
+
Mage::throwException($item);
|
110 |
+
}
|
111 |
+
if ($item->getHasError()) {
|
112 |
+
Mage::throwException($item->getMessage());
|
113 |
+
}
|
114 |
+
|
115 |
+
$related = $this->getRequest()->getParam('related_product');
|
116 |
+
if (!empty($related)) {
|
117 |
+
$cart->addProductsByIds(explode(',', $related));
|
118 |
+
}
|
119 |
+
|
120 |
+
$cart->save();
|
121 |
+
|
122 |
+
$this->_getSession()->setCartWasUpdated(true);
|
123 |
+
|
124 |
+
$this->getLayout()->getUpdate()->addHandle('ajaxwishlist');
|
125 |
+
$this->loadLayout();
|
126 |
+
|
127 |
+
Mage::dispatchEvent('checkout_cart_update_item_complete', array('item' => $item, 'request' => $this->getRequest(), 'response' => $this->getResponse())
|
128 |
+
);
|
129 |
+
if (!$this->_getSession()->getNoCartRedirect(true)) {
|
130 |
+
if (!$cart->getQuote()->getHasError()) {
|
131 |
+
$message = $this->__('%s was updated in your shopping cart.', Mage::helper('core')->htmlEscape($item->getProduct()->getName()));
|
132 |
+
$this->_getSession()->addSuccess($message);
|
133 |
+
}
|
134 |
+
$this->_goBack();
|
135 |
+
}
|
136 |
+
} catch (Mage_Core_Exception $e) {
|
137 |
+
$_response = Mage::getModel('ajaxwishlist/response');
|
138 |
+
$_response->setError(true);
|
139 |
+
|
140 |
+
$messages = array_unique(explode("\n", $e->getMessage()));
|
141 |
+
$json_messages = array();
|
142 |
+
foreach ($messages as $message) {
|
143 |
+
$json_messages[] = Mage::helper('core')->escapeHtml($message);
|
144 |
+
}
|
145 |
+
|
146 |
+
$_response->setMessages($json_messages);
|
147 |
+
|
148 |
+
$url = $this->_getSession()->getRedirectUrl(true);
|
149 |
+
|
150 |
+
$_response->send();
|
151 |
+
} catch (Exception $e) {
|
152 |
+
$this->_getSession()->addException($e, $this->__('Cannot update the item.'));
|
153 |
+
Mage::logException($e);
|
154 |
+
|
155 |
+
$_response = Mage::getModel('ajaxwishlist/response');
|
156 |
+
$_response->setError(true);
|
157 |
+
$_response->setMessage($this->__('Cannot update the item.'));
|
158 |
+
$_response->send();
|
159 |
+
}
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Delete shoping cart item action
|
164 |
+
*/
|
165 |
+
public function deleteAction() {
|
166 |
+
$id = (int) $this->getRequest()->getParam('id');
|
167 |
+
if ($id) {
|
168 |
+
try {
|
169 |
+
$this->_getCart()->removeItem($id)
|
170 |
+
->save();
|
171 |
+
} catch (Exception $e) {
|
172 |
+
$_response = Mage::getModel('ajaxwishlist/response');
|
173 |
+
$_response->setError(true);
|
174 |
+
$_response->setMessage($this->__('Cannot remove the item.'));
|
175 |
+
$_response->send();
|
176 |
+
|
177 |
+
Mage::logException($e);
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
$_response = Mage::getModel('ajaxwishlist/response');
|
182 |
+
|
183 |
+
$_response->setMessage($this->__('Item was removed.'));
|
184 |
+
|
185 |
+
//append updated blocks
|
186 |
+
$this->getLayout()->getUpdate()->addHandle('ajaxwishlist');
|
187 |
+
$this->loadLayout();
|
188 |
+
|
189 |
+
$_response->addUpdatedBlocks($_response);
|
190 |
+
|
191 |
+
$_response->send();
|
192 |
+
}
|
193 |
+
|
194 |
+
}
|
app/code/community/Excel/AjaxWishlist/controllers/IndexController.php
ADDED
@@ -0,0 +1,712 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Excel_AjaxWishlist_IndexController extends Mage_Core_Controller_Front_Action
|
4 |
+
{
|
5 |
+
|
6 |
+
public function indexAction()
|
7 |
+
{
|
8 |
+
$this->loadLayout();
|
9 |
+
$this->renderLayout();
|
10 |
+
}
|
11 |
+
|
12 |
+
public function compareAction()
|
13 |
+
{
|
14 |
+
$response = array();
|
15 |
+
|
16 |
+
if ($productId = (int) $this->getRequest()->getParam('product'))
|
17 |
+
{
|
18 |
+
$product = Mage::getModel('catalog/product')
|
19 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
20 |
+
->load($productId);
|
21 |
+
|
22 |
+
if ($product->getId()/* && !$product->isSuper() */)
|
23 |
+
{
|
24 |
+
Mage::getSingleton('catalog/product_compare_list')->addProduct($product);
|
25 |
+
$response['status'] = 'SUCCESS';
|
26 |
+
$response['message'] = $this->__('The product %s has been added to comparison list.', Mage::helper('core')->escapeHtml($product->getName()));
|
27 |
+
Mage::register('referrer_url', $this->_getRefererUrl());
|
28 |
+
Mage::helper('catalog/product_compare')->calculate();
|
29 |
+
Mage::dispatchEvent('catalog_product_compare_add_product', array('product' => $product));
|
30 |
+
$this->loadLayout();
|
31 |
+
$sidebar_block = $this->getLayout()->getBlock('catalog.compare.sidebar');
|
32 |
+
$sidebar_block->setTemplate('ajaxwishlist/catalog/product/compare/sidebar.phtml');
|
33 |
+
$sidebar = $sidebar_block->toHtml();
|
34 |
+
$response['sidebar'] = $sidebar;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
38 |
+
return;
|
39 |
+
}
|
40 |
+
|
41 |
+
protected function _getWishlist()
|
42 |
+
{
|
43 |
+
$wishlist = Mage::registry('wishlist');
|
44 |
+
if ($wishlist)
|
45 |
+
{
|
46 |
+
return $wishlist;
|
47 |
+
}
|
48 |
+
|
49 |
+
try
|
50 |
+
{
|
51 |
+
$wishlist = Mage::getModel('wishlist/wishlist')
|
52 |
+
->loadByCustomer(Mage::getSingleton('customer/session')->getCustomer(), true);
|
53 |
+
Mage::register('wishlist', $wishlist);
|
54 |
+
} catch (Mage_Core_Exception $e)
|
55 |
+
{
|
56 |
+
Mage::getSingleton('wishlist/session')->addError($e->getMessage());
|
57 |
+
} catch (Exception $e)
|
58 |
+
{
|
59 |
+
Mage::getSingleton('wishlist/session')->addException($e, Mage::helper('wishlist')->__('Cannot create wishlist.')
|
60 |
+
);
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
|
64 |
+
return $wishlist;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function addAction()
|
68 |
+
{
|
69 |
+
|
70 |
+
$response = array();
|
71 |
+
if (!Mage::getStoreConfigFlag('wishlist/general/active'))
|
72 |
+
{
|
73 |
+
$response['status'] = 'ERROR';
|
74 |
+
$response['message'] = $this->__('Wishlist Has Been Disabled By Admin');
|
75 |
+
}
|
76 |
+
if (!Mage::getSingleton('customer/session')->isLoggedIn())
|
77 |
+
{
|
78 |
+
$response['status'] = 'ERROR';
|
79 |
+
$response['message'] = $this->__('Please Login First');
|
80 |
+
}
|
81 |
+
|
82 |
+
if (empty($response))
|
83 |
+
{
|
84 |
+
$session = Mage::getSingleton('customer/session');
|
85 |
+
$wishlist = $this->_getWishlist();
|
86 |
+
if (!$wishlist)
|
87 |
+
{
|
88 |
+
$response['status'] = 'ERROR';
|
89 |
+
$response['message'] = $this->__('Unable to Create Wishlist');
|
90 |
+
} else
|
91 |
+
{
|
92 |
+
|
93 |
+
$productId = (int) $this->getRequest()->getParam('product');
|
94 |
+
if (!$productId)
|
95 |
+
{
|
96 |
+
$response['status'] = 'ERROR';
|
97 |
+
$response['message'] = $this->__('Product Not Found');
|
98 |
+
} else
|
99 |
+
{
|
100 |
+
|
101 |
+
$product = Mage::getModel('catalog/product')->load($productId);
|
102 |
+
if (!$product->getId() || !$product->isVisibleInCatalog())
|
103 |
+
{
|
104 |
+
$response['status'] = 'ERROR';
|
105 |
+
$response['message'] = $this->__('Cannot specify product.');
|
106 |
+
} else
|
107 |
+
{
|
108 |
+
|
109 |
+
try
|
110 |
+
{
|
111 |
+
$requestParams = $this->getRequest()->getParams();
|
112 |
+
$buyRequest = new Varien_Object($requestParams);
|
113 |
+
|
114 |
+
$result = $wishlist->addNewItem($product, $buyRequest);
|
115 |
+
if (is_string($result))
|
116 |
+
{
|
117 |
+
Mage::throwException($result);
|
118 |
+
}
|
119 |
+
$wishlist->save();
|
120 |
+
|
121 |
+
Mage::dispatchEvent(
|
122 |
+
'wishlist_add_product', array(
|
123 |
+
'wishlist' => $wishlist,
|
124 |
+
'product' => $product,
|
125 |
+
'item' => $result
|
126 |
+
)
|
127 |
+
);
|
128 |
+
|
129 |
+
Mage::helper('wishlist')->calculate();
|
130 |
+
|
131 |
+
$message = $this->__('%1$s has been added to your wishlist.', $product->getName(), $referer);
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
$response['status'] = 'SUCCESS';
|
136 |
+
$response['message'] = $message;
|
137 |
+
$response['item_id'] = $result->getId();
|
138 |
+
$response['product_id'] = $productId;
|
139 |
+
|
140 |
+
Mage::unregister('wishlist');
|
141 |
+
|
142 |
+
|
143 |
+
$this->loadLayout();
|
144 |
+
$toplink = $this->getLayout()->getBlock('top.links')->toHtml();
|
145 |
+
$sidebar_block = $this->getLayout()->getBlock('ajaxwishlist_wishlist_sidebar');
|
146 |
+
$sidebar = $sidebar_block->toHtml();
|
147 |
+
$response['toplink'] = $toplink;
|
148 |
+
$response['sidebar'] = $sidebar;
|
149 |
+
} catch (Mage_Core_Exception $e)
|
150 |
+
{
|
151 |
+
$response['status'] = 'ERROR';
|
152 |
+
$response['message'] = $this->__('An error occurred while adding item to wishlist: %s', $e->getMessage());
|
153 |
+
} catch (Exception $e)
|
154 |
+
{
|
155 |
+
mage::log($e->getMessage());
|
156 |
+
$response['status'] = 'ERROR';
|
157 |
+
$response['message'] = $this->__('An error occurred while adding item to wishlist.');
|
158 |
+
}
|
159 |
+
}
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
164 |
+
return;
|
165 |
+
}
|
166 |
+
|
167 |
+
// Remove Item From Wishlist
|
168 |
+
|
169 |
+
public function removeAction()
|
170 |
+
{
|
171 |
+
|
172 |
+
$response = array();
|
173 |
+
if (!Mage::getStoreConfigFlag('wishlist/general/active'))
|
174 |
+
{
|
175 |
+
$response['status'] = 'ERROR';
|
176 |
+
$response['message'] = $this->__('Wishlist Has Been Disabled By Admin');
|
177 |
+
}
|
178 |
+
if (!Mage::getSingleton('customer/session')->isLoggedIn())
|
179 |
+
{
|
180 |
+
$response['status'] = 'ERROR';
|
181 |
+
$response['message'] = $this->__('Please Login First');
|
182 |
+
}
|
183 |
+
|
184 |
+
if (empty($response))
|
185 |
+
{
|
186 |
+
$session = Mage::getSingleton('customer/session');
|
187 |
+
$wishlist = $this->_getWishlist();
|
188 |
+
if (!$wishlist)
|
189 |
+
{
|
190 |
+
$response['status'] = 'ERROR';
|
191 |
+
$response['message'] = $this->__('Unable to Delete Wishlist');
|
192 |
+
} else
|
193 |
+
{
|
194 |
+
|
195 |
+
$itemId = (int) $this->getRequest()->getParam('item');
|
196 |
+
|
197 |
+
if (!$itemId)
|
198 |
+
{
|
199 |
+
$response['status'] = 'ERROR';
|
200 |
+
$response['message'] = $this->__('Product Not Found');
|
201 |
+
} else
|
202 |
+
{
|
203 |
+
try
|
204 |
+
{
|
205 |
+
|
206 |
+
$id = (int) $this->getRequest()->getParam('item');
|
207 |
+
$item = Mage::getModel('wishlist/item')->load($id);
|
208 |
+
$productId = $item->getProductId();
|
209 |
+
if (!$item->getId())
|
210 |
+
{
|
211 |
+
return $this->norouteAction();
|
212 |
+
}
|
213 |
+
|
214 |
+
$wishlist = $this->_getWishlist($item->getWishlistId());
|
215 |
+
if (!$wishlist)
|
216 |
+
{
|
217 |
+
return $this->norouteAction();
|
218 |
+
}
|
219 |
+
|
220 |
+
$item->delete();
|
221 |
+
$wishlist->save();
|
222 |
+
|
223 |
+
|
224 |
+
Mage::helper('wishlist')->calculate();
|
225 |
+
|
226 |
+
$message = $this->__('Item has been deleted to your wishlist.');
|
227 |
+
$response['status'] = 'SUCCESS';
|
228 |
+
$response['message'] = $message;
|
229 |
+
|
230 |
+
Mage::unregister('wishlist');
|
231 |
+
|
232 |
+
$this->loadLayout();
|
233 |
+
$toplink = $this->getLayout()->getBlock('top.links')->toHtml();
|
234 |
+
$sidebar_block = $this->getLayout()->getBlock('ajaxwishlist_wishlist_sidebar');
|
235 |
+
$sidebar = $sidebar_block->toHtml();
|
236 |
+
$response['toplink'] = $toplink;
|
237 |
+
$response['sidebar'] = $sidebar;
|
238 |
+
$response['flag'] = "false";
|
239 |
+
$wishlistCollection = Mage::getModel('wishlist/item')->getCollection();
|
240 |
+
foreach ($wishlistCollection as $key => $wishlistModel)
|
241 |
+
{
|
242 |
+
if($wishlistModel->getProductId()==$productId)
|
243 |
+
{
|
244 |
+
$response['flag'] = "true";
|
245 |
+
$response['previous'] = $id;
|
246 |
+
$response['current'] = (int)$wishlistModel->getId();
|
247 |
+
break;
|
248 |
+
}
|
249 |
+
|
250 |
+
}
|
251 |
+
|
252 |
+
|
253 |
+
|
254 |
+
} catch (Mage_Core_Exception $e)
|
255 |
+
{
|
256 |
+
$response['status'] = 'ERROR';
|
257 |
+
$response['message'] = $this->__('An error occurred while deleting the item from wishlist: %s', $e->getMessage());
|
258 |
+
} catch (Exception $e)
|
259 |
+
{
|
260 |
+
mage::log($e->getMessage());
|
261 |
+
$response['status'] = 'ERROR';
|
262 |
+
$response['message'] = $this->__('An error occurred while deleting the item from wishlist');
|
263 |
+
}
|
264 |
+
}
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
+
|
269 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
270 |
+
return;
|
271 |
+
}
|
272 |
+
|
273 |
+
/* remove Item from lightview wishlist List */
|
274 |
+
|
275 |
+
public function iframeRemoveItemAction()
|
276 |
+
{
|
277 |
+
|
278 |
+
$response = array();
|
279 |
+
|
280 |
+
if (!Mage::getStoreConfigFlag('wishlist/general/active'))
|
281 |
+
{
|
282 |
+
$response['status'] = 'ERROR';
|
283 |
+
$response['message'] = $this->__('Wishlist Has Been Disabled By Admin');
|
284 |
+
}
|
285 |
+
if (!Mage::getSingleton('customer/session')->isLoggedIn())
|
286 |
+
{
|
287 |
+
$response['status'] = 'ERROR';
|
288 |
+
$response['message'] = $this->__('Please Login First');
|
289 |
+
}
|
290 |
+
|
291 |
+
if (empty($response))
|
292 |
+
{
|
293 |
+
$session = Mage::getSingleton('customer/session');
|
294 |
+
$wishlist = $this->_getWishlist();
|
295 |
+
if (!$wishlist)
|
296 |
+
{
|
297 |
+
$response['status'] = 'ERROR';
|
298 |
+
$response['message'] = $this->__('Unable to Delete Wishlist');
|
299 |
+
} else
|
300 |
+
{
|
301 |
+
|
302 |
+
$itemId = (int) $this->getRequest()->getParam('item');
|
303 |
+
|
304 |
+
if (!$itemId)
|
305 |
+
{
|
306 |
+
$response['status'] = 'ERROR';
|
307 |
+
$response['message'] = $this->__('Product Not Found');
|
308 |
+
} else
|
309 |
+
{
|
310 |
+
try
|
311 |
+
{
|
312 |
+
|
313 |
+
$id = (int) $this->getRequest()->getParam('item');
|
314 |
+
$item = Mage::getModel('wishlist/item')->load($id);
|
315 |
+
if (!$item->getId())
|
316 |
+
{
|
317 |
+
return $this->norouteAction();
|
318 |
+
}
|
319 |
+
|
320 |
+
$wishlist = $this->_getWishlist($item->getWishlistId());
|
321 |
+
if (!$wishlist)
|
322 |
+
{
|
323 |
+
return $this->norouteAction();
|
324 |
+
}
|
325 |
+
|
326 |
+
$item->delete();
|
327 |
+
$wishlist->save();
|
328 |
+
|
329 |
+
|
330 |
+
Mage::helper('wishlist')->calculate();
|
331 |
+
|
332 |
+
$message = $this->__('Item has been deleted to your wishlist.', $item->getName());
|
333 |
+
$response['status'] = 'SUCCESS';
|
334 |
+
$response['message'] = $message;
|
335 |
+
|
336 |
+
Mage::unregister('wishlist');
|
337 |
+
|
338 |
+
$this->loadLayout();
|
339 |
+
$toplink = $this->getLayout()->getBlock('top.links')->toHtml();
|
340 |
+
$wishlist_block = $this->getLayout()->getBlock('ajax.customer.wishlist');
|
341 |
+
$wishlist = $wishlist_block->toHtml();
|
342 |
+
$response['toplink'] = $toplink;
|
343 |
+
$response['wishlist'] = $wishlist;
|
344 |
+
|
345 |
+
$sidebar_block = $this->getLayout()->getBlock('ajaxwishlist_wishlist_sidebar');
|
346 |
+
$sidebar = $sidebar_block->toHtml();
|
347 |
+
$response['sidebar'] = $sidebar;
|
348 |
+
|
349 |
+
} catch (Mage_Core_Exception $e)
|
350 |
+
{
|
351 |
+
$response['status'] = 'ERROR';
|
352 |
+
$response['message'] = $this->__('An error occurred while deleting the item from wishlist: %s', $e->getMessage());
|
353 |
+
} catch (Exception $e)
|
354 |
+
{
|
355 |
+
mage::log($e->getMessage());
|
356 |
+
$response['status'] = 'ERROR';
|
357 |
+
$response['message'] = $this->__('An error occurred while deleting the item from wishlist');
|
358 |
+
}
|
359 |
+
}
|
360 |
+
}
|
361 |
+
}
|
362 |
+
|
363 |
+
|
364 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
365 |
+
return;
|
366 |
+
}
|
367 |
+
|
368 |
+
public function wishlistAction()
|
369 |
+
{
|
370 |
+
|
371 |
+
$this->loadLayout();
|
372 |
+
$this->renderLayout();
|
373 |
+
}
|
374 |
+
|
375 |
+
public function updateAction()
|
376 |
+
{
|
377 |
+
|
378 |
+
if (!Mage::getStoreConfigFlag('wishlist/general/active'))
|
379 |
+
{
|
380 |
+
$response['status'] = 'ERROR';
|
381 |
+
$response['message'] = $this->__('Wishlist Has Been Disabled By Admin');
|
382 |
+
}
|
383 |
+
if (!Mage::getSingleton('customer/session')->isLoggedIn())
|
384 |
+
{
|
385 |
+
$response['status'] = 'ERROR';
|
386 |
+
$response['message'] = $this->__('Please Login First');
|
387 |
+
}
|
388 |
+
if (empty($response))
|
389 |
+
{
|
390 |
+
$session = Mage::getSingleton('customer/session');
|
391 |
+
$wishlist = $this->_getWishlist();
|
392 |
+
if (!$wishlist)
|
393 |
+
{
|
394 |
+
$response['status'] = 'ERROR';
|
395 |
+
$response['message'] = $this->__('Unable to Delete Wishlist');
|
396 |
+
} else
|
397 |
+
{
|
398 |
+
|
399 |
+
if(Mage::helper('ajaxwishlist')->func_wishlistVersion()):
|
400 |
+
$praItemId = 1;
|
401 |
+
else:
|
402 |
+
$praItemId = (int) $this->getRequest()->getParam('wishlist_id');
|
403 |
+
endif;
|
404 |
+
|
405 |
+
if (!$praItemId)
|
406 |
+
{
|
407 |
+
$response['status'] = 'ERROR';
|
408 |
+
$response['message'] = $this->__('Product Not Found');
|
409 |
+
} else
|
410 |
+
{
|
411 |
+
|
412 |
+
|
413 |
+
$wishlist = $this->_getWishlist();
|
414 |
+
if (!$wishlist)
|
415 |
+
{
|
416 |
+
return $this->norouteAction();
|
417 |
+
}
|
418 |
+
|
419 |
+
$post = $this->getRequest()->getPost();
|
420 |
+
if ($post && isset($post['description']) && is_array($post['description']))
|
421 |
+
{
|
422 |
+
|
423 |
+
try
|
424 |
+
{
|
425 |
+
$updatedItems = 0;
|
426 |
+
|
427 |
+
foreach ($post['description'] as $itemId => $description)
|
428 |
+
{
|
429 |
+
$item = Mage::getModel('wishlist/item')->load($itemId);
|
430 |
+
if ($item->getWishlistId() != $wishlist->getId())
|
431 |
+
{
|
432 |
+
continue;
|
433 |
+
}
|
434 |
+
|
435 |
+
// Extract new values
|
436 |
+
$description = (string) $description;
|
437 |
+
if (!strlen($description))
|
438 |
+
{
|
439 |
+
$description = $item->getDescription();
|
440 |
+
}
|
441 |
+
|
442 |
+
$qty = null;
|
443 |
+
if (isset($post['qty'][$itemId]))
|
444 |
+
{
|
445 |
+
$qty = $this->_processLocalizedQty($post['qty'][$itemId]);
|
446 |
+
}
|
447 |
+
if (is_null($qty))
|
448 |
+
{
|
449 |
+
$qty = $item->getQty();
|
450 |
+
if (!$qty)
|
451 |
+
{
|
452 |
+
$qty = 1;
|
453 |
+
}
|
454 |
+
} elseif (0 == $qty)
|
455 |
+
{
|
456 |
+
$item->delete();
|
457 |
+
|
458 |
+
$this->loadLayout();
|
459 |
+
$response['status'] = 'SUCCESS';
|
460 |
+
$response['message'] = $this->__('Item has been deleted to your wishlist', $item->getName());
|
461 |
+
|
462 |
+
$sidebar_block = $this->getLayout()->getBlock('ajax.customer.wishlist');
|
463 |
+
$sidebar = $sidebar_block->toHtml();
|
464 |
+
$response['wishlist'] = $sidebar;
|
465 |
+
|
466 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
467 |
+
return;
|
468 |
+
}
|
469 |
+
|
470 |
+
|
471 |
+
// Check that we need to save
|
472 |
+
if (($item->getDescription() == $description) && ($item->getQty() == $qty))
|
473 |
+
{
|
474 |
+
continue;
|
475 |
+
}
|
476 |
+
|
477 |
+
$item->setDescription($description)
|
478 |
+
->setQty($qty)
|
479 |
+
->save();
|
480 |
+
$updatedItems++;
|
481 |
+
}
|
482 |
+
|
483 |
+
// save wishlist model for setting date of last update
|
484 |
+
if ($updatedItems)
|
485 |
+
{
|
486 |
+
$wishlist->save();
|
487 |
+
Mage::helper('wishlist')->calculate();
|
488 |
+
|
489 |
+
$response['status'] = 'SUCCESS';
|
490 |
+
$response['message'] = $this->__('update wishlist Successfully');
|
491 |
+
}
|
492 |
+
} catch (Mage_Core_Exception $e)
|
493 |
+
{
|
494 |
+
$response['status'] = 'ERROR';
|
495 |
+
$response['message'] = $this->__('An error occurred while updating the item from wishlist: %s', $e->getMessage());
|
496 |
+
} catch (Exception $e)
|
497 |
+
{
|
498 |
+
mage::log($e->getMessage());
|
499 |
+
$response['status'] = 'ERROR';
|
500 |
+
$response['message'] = $this->__('An error occurred while updating the item from wishlist');
|
501 |
+
}
|
502 |
+
}
|
503 |
+
}
|
504 |
+
}
|
505 |
+
}
|
506 |
+
|
507 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
508 |
+
return;
|
509 |
+
}
|
510 |
+
|
511 |
+
protected function _processLocalizedQty($qty)
|
512 |
+
{
|
513 |
+
if (!$this->_localFilter)
|
514 |
+
{
|
515 |
+
$this->_localFilter = new Zend_Filter_LocalizedToNormalized(
|
516 |
+
array('locale' => Mage::app()->getLocale()->getLocaleCode())
|
517 |
+
);
|
518 |
+
}
|
519 |
+
$qty = $this->_localFilter->filter((float) $qty);
|
520 |
+
if ($qty < 0)
|
521 |
+
{
|
522 |
+
$qty = null;
|
523 |
+
}
|
524 |
+
return $qty;
|
525 |
+
}
|
526 |
+
|
527 |
+
public function updateItemOptionsAction()
|
528 |
+
{
|
529 |
+
$session = Mage::getSingleton('customer/session');
|
530 |
+
$productId = (int) $this->getRequest()->getParam('product');
|
531 |
+
if (!$productId)
|
532 |
+
{
|
533 |
+
$this->_redirect('*/');
|
534 |
+
return;
|
535 |
+
}
|
536 |
+
|
537 |
+
$product = Mage::getModel('catalog/product')->load($productId);
|
538 |
+
if (!$product->getId() || !$product->isVisibleInCatalog())
|
539 |
+
{
|
540 |
+
$session->addError($this->__('Cannot specify product.'));
|
541 |
+
$this->_redirect('*/');
|
542 |
+
return;
|
543 |
+
}
|
544 |
+
|
545 |
+
try
|
546 |
+
{
|
547 |
+
$id = (int) $this->getRequest()->getParam('id');
|
548 |
+
/* @var Mage_Wishlist_Model_Item */
|
549 |
+
$item = Mage::getModel('wishlist/item');
|
550 |
+
$item->load($id);
|
551 |
+
$wishlist = $this->_getWishlist($item->getWishlistId());
|
552 |
+
if (!$wishlist)
|
553 |
+
{
|
554 |
+
$this->_redirect('*/');
|
555 |
+
return;
|
556 |
+
}
|
557 |
+
|
558 |
+
$buyRequest = new Varien_Object($this->getRequest()->getParams());
|
559 |
+
|
560 |
+
$wishlist->updateItem($id, $buyRequest)
|
561 |
+
->save();
|
562 |
+
|
563 |
+
Mage::helper('wishlist')->calculate();
|
564 |
+
Mage::dispatchEvent('wishlist_update_item', array(
|
565 |
+
'wishlist' => $wishlist, 'product' => $product, 'item' => $wishlist->getItem($id))
|
566 |
+
);
|
567 |
+
|
568 |
+
Mage::helper('wishlist')->calculate();
|
569 |
+
|
570 |
+
$message = $this->__('%1$s has been updated in your wishlist.', $product->getName());
|
571 |
+
$session->addSuccess($message);
|
572 |
+
} catch (Mage_Core_Exception $e)
|
573 |
+
{
|
574 |
+
$session->addError($e->getMessage());
|
575 |
+
} catch (Exception $e)
|
576 |
+
{
|
577 |
+
$session->addError($this->__('An error occurred while updating wishlist.'));
|
578 |
+
Mage::logException($e);
|
579 |
+
}
|
580 |
+
$this->_redirect('*/index/wishlist', array('wishlist_id' => $wishlist->getId()));
|
581 |
+
}
|
582 |
+
|
583 |
+
public function shareAction()
|
584 |
+
{
|
585 |
+
$this->_getWishlist();
|
586 |
+
$this->loadLayout();
|
587 |
+
$this->_initLayoutMessages('customer/session');
|
588 |
+
$this->_initLayoutMessages('wishlist/session');
|
589 |
+
$this->renderLayout();
|
590 |
+
}
|
591 |
+
|
592 |
+
|
593 |
+
/**
|
594 |
+
* Add wishlist item to shopping cart and remove from wishlist
|
595 |
+
*
|
596 |
+
* If Product has required options - item removed from wishlist and redirect
|
597 |
+
* to product view page with message about needed defined required options
|
598 |
+
*/
|
599 |
+
public function cartAction()
|
600 |
+
{
|
601 |
+
$itemId = (int) $this->getRequest()->getParam('item');
|
602 |
+
|
603 |
+
|
604 |
+
/* @var $item Mage_Wishlist_Model_Item */
|
605 |
+
$item = Mage::getModel('wishlist/item')->load($itemId);
|
606 |
+
if (!$item->getId()) {
|
607 |
+
|
608 |
+
$response['status'] = 'ERROR';
|
609 |
+
$response['message'] = $this->__('Product Not Found');
|
610 |
+
//return $this->_redirect('*/*');
|
611 |
+
}
|
612 |
+
$wishlist = $this->_getWishlist($item->getWishlistId());
|
613 |
+
if (!$wishlist) {
|
614 |
+
$response['status'] = 'ERROR';
|
615 |
+
$response['message'] = $this->__('Product Not Found');
|
616 |
+
//return $this->_redirect('*/*');
|
617 |
+
}
|
618 |
+
|
619 |
+
if(empty($response))
|
620 |
+
{
|
621 |
+
$qty = $this->getRequest()->getParam('qty');
|
622 |
+
if (is_array($qty)) {
|
623 |
+
if (isset($qty[$itemId])) {
|
624 |
+
$qty = $qty[$itemId];
|
625 |
+
} else {
|
626 |
+
$qty = 1;
|
627 |
+
}
|
628 |
+
}
|
629 |
+
$qty = $this->_processLocalizedQty($qty);
|
630 |
+
if ($qty) {
|
631 |
+
$item->setQty($qty);
|
632 |
+
}
|
633 |
+
|
634 |
+
$session = Mage::getSingleton('wishlist/session');
|
635 |
+
$cart = Mage::getSingleton('checkout/cart');
|
636 |
+
|
637 |
+
$redirectUrl = Mage::getUrl('*/*');
|
638 |
+
|
639 |
+
try {
|
640 |
+
|
641 |
+
$options = Mage::getModel('wishlist/item_option')->getCollection()
|
642 |
+
->addItemFilter(array($itemId));
|
643 |
+
$item->setOptions($options->getOptionsByItem($itemId));
|
644 |
+
|
645 |
+
$buyRequest = Mage::helper('catalog/product')->addParamsToBuyRequest(
|
646 |
+
$this->getRequest()->getParams(),
|
647 |
+
array('current_config' => $item->getBuyRequest())
|
648 |
+
);
|
649 |
+
|
650 |
+
$item->mergeBuyRequest($buyRequest);
|
651 |
+
$item->addToCart($cart, true);
|
652 |
+
$cart->save()->getQuote()->collectTotals();
|
653 |
+
$wishlist->save();
|
654 |
+
|
655 |
+
Mage::helper('wishlist')->calculate();
|
656 |
+
|
657 |
+
if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {
|
658 |
+
$redirectUrl = Mage::helper('checkout/cart')->getCartUrl();
|
659 |
+
} else if ($this->_getRefererUrl()) {
|
660 |
+
$redirectUrl = $this->_getRefererUrl();
|
661 |
+
}
|
662 |
+
Mage::helper('wishlist')->calculate();
|
663 |
+
|
664 |
+
$response['status'] = 'SUCCESS';
|
665 |
+
$response['message'] = $this->__('Product has been added to cart');
|
666 |
+
$response['redirect'] = $redirectUrl;
|
667 |
+
|
668 |
+
} catch (Mage_Core_Exception $e) {
|
669 |
+
if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {
|
670 |
+
$response['status'] = 'ERROR';
|
671 |
+
$response['message'] = $this->__('This product(s) is currently out of stock');
|
672 |
+
//$session->addError(Mage::helper('wishlist')->__('This product(s) is currently out of stock'));
|
673 |
+
} else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {
|
674 |
+
|
675 |
+
$response['status'] = 'ERROR';
|
676 |
+
$response['message'] = $this->__($e->getMessage());
|
677 |
+
$response['redirectUrl'] = Mage::getUrl('*/*/configure/', array('id' => $item->getId()));
|
678 |
+
|
679 |
+
//Mage::getSingleton('catalog/session')->addNotice($e->getMessage());
|
680 |
+
//$redirectUrl = Mage::getUrl('*/*/configure/', array('id' => $item->getId()));
|
681 |
+
} else {
|
682 |
+
$response['status'] = 'ERROR';
|
683 |
+
$response['message'] = $this->__($e->getMessage());
|
684 |
+
$response['redirectUrl'] = Mage::getUrl('*/*/configure/', array('id' => $item->getId()));
|
685 |
+
|
686 |
+
//Mage::getSingleton('catalog/session')->addNotice($e->getMessage());
|
687 |
+
//$redirectUrl = Mage::getUrl('*/*/configure/', array('id' => $item->getId()));
|
688 |
+
}
|
689 |
+
} catch (Exception $e) {
|
690 |
+
//$session->addException($e, Mage::helper('wishlist')->__('Cannot add item to shopping cart'));
|
691 |
+
$response['status'] = 'ERROR';
|
692 |
+
$response['message'] = $this->__("'Cannot add item to shopping cart'");
|
693 |
+
}
|
694 |
+
|
695 |
+
Mage::helper('wishlist')->calculate();
|
696 |
+
|
697 |
+
//return $this->_redirectUrl($redirectUrl);
|
698 |
+
|
699 |
+
}
|
700 |
+
// Set qty
|
701 |
+
|
702 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
703 |
+
return;
|
704 |
+
|
705 |
+
/* @var $session Mage_Wishlist_Model_Session */
|
706 |
+
|
707 |
+
}
|
708 |
+
|
709 |
+
|
710 |
+
|
711 |
+
}
|
712 |
+
|
app/code/community/Excel/AjaxWishlist/etc/adminhtml.xml
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category Mage
|
23 |
+
* @package Mage_Catalog
|
24 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<config>
|
29 |
+
<acl>
|
30 |
+
<resources>
|
31 |
+
<admin>
|
32 |
+
<children>
|
33 |
+
<system>
|
34 |
+
<children>
|
35 |
+
<config>
|
36 |
+
<children>
|
37 |
+
<ajaxwishlist translate="title" module="ajaxwishlist">
|
38 |
+
<title>Ajax Cart With Wishlist </title>
|
39 |
+
</ajaxwishlist>
|
40 |
+
</children>
|
41 |
+
</config>
|
42 |
+
</children>
|
43 |
+
</system>
|
44 |
+
</children>
|
45 |
+
</admin>
|
46 |
+
</resources>
|
47 |
+
</acl>
|
48 |
+
</config>
|
app/code/community/Excel/AjaxWishlist/etc/config.xml
ADDED
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Excel_AjaxWishlist>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Excel_AjaxWishlist>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<ajaxwishlist>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Excel_AjaxWishlist</module>
|
14 |
+
<frontName>ajaxwishlist</frontName>
|
15 |
+
</args>
|
16 |
+
</ajaxwishlist>
|
17 |
+
</routers>
|
18 |
+
<events>
|
19 |
+
<checkout_cart_add_product_complete>
|
20 |
+
<observers>
|
21 |
+
<ajaxwishlist>
|
22 |
+
<type>singleton</type>
|
23 |
+
<class>ajaxwishlist/observer</class>
|
24 |
+
<method>addToCartEvent</method>
|
25 |
+
</ajaxwishlist>
|
26 |
+
</observers>
|
27 |
+
</checkout_cart_add_product_complete>
|
28 |
+
<checkout_cart_update_item_complete>
|
29 |
+
<observers>
|
30 |
+
<ajaxwishlist>
|
31 |
+
<type>singleton</type>
|
32 |
+
<class>ajaxwishlist/observer</class>
|
33 |
+
<method>updateItemEvent</method>
|
34 |
+
</ajaxwishlist>
|
35 |
+
</observers>
|
36 |
+
</checkout_cart_update_item_complete>
|
37 |
+
<!--for configurable products-->
|
38 |
+
<controller_action_postdispatch_catalog_product_view>
|
39 |
+
<observers>
|
40 |
+
<ajaxwishlist>
|
41 |
+
<class>ajaxwishlist/observer</class>
|
42 |
+
<method>getConfigurableOptions</method>
|
43 |
+
</ajaxwishlist>
|
44 |
+
</observers>
|
45 |
+
</controller_action_postdispatch_catalog_product_view>
|
46 |
+
<!--for group products-->
|
47 |
+
<controller_action_predispatch_checkout_cart_add>
|
48 |
+
<observers>
|
49 |
+
<ajaxwishlist>
|
50 |
+
<type>singleton</type>
|
51 |
+
<class>ajaxwishlist/observer</class>
|
52 |
+
<method>getGroupProductOptions</method>
|
53 |
+
</ajaxwishlist>
|
54 |
+
</observers>
|
55 |
+
</controller_action_predispatch_checkout_cart_add>
|
56 |
+
<controller_action_layout_generate_blocks_before>
|
57 |
+
<observers>
|
58 |
+
<ajaxwishlist>
|
59 |
+
<class>ajaxwishlist/observer</class>
|
60 |
+
<method>setWishlistLayoutPosition</method>
|
61 |
+
</ajaxwishlist>
|
62 |
+
</observers>
|
63 |
+
</controller_action_layout_generate_blocks_before>
|
64 |
+
</events>
|
65 |
+
<layout>
|
66 |
+
<updates>
|
67 |
+
<ajaxwishlist>
|
68 |
+
<file>ajaxwishlist.xml</file>
|
69 |
+
</ajaxwishlist>
|
70 |
+
</updates>
|
71 |
+
</layout>
|
72 |
+
</frontend>
|
73 |
+
<admin>
|
74 |
+
<routers>
|
75 |
+
<ajaxwishlist>
|
76 |
+
<use>admin</use>
|
77 |
+
<args>
|
78 |
+
<module>Excel_AjaxWishlist</module>
|
79 |
+
<frontName>ajaxwishlist</frontName>
|
80 |
+
</args>
|
81 |
+
</ajaxwishlist>
|
82 |
+
</routers>
|
83 |
+
</admin>
|
84 |
+
<global>
|
85 |
+
<models>
|
86 |
+
<ajaxwishlist>
|
87 |
+
<class>Excel_AjaxWishlist_Model</class>
|
88 |
+
<resourceModel>ajaxwishlist_mysql4</resourceModel>
|
89 |
+
</ajaxwishlist>
|
90 |
+
<ajaxwishlist_mysql4>
|
91 |
+
<class>Excel_AjaxWishlist_Model_Mysql4</class>
|
92 |
+
<entities>
|
93 |
+
<ajaxwishlist>
|
94 |
+
<table>ajaxwishlist</table>
|
95 |
+
</ajaxwishlist>
|
96 |
+
</entities>
|
97 |
+
</ajaxwishlist_mysql4>
|
98 |
+
</models>
|
99 |
+
<resources>
|
100 |
+
<ajaxwishlist_setup>
|
101 |
+
<setup>
|
102 |
+
<module>Excel_AjaxWishlist</module>
|
103 |
+
</setup>
|
104 |
+
<connection>
|
105 |
+
<use>core_setup</use>
|
106 |
+
</connection>
|
107 |
+
</ajaxwishlist_setup>
|
108 |
+
<ajaxwishlist_write>
|
109 |
+
<connection>
|
110 |
+
<use>core_write</use>
|
111 |
+
</connection>
|
112 |
+
</ajaxwishlist_write>
|
113 |
+
<ajaxwishlist_read>
|
114 |
+
<connection>
|
115 |
+
<use>core_read</use>
|
116 |
+
</connection>
|
117 |
+
</ajaxwishlist_read>
|
118 |
+
</resources>
|
119 |
+
<blocks>
|
120 |
+
<ajaxwishlist>
|
121 |
+
<class>Excel_AjaxWishlist_Block</class>
|
122 |
+
</ajaxwishlist>
|
123 |
+
</blocks>
|
124 |
+
<helpers>
|
125 |
+
<ajaxwishlist>
|
126 |
+
<class>Excel_AjaxWishlist_Helper</class>
|
127 |
+
</ajaxwishlist>
|
128 |
+
</helpers>
|
129 |
+
<rewrite>
|
130 |
+
<Excel_AjaxWishlist_checkout_cart>
|
131 |
+
<from><![CDATA[#^/checkout/cart/#]]></from>
|
132 |
+
<to>/ajaxwishlist/checkout_cart/</to>
|
133 |
+
</Excel_AjaxWishlist_checkout_cart>
|
134 |
+
</rewrite>
|
135 |
+
</global>
|
136 |
+
<default>
|
137 |
+
<ajaxwishlist>
|
138 |
+
<general>
|
139 |
+
<enable>1</enable>
|
140 |
+
<update_blocks>a:2:{s:2:"id";a:3:{i:0;s:17:".block.block-cart";i:1;s:14:".header .links";i:2;s:26:".checkout-cart-index .cart";}s:3:"xml";a:3:{i:0;s:12:"cart_sidebar";i:1;s:9:"top.links";i:2;s:13:"checkout.cart";}}</update_blocks>
|
141 |
+
</general>
|
142 |
+
<wishlist_general>
|
143 |
+
<wishlist_status>0</wishlist_status>
|
144 |
+
<wishlist_link>/index.php/ajaxwishlist/index/wishlist/</wishlist_link>
|
145 |
+
</wishlist_general>
|
146 |
+
<wishlist_ajax>
|
147 |
+
<ajax_status>1</ajax_status>
|
148 |
+
<ajax_popup_width>600</ajax_popup_width>
|
149 |
+
<ajax_popup_height>800</ajax_popup_height>
|
150 |
+
</wishlist_ajax>
|
151 |
+
<wishlist_bookmark>
|
152 |
+
<bookmark_status>1</bookmark_status>
|
153 |
+
</wishlist_bookmark>
|
154 |
+
<wishlist_sidebar>
|
155 |
+
<sidebar_status>1</sidebar_status>
|
156 |
+
</wishlist_sidebar>
|
157 |
+
</ajaxwishlist>
|
158 |
+
</default>
|
159 |
+
</config>
|
app/code/community/Excel/AjaxWishlist/etc/system.xml
ADDED
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category Mage
|
23 |
+
* @package Mage_Catalog
|
24 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<config>
|
29 |
+
<tabs>
|
30 |
+
<media translate="label" module="ajaxwishlist">
|
31 |
+
<label>Excel Extension</label>
|
32 |
+
<sort_order>201</sort_order>
|
33 |
+
</media>
|
34 |
+
</tabs>
|
35 |
+
<sections>
|
36 |
+
<ajaxwishlist translate="label" module="ajaxwishlist">
|
37 |
+
<class>separator-top</class>
|
38 |
+
<label>Ajax Wishlist Setting</label>
|
39 |
+
<tab>media</tab>
|
40 |
+
<frontend_type>text</frontend_type>
|
41 |
+
<sort_order>40</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>1</show_in_store>
|
45 |
+
<groups>
|
46 |
+
<wishlist_general translate="label">
|
47 |
+
<label>General Options</label>
|
48 |
+
<frontend_type>text</frontend_type>
|
49 |
+
<sort_order>100</sort_order>
|
50 |
+
<show_in_default>1</show_in_default>
|
51 |
+
<show_in_website>1</show_in_website>
|
52 |
+
<show_in_store>1</show_in_store>
|
53 |
+
<fields>
|
54 |
+
<wishlist_status translate="label">
|
55 |
+
<label>Enabled</label>
|
56 |
+
<frontend_type>select</frontend_type>
|
57 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
58 |
+
<sort_order>10</sort_order>
|
59 |
+
<show_in_default>1</show_in_default>
|
60 |
+
<show_in_website>1</show_in_website>
|
61 |
+
<show_in_store>1</show_in_store>
|
62 |
+
<backend_model>ajaxwishlist/system_config_backend_validate</backend_model>
|
63 |
+
</wishlist_status>
|
64 |
+
<wishlist_link translate="label">
|
65 |
+
<label>My Wishlist Link</label>
|
66 |
+
<comment><![CDATA[Popup view Wishlist Link : /index.php/ajaxwishlist/index/wishlist/ or /ajaxwishlist/index/wishlist/]]></comment>
|
67 |
+
<frontend_type>text</frontend_type>
|
68 |
+
<sort_order>20</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 |
+
<depends><wishlist_status>1</wishlist_status></depends>
|
73 |
+
</wishlist_link>
|
74 |
+
</fields>
|
75 |
+
</wishlist_general>
|
76 |
+
<wishlist_sidebar translate="label">
|
77 |
+
<label>Wishlist Sidebar</label>
|
78 |
+
<frontend_type>text</frontend_type>
|
79 |
+
<sort_order>200</sort_order>
|
80 |
+
<show_in_default>1</show_in_default>
|
81 |
+
<show_in_website>1</show_in_website>
|
82 |
+
<show_in_store>1</show_in_store>
|
83 |
+
<fields>
|
84 |
+
<sidebar_status translate="label">
|
85 |
+
<label>Enabled</label>
|
86 |
+
<frontend_type>select</frontend_type>
|
87 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
88 |
+
<sort_order>10</sort_order>
|
89 |
+
<show_in_default>1</show_in_default>
|
90 |
+
<show_in_website>1</show_in_website>
|
91 |
+
<show_in_store>1</show_in_store>
|
92 |
+
<!-- <backend_model>ajaxwishlist/system_config_backend_validate</backend_model> -->
|
93 |
+
</sidebar_status>
|
94 |
+
<wishlist_show translate="label">
|
95 |
+
<label>Show Wishlist On</label>
|
96 |
+
<frontend_type>select</frontend_type>
|
97 |
+
<source_model>ajaxwishlist/system_config_source_dropdown_sidebar</source_model>
|
98 |
+
<sort_order>20</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 |
+
</wishlist_show>
|
103 |
+
</fields>
|
104 |
+
</wishlist_sidebar>
|
105 |
+
<wishlist_ajax translate="label">
|
106 |
+
<label>Ajax Mode</label>
|
107 |
+
<frontend_type>text</frontend_type>
|
108 |
+
<sort_order>300</sort_order>
|
109 |
+
<show_in_default>1</show_in_default>
|
110 |
+
<show_in_website>1</show_in_website>
|
111 |
+
<show_in_store>1</show_in_store>
|
112 |
+
<fields>
|
113 |
+
<ajax_status translate="label">
|
114 |
+
<label>Enabled</label>
|
115 |
+
<comment><![CDATA[if select "No" then stop Working Ajax Functionality and Working as a normal ]]></comment>
|
116 |
+
<frontend_type>select</frontend_type>
|
117 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
118 |
+
<sort_order>10</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 |
+
<!-- <backend_model>ajaxWishlist/system_config_backend_validate</backend_model> -->
|
123 |
+
</ajax_status>
|
124 |
+
<ajax_popup_width translate="label">
|
125 |
+
<label>Popup Width</label>
|
126 |
+
<comment><![CDATA[Default width 800px]]></comment>
|
127 |
+
<frontend_type>text</frontend_type>
|
128 |
+
<sort_order>20</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 |
+
<depends><ajax_status>1</ajax_status></depends>
|
133 |
+
</ajax_popup_width>
|
134 |
+
<ajax_popup_height translate="label">
|
135 |
+
<label>Popup Height</label>
|
136 |
+
<comment><![CDATA[Default Height 600px]]></comment>
|
137 |
+
<frontend_type>text</frontend_type>
|
138 |
+
<sort_order>30</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 |
+
<depends><ajax_status>1</ajax_status></depends>
|
143 |
+
</ajax_popup_height>
|
144 |
+
</fields>
|
145 |
+
</wishlist_ajax>
|
146 |
+
<wishlist_bookmark translate="label">
|
147 |
+
<label>BookMark Function</label>
|
148 |
+
|
149 |
+
<frontend_type>text</frontend_type>
|
150 |
+
<sort_order>400</sort_order>
|
151 |
+
<show_in_default>1</show_in_default>
|
152 |
+
<show_in_website>1</show_in_website>
|
153 |
+
<show_in_store>1</show_in_store>
|
154 |
+
<fields>
|
155 |
+
<bookmark_status translate="label">
|
156 |
+
<label>Enabled</label>
|
157 |
+
<comment><![CDATA[Hide bookmark Image from frontend Product. ]]></comment>
|
158 |
+
<frontend_type>select</frontend_type>
|
159 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
160 |
+
<sort_order>10</sort_order>
|
161 |
+
<show_in_default>1</show_in_default>
|
162 |
+
<show_in_website>1</show_in_website>
|
163 |
+
<show_in_store>1</show_in_store>
|
164 |
+
<!-- <backend_model>ajaxWishlist/system_config_backend_validate</backend_model> -->
|
165 |
+
</bookmark_status>
|
166 |
+
</fields>
|
167 |
+
</wishlist_bookmark>
|
168 |
+
<plugin_info>
|
169 |
+
<frontend_model>ajaxwishlist/adminhtml_info</frontend_model>
|
170 |
+
<sort_order>0</sort_order>
|
171 |
+
<show_in_default>1</show_in_default>
|
172 |
+
<show_in_website>1</show_in_website>
|
173 |
+
<show_in_store>1</show_in_store>
|
174 |
+
</plugin_info>
|
175 |
+
<general translate="label">
|
176 |
+
<label>Ajaxcart Configuration</label>
|
177 |
+
<show_in_default>1</show_in_default>
|
178 |
+
<show_in_website>1</show_in_website>
|
179 |
+
<show_in_store>1</show_in_store>
|
180 |
+
<sort_order>2</sort_order>
|
181 |
+
<fields>
|
182 |
+
<enable translate="label">
|
183 |
+
<label>Enable Ajax Cart</label>
|
184 |
+
<frontend_type>select</frontend_type>
|
185 |
+
<sort_order>1</sort_order>
|
186 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
187 |
+
<show_in_default>1</show_in_default>
|
188 |
+
<show_in_website>1</show_in_website>
|
189 |
+
<show_in_store>1</show_in_store>
|
190 |
+
<comment>Enable using Ajaxcart</comment>
|
191 |
+
</enable>
|
192 |
+
<update_blocks translate="label">
|
193 |
+
<label>XML of update blocks</label>
|
194 |
+
<comment>insert HTML parent tag ID of block to be updated</comment>
|
195 |
+
<frontend_model>ajaxwishlist/adminhtml_url</frontend_model>
|
196 |
+
<backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
|
197 |
+
<sort_order>50</sort_order>
|
198 |
+
<show_in_default>1</show_in_default>
|
199 |
+
<show_in_website>0</show_in_website>
|
200 |
+
<show_in_store>0</show_in_store>
|
201 |
+
</update_blocks>
|
202 |
+
</fields>
|
203 |
+
</general>
|
204 |
+
</groups>
|
205 |
+
</ajaxwishlist>
|
206 |
+
</sections>
|
207 |
+
</config>
|
app/code/local/Amar/Ajax/Block/Ajax.php
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Amar_Ajax_Block_Ajax extends Mage_Core_Block_Template
|
3 |
-
{
|
4 |
-
public function _prepareLayout()
|
5 |
-
{
|
6 |
-
return parent::_prepareLayout();
|
7 |
-
}
|
8 |
-
|
9 |
-
public function getAjax()
|
10 |
-
{
|
11 |
-
if (!$this->hasData('ajax')) {
|
12 |
-
$this->setData('ajax', Mage::registry('ajax'));
|
13 |
-
}
|
14 |
-
return $this->getData('ajax');
|
15 |
-
|
16 |
-
}
|
17 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Amar/Ajax/Block/Cart/Sidebar.php
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Amar_Ajax_Block_Cart_Sidebar extends Mage_Checkout_Block_Cart_Sidebar{
|
4 |
-
public function getItemRenderer($type)
|
5 |
-
{
|
6 |
-
if (!isset($this->_itemRenders[$type])) {
|
7 |
-
$type = 'default';
|
8 |
-
}
|
9 |
-
if (is_null($this->_itemRenders[$type]['blockInstance'])) {
|
10 |
-
$this->_itemRenders[$type]['blockInstance'] = $this->getLayout()
|
11 |
-
->createBlock($this->_itemRenders[$type]['block'])
|
12 |
-
->setTemplate('ajax/checkout/cart/sidebar/default.phtml')
|
13 |
-
->setRenderedBlock($this);
|
14 |
-
}
|
15 |
-
|
16 |
-
return $this->_itemRenders[$type]['blockInstance'];
|
17 |
-
}
|
18 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Amar/Ajax/Helper/Data.php
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Amar_Ajax_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
-
{
|
5 |
-
|
6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Amar/Ajax/Model/Ajax.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Amar_Ajax_Model_Ajax extends Mage_Core_Model_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('ajax/ajax');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Amar/Ajax/Model/Mysql4/Ajax.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Amar_Ajax_Model_Mysql4_Ajax extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
// Note that the ajax_id refers to the key field in your database table.
|
8 |
-
$this->_init('ajax/ajax', 'ajax_id');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Amar/Ajax/Model/Mysql4/Ajax/Collection.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Amar_Ajax_Model_Mysql4_Ajax_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('ajax/ajax');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Amar/Ajax/Model/Status.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Amar_Ajax_Model_Status extends Varien_Object
|
4 |
-
{
|
5 |
-
const STATUS_ENABLED = 1;
|
6 |
-
const STATUS_DISABLED = 2;
|
7 |
-
|
8 |
-
static public function getOptionArray()
|
9 |
-
{
|
10 |
-
return array(
|
11 |
-
self::STATUS_ENABLED => Mage::helper('ajax')->__('Enabled'),
|
12 |
-
self::STATUS_DISABLED => Mage::helper('ajax')->__('Disabled')
|
13 |
-
);
|
14 |
-
}
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Amar/Ajax/controllers/IndexController.php
DELETED
@@ -1,108 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
require_once 'Mage/Checkout/controllers/CartController.php';
|
3 |
-
class Amar_Ajax_IndexController extends Mage_Checkout_CartController
|
4 |
-
{
|
5 |
-
public function addAction()
|
6 |
-
{
|
7 |
-
$cart = $this->_getCart();
|
8 |
-
$params = $this->getRequest()->getParams();
|
9 |
-
if($params['isAjax'] == 1){
|
10 |
-
$response = array();
|
11 |
-
try {
|
12 |
-
if (isset($params['qty'])) {
|
13 |
-
$filter = new Zend_Filter_LocalizedToNormalized(
|
14 |
-
array('locale' => Mage::app()->getLocale()->getLocaleCode())
|
15 |
-
);
|
16 |
-
$params['qty'] = $filter->filter($params['qty']);
|
17 |
-
}
|
18 |
-
|
19 |
-
$product = $this->_initProduct();
|
20 |
-
$related = $this->getRequest()->getParam('related_product');
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Check product availability
|
24 |
-
*/
|
25 |
-
if (!$product) {
|
26 |
-
$response['status'] = 'ERROR';
|
27 |
-
$response['message'] = $this->__('Unable to find Product ID');
|
28 |
-
}
|
29 |
-
|
30 |
-
$cart->addProduct($product, $params);
|
31 |
-
if (!empty($related)) {
|
32 |
-
$cart->addProductsByIds(explode(',', $related));
|
33 |
-
}
|
34 |
-
|
35 |
-
$cart->save();
|
36 |
-
|
37 |
-
$this->_getSession()->setCartWasUpdated(true);
|
38 |
-
|
39 |
-
/**
|
40 |
-
* @todo remove wishlist observer processAddToCart
|
41 |
-
*/
|
42 |
-
Mage::dispatchEvent('checkout_cart_add_product_complete',
|
43 |
-
array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())
|
44 |
-
);
|
45 |
-
|
46 |
-
if (!$cart->getQuote()->getHasError()){
|
47 |
-
$message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));
|
48 |
-
$response['status'] = 'SUCCESS';
|
49 |
-
$response['message'] = $message;
|
50 |
-
//New Code Here
|
51 |
-
$this->loadLayout();
|
52 |
-
$toplink = $this->getLayout()->getBlock('top.links')->toHtml();
|
53 |
-
$sidebar_block = $this->getLayout()->getBlock('cart_sidebar');
|
54 |
-
Mage::register('referrer_url', $this->_getRefererUrl());
|
55 |
-
$sidebar = $sidebar_block->toHtml();
|
56 |
-
$response['toplink'] = $toplink;
|
57 |
-
$response['sidebar'] = $sidebar;
|
58 |
-
}
|
59 |
-
} catch (Mage_Core_Exception $e) {
|
60 |
-
$msg = "";
|
61 |
-
if ($this->_getSession()->getUseNotice(true)) {
|
62 |
-
$msg = $e->getMessage();
|
63 |
-
} else {
|
64 |
-
$messages = array_unique(explode("\n", $e->getMessage()));
|
65 |
-
foreach ($messages as $message) {
|
66 |
-
$msg .= $message.'<br/>';
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
-
$response['status'] = 'ERROR';
|
71 |
-
$response['message'] = $msg;
|
72 |
-
} catch (Exception $e) {
|
73 |
-
$response['status'] = 'ERROR';
|
74 |
-
$response['message'] = $this->__('Cannot add the item to shopping cart.');
|
75 |
-
Mage::logException($e);
|
76 |
-
}
|
77 |
-
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
78 |
-
return;
|
79 |
-
}else{
|
80 |
-
return parent::addAction();
|
81 |
-
}
|
82 |
-
}
|
83 |
-
public function optionsAction(){
|
84 |
-
$productId = $this->getRequest()->getParam('product_id');
|
85 |
-
// Prepare helper and params
|
86 |
-
$viewHelper = Mage::helper('catalog/product_view');
|
87 |
-
|
88 |
-
$params = new Varien_Object();
|
89 |
-
$params->setCategoryId(false);
|
90 |
-
$params->setSpecifyOptions(false);
|
91 |
-
|
92 |
-
// Render page
|
93 |
-
try {
|
94 |
-
$viewHelper->prepareAndRender($productId, $this, $params);
|
95 |
-
} catch (Exception $e) {
|
96 |
-
if ($e->getCode() == $viewHelper->ERR_NO_PRODUCT_LOADED) {
|
97 |
-
if (isset($_GET['store']) && !$this->getResponse()->isRedirect()) {
|
98 |
-
$this->_redirect('');
|
99 |
-
} elseif (!$this->getResponse()->isRedirect()) {
|
100 |
-
$this->_forward('noRoute');
|
101 |
-
}
|
102 |
-
} else {
|
103 |
-
Mage::logException($e);
|
104 |
-
$this->_forward('noRoute');
|
105 |
-
}
|
106 |
-
}
|
107 |
-
}
|
108 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Amar/Ajax/etc/config.xml
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Amar_Ajax>
|
5 |
-
<version>0.1.0</version>
|
6 |
-
</Amar_Ajax>
|
7 |
-
</modules>
|
8 |
-
<frontend>
|
9 |
-
<routers>
|
10 |
-
<ajax>
|
11 |
-
<use>standard</use>
|
12 |
-
<args>
|
13 |
-
<module>Amar_Ajax</module>
|
14 |
-
<frontName>ajax</frontName>
|
15 |
-
</args>
|
16 |
-
</ajax>
|
17 |
-
</routers>
|
18 |
-
<layout>
|
19 |
-
<updates>
|
20 |
-
<ajax>
|
21 |
-
<file>ajax.xml</file>
|
22 |
-
</ajax>
|
23 |
-
</updates>
|
24 |
-
</layout>
|
25 |
-
</frontend>
|
26 |
-
<global>
|
27 |
-
<models>
|
28 |
-
<ajax>
|
29 |
-
<class>Amar_Ajax_Model</class>
|
30 |
-
<resourceModel>ajax_mysql4</resourceModel>
|
31 |
-
</ajax>
|
32 |
-
<ajax_mysql4>
|
33 |
-
<class>Amar_Ajax_Model_Mysql4</class>
|
34 |
-
<entities>
|
35 |
-
<ajax>
|
36 |
-
<table>ajax</table>
|
37 |
-
</ajax>
|
38 |
-
</entities>
|
39 |
-
</ajax_mysql4>
|
40 |
-
</models>
|
41 |
-
<resources>
|
42 |
-
<ajax_setup>
|
43 |
-
<setup>
|
44 |
-
<module>Amar_Ajax</module>
|
45 |
-
</setup>
|
46 |
-
<connection>
|
47 |
-
<use>core_setup</use>
|
48 |
-
</connection>
|
49 |
-
</ajax_setup>
|
50 |
-
<ajax_write>
|
51 |
-
<connection>
|
52 |
-
<use>core_write</use>
|
53 |
-
</connection>
|
54 |
-
</ajax_write>
|
55 |
-
<ajax_read>
|
56 |
-
<connection>
|
57 |
-
<use>core_read</use>
|
58 |
-
</connection>
|
59 |
-
</ajax_read>
|
60 |
-
</resources>
|
61 |
-
<blocks>
|
62 |
-
<checkout>
|
63 |
-
<rewrite>
|
64 |
-
<cart_sidebar>Amar_Ajax_Block_Cart_Sidebar</cart_sidebar>
|
65 |
-
</rewrite>
|
66 |
-
</checkout>
|
67 |
-
<ajax>
|
68 |
-
<class>Amar_Ajax_Block</class>
|
69 |
-
</ajax>
|
70 |
-
</blocks>
|
71 |
-
<helpers>
|
72 |
-
<ajax>
|
73 |
-
<class>Amar_Ajax_Helper</class>
|
74 |
-
</ajax>
|
75 |
-
</helpers>
|
76 |
-
</global>
|
77 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/layout/ajaxwishlist.xml
ADDED
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
|
4 |
+
<default>
|
5 |
+
<reference name="head">
|
6 |
+
<!--ajaxcart assets start-->
|
7 |
+
<action method="addItem">
|
8 |
+
<type>skin_js</type>
|
9 |
+
<name>js/ajaxwishlist/ajaxcart/growler.js</name>
|
10 |
+
</action>
|
11 |
+
<action method="addCss">
|
12 |
+
<stylesheet>css/ajaxwishlist/ajaxcart/growler.css</stylesheet>
|
13 |
+
</action>
|
14 |
+
<action method="addCss">
|
15 |
+
<stylesheet>css/ajaxwishlist/ajaxcart/modalbox.css</stylesheet>
|
16 |
+
</action>
|
17 |
+
<action method="addItem">
|
18 |
+
<type>skin_js</type>
|
19 |
+
<name>js/ajaxwishlist/ajaxcart/modalbox.js</name>
|
20 |
+
</action>
|
21 |
+
<action method="addItem">
|
22 |
+
<type>skin_js</type>
|
23 |
+
<name>js/ajaxwishlist/ajaxcart/ajaxcart.js</name>
|
24 |
+
</action>
|
25 |
+
<!--ajaxcart assets end-->
|
26 |
+
|
27 |
+
<!-- product type assets start -->
|
28 |
+
<action method="addJs">
|
29 |
+
<script>varien/product.js</script>
|
30 |
+
</action>
|
31 |
+
<action method="addJs">
|
32 |
+
<script>varien/configurable.js</script>
|
33 |
+
</action>
|
34 |
+
<action method="addItem">
|
35 |
+
<type>skin_js</type>
|
36 |
+
<name>js/bundle.js</name>
|
37 |
+
</action>
|
38 |
+
|
39 |
+
<action method="addItem">
|
40 |
+
<type>js_css</type>
|
41 |
+
<name>calendar/calendar-win2k-1.css</name>
|
42 |
+
<params/>
|
43 |
+
<!--<if/><condition>can_load_calendar_js</condition>-->
|
44 |
+
</action>
|
45 |
+
<action method="addItem">
|
46 |
+
<type>js</type>
|
47 |
+
<name>calendar/calendar.js</name>
|
48 |
+
<!--<params/><if/><condition>can_load_calendar_js</condition>-->
|
49 |
+
</action>
|
50 |
+
<action method="addItem">
|
51 |
+
<type>js</type>
|
52 |
+
<name>calendar/calendar-setup.js</name>
|
53 |
+
<!--<params/><if/><condition>can_load_calendar_js</condition>-->
|
54 |
+
</action>
|
55 |
+
<!-- product type assets end -->
|
56 |
+
</reference>
|
57 |
+
<reference name="empty">
|
58 |
+
<block type="wishlist/customer_sidebar" name="ajaxwishlist_wishlist_sidebar" as="ajaxwishlist" after="cart_sidebar" template="ajaxwishlist/wishlist/sidebar.phtml" ></block>
|
59 |
+
<block type="wishlist/customer_wishlist" name="ajax.customer.wishlist" template="ajaxwishlist/wishlist/view.phtml">
|
60 |
+
<action method="setTitle" translate="title">
|
61 |
+
<title>My Wishlist</title>
|
62 |
+
</action>
|
63 |
+
<block type="wishlist/customer_wishlist_items" name="customer.wishlist.items" as="items" template="ajaxwishlist/wishlist/item/list.phtml">
|
64 |
+
<block type="wishlist/customer_wishlist_item_column_image" name="customer.wishlist.item.image" template="ajaxwishlist/wishlist/item/column/image.phtml" >
|
65 |
+
<action method="setTitle" translate="title">
|
66 |
+
<title>Product</title>
|
67 |
+
</action>
|
68 |
+
</block>
|
69 |
+
|
70 |
+
<block type="wishlist/customer_wishlist_item_column_comment" name="customer.wishlist.item.info" template="ajaxwishlist/wishlist/item/column/info.phtml">
|
71 |
+
<action method="setTitle" translate="title">
|
72 |
+
<title>Comment</title>
|
73 |
+
</action>
|
74 |
+
</block>
|
75 |
+
<block type="wishlist/customer_wishlist_item_column_cart" name="customer.wishlist.item.cart" template="ajaxwishlist/wishlist/item/column/cart.phtml">
|
76 |
+
<action method="setTitle" translate="title">
|
77 |
+
<title>Add to Cart</title>
|
78 |
+
</action>
|
79 |
+
<block type="wishlist/customer_wishlist_item_options" name="customer.wishlist.item.options" />
|
80 |
+
</block>
|
81 |
+
<block type="wishlist/customer_wishlist_item_column_remove" name="customer.wishlist.item.remove" template="ajaxwishlist/wishlist/item/column/remove.phtml" >
|
82 |
+
<action method="setTitle" translate="title">
|
83 |
+
<title>Remove</title>
|
84 |
+
</action>
|
85 |
+
</block>
|
86 |
+
</block>
|
87 |
+
<block type="core/text_list" name="customer.wishlist.buttons" as="control_buttons">
|
88 |
+
<block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.share" template="ajaxwishlist/wishlist/button/share.phtml" />
|
89 |
+
<block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.toCart" template="ajaxwishlist/wishlist/button/tocart.phtml" />
|
90 |
+
<block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.update" template="ajaxwishlist/wishlist/button/update.phtml" />
|
91 |
+
</block>
|
92 |
+
</block>
|
93 |
+
|
94 |
+
<block type="wishlist/customer_sharing" name="ajaxwishlist.sharing" template="ajaxwishlist/wishlist/sharing.phtml" ></block>
|
95 |
+
|
96 |
+
</reference>
|
97 |
+
<reference name="footer">
|
98 |
+
<block type="core/template" name="common" template="ajaxwishlist/common.phtml"/>
|
99 |
+
|
100 |
+
</reference>
|
101 |
+
|
102 |
+
</default>
|
103 |
+
|
104 |
+
<catalog_product_view>
|
105 |
+
<reference name="head">
|
106 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_ajax/ajax_status"><type>skin_js</type><name>js/ajaxwishlist/lightview/scriptaculous.js</name></action>
|
107 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_ajax/ajax_status"><type>skin_js</type><name>js/ajaxwishlist/lightview/lightview.js</name></action>
|
108 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_ajax/ajax_status"><type>skin_css</type><name>css/ajaxwishlist/lightview/lightviewyoung.css</name></action>
|
109 |
+
<action method="addItem"><type>skin_js</type><name>js/ajaxwishlist/ajaxwishlist.js</name></action>
|
110 |
+
<action method="addItem"><type>skin_css</type><name>css/ajaxwishlist/ajaxwishlist.css</name></action>
|
111 |
+
|
112 |
+
</reference>
|
113 |
+
<reference name='product.info.addto'>
|
114 |
+
<action ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1" method='setTemplate'><template>ajaxwishlist/catalog/product/view/addto.phtml</template></action>
|
115 |
+
</reference>
|
116 |
+
|
117 |
+
<!-- <reference name="catalog.product.related">
|
118 |
+
<block type="ajaxwishlist/ajaxWishlist" name="ajaxwishlist.wishlist.item" >
|
119 |
+
<action method='ajaxTemplate' ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><path>catalog/product_list_related</path><template>ajaxwishlist/catalog/product/list/related.phtml</template></action>
|
120 |
+
</block>
|
121 |
+
</reference>
|
122 |
+
|
123 |
+
<reference name="catalog.product.related">
|
124 |
+
<action method='setTemplate' before="-" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><template>ajaxwishlist/catalog/product/list/related.phtml</template></action>
|
125 |
+
</reference> -->
|
126 |
+
|
127 |
+
<reference name="product.info.media">
|
128 |
+
<action method='setTemplate' ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><template>ajaxwishlist/catalog/product/view/media.phtml</template></action>
|
129 |
+
</reference>
|
130 |
+
<reference name="wishlist_sidebar">
|
131 |
+
<action method='setTemplate' ifconfig="ajaxwishlist/wishlist_sidebar/sidebar_status" value="1"><template>ajaxwishlist/wishlist/sidebar.phtml</template></action>
|
132 |
+
</reference>
|
133 |
+
</catalog_product_view>
|
134 |
+
|
135 |
+
<ajaxwishlist_index_wishlist>
|
136 |
+
<reference name="head">
|
137 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_js</type><name>js/ajaxwishlist/ajaxwishlist.js</name></action>
|
138 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_css</type><name>css/ajaxwishlist/ajaxwishlist.css</name></action>
|
139 |
+
</reference>
|
140 |
+
<reference name="root">
|
141 |
+
<action method="setTemplate" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><template>page/empty.phtml</template></action>
|
142 |
+
</reference>
|
143 |
+
<reference name="content">
|
144 |
+
<update handle="customer_account" />
|
145 |
+
<block type="ajaxwishlist/customer_wishlist" name="ajax.customer.wishlist" template="ajaxwishlist/wishlist/view.phtml">
|
146 |
+
<action method="setTitle" translate="title">
|
147 |
+
<title>My Wishlist</title>
|
148 |
+
</action>
|
149 |
+
<block type="wishlist/customer_wishlist_items" name="customer.wishlist.items" as="items" template="ajaxwishlist/wishlist/item/list.phtml">
|
150 |
+
<block type="wishlist/customer_wishlist_item_column_image" name="customer.wishlist.item.image" template="ajaxwishlist/wishlist/item/column/image.phtml" >
|
151 |
+
<action method="setTitle" translate="title">
|
152 |
+
<title>Product</title>
|
153 |
+
</action>
|
154 |
+
</block>
|
155 |
+
|
156 |
+
<block type="wishlist/customer_wishlist_item_column_comment" name="customer.wishlist.item.info" template="ajaxwishlist/wishlist/item/column/info.phtml">
|
157 |
+
<action method="setTitle" translate="title">
|
158 |
+
<title>Comment</title>
|
159 |
+
</action>
|
160 |
+
</block>
|
161 |
+
<block type="wishlist/customer_wishlist_item_column_cart" name="customer.wishlist.item.cart" template="ajaxwishlist/wishlist/item/column/cart.phtml">
|
162 |
+
<action method="setTitle" translate="title">
|
163 |
+
<title>Add to Cart</title>
|
164 |
+
</action>
|
165 |
+
<block type="wishlist/customer_wishlist_item_options" name="customer.wishlist.item.options" />
|
166 |
+
</block>
|
167 |
+
<block type="wishlist/customer_wishlist_item_column_remove" name="customer.wishlist.item.remove" template="ajaxwishlist/wishlist/item/column/remove.phtml" >
|
168 |
+
<action method="setTitle" translate="title">
|
169 |
+
<title>Remove</title>
|
170 |
+
</action>
|
171 |
+
</block>
|
172 |
+
</block>
|
173 |
+
<block type="core/text_list" name="customer.wishlist.buttons" as="control_buttons">
|
174 |
+
<block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.share" template="ajaxwishlist/wishlist/button/share.phtml" />
|
175 |
+
<block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.toCart" template="ajaxwishlist/wishlist/button/tocart.phtml" />
|
176 |
+
<block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.update" template="ajaxwishlist/wishlist/button/update.phtml" />
|
177 |
+
</block>
|
178 |
+
</block>
|
179 |
+
</reference>
|
180 |
+
</ajaxwishlist_index_wishlist>
|
181 |
+
|
182 |
+
<catalog_category_default>
|
183 |
+
<reference name="head">
|
184 |
+
|
185 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_js</type><name>js/ajaxwishlist/lightview/scriptaculous.js</name></action>
|
186 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_js</type><name>js/ajaxwishlist/lightview/lightview.js</name></action>
|
187 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_css</type><name>css/ajaxwishlist/lightview/lightviewyoung.css</name></action>
|
188 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_js</type><name>js/ajaxwishlist/ajaxwishlist.js</name></action>
|
189 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_css</type><name>css/ajaxwishlist/ajaxwishlist.css</name></action>
|
190 |
+
</reference>
|
191 |
+
<reference name='product_list'>
|
192 |
+
<action method='setTemplate' ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><template>ajaxwishlist/catalog/product/list.phtml</template></action>
|
193 |
+
</reference>
|
194 |
+
<reference name="wishlist_sidebar">
|
195 |
+
<action method='setTemplate' ifconfig="ajaxwishlist/wishlist_sidebar/sidebar_status" value="1"><template>ajaxwishlist/wishlist/sidebar.phtml</template></action>
|
196 |
+
</reference>
|
197 |
+
</catalog_category_default>
|
198 |
+
|
199 |
+
<catalog_category_layered>
|
200 |
+
<reference name="head">
|
201 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_js</type><name>js/ajaxwishlist/lightview/scriptaculous.js</name></action>
|
202 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_js</type><name>js/ajaxwishlist/lightview/lightview.js</name></action>
|
203 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_css</type><name>css/ajaxwishlist/lightview/lightviewyoung.css</name></action>
|
204 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_js</type><name>js/ajaxwishlist/ajaxwishlist.js</name></action>
|
205 |
+
<action method="addItem" ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><type>skin_css</type><name>css/ajaxwishlist/ajaxwishlist.css</name></action>
|
206 |
+
</reference>
|
207 |
+
<reference name='product_list'>
|
208 |
+
<action method='setTemplate' ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1"><template>ajaxwishlist/catalog/product/list.phtml</template></action>
|
209 |
+
</reference>
|
210 |
+
<reference name="wishlist_sidebar">
|
211 |
+
<action method='setTemplate' ifconfig="ajaxwishlist/wishlist_sidebar/sidebar_status" value="1" ><template>ajaxwishlist/wishlist/sidebar.phtml</template></action>
|
212 |
+
<action method='setTemplate' ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="1" ><template>ajaxwishlist/wishlist/sidebar.phtml</template></action>
|
213 |
+
<action method='setTemplate' ifconfig="ajaxwishlist/wishlist_sidebar/sidebar_status" value="0" ><template>wishlist/sidebar.phtml</template></action>
|
214 |
+
<action method='setTemplate' ifconfig="ajaxwishlist/wishlist_general/wishlist_status" value="0" ><template>wishlist/sidebar.phtml</template></action>
|
215 |
+
</reference>
|
216 |
+
</catalog_category_layered>
|
217 |
+
|
218 |
+
<ajaxwishlist_index_share>
|
219 |
+
<update handle="customer_account" />
|
220 |
+
<reference name="my.account.wrapper">
|
221 |
+
<block type="wishlist/customer_sharing" name="ajaxwishlist.sharing" template="ajaxwishlist/wishlist/sharing.phtml" />
|
222 |
+
</reference>
|
223 |
+
<reference name="right">
|
224 |
+
<action method="unsetChild"><name>wishlist_customer_sidebar</name></action>
|
225 |
+
</reference>
|
226 |
+
</ajaxwishlist_index_share>
|
227 |
+
|
228 |
+
|
229 |
+
<!-- Ajax Cart Controller Action Start Here -->
|
230 |
+
<ajaxwishlist>
|
231 |
+
<reference name="content">
|
232 |
+
<block type="checkout/cart" name="checkout.cart">
|
233 |
+
<action method="setCartTemplate">
|
234 |
+
<value>checkout/cart.phtml</value>
|
235 |
+
</action>
|
236 |
+
<action method="setEmptyTemplate">
|
237 |
+
<value>checkout/cart/noItems.phtml</value>
|
238 |
+
</action>
|
239 |
+
<action method="chooseTemplate"/>
|
240 |
+
<action method="addItemRender">
|
241 |
+
<type>simple</type>
|
242 |
+
<block>checkout/cart_item_renderer</block>
|
243 |
+
<template>checkout/cart/item/default.phtml</template>
|
244 |
+
</action>
|
245 |
+
<action method="addItemRender">
|
246 |
+
<type>grouped</type>
|
247 |
+
<block>checkout/cart_item_renderer_grouped</block>
|
248 |
+
<template>checkout/cart/item/default.phtml</template>
|
249 |
+
</action>
|
250 |
+
<action method="addItemRender">
|
251 |
+
<type>configurable</type>
|
252 |
+
<block>checkout/cart_item_renderer_configurable</block>
|
253 |
+
<template>checkout/cart/item/default.phtml</template>
|
254 |
+
</action>
|
255 |
+
|
256 |
+
<block type="core/text_list" name="checkout.cart.top_methods" as="top_methods" translate="label">
|
257 |
+
<label>Payment Methods Before Checkout Button</label>
|
258 |
+
<block type="checkout/onepage_link" name="checkout.cart.methods.onepage"
|
259 |
+
template="checkout/onepage/link.phtml"/>
|
260 |
+
</block>
|
261 |
+
|
262 |
+
<block type="page/html_wrapper" name="checkout.cart.form.before" as="form_before" translate="label">
|
263 |
+
<label>Shopping Cart Form Before</label>
|
264 |
+
</block>
|
265 |
+
|
266 |
+
<block type="core/text_list" name="checkout.cart.methods" as="methods" translate="label">
|
267 |
+
<label>Payment Methods After Checkout Button</label>
|
268 |
+
<block type="checkout/onepage_link" name="checkout.cart.methods.onepage"
|
269 |
+
template="checkout/onepage/link.phtml"/>
|
270 |
+
<block type="checkout/multishipping_link" name="checkout.cart.methods.multishipping"
|
271 |
+
template="checkout/multishipping/link.phtml"/>
|
272 |
+
</block>
|
273 |
+
|
274 |
+
<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon"
|
275 |
+
template="checkout/cart/coupon.phtml"/>
|
276 |
+
<block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping"
|
277 |
+
template="checkout/cart/shipping.phtml"/>
|
278 |
+
<block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell"
|
279 |
+
template="checkout/cart/crosssell.phtml"/>
|
280 |
+
|
281 |
+
<block type="checkout/cart_totals" name="checkout.cart.totals" as="totals"
|
282 |
+
template="checkout/cart/totals.phtml"/>
|
283 |
+
</block>
|
284 |
+
</reference>
|
285 |
+
</ajaxwishlist>
|
286 |
+
<ajaxwishlist_configurable_options>
|
287 |
+
<reference name="content">
|
288 |
+
<block type="catalog/product_view" name="ajaxcart.configurable.options"
|
289 |
+
template="ajaxwishlist/ajaxcart/configurable_options.phtml" as="ajaxcart.configurable.options">
|
290 |
+
<block type="core/template_facade" name="product.info.container1" as="container1">
|
291 |
+
<action method="setDataByKey">
|
292 |
+
<key>alias_in_layout</key>
|
293 |
+
<value>container1</value>
|
294 |
+
</action>
|
295 |
+
<action method="setDataByKeyFromRegistry">
|
296 |
+
<key>options_container</key>
|
297 |
+
<key_in_registry>product</key_in_registry>
|
298 |
+
</action>
|
299 |
+
<action method="append">
|
300 |
+
<block>product.info.options.wrapper</block>
|
301 |
+
</action>
|
302 |
+
<action method="append">
|
303 |
+
<block>product.info.options.wrapper.bottom</block>
|
304 |
+
</action>
|
305 |
+
</block>
|
306 |
+
</block>
|
307 |
+
</reference>
|
308 |
+
</ajaxwishlist_configurable_options>
|
309 |
+
<ajaxwishlist_bundle_options>
|
310 |
+
<reference name="content">
|
311 |
+
<block type="bundle/catalog_product_view_type_bundle" name="product.info.bundle" as="product_type_data" template="bundle/catalog/product/view/type/bundle.phtml">
|
312 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
313 |
+
<block type="bundle/catalog_product_price" name="bundle.prices" as="bundle_prices" template="bundle/catalog/product/view/price.phtml">
|
314 |
+
<action method="setMAPTemplate"><tmpl>catalog/product/price_msrp_item.phtml</tmpl></action>
|
315 |
+
</block>
|
316 |
+
</block>
|
317 |
+
</reference>
|
318 |
+
</ajaxwishlist_bundle_options>
|
319 |
+
<ajaxwishlist_grouped_options translate="label" module="catalog">
|
320 |
+
<reference name="content">
|
321 |
+
<block type="catalog/product_view" name="ajaxcart.grouped.options"
|
322 |
+
template="ajaxwishlist/ajaxcart/grouped_options.phtml" as="ajaxcart.grouped.options">
|
323 |
+
<block type="catalog/product_view_type_grouped" name="grouped.options"
|
324 |
+
as="grouped.options" template="catalog/product/view/type/grouped.phtml">
|
325 |
+
<block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra"
|
326 |
+
translate="label">
|
327 |
+
<label>Product Extra Info</label>
|
328 |
+
</block>
|
329 |
+
</block>
|
330 |
+
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>
|
331 |
+
</block>
|
332 |
+
</reference>
|
333 |
+
</ajaxwishlist_grouped_options>
|
334 |
+
<wishlist_index_configure translate="label">
|
335 |
+
<reference name="head">
|
336 |
+
<action method="removeItem">
|
337 |
+
<type>skin_js</type>
|
338 |
+
<name>js/ajaxwishlist/ajaxcart/modalbox.js</name>
|
339 |
+
</action>
|
340 |
+
<action method="removeItem">
|
341 |
+
<type>skin_js</type>
|
342 |
+
<name>js/ajaxwishlist/ajaxcart/growler.js</name>
|
343 |
+
</action>
|
344 |
+
<action method="removeItem">
|
345 |
+
<type>skin_js</type>
|
346 |
+
<name>js/ajaxwishlist/ajaxcart/ajaxcart.js</name>
|
347 |
+
</action>
|
348 |
+
</reference>
|
349 |
+
</wishlist_index_configure>
|
350 |
+
</layout>
|
app/design/frontend/base/default/template/ajaxwishlist/ajaxcart/configurable_options.phtml
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $_product = Mage::registry('current_product'); ?>
|
2 |
+
|
3 |
+
<script type="text/javascript">
|
4 |
+
var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
|
5 |
+
</script>
|
6 |
+
<form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post"
|
7 |
+
id="product_addtocart_form">
|
8 |
+
<div class="no-display">
|
9 |
+
<input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
|
10 |
+
<input type="hidden" name="related_product" id="related-products-field" value="" />
|
11 |
+
</div>
|
12 |
+
<?php if ($_product->isSaleable()): ?>
|
13 |
+
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
|
14 |
+
<?php endif; ?>
|
15 |
+
</form>
|
16 |
+
<script type="text/javascript">
|
17 |
+
//<![CDATA[
|
18 |
+
var productAddToCartForm = new VarienForm('product_addtocart_form');
|
19 |
+
productAddToCartForm.submit = function(button, url) {
|
20 |
+
if (this.validator.validate()) {
|
21 |
+
var form = this.form;
|
22 |
+
var oldUrl = form.action;
|
23 |
+
|
24 |
+
if (url) {
|
25 |
+
form.action = url;
|
26 |
+
}
|
27 |
+
var e = null;
|
28 |
+
try {
|
29 |
+
this.form.submit();
|
30 |
+
} catch (e) {
|
31 |
+
}
|
32 |
+
this.form.action = oldUrl;
|
33 |
+
if (e) {
|
34 |
+
throw e;
|
35 |
+
}
|
36 |
+
|
37 |
+
if (button && button != 'undefined') {
|
38 |
+
button.disabled = true;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}.bind(productAddToCartForm);
|
42 |
+
|
43 |
+
productAddToCartForm.submitLight = function(button, url){
|
44 |
+
if(this.validator) {
|
45 |
+
var nv = Validation.methods;
|
46 |
+
delete Validation.methods['required-entry'];
|
47 |
+
delete Validation.methods['validate-one-required'];
|
48 |
+
delete Validation.methods['validate-one-required-by-name'];
|
49 |
+
// Remove custom datetime validators
|
50 |
+
for (var methodName in Validation.methods) {
|
51 |
+
if (methodName.match(/^validate-datetime-.*/i)) {
|
52 |
+
delete Validation.methods[methodName];
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
if (this.validator.validate()) {
|
57 |
+
if (url) {
|
58 |
+
this.form.action = url;
|
59 |
+
}
|
60 |
+
this.form.submit();
|
61 |
+
}
|
62 |
+
Object.extend(Validation.methods, nv);
|
63 |
+
}
|
64 |
+
}.bind(productAddToCartForm);
|
65 |
+
//]]>
|
66 |
+
</script>
|
67 |
+
<script type="text/javascript">
|
68 |
+
$("MB_window").setStyle({
|
69 |
+
"height":"450px"
|
70 |
+
});
|
71 |
+
</script>
|
app/design/frontend/base/default/template/ajaxwishlist/ajaxcart/grouped_options.phtml
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $_product = Mage::registry('current_product'); ?>
|
2 |
+
|
3 |
+
<script type="text/javascript">
|
4 |
+
var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
|
5 |
+
</script>
|
6 |
+
<form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post"
|
7 |
+
id="product_addtocart_form">
|
8 |
+
<div class="no-display">
|
9 |
+
<input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
|
10 |
+
<input type="hidden" name="related_product" id="related-products-field" value="" />
|
11 |
+
</div>
|
12 |
+
<?php echo $this->getChildHtml('grouped.options') ?>
|
13 |
+
<?php if ($_product->isSaleable()): ?>
|
14 |
+
<?php echo $this->getChildHtml('addtocart') ?>
|
15 |
+
<?php endif; ?>
|
16 |
+
</form>
|
17 |
+
<script type="text/javascript">
|
18 |
+
//<![CDATA[
|
19 |
+
var productAddToCartForm = new VarienForm('product_addtocart_form');
|
20 |
+
productAddToCartForm.submit = function(button, url) {
|
21 |
+
if (this.validator.validate()) {
|
22 |
+
var form = this.form;
|
23 |
+
var oldUrl = form.action;
|
24 |
+
|
25 |
+
if (url) {
|
26 |
+
form.action = url;
|
27 |
+
}
|
28 |
+
var e = null;
|
29 |
+
try {
|
30 |
+
this.form.submit();
|
31 |
+
} catch (e) {
|
32 |
+
}
|
33 |
+
this.form.action = oldUrl;
|
34 |
+
if (e) {
|
35 |
+
throw e;
|
36 |
+
}
|
37 |
+
|
38 |
+
if (button && button != 'undefined') {
|
39 |
+
button.disabled = true;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}.bind(productAddToCartForm);
|
43 |
+
|
44 |
+
productAddToCartForm.submitLight = function(button, url){
|
45 |
+
if(this.validator) {
|
46 |
+
var nv = Validation.methods;
|
47 |
+
delete Validation.methods['required-entry'];
|
48 |
+
delete Validation.methods['validate-one-required'];
|
49 |
+
delete Validation.methods['validate-one-required-by-name'];
|
50 |
+
// Remove custom datetime validators
|
51 |
+
for (var methodName in Validation.methods) {
|
52 |
+
if (methodName.match(/^validate-datetime-.*/i)) {
|
53 |
+
delete Validation.methods[methodName];
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
if (this.validator.validate()) {
|
58 |
+
if (url) {
|
59 |
+
this.form.action = url;
|
60 |
+
}
|
61 |
+
this.form.submit();
|
62 |
+
}
|
63 |
+
Object.extend(Validation.methods, nv);
|
64 |
+
}
|
65 |
+
}.bind(productAddToCartForm);
|
66 |
+
//]]>
|
67 |
+
</script>
|
app/design/frontend/base/default/template/ajaxwishlist/catalog/product/compare/sidebar.phtml
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$_helper = $this->helper('catalog/product_compare');
|
3 |
+
$_items = $_helper->getItemCount() > 0 ? $_helper->getItemCollection() : null;
|
4 |
+
?>
|
5 |
+
<div class="block block-list block-compare">
|
6 |
+
<div class="block-title">
|
7 |
+
<strong><span><?php echo $this->__('Compare Products') ?>
|
8 |
+
<?php if($_helper->getItemCount() > 0): ?>
|
9 |
+
<small><?php echo $this->__('(%d)', $_helper->getItemCount()) ?></small>
|
10 |
+
<?php endif; ?>
|
11 |
+
</span></strong>
|
12 |
+
</div>
|
13 |
+
<div class="block-content">
|
14 |
+
<?php if($_helper->getItemCount() > 0): ?>
|
15 |
+
<ol id="compare-items">
|
16 |
+
<?php foreach($_items as $_index => $_item): ?>
|
17 |
+
<li class="item">
|
18 |
+
<input type="hidden" class="compare-item-id" value="<?php echo $_item->getId() ?>" />
|
19 |
+
<a href="<?php
|
20 |
+
$params = $this->getRequest()->getParams();
|
21 |
+
if($params['isAjax'] == 1){
|
22 |
+
$refererUrl = Mage::registry('referrer_url');
|
23 |
+
if (empty($refererUrl)) {
|
24 |
+
$refererUrl = Mage::getBaseUrl();
|
25 |
+
}
|
26 |
+
$deleteUrl = $this->getUrl(
|
27 |
+
'catalog/product_compare/remove',
|
28 |
+
array(
|
29 |
+
'product'=>$_item->getId(),
|
30 |
+
Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED => $this->helper('core/url')->getEncodedUrl($refererUrl)
|
31 |
+
)
|
32 |
+
);
|
33 |
+
}else{
|
34 |
+
$deleteUrl = $_helper->getRemoveUrl($_item);
|
35 |
+
}
|
36 |
+
$data = split("/uenc", $deleteUrl);
|
37 |
+
echo $data[0];
|
38 |
+
|
39 |
+
?>" title="<?php echo $this->__('Remove This Item') ?>" class="btn-remove" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the compare products?') ?>');"><?php echo $this->__('Remove This Item') ?></a>
|
40 |
+
<p class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getName(), 'name') ?></a></p>
|
41 |
+
</li>
|
42 |
+
<?php endforeach; ?>
|
43 |
+
</ol>
|
44 |
+
<script type="text/javascript">decorateList('compare-items')</script>
|
45 |
+
<div class="actions">
|
46 |
+
<a href="<?php
|
47 |
+
$params = $this->getRequest()->getParams();
|
48 |
+
if($params['isAjax'] == 1){
|
49 |
+
$refererUrl = Mage::registry('referrer_url');
|
50 |
+
if (empty($refererUrl)) {
|
51 |
+
$refererUrl = Mage::getBaseUrl();
|
52 |
+
}
|
53 |
+
$deleteUrl = $this->getUrl(
|
54 |
+
'catalog/product_compare/clear',
|
55 |
+
array(
|
56 |
+
Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED => $this->helper('core/url')->getEncodedUrl($refererUrl)
|
57 |
+
)
|
58 |
+
);
|
59 |
+
}else{
|
60 |
+
$deleteUrl = $_helper->getClearListUrl();
|
61 |
+
}
|
62 |
+
//echo $deleteUrl;
|
63 |
+
$data = split("/uenc", $deleteUrl);
|
64 |
+
echo $data[0];
|
65 |
+
?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove all products from your comparison?') ?>');"><?php echo $this->__('Clear All') ?></a>
|
66 |
+
<button type="button" title="<?php echo $this->__('Compare') ?>" class="button" onclick="popWin('<?php echo $_helper->getListUrl() ?>','compare','top:0,left:0,width=820,height=600,resizable=yes,scrollbars=yes')"><span><span><?php echo $this->__('Compare') ?></span></span></button>
|
67 |
+
</div>
|
68 |
+
<?php else: ?>
|
69 |
+
<p class="empty"><?php echo $this->__('You have no items to compare.') ?></p>
|
70 |
+
<?php endif; ?>
|
71 |
+
</div>
|
72 |
+
</div>
|
app/design/frontend/base/default/template/ajaxwishlist/catalog/product/list.phtml
ADDED
@@ -0,0 +1,329 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
$_productCollection=$this->getLoadedProductCollection();
|
9 |
+
$_helper = $this->helper('catalog/output');
|
10 |
+
|
11 |
+
$wishlistPopModeUrl = $this->helper("ajaxwishlist")->getWishlistUrl();
|
12 |
+
$wishlistAjaxStatus = $this->helper("ajaxwishlist")->getWishlistAjaxMode();
|
13 |
+
$wishlistPopModeWidht = $this->helper("ajaxwishlist")->getWishlistPopupWidth();
|
14 |
+
$wishlistPopModeHeight = $this->helper("ajaxwishlist")->getWishlistPopupHeight();
|
15 |
+
$wishlistSidebarPosition = $this->helper("ajaxwishlist")->getWishlistSidebarPositionShow();
|
16 |
+
$wishlistMarkerStatus = $this->helper("ajaxwishlist")->getMarkerStatus();
|
17 |
+
|
18 |
+
if($customer = Mage::getSingleton('customer/session')->isLoggedIn()) {
|
19 |
+
$customerId = Mage::getModel('customer/session')->getCustomer()->getId();
|
20 |
+
|
21 |
+
}
|
22 |
+
|
23 |
+
?>
|
24 |
+
<?php if(!$_productCollection->count()): ?>
|
25 |
+
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
|
26 |
+
<?php else: ?>
|
27 |
+
<div class="category-products">
|
28 |
+
<?php echo $this->getToolbarHtml() ?>
|
29 |
+
<?php // List mode ?>
|
30 |
+
<?php if($this->getMode()!='grid'): ?>
|
31 |
+
<?php $_iterator = 0; ?>
|
32 |
+
<ol class="products-list" id="products-list">
|
33 |
+
<?php foreach ($_productCollection as $_product): ?>
|
34 |
+
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
|
35 |
+
<?php
|
36 |
+
|
37 |
+
$_wishlistItem = Mage::getModel('wishlist/item')->loadByProductWishlist(
|
38 |
+
$this->helper('wishlist')->getWishlist()->getId(),
|
39 |
+
$_product->getId(),
|
40 |
+
$_product->getStoreId());
|
41 |
+
|
42 |
+
|
43 |
+
$CustomerWishlistId = $_wishlistItem->getWishlistId();
|
44 |
+
$CustomerProductId = $_wishlistItem->getproductId();
|
45 |
+
|
46 |
+
|
47 |
+
$_wishlistRemoveUrl = $this->helper('wishlist')->getRemoveUrl($_wishlistItem);
|
48 |
+
|
49 |
+
?>
|
50 |
+
|
51 |
+
<?php if($wishlistAjaxStatus): ?>
|
52 |
+
<?php if($wishlistMarkerStatus):
|
53 |
+
|
54 |
+
|
55 |
+
?>
|
56 |
+
<?php if($_product->getId() == $CustomerProductId && $customerId != null):?>
|
57 |
+
|
58 |
+
<div id="wishlist_list" class="wishlist_list_view">
|
59 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:visible;" onclick='func_removeListItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
60 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="visibility:hidden;" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
61 |
+
<div class="ajax_loadder"><span id='ajax_loading_list<?php echo $_product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif')?>'/></span></div>
|
62 |
+
</div>
|
63 |
+
|
64 |
+
<?php else: ?>
|
65 |
+
<div id="wishlist_list" class="wishlist_list_view">
|
66 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
67 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:hidden;" onclick='func_removeListItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
68 |
+
<div class="ajax_loadder"><span id='ajax_loading_list<?php echo $_product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif')?>'/></span></div>
|
69 |
+
</div>
|
70 |
+
<?php endif; ?>
|
71 |
+
|
72 |
+
|
73 |
+
<a href='<?php echo $this->helper("ajaxwishlist")->getWishlistUrl(); ?>' id="popup_wishlist_<?php echo $_product->getId() ?>" rel='iframe' title=' :: :: width: <?php echo $wishlistPopModeWidht ?>, height: <?php echo $wishlistPopModeHeight ?>' class='lightview'></a>
|
74 |
+
|
75 |
+
<?php endif; ?>
|
76 |
+
|
77 |
+
<?php else: ?>
|
78 |
+
<?php if($wishlistMarkerStatus): ?>
|
79 |
+
<?php if($_product->getId() == $CustomerProductId && $customerId != null):?>
|
80 |
+
|
81 |
+
<div id="wishlist_list" class="wishlist_list_view">
|
82 |
+
|
83 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:visible;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
84 |
+
|
85 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="visibility:hidden;" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
86 |
+
</div>
|
87 |
+
|
88 |
+
<?php else: ?>
|
89 |
+
<div id="wishlist_list" class="wishlist_list_view">
|
90 |
+
|
91 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
92 |
+
<?php //after select ?>
|
93 |
+
|
94 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:hidden;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
95 |
+
</div>
|
96 |
+
<?php endif; ?>
|
97 |
+
<?php endif; ?>
|
98 |
+
<?php endif; ?>
|
99 |
+
|
100 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
|
101 |
+
|
102 |
+
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
|
103 |
+
</a>
|
104 |
+
<?php // Product description ?>
|
105 |
+
<div class="product-shop">
|
106 |
+
<div class="f-fix">
|
107 |
+
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
|
108 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
|
109 |
+
<?php if($_product->getRatingSummary()): ?>
|
110 |
+
<?php echo $this->getReviewsSummaryHtml($_product) ?>
|
111 |
+
<?php endif; ?>
|
112 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
113 |
+
<?php if($_product->isSaleable()): ?>
|
114 |
+
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>?options=cart')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
115 |
+
<?php else: ?>
|
116 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
117 |
+
<?php endif; ?>
|
118 |
+
<div class="desc std">
|
119 |
+
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
|
120 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
|
121 |
+
</div>
|
122 |
+
<ul class="add-to-links">
|
123 |
+
<?php if($wishlistAjaxStatus): ?>
|
124 |
+
<?php if($_product->getId() == $CustomerProductId && $customerId != null):?>
|
125 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
126 |
+
<li id="Remove_Link_<?php echo $_product->getId()?>" style="display: block;"><a class="link_AddtoWishlist" id="Remove_Link_<?php echo $_product->getId()?>" href="javascript:void(0);" onclick='func_removeItemFromLink("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Remove to Wishlist') ?></a>
|
127 |
+
<span id='ajax_loading_remove<?php echo $_product->getId()?>' class="link_loader_listview" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
128 |
+
</li>
|
129 |
+
<li id="Add_Item_Link_<?php echo $_product->getId()?>" style="display: none;"><a class="link_AddtoWishlist" href="javascript:void(0);" onclick='ajaxWishlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
|
130 |
+
<span id='ajax_loading<?php echo $_product->getId()?>' class="link_loader_listview" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
131 |
+
</li>
|
132 |
+
<?php endif; ?>
|
133 |
+
<?php else: ?>
|
134 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
135 |
+
<li id="Remove_Link_<?php echo $_product->getId()?>" style="display: none;"><a class="link_AddtoWishlist" id="Remove_Link_<?php echo $_product->getId()?>" href="javascript:void(0);" onclick='func_removeItemFromLink("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Remove to Wishlist') ?></a>
|
136 |
+
<span id='ajax_loading_remove<?php echo $_product->getId()?>' class="link_loader_listview" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
137 |
+
</li>
|
138 |
+
<li id="Add_Item_Link_<?php echo $_product->getId()?>" style="display: block;"><a class="link_AddtoWishlist" href="javascript:void(0);" onclick='ajaxWishlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
|
139 |
+
<span id='ajax_loading<?php echo $_product->getId()?>' class="link_loader_listview" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
140 |
+
</li>
|
141 |
+
<?php endif; ?>
|
142 |
+
<?php endif; ?>
|
143 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
144 |
+
<li class="comapre_li">
|
145 |
+
<a href="#" class="link_AddtoWishlist"onclick='ajaxCompare("<?php echo $_compareUrl ?>","<?php echo $_product->getId()?>");return false;' class="link-compare"><?php echo $this->__('Add to Compare') ?></a>
|
146 |
+
<span class="ajax_compare_loading" id='ajax_compare_loading<?php echo $_product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
147 |
+
</li>
|
148 |
+
<?php endif; ?>
|
149 |
+
<?php else: ?>
|
150 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
151 |
+
|
152 |
+
<li><a href="<?php echo $this->getAddToCompareUrl($_product);?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
153 |
+
|
154 |
+
<?php endif; ?>
|
155 |
+
|
156 |
+
</ul>
|
157 |
+
|
158 |
+
</div>
|
159 |
+
</div>
|
160 |
+
</li>
|
161 |
+
<?php endforeach; ?>
|
162 |
+
</ol>
|
163 |
+
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
|
164 |
+
|
165 |
+
<?php else: ?>
|
166 |
+
|
167 |
+
<?php // Grid Mode ?>
|
168 |
+
|
169 |
+
<?php $_collectionSize = $_productCollection->count() ?>
|
170 |
+
<?php $_columnCount = $this->getColumnCount(); ?>
|
171 |
+
<?php $i=0; foreach ($_productCollection as $_product): ?>
|
172 |
+
<?php if ($i++%$_columnCount==0): ?>
|
173 |
+
<ul class="products-grid">
|
174 |
+
<?php endif ?>
|
175 |
+
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
|
176 |
+
<?php
|
177 |
+
|
178 |
+
|
179 |
+
|
180 |
+
$_wishlistItem = Mage::getModel('wishlist/item')->loadByProductWishlist(
|
181 |
+
$this->helper('wishlist')->getWishlist()->getId(),
|
182 |
+
$_product->getId(),
|
183 |
+
$_product->getStoreId());
|
184 |
+
|
185 |
+
|
186 |
+
$CustomerWishlistId = $_wishlistItem->getWishlistId();
|
187 |
+
$CustomerProductId = $_wishlistItem->getproductId();
|
188 |
+
|
189 |
+
|
190 |
+
$_wishlistRemoveUrl = $this->helper('wishlist')->getRemoveUrl($_wishlistItem);
|
191 |
+
|
192 |
+
|
193 |
+
|
194 |
+
?>
|
195 |
+
<?php if($wishlistAjaxStatus): ?>
|
196 |
+
<?php if($wishlistMarkerStatus): ?>
|
197 |
+
<?php if($_product->getId() == $CustomerProductId && $customerId != null):?>
|
198 |
+
|
199 |
+
<div id="wishlist_list">
|
200 |
+
<div class="ajax_loadder"><span id='ajax_loading_list<?php echo $_product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif')?>'/></span></div>
|
201 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:visible;" onclick='func_removeListItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
202 |
+
|
203 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="visibility:hidden;" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
204 |
+
</div>
|
205 |
+
|
206 |
+
<?php else: ?>
|
207 |
+
<div id="wishlist_list">
|
208 |
+
<div class="ajax_loadder"><span id='ajax_loading_list<?php echo $_product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif')?>'/></span></div>
|
209 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
210 |
+
<?php //after select ?>
|
211 |
+
|
212 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:hidden;" onclick='func_removeListItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
213 |
+
</div>
|
214 |
+
<?php endif; ?>
|
215 |
+
|
216 |
+
|
217 |
+
<a href='<?php echo $this->helper("ajaxwishlist")->getWishlistUrl(); ?>' id="popup_wishlist_<?php echo $_product->getId() ?>" rel='iframe' title=' :: :: width: <?php echo $wishlistPopModeWidht ?>, height: <?php echo $wishlistPopModeHeight ?>' class='lightview'></a>
|
218 |
+
|
219 |
+
<?php endif; ?>
|
220 |
+
|
221 |
+
<?php else: ?>
|
222 |
+
<?php if($wishlistMarkerStatus): ?>
|
223 |
+
<?php if($_product->getId() == $CustomerProductId && $customerId != null):?>
|
224 |
+
|
225 |
+
<div id="wishlist_list">
|
226 |
+
|
227 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:visible;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
228 |
+
|
229 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="visibility:hidden;" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
230 |
+
</div>
|
231 |
+
|
232 |
+
<?php else: ?>
|
233 |
+
<div id="wishlist_list">
|
234 |
+
|
235 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
236 |
+
<?php //after select ?>
|
237 |
+
|
238 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:hidden;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
239 |
+
</div>
|
240 |
+
<?php endif; ?>
|
241 |
+
<?php endif; ?>
|
242 |
+
<?php endif; ?>
|
243 |
+
|
244 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
|
245 |
+
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
|
246 |
+
</a>
|
247 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
248 |
+
<?php if($_product->getRatingSummary()): ?>
|
249 |
+
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
|
250 |
+
<?php endif; ?>
|
251 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
252 |
+
<div class="actions">
|
253 |
+
<?php if($_product->isSaleable()): ?>
|
254 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>?options=cart')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
255 |
+
<?php else: ?>
|
256 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
257 |
+
<?php endif; ?>
|
258 |
+
|
259 |
+
<?php if($wishlistAjaxStatus): ?>
|
260 |
+
<ul class="add-to-links">
|
261 |
+
<?php if($_product->getId() == $CustomerProductId && $customerId != null):?>
|
262 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
263 |
+
<li id="Remove_Link_<?php echo $_product->getId()?>" style="display: block;"><a class="link_AddtoWishlist" id="Remove_Link_<?php echo $_product->getId()?>" href="javascript:void(0);" onclick='func_removeItemFromLink("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Remove to Wishlist') ?></a>
|
264 |
+
<span id='ajax_loading_remove<?php echo $_product->getId()?>' class="link_loader" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
265 |
+
</li>
|
266 |
+
<li id="Add_Item_Link_<?php echo $_product->getId()?>" style="display: none;"><a class="link_AddtoWishlist" href="javascript:void(0);" onclick='ajaxWishlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
|
267 |
+
<span id='ajax_loading<?php echo $_product->getId()?>' class="link_loader" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
268 |
+
</li>
|
269 |
+
<?php endif; ?>
|
270 |
+
<?php else: ?>
|
271 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
272 |
+
<li id="Remove_Link_<?php echo $_product->getId()?>" style="display: none;"><a class="link_AddtoWishlist" id="Remove_Link_<?php echo $_product->getId()?>" href="javascript:void(0);" onclick='func_removeItemFromLink("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Remove to Wishlist') ?></a>
|
273 |
+
<span id='ajax_loading_remove<?php echo $_product->getId()?>' class="link_loader" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
274 |
+
</li>
|
275 |
+
<li id="Add_Item_Link_<?php echo $_product->getId()?>" style="display: block"><a class="link_AddtoWishlist" href="javascript:void(0);" onclick='ajaxWishlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
|
276 |
+
<span id='ajax_loading<?php echo $_product->getId()?>' class="link_loader" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
277 |
+
</li>
|
278 |
+
<?php endif; ?>
|
279 |
+
<?php endif; ?>
|
280 |
+
|
281 |
+
|
282 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
283 |
+
<li><span class="separator">|</span> <a href="#" onclick='ajaxCompare("<?php echo $_compareUrl ?>","<?php echo $_product->getId()?>");return false;' class="link-compare"><?php echo $this->__('Add to Compare') ?></a>
|
284 |
+
<span id='ajax_compare_loading<?php echo $_product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
285 |
+
</li>
|
286 |
+
<?php endif; ?>
|
287 |
+
</ul>
|
288 |
+
<?php else: ?>
|
289 |
+
<ul class="add-to-links">
|
290 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
291 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
|
292 |
+
|
293 |
+
</li>
|
294 |
+
<?php endif; ?>
|
295 |
+
|
296 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
297 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a>
|
298 |
+
|
299 |
+
</li>
|
300 |
+
<?php endif; ?>
|
301 |
+
</ul>
|
302 |
+
<?php endif; ?>
|
303 |
+
|
304 |
+
</div>
|
305 |
+
</li>
|
306 |
+
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
|
307 |
+
</ul>
|
308 |
+
<?php endif ?>
|
309 |
+
<?php endforeach ?>
|
310 |
+
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
|
311 |
+
<?php endif; ?>
|
312 |
+
|
313 |
+
<div class="toolbar-bottom">
|
314 |
+
<?php echo $this->getToolbarHtml() ?>
|
315 |
+
</div>
|
316 |
+
</div>
|
317 |
+
<?php endif; ?>
|
318 |
+
<style type="text/css">
|
319 |
+
|
320 |
+
|
321 |
+
.category-products #wishlist_list .wishlist_button
|
322 |
+
{
|
323 |
+
background: url('<?php echo $this->getSkinUrl("images/ajaxWishlist/star_empty.png")?>') no-repeat;
|
324 |
+
}
|
325 |
+
.category-products #wishlist_list .wishlist_button_select
|
326 |
+
{
|
327 |
+
background: url('<?php echo $this->getSkinUrl("images/ajaxWishlist/star_select.png")?>') no-repeat;
|
328 |
+
}
|
329 |
+
</style>
|
app/design/frontend/base/default/template/ajaxwishlist/catalog/product/list/related.phtml
ADDED
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php if($this->getItems()->getSize()): ?>
|
28 |
+
<div class="block block-related">
|
29 |
+
<div class="block-title">
|
30 |
+
<strong><span><?php echo $this->__('Related Products') ?></span></strong>
|
31 |
+
</div>
|
32 |
+
<div class="block-content">
|
33 |
+
<p class="block-subtitle"><?php echo $this->__('Check items to add to the cart or') ?> <a href="#" onclick="selectAllRelated(this); return false;"><?php echo $this->__('select all') ?></a></p>
|
34 |
+
<ol class="mini-products-list" id="block-related">
|
35 |
+
<?php foreach($this->getItems() as $_item): ?>
|
36 |
+
<li class="item">
|
37 |
+
<?php if(!$_item->isComposite() && $_item->isSaleable()): ?>
|
38 |
+
<?php if (!$_item->getRequiredOptions()): ?>
|
39 |
+
<input type="checkbox" class="checkbox related-checkbox" id="related-checkbox<?php echo $_item->getId() ?>" name="related_products[]" value="<?php echo $_item->getId() ?>" />
|
40 |
+
<?php endif; ?>
|
41 |
+
<?php endif; ?>
|
42 |
+
<div class="product">
|
43 |
+
<!-- Ad Product To wishlist Using Ajax -->
|
44 |
+
<?php
|
45 |
+
|
46 |
+
if($customer = Mage::getSingleton('customer/session')->isLoggedIn()) {
|
47 |
+
$customerId = Mage::getModel('customer/session')->getCustomer()->getId();
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
$_wishlistItem = Mage::getModel('wishlist/item')->loadByProductWishlist(
|
52 |
+
$this->helper('wishlist')->getWishlist()->getId(),
|
53 |
+
$_item->getId(),
|
54 |
+
$_item->getStoreId());
|
55 |
+
|
56 |
+
|
57 |
+
$CustomerWishlistId = $_wishlistItem->getWishlistId();
|
58 |
+
$CustomerProductId = $_wishlistItem->getproductId();
|
59 |
+
|
60 |
+
$wishlistPopModeUrl = $this->helper("ajaxwishlist")->getWishlistUrl();
|
61 |
+
$wishlistAjaxStatus = $this->helper("ajaxwishlist")->getWishlistAjaxMode();
|
62 |
+
$wishlistPopModeWidht = $this->helper("ajaxwishlist")->getWishlistPopupWidth();
|
63 |
+
$wishlistPopModeHeight = $this->helper("ajaxwishlist")->getWishlistPopupHeight();
|
64 |
+
$wishlistMarkerStatus = $this->helper("ajaxwishlist")->getMarkerStatus();
|
65 |
+
$_wishlistRemoveUrl = $this->helper('wishlist')->getRemoveUrl($_wishlistItem);
|
66 |
+
|
67 |
+
|
68 |
+
?>
|
69 |
+
|
70 |
+
<a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>" class="product-image">
|
71 |
+
|
72 |
+
<?php if($wishlistAjaxStatus): ?>
|
73 |
+
<?php if($wishlistMarkerStatus): ?>
|
74 |
+
<?php if ($_item->getId() == $CustomerProductId && $customerId != null): ?>
|
75 |
+
|
76 |
+
<div id="wishlist_list">
|
77 |
+
<div class="ajax_loadder"><span id='ajax_loading_list<?php echo $_item->getId() ?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif') ?>'/></span></div>
|
78 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:visible;" onclick='func_removeListItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_item->getId() ?>");return false;' name="add_wishlist<?php echo $_item->getId() ?>" id="wishlist_unselect_<?php echo $_item->getId() ?>" />
|
79 |
+
|
80 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="visibility:hidden;" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($_item) ?>","<?php echo $_item->getId() ?>");return false;' name="add_wishlist<?php echo $_item->getId() ?>" id="wishlist_select_<?php echo $_item->getId() ?>" />
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<?php else: ?>
|
84 |
+
<div id="wishlist_list">
|
85 |
+
<div class="ajax_loadder"><span id='ajax_loading_list<?php echo $_item->getId() ?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif') ?>'/></span></div>
|
86 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($_item) ?>","<?php echo $_item->getId() ?>");return false;' name="add_wishlist<?php echo $_item->getId() ?>" id="wishlist_select_<?php echo $_item->getId() ?>" />
|
87 |
+
<?php //after select ?>
|
88 |
+
|
89 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:hidden;" onclick='func_removeListItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_item->getId() ?>");return false;' name="add_wishlist<?php echo $_item->getId() ?>" id="wishlist_unselect_<?php echo $_item->getId() ?>" />
|
90 |
+
</div>
|
91 |
+
<?php endif; ?>
|
92 |
+
|
93 |
+
<img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50) ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" />
|
94 |
+
</a>
|
95 |
+
|
96 |
+
<a href='<?php echo $this->helper("ajaxwishlist")->getWishlistUrl(); ?>' id="popup_wishlist_<?php echo $_item->getId() ?>" rel='iframe' title=' :: :: width: <?php echo $wishlistPopModeWidht ?>, height: <?php echo $wishlistPopModeHeight ?>' class='lightview'></a>
|
97 |
+
|
98 |
+
<?php endif; ?>
|
99 |
+
<?php else: ?>
|
100 |
+
<?php if($wishlistMarkerStatus): ?>
|
101 |
+
<?php if($_item->getId() == $CustomerProductId && $customerId != null):?>
|
102 |
+
|
103 |
+
<div id="wishlist_list">
|
104 |
+
|
105 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:visible;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_item->getId()?>");return false;' name="add_wishlist<?php echo $_item->getId() ?>" id="wishlist_unselect_<?php echo $_item->getId() ?>" />
|
106 |
+
|
107 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="visibility:hidden;" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($_item) ?>","<?php echo $_item->getId()?>");return false;' name="add_wishlist<?php echo $_item->getId() ?>" id="wishlist_select_<?php echo $_item->getId() ?>" />
|
108 |
+
</div>
|
109 |
+
|
110 |
+
<?php else: ?>
|
111 |
+
<div id="wishlist_list">
|
112 |
+
|
113 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($_item) ?>","<?php echo $_item->getId()?>");return false;' name="add_wishlist<?php echo $_item->getId() ?>" id="wishlist_select_<?php echo $_item->getId() ?>" />
|
114 |
+
<?php //after select ?>
|
115 |
+
|
116 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:hidden;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_item->getId()?>");return false;' name="add_wishlist<?php echo $_item->getId() ?>" id="wishlist_unselect_<?php echo $_item->getId() ?>" />
|
117 |
+
</div>
|
118 |
+
<?php endif; ?>
|
119 |
+
|
120 |
+
<img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50) ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" />
|
121 |
+
</a>
|
122 |
+
|
123 |
+
<?php endif; ?>
|
124 |
+
<?php endif; ?>
|
125 |
+
|
126 |
+
<div class="product-details">
|
127 |
+
<p class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></p>
|
128 |
+
<?php echo $this->getPriceHtml($_item, true, '-related') ?>
|
129 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
130 |
+
<a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
|
131 |
+
<?php endif; ?>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
</li>
|
135 |
+
<?php endforeach ?>
|
136 |
+
</ol>
|
137 |
+
<script type="text/javascript">decorateList('block-related', 'none-recursive')</script>
|
138 |
+
</div>
|
139 |
+
<script type="text/javascript">
|
140 |
+
//<![CDATA[
|
141 |
+
$$('.related-checkbox').each(function(elem){
|
142 |
+
Event.observe(elem, 'click', addRelatedToProduct)
|
143 |
+
});
|
144 |
+
|
145 |
+
var relatedProductsCheckFlag = false;
|
146 |
+
function selectAllRelated(txt){
|
147 |
+
if (relatedProductsCheckFlag == false) {
|
148 |
+
$$('.related-checkbox').each(function(elem){
|
149 |
+
elem.checked = true;
|
150 |
+
});
|
151 |
+
relatedProductsCheckFlag = true;
|
152 |
+
txt.innerHTML="<?php echo $this->__('unselect all') ?>";
|
153 |
+
} else {
|
154 |
+
$$('.related-checkbox').each(function(elem){
|
155 |
+
elem.checked = false;
|
156 |
+
});
|
157 |
+
relatedProductsCheckFlag = false;
|
158 |
+
txt.innerHTML="<?php echo $this->__('select all') ?>";
|
159 |
+
}
|
160 |
+
addRelatedToProduct();
|
161 |
+
}
|
162 |
+
|
163 |
+
function addRelatedToProduct(){
|
164 |
+
var checkboxes = $$('.related-checkbox');
|
165 |
+
var values = [];
|
166 |
+
for(var i=0;i<checkboxes.length;i++){
|
167 |
+
if(checkboxes[i].checked) values.push(checkboxes[i].value);
|
168 |
+
}
|
169 |
+
if($('related-products-field')){
|
170 |
+
$('related-products-field').value = values.join(',');
|
171 |
+
}
|
172 |
+
}
|
173 |
+
//]]>
|
174 |
+
</script>
|
175 |
+
</div>
|
176 |
+
<?php endif ?>
|
177 |
+
<style type="text/css">
|
178 |
+
|
179 |
+
.block-related .block-content #wishlist_list .wishlist_button
|
180 |
+
{
|
181 |
+
background: url('<?php echo $this->getSkinUrl("images/ajaxWishlist/star_empty.png")?>') no-repeat;
|
182 |
+
}
|
183 |
+
.block-related .block-content #wishlist_list .wishlist_button_select
|
184 |
+
{
|
185 |
+
background: url('<?php echo $this->getSkinUrl("images/ajaxWishlist/star_select.png")?>') no-repeat;
|
186 |
+
|
187 |
+
}
|
188 |
+
|
189 |
+
</style>
|
app/design/frontend/base/default/template/ajaxwishlist/catalog/product/view/addto.phtml
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $_product = $this->getProduct(); ?>
|
2 |
+
<?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrl($_product);
|
3 |
+
$wishlistPopModeUrl = $this->helper("ajaxwishlist")->getWishlistUrl();
|
4 |
+
$wishlistAjaxStatus = $this->helper("ajaxwishlist")->getWishlistAjaxMode();
|
5 |
+
$wishlistPopModeWidht = $this->helper("ajaxwishlist")->getWishlistPopupWidth();
|
6 |
+
$wishlistPopModeHeight = $this->helper("ajaxwishlist")->getWishlistPopupHeight();
|
7 |
+
$wishlistSidebarPosition = $this->helper("ajaxwishlist")->getWishlistSidebarPositionShow();
|
8 |
+
$wishlistMarkerStatus = $this->helper("ajaxwishlist")->getMarkerStatus();
|
9 |
+
|
10 |
+
$_wishlistItem = Mage::getModel('wishlist/item')->loadByProductWishlist(
|
11 |
+
$this->helper('wishlist')->getWishlist()->getId(),
|
12 |
+
$_product->getId(),
|
13 |
+
$_product->getStoreId());
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
if($customer = Mage::getSingleton('customer/session')->isLoggedIn()) {
|
18 |
+
$customerId = Mage::getModel('customer/session')->getCustomer()->getId();
|
19 |
+
|
20 |
+
}
|
21 |
+
|
22 |
+
$CustomerWishlistId = $_wishlistItem->getWishlistId();
|
23 |
+
$CustomerProductId = $_wishlistItem->getproductId();
|
24 |
+
|
25 |
+
|
26 |
+
$_wishlistRemoveUrl = $this->helper('wishlist')->getRemoveUrl($_wishlistItem);
|
27 |
+
|
28 |
+
?>
|
29 |
+
|
30 |
+
<ul class="add-to-links">
|
31 |
+
<?php if($wishlistAjaxStatus): ?>
|
32 |
+
|
33 |
+
<?php if($_product->getId() == $CustomerProductId && $customerId != null):?>
|
34 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
35 |
+
<li id="Remove_Link_<?php echo $_product->getId()?>" style="display: block;">
|
36 |
+
<a style="display: block;" id="Remove_Link_<?php echo $_product->getId()?>" href="javascript:void(0);" onclick='func_removeItemFromLink("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Remove to Wishlist') ?>
|
37 |
+
<span id='ajax_loading_remove<?php echo $_product->getId()?>' class="link_loader Wishlst_custom_option" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
38 |
+
</a>
|
39 |
+
|
40 |
+
</li>
|
41 |
+
<li id="Add_Item_Link_<?php echo $_product->getId()?>" style="display: none;">
|
42 |
+
<a style="display: none;" href="javascript:void(0);" onclick='ajaxWishlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?>
|
43 |
+
<span id='ajax_loading<?php echo $_product->getId()?>' class="link_loader Wishlst_custom_option" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
44 |
+
</a>
|
45 |
+
|
46 |
+
</li>
|
47 |
+
<?php endif; ?>
|
48 |
+
<?php else: ?>
|
49 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
50 |
+
<li id="Remove_Link_<?php echo $_product->getId()?>" style="display: none;">
|
51 |
+
<a style="display: none;" id="Remove_Link_<?php echo $_product->getId()?>" href="javascript:void(0);" onclick='func_removeItemFromLink("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Remove to Wishlist') ?>
|
52 |
+
<span id='ajax_loading_remove<?php echo $_product->getId()?>' class="link_loader Wishlst_custom_option" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
53 |
+
</a>
|
54 |
+
</li>
|
55 |
+
<li id="Add_Item_Link_<?php echo $_product->getId()?>" style="display: block;">
|
56 |
+
<a style="display: block;" href="javascript:void(0);" onclick='ajaxWishlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?>
|
57 |
+
<span id='ajax_loading<?php echo $_product->getId()?>' class="link_loader Wishlst_custom_option " style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
58 |
+
</a>
|
59 |
+
|
60 |
+
</li>
|
61 |
+
<?php endif; ?>
|
62 |
+
<?php endif; ?>
|
63 |
+
|
64 |
+
|
65 |
+
<?php /* if ($this->helper('wishlist')->isAllow()) : ?>
|
66 |
+
<li><a href="#" onclick="wishlistForm.submitAjaxWishlist(this, '<?php echo $_wishlistSubmitUrl ?>','<?php echo $_product->getId()?>'); return false;" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
|
67 |
+
<span id='ajax_loading<?php echo $_product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif')?>'/></span>
|
68 |
+
</li>
|
69 |
+
<?php endif; */ ?>
|
70 |
+
|
71 |
+
|
72 |
+
<?php
|
73 |
+
$_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product);
|
74 |
+
?>
|
75 |
+
<?php if($_compareUrl) : ?>
|
76 |
+
<li><a href="#" class="link_Addtocompare" onclick="ajaxCompare('<?php echo $_compareUrl?>','<?php echo $_product->getId()?>'); return false;" class="link-compare"><?php echo $this->__('Add to Compare') ?>
|
77 |
+
<span id='ajax_compare_loading<?php echo $_product->getId()?>' class="link_loader" style='display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif')?>'/></span>
|
78 |
+
</a>
|
79 |
+
</li>
|
80 |
+
<?php endif; ?>
|
81 |
+
|
82 |
+
|
83 |
+
<?php else: ?>
|
84 |
+
|
85 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
86 |
+
<li><a href="<?php echo $_wishlistSubmitUrl ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
|
87 |
+
|
88 |
+
</li>
|
89 |
+
<?php endif; ?>
|
90 |
+
<?php
|
91 |
+
$_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product);
|
92 |
+
?>
|
93 |
+
<?php if($_compareUrl) : ?>
|
94 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a>
|
95 |
+
|
96 |
+
</li>
|
97 |
+
<?php endif; ?>
|
98 |
+
|
99 |
+
|
100 |
+
<?php endif; ?>
|
101 |
+
|
102 |
+
</ul>
|
103 |
+
|
104 |
+
<script type="text/javascript">
|
105 |
+
var wishlistForm = new VarienForm('product_addtocart_form');
|
106 |
+
wishlistForm.submitAjaxWishlist = function(button, url,id){
|
107 |
+
if(this.validator) {
|
108 |
+
var nv = Validation.methods;
|
109 |
+
delete Validation.methods['required-entry'];
|
110 |
+
delete Validation.methods['validate-one-required'];
|
111 |
+
delete Validation.methods['validate-one-required-by-name'];
|
112 |
+
if (this.validator.validate()) {
|
113 |
+
url = url.replace("wishlist/index","ajaxwishlist/index");
|
114 |
+
var data = $('product_addtocart_form').serialize();
|
115 |
+
//data += '&isAjax=1';
|
116 |
+
$('ajax_loading'+id).show();
|
117 |
+
new Ajax.Request(url+'&isAjax=1', {
|
118 |
+
method:'Post',
|
119 |
+
dataType : 'json',
|
120 |
+
contentType : 'application/json',
|
121 |
+
parameters: {data:data},
|
122 |
+
onSuccess: function(transport) {
|
123 |
+
$('ajax_loading'+id).hide();
|
124 |
+
|
125 |
+
var response = transport.responseText.evalJSON(true);
|
126 |
+
|
127 |
+
if(response.status == "ERROR")
|
128 |
+
{
|
129 |
+
alert(response.message);
|
130 |
+
}
|
131 |
+
else
|
132 |
+
{
|
133 |
+
alert(response.message);
|
134 |
+
|
135 |
+
$$('ul.links').each(function(element) {
|
136 |
+
element.replace(response.toplink);
|
137 |
+
});
|
138 |
+
|
139 |
+
if($$('div.block-wishlist').length == 1){
|
140 |
+
|
141 |
+
$$('div.block-wishlist').each(function(element) {
|
142 |
+
element.replace(response.sidebar);
|
143 |
+
});
|
144 |
+
|
145 |
+
}
|
146 |
+
else
|
147 |
+
{
|
148 |
+
|
149 |
+
if($$('.col-right').length == 1 && $$('.col-left').length == 0){
|
150 |
+
|
151 |
+
$$(".col-right").each(function(element){
|
152 |
+
element.insert(response.sidebar);
|
153 |
+
});
|
154 |
+
}
|
155 |
+
|
156 |
+
if($$('.col-left').length == 1 && $$('.col-right').length == 0){
|
157 |
+
|
158 |
+
$$(".col-left").each(function(element){
|
159 |
+
element.insert(response.sidebar);
|
160 |
+
});
|
161 |
+
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
}
|
166 |
+
},
|
167 |
+
|
168 |
+
onFailure: function() {
|
169 |
+
alert('Please Try Again..');
|
170 |
+
}
|
171 |
+
});
|
172 |
+
|
173 |
+
}
|
174 |
+
Object.extend(Validation.methods, nv);
|
175 |
+
}
|
176 |
+
}.bind(wishlistForm);
|
177 |
+
</script>
|
app/design/frontend/base/default/template/ajaxwishlist/catalog/product/view/addto_jQ.phtml
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $_product = $this->getProduct(); ?>
|
2 |
+
<?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrl($_product); ?>
|
3 |
+
|
4 |
+
<ul class="add-to-links">
|
5 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
6 |
+
<li><a href="#" onclick="wishlistForm.submitAjaxWishlist(this, '<?php echo $_wishlistSubmitUrl ?>','<?php echo $_product->getId()?>'); return false;" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
7 |
+
<?php endif; ?>
|
8 |
+
<?php
|
9 |
+
$_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product);
|
10 |
+
?>
|
11 |
+
<?php if($_compareUrl) : ?>
|
12 |
+
<li><span class="separator">|</span> <a href="#" onclick="ajaxCompare('<?php echo $_compareUrl?>','<?php echo $_product->getId()?>'); return false;" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
13 |
+
<?php endif; ?>
|
14 |
+
<li><span id='ajax_loading<?php echo $_product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span></li>
|
15 |
+
</ul>
|
16 |
+
<script type="text/javascript">
|
17 |
+
var wishlistForm = new VarienForm('product_addtocart_form');
|
18 |
+
wishlistForm.submitAjaxWishlist = function(button, url,id){
|
19 |
+
if(this.validator) {
|
20 |
+
var nv = Validation.methods;
|
21 |
+
delete Validation.methods['required-entry'];
|
22 |
+
delete Validation.methods['validate-one-required'];
|
23 |
+
delete Validation.methods['validate-one-required-by-name'];
|
24 |
+
if (this.validator.validate()) {
|
25 |
+
url = url.replace("wishlist/index","ajaxwishlist/index");
|
26 |
+
var data = jQuery('#product_addtocart_form').serialize();
|
27 |
+
data += '&isAjax=1';
|
28 |
+
jQuery('#ajax_loading'+id).show();
|
29 |
+
jQuery.ajax( {
|
30 |
+
url : url,
|
31 |
+
dataType : 'json',
|
32 |
+
type : 'post',
|
33 |
+
data : data,
|
34 |
+
success : function(data) {
|
35 |
+
jQuery('#ajax_loading'+id).hide();
|
36 |
+
if(data.status == 'ERROR'){
|
37 |
+
alert(data.message);
|
38 |
+
}else{
|
39 |
+
alert(data.message);
|
40 |
+
if(jQuery('.block-wishlist').length){
|
41 |
+
jQuery('.block-wishlist').replaceWith(data.sidebar);
|
42 |
+
}else{
|
43 |
+
if(jQuery('.col-right').length){
|
44 |
+
jQuery('.col-right').prepend(data.sidebar);
|
45 |
+
}
|
46 |
+
}
|
47 |
+
if(jQuery('.header .links').length){
|
48 |
+
jQuery('.header .links').replaceWith(data.toplink);
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
});
|
53 |
+
}
|
54 |
+
Object.extend(Validation.methods, nv);
|
55 |
+
}
|
56 |
+
}.bind(wishlistForm);
|
57 |
+
</script>
|
app/design/frontend/base/default/template/ajaxwishlist/catalog/product/view/media.phtml
ADDED
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Product media data template
|
29 |
+
*
|
30 |
+
* @see Mage_Catalog_Block_Product_View_Media
|
31 |
+
*/
|
32 |
+
?>
|
33 |
+
<?php
|
34 |
+
$_product = $this->getProduct();
|
35 |
+
$_helper = $this->helper('catalog/output');
|
36 |
+
?>
|
37 |
+
<?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
|
38 |
+
<?php
|
39 |
+
|
40 |
+
if($customer = Mage::getSingleton('customer/session')->isLoggedIn()) {
|
41 |
+
$customerId = Mage::getModel('customer/session')->getCustomer()->getId();
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
$_wishlistItem = Mage::getModel('wishlist/item')->loadByProductWishlist(
|
46 |
+
$this->helper('wishlist')->getWishlist()->getId(),
|
47 |
+
$_product->getId(),
|
48 |
+
$_product->getStoreId());
|
49 |
+
|
50 |
+
|
51 |
+
$CustomerWishlistId = $_wishlistItem->getWishlistId();
|
52 |
+
$CustomerProductId = $_wishlistItem->getproductId();
|
53 |
+
|
54 |
+
$wishlistPopModeUrl = $this->helper("ajaxwishlist")->getWishlistUrl();
|
55 |
+
$wishlistPopModeStatus = $this->helper("ajaxwishlist")->getWishlistAjaxMode();
|
56 |
+
$wishlistPopModeWidht = $this->helper("ajaxwishlist")->getWishlistPopupWidth();
|
57 |
+
$wishlistPopModeHeight = $this->helper("ajaxwishlist")->getWishlistPopupHeight();
|
58 |
+
$wishlistAjaxStatus = $this->helper("ajaxwishlist")->getWishlistAjaxMode();
|
59 |
+
$wishlistMarkerStatus = $this->helper("ajaxwishlist")->getMarkerStatus();
|
60 |
+
$wishlistSidebarPosition = $this->helper("ajaxwishlist")->getWishlistSidebarPositionShow();
|
61 |
+
$_wishlistRemoveUrl = $this->helper('wishlist')->getRemoveUrl($_wishlistItem);
|
62 |
+
|
63 |
+
|
64 |
+
?>
|
65 |
+
<?php if($wishlistAjaxStatus): ?>
|
66 |
+
<?php if ($wishlistMarkerStatus): ?>
|
67 |
+
|
68 |
+
<?php if ($_product->getId() == $CustomerProductId && $customerId != null): ?>
|
69 |
+
|
70 |
+
<div id="wishlist_list">
|
71 |
+
<div class="ajax_loadder"><span id='ajax_loading_list<?php echo $_product->getId() ?>' style='position: relative;z-index: 10;display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif') ?>'/></span></div>
|
72 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="z-index:10;visibility:visible;" onclick='func_removeListItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
73 |
+
|
74 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="z-index:10;visibility:hidden;" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
75 |
+
</div>
|
76 |
+
|
77 |
+
<?php else: ?>
|
78 |
+
<div id="wishlist_list">
|
79 |
+
<div class="ajax_loadder"><span id='ajax_loading_list<?php echo $_product->getId() ?>' style='position: relative;z-index: 10;display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif') ?>'/></span></div>
|
80 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' style="z-index:10;" name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
81 |
+
<?php //after select ?>
|
82 |
+
|
83 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="z-index:10;visibility:hidden;" onclick='func_removeListItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' style="z-index:10;" name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
84 |
+
</div>
|
85 |
+
<?php endif; ?>
|
86 |
+
|
87 |
+
<a href='<?php echo $this->helper("ajaxwishlist")->getWishlistUrl(); ?>' id="popup_wishlist_<?php echo $_product->getId() ?>" rel='iframe' title=' :: :: width: <?php echo $wishlistPopModeWidht ?>, height: <?php echo $wishlistPopModeHeight ?>' class='lightview'></a>
|
88 |
+
|
89 |
+
<?php endif; ?>
|
90 |
+
|
91 |
+
<?php else: ?>
|
92 |
+
<?php if ($wishlistMarkerStatus): ?>
|
93 |
+
|
94 |
+
<?php if ($_product->getId() == $CustomerProductId && $customerId != null): ?>
|
95 |
+
|
96 |
+
<div id="wishlist_list">
|
97 |
+
|
98 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="z-index:10;visibility:visible;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
99 |
+
|
100 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="z-index:10;visibility:hidden;" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<?php else: ?>
|
104 |
+
<div id="wishlist_list">
|
105 |
+
|
106 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" style="z-index:10;" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
107 |
+
<?php //after select ?>
|
108 |
+
|
109 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="z-index:10;visibility:hidden;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' style="z-index:10;" name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
110 |
+
</div>
|
111 |
+
<?php endif; ?>
|
112 |
+
|
113 |
+
<?php endif; ?>
|
114 |
+
|
115 |
+
<?php endif; ?>
|
116 |
+
<p class="product-image product-image-zoom">
|
117 |
+
|
118 |
+
<?php
|
119 |
+
$_img = '<img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image').'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
|
120 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
121 |
+
?>
|
122 |
+
</p>
|
123 |
+
|
124 |
+
<p class="zoom-notice" id="track_hint"><?php echo $this->__('Double click on above image to view full picture') ?></p>
|
125 |
+
<div class="zoom">
|
126 |
+
<img id="zoom_out" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_out.gif') ?>" alt="<?php echo $this->__('Zoom Out') ?>" title="<?php echo $this->__('Zoom Out') ?>" class="btn-zoom-out" />
|
127 |
+
<div id="track">
|
128 |
+
<div id="handle"></div>
|
129 |
+
</div>
|
130 |
+
<img id="zoom_in" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_in.gif') ?>" alt="<?php echo $this->__('Zoom In') ?>" title="<?php echo $this->__('Zoom In') ?>" class="btn-zoom-in" />
|
131 |
+
</div>
|
132 |
+
<script type="text/javascript">
|
133 |
+
//<![CDATA[
|
134 |
+
Event.observe(window, 'load', function() {
|
135 |
+
product_zoom = new Product.Zoom('image', 'track', 'handle', 'zoom_in', 'zoom_out', 'track_hint');
|
136 |
+
});
|
137 |
+
//]]>
|
138 |
+
</script>
|
139 |
+
<?php else: ?>
|
140 |
+
<p class="product-image">
|
141 |
+
|
142 |
+
<?php
|
143 |
+
|
144 |
+
if($customer = Mage::getSingleton('customer/session')->isLoggedIn()) {
|
145 |
+
$customerId = Mage::getModel('customer/session')->getCustomer()->getId();
|
146 |
+
|
147 |
+
}
|
148 |
+
|
149 |
+
$_wishlistItem = Mage::getModel('wishlist/item')->loadByProductWishlist(
|
150 |
+
$this->helper('wishlist')->getWishlist()->getId(),
|
151 |
+
$_product->getId(),
|
152 |
+
$_product->getStoreId());
|
153 |
+
|
154 |
+
|
155 |
+
$CustomerWishlistId = $_wishlistItem->getWishlistId();
|
156 |
+
$CustomerProductId = $_wishlistItem->getproductId();
|
157 |
+
|
158 |
+
$wishlistPopModeUrl = $this->helper("ajaxwishlist")->getWishlistUrl();
|
159 |
+
$wishlistPopModeStatus = $this->helper("ajaxwishlist")->getWishlistAjaxMode();
|
160 |
+
$wishlistPopModeWidht = $this->helper("ajaxwishlist")->getWishlistPopupWidth();
|
161 |
+
$wishlistPopModeHeight = $this->helper("ajaxwishlist")->getWishlistPopupHeight();
|
162 |
+
$wishlistAjaxStatus = $this->helper("ajaxwishlist")->getWishlistAjaxMode();
|
163 |
+
$wishlistMarkerStatus = $this->helper("ajaxwishlist")->getMarkerStatus();
|
164 |
+
$_wishlistRemoveUrl = $this->helper('wishlist')->getRemoveUrl($_wishlistItem);
|
165 |
+
$wishlistSidebarPosition = $this->helper("ajaxwishlist")->getWishlistSidebarPositionShow();
|
166 |
+
|
167 |
+
|
168 |
+
?>
|
169 |
+
<?php if($wishlistAjaxStatus): ?>
|
170 |
+
<?php if ($wishlistMarkerStatus): ?>
|
171 |
+
|
172 |
+
<?php if ($_product->getId() == $CustomerProductId && $customerId != null): ?>
|
173 |
+
|
174 |
+
<div id="wishlist_list">
|
175 |
+
<div class="ajax_loadder"><span id='ajax_loading_list<?php echo $_product->getId() ?>' style='position: relative;z-index: 10;display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif') ?>'/></span></div>
|
176 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="z-index:10;visibility:visible;" onclick='func_removeListItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
177 |
+
|
178 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="z-index:10;visibility:hidden;" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
179 |
+
</div>
|
180 |
+
|
181 |
+
<?php else: ?>
|
182 |
+
<div id="wishlist_list">
|
183 |
+
<div class="ajax_loadder"><span id='ajax_loading_list<?php echo $_product->getId() ?>' style='position: relative;z-index: 10;display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif') ?>'/></span></div>
|
184 |
+
<input type="button" class="wishlist_button" style="z-index:10;" title="Add Wishlist" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
185 |
+
<?php //after select ?>
|
186 |
+
|
187 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="z-index:10;visibility:hidden;" onclick='func_removeListItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
188 |
+
</div>
|
189 |
+
<?php endif; ?>
|
190 |
+
|
191 |
+
<a href='<?php echo $this->helper("ajaxwishlist")->getWishlistUrl(); ?>' id="popup_wishlist_<?php echo $_product->getId() ?>" rel='iframe' title=' :: :: width: <?php echo $wishlistPopModeWidht ?>, height: <?php echo $wishlistPopModeHeight ?>' class='lightview'></a>
|
192 |
+
|
193 |
+
<?php endif; ?>
|
194 |
+
|
195 |
+
<?php else: ?>
|
196 |
+
<?php if ($wishlistMarkerStatus): ?>
|
197 |
+
|
198 |
+
<?php if ($_product->getId() == $CustomerProductId && $customerId != null): ?>
|
199 |
+
|
200 |
+
<div id="wishlist_list">
|
201 |
+
|
202 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="z-index:10;visibility:visible;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
203 |
+
|
204 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="z-index:10;visibility:hidden;" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
205 |
+
</div>
|
206 |
+
|
207 |
+
<?php else: ?>
|
208 |
+
<div id="wishlist_list">
|
209 |
+
|
210 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" style="z-index:10;" id="wishlist_select_<?php echo $_product->getId() ?>" />
|
211 |
+
<?php //after select ?>
|
212 |
+
|
213 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="z-index:10;visibility:hidden;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $_product->getId() ?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $_product->getId() ?>" id="wishlist_unselect_<?php echo $_product->getId() ?>" />
|
214 |
+
</div>
|
215 |
+
<?php endif; ?>
|
216 |
+
|
217 |
+
<?php endif; ?>
|
218 |
+
|
219 |
+
<?php endif; ?>
|
220 |
+
|
221 |
+
|
222 |
+
<?php
|
223 |
+
$_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
|
224 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
225 |
+
?>
|
226 |
+
</p>
|
227 |
+
<?php endif; ?>
|
228 |
+
<?php if (count($this->getGalleryImages()) > 0): ?>
|
229 |
+
<div class="more-views">
|
230 |
+
<h2><?php echo $this->__('More Views') ?></h2>
|
231 |
+
<ul>
|
232 |
+
<?php foreach ($this->getGalleryImages() as $_image): ?>
|
233 |
+
<li>
|
234 |
+
<a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'width=300,height=300,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
|
235 |
+
</li>
|
236 |
+
<?php endforeach; ?>
|
237 |
+
</ul>
|
238 |
+
</div>
|
239 |
+
<?php endif; ?>
|
240 |
+
|
241 |
+
<style type="text/css">
|
242 |
+
|
243 |
+
|
244 |
+
.product-essential #wishlist_list .wishlist_button{
|
245 |
+
|
246 |
+
background: url('<?php echo $this->getSkinUrl("images/ajaxWishlist/star_empty.png")?>') no-repeat;
|
247 |
+
}
|
248 |
+
|
249 |
+
.product-essential #wishlist_list .wishlist_button_select
|
250 |
+
{
|
251 |
+
background: url('<?php echo $this->getSkinUrl("images/ajaxWishlist/star_select.png")?>') no-repeat;
|
252 |
+
}
|
253 |
+
</style>
|
app/design/frontend/base/default/template/ajaxwishlist/common.phtml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(strstr(strtolower(Mage::helper('core/url')->getCurrentUrl()),'wishlist/index/configure'))
|
3 |
+
{
|
4 |
+
?>
|
5 |
+
<script type="text/javascript">
|
6 |
+
$('wishlist_list').select("input").each(function(ele,index)
|
7 |
+
{
|
8 |
+
ele.removeAttribute("onclick");
|
9 |
+
});
|
10 |
+
</script>
|
11 |
+
<?php
|
12 |
+
}
|
13 |
+
?>
|
14 |
+
<script type="text/javascript">
|
15 |
+
function getBaseUrl()
|
16 |
+
{
|
17 |
+
var baseUrl = '<?php echo str_replace('index.php/', '', $this->getBaseUrl());?>';
|
18 |
+
return baseUrl;
|
19 |
+
}
|
20 |
+
</script>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/button/share.phtml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php if($this->getWishlist()->getItemsCount()): ?>
|
29 |
+
<button type="submit" name="save_and_share" onclick="func_share_Wishlist();" title="<?php echo $this->__('Share Wishlist') ?>" class="button btn-share"><span><span><?php echo $this->__('Share Wishlist') ?></span></span></button>
|
30 |
+
<?php endif;?>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/button/tocart.phtml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php if($this->getWishlist()->getItemsCount() && $this->getWishlist()->isSalable()): ?>
|
29 |
+
<button type="button" title="<?php echo $this->__('Add All to Cart') ?>" onclick="addAllWItemsToCart()" class="button btn-add"><span><span><?php echo $this->__('Add All to Cart') ?></span></span></button>
|
30 |
+
<?php endif;?>
|
31 |
+
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/button/update.phtml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php if($this->getWishlist()->getItemsCount()): ?>
|
29 |
+
<button type="button" onclick="func_updateWishtlist('test');" name="do" title="<?php echo $this->__('Update Wishlist') ?>" class="button btn-update"><span><span><?php echo $this->__('Update Wishlist') ?></span></span></button>
|
30 |
+
<?php endif;?>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/column/cart.phtml
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/* @var $this Mage_Wishlist_Block_Customer_Wishlist_Item_Column_Cart */
|
28 |
+
/* @var Mage_Wishlist_Model_Item $item */
|
29 |
+
$item = $this->getItem();
|
30 |
+
$product = $item->getProduct();
|
31 |
+
?>
|
32 |
+
<div class="cart-cell">
|
33 |
+
<?php // echo $this->getPriceHtml($product);?>
|
34 |
+
<div class="add-to-cart-alt">
|
35 |
+
<?php if ($item->canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?>
|
36 |
+
<div class="lightviewQty"><input type="text" class="input-text qty validate-not-negative-number" name="qty[<?php echo $item->getId() ?>]" value="<?php echo $this->getAddToCartQty($item) * 1 ?>" /></div>
|
37 |
+
<?php endif; ?>
|
38 |
+
<?php if ($product->isSaleable()): ?>
|
39 |
+
<div class="lightviewQty"><button type="button" title="<?php echo $this->__('Add to Cart') ?>" onclick="addpopupItemToCart('<?php echo $this->getItemAddToCartUrl($item->getId()) ?>','<?php echo $item->getId()?>');" class="button btn-cart"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></div>
|
40 |
+
<?php else: ?>
|
41 |
+
<?php if ($product->getIsSalable()): ?>
|
42 |
+
<p class="availability in-stock"><span><?php echo $this->__('In stock') ?></span></p>
|
43 |
+
<?php else: ?>
|
44 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
45 |
+
<?php endif; ?>
|
46 |
+
<?php endif; ?>
|
47 |
+
</div>
|
48 |
+
<?php foreach($this->getSortedChildren() as $childName):?>
|
49 |
+
<?php echo $this->getChildHtml($childName, false);?>
|
50 |
+
<?php endforeach;?>
|
51 |
+
<?php if ($product->isVisibleInSiteVisibility()): ?>
|
52 |
+
<div class="lightviewQty"><p><a class="link-edit" href="javascript:void(0);" onclick="javascript:func_redirectToProduct('<?php echo $this->getItemConfigureUrl($item) ?>')"><?php echo $this->__('Edit') ?></a></p></div>
|
53 |
+
<?php endif ?>
|
54 |
+
</div>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/column/image.phtml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/* @var Mage_Wishlist_Model_Item $item */
|
28 |
+
$item = $this->getItem();
|
29 |
+
$product = $item->getProduct();
|
30 |
+
?>
|
31 |
+
<a class="product-image" href="javascript:void(0);" onclick="javascript:func_redirectToProduct('<?php echo $this->getProductUrl($item) ?>')" title="<?php echo $this->escapeHtml($product->getName()) ?>">
|
32 |
+
<img src="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(113, 113); ?>" width="113" height="113" alt="<?php echo $this->escapeHtml($product->getName()) ?>" />
|
33 |
+
</a>
|
34 |
+
<h3 class="product-name"><a href="javascript:void(0);" onclick="javascript:func_redirectToProduct('<?php echo $this->getProductUrl($item) ?>')" title="<?php echo $this->escapeHtml($product->getName()) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></h3>
|
35 |
+
<div class="price"><?php echo $this->getPriceHtml($product);?></div>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/column/info.phtml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/* @var Mage_Wishlist_Model_Item $item */
|
28 |
+
$item = $this->getItem();
|
29 |
+
$product = $item->getProduct();
|
30 |
+
?>
|
31 |
+
<?php /* <h3 class="product-name"><a href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></h3>
|
32 |
+
<div class="description std"><div class="inner"><?php echo $this->escapeHtml($this->stripTags($product->getShortDescription()));?></div></div> */ ?>
|
33 |
+
<textarea name="description[<?php echo $item->getWishlistItemId() ?>]" rows="3" cols="5" onfocus="focusComment(this)" onblur="focusComment(this)" title="<?php echo $this->__('Comment') ?>"><?php echo ($this->escapeHtml($item->getDescription())) ?></textarea>
|
34 |
+
<?php if($this->getSortedChildren()): ?>
|
35 |
+
<div class="item-manage">
|
36 |
+
<?php foreach($this->getSortedChildren() as $childName):?>
|
37 |
+
<?php echo $this->getChildHtml($childName, false);?>
|
38 |
+
<?php endforeach;?>
|
39 |
+
</div>
|
40 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/column/remove.phtml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
?>
|
28 |
+
<a href="javascript:void(0);" onclick="javascript:lightviewRemoveWishlistItem('<?php echo $this->getItemRemoveUrl($this->getItem()); ?>','<?php echo $this->getId() ?>');" title="<?php echo $this->__('Remove Item') ?>"
|
29 |
+
class="btn-remove btn-remove2"><?php echo $this->__('Remove item');?></a>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/column/remove_bk.phtml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
?>
|
28 |
+
<a href="<?php echo $this->getItemRemoveUrl($this->getItem()); ?>" onclick="return confirmRemoveWishlistItem();" title="<?php echo $this->__('Remove Item') ?>"
|
29 |
+
class="btn-remove btn-remove2"><?php echo $this->__('Remove item');?></a>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/configure/addto.phtml
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php $_wishlistItem = $this->getWishlistItem(); ?>
|
29 |
+
<?php $_wishlistSubmitUrl = $this->helper('wishlist')->getUpdateUrl($_wishlistItem); ?>
|
30 |
+
<ul class="add-to-links">
|
31 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
32 |
+
<li><a href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;" class="link-compare"><?php echo $this->__('Update Wishlist') ?></a></li>
|
33 |
+
<?php endif; ?>
|
34 |
+
<?php $_product = $this->getProduct(); ?>
|
35 |
+
<?php $_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product); ?>
|
36 |
+
<?php if ($_compareUrl) : ?>
|
37 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
38 |
+
<?php endif; ?>
|
39 |
+
</ul>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/item/list.phtml
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
$columns = $this->getColumns();
|
29 |
+
?>
|
30 |
+
<table class="data-table" id="wishlist-table">
|
31 |
+
<thead>
|
32 |
+
<tr>
|
33 |
+
<?php foreach ($columns as $column): ?>
|
34 |
+
<th><?php echo $column->getTitle();?></th>
|
35 |
+
<?php endforeach; ?>
|
36 |
+
</tr>
|
37 |
+
</thead>
|
38 |
+
<tbody>
|
39 |
+
<?php if (count($this->getItems())): ?>
|
40 |
+
<?php foreach ($this->getItems() as $item): ?>
|
41 |
+
<tr id="item_<?php echo $item->getId();?>">
|
42 |
+
<?php foreach ($columns as $column): ?>
|
43 |
+
<td><?php $column->setItem($item); echo $column->toHtml($item);?></td>
|
44 |
+
<?php endforeach; ?>
|
45 |
+
</tr>
|
46 |
+
<?php endforeach ?>
|
47 |
+
<?php else: ?>
|
48 |
+
<td colspan="<?php echo count($columns);?>" class="wishlist-empty"><?php echo $this->__('This Wishlist has no Items');?></td>
|
49 |
+
<?php endif; ?>
|
50 |
+
</tbody>
|
51 |
+
</table>
|
52 |
+
<?php foreach ($columns as $column): ?>
|
53 |
+
<?php echo $column->getAdditionalHtml();?>
|
54 |
+
<?php endforeach; ?>
|
55 |
+
<script type="text/javascript">
|
56 |
+
//<![CDATA[
|
57 |
+
decorateTable('wishlist-table');
|
58 |
+
|
59 |
+
<?php foreach ($columns as $column): ?>
|
60 |
+
<?php echo $column->getJs();?>
|
61 |
+
<?php endforeach; ?>
|
62 |
+
//]]>
|
63 |
+
|
64 |
+
</script>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/sharing.phtml
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<div class="page-title">
|
28 |
+
<h1><?php echo $this->__('Share Your Wishlist') ?></h1>
|
29 |
+
</div>
|
30 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
31 |
+
<form action="<?php echo $this->getSendUrl() ?>" id="form-validate" method="post">
|
32 |
+
<div class="fieldset">
|
33 |
+
<?php echo $this->getBlockHtml('formkey')?>
|
34 |
+
<h2 class="legend"><?php echo $this->__('Sharing Information') ?></h2>
|
35 |
+
<ul class="form-list">
|
36 |
+
<li class="wide">
|
37 |
+
<label for="email_address" class="required"><em>*</em><?php echo $this->__('Email addresses, separated by commas') ?></label>
|
38 |
+
<div class="input-box">
|
39 |
+
<textarea name="emails" cols="60" rows="5" id="email_address" class="validate-emails required-entry"><?php echo $this->getEnteredData('emails') ?></textarea>
|
40 |
+
</div>
|
41 |
+
</li>
|
42 |
+
<li class="wide">
|
43 |
+
<label for="message"><?php echo $this->__('Message') ?></label>
|
44 |
+
<div class="input-box">
|
45 |
+
<textarea id="message" name="message" cols="60" rows="5"><?php echo $this->getEnteredData('message') ?></textarea>
|
46 |
+
</div>
|
47 |
+
</li>
|
48 |
+
<?php if($this->helper('wishlist')->isRssAllow()): ?>
|
49 |
+
<li class="control">
|
50 |
+
<div class="input-box">
|
51 |
+
<input type="checkbox" name="rss_url" id="rss_url" value="1" title="<?php echo $this->__('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?>" class="checkbox" />
|
52 |
+
</div>
|
53 |
+
<label for="rss_url"><?php echo $this->__('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?></label>
|
54 |
+
</li>
|
55 |
+
<?php endif; ?>
|
56 |
+
</ul>
|
57 |
+
</div>
|
58 |
+
<div class="buttons-set form-buttons">
|
59 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
60 |
+
<p class="back-link"><a href="<?php echo $this->getBackUrl(); ?>"><small>« </small><?php echo $this->__('Back')?></a></p>
|
61 |
+
<button type="submit" title="<?php echo $this->__('Share Wishlist') ?>" class="button"><span><span><?php echo $this->__('Share Wishlist') ?></span></span></button>
|
62 |
+
</div>
|
63 |
+
</form>
|
64 |
+
<script type="text/javascript">
|
65 |
+
//<![CDATA[
|
66 |
+
Validation.addAllThese([
|
67 |
+
['validate-emails', '<?php echo $this->__('Please enter a valid email addresses, separated by commas. For example johndoe@domain.com, johnsmith@domain.com.') ?>', function (v) {
|
68 |
+
if(Validation.get('IsEmpty').test(v)) {
|
69 |
+
return true;
|
70 |
+
}
|
71 |
+
|
72 |
+
var valid_regexp = /^[a-z0-9\._-]{1,30}@([a-z0-9_-]{1,30}\.){1,5}[a-z]{2,4}$/i;
|
73 |
+
var emails = v.split(',');
|
74 |
+
|
75 |
+
for (var i=0; i<emails.length; i++) {
|
76 |
+
if(!valid_regexp.test(emails[i].strip())) {
|
77 |
+
return false;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
return true;
|
82 |
+
}]
|
83 |
+
]);
|
84 |
+
var dataForm = new VarienForm('form-validate', true);
|
85 |
+
//]]>
|
86 |
+
</script>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/sidebar.phtml
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
/* @var $this Mage_Wishlist_Block_Customer_Sidebar */
|
27 |
+
?>
|
28 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
29 |
+
<div class="block block-wishlist">
|
30 |
+
<div class="block-title">
|
31 |
+
<strong><span><?php echo $this->getTitle(); ?></span></strong>
|
32 |
+
</div>
|
33 |
+
<div class="block-content">
|
34 |
+
<p class="block-subtitle"><?php echo $this->__('Last Added Items') ?></p>
|
35 |
+
<?php if ($this->hasWishlistItems()): ?>
|
36 |
+
<ol class="mini-products-list" id="wishlist-sidebar">
|
37 |
+
<?php foreach ($this->getWishlistItems() as $_item): ?>
|
38 |
+
<?php $product = $_item->getProduct(); ?>
|
39 |
+
<li class="item">
|
40 |
+
<?php
|
41 |
+
|
42 |
+
if($customer = Mage::getSingleton('customer/session')->isLoggedIn()) {
|
43 |
+
$customerId = Mage::getModel('customer/session')->getCustomer()->getId();
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
$_wishlistItem = Mage::getModel('wishlist/item')->loadByProductWishlist(
|
48 |
+
$this->helper('wishlist')->getWishlist()->getId(),
|
49 |
+
$product->getId(),
|
50 |
+
$product->getStoreId());
|
51 |
+
|
52 |
+
|
53 |
+
$CustomerWishlistId = $_wishlistItem->getWishlistId();
|
54 |
+
$CustomerProductId = $_wishlistItem->getproductId();
|
55 |
+
|
56 |
+
$wishlistSidebar = $this->helper("ajaxwishlist")->getwishlistsidebar();
|
57 |
+
$wishlistAjaxStatus = $this->helper("ajaxwishlist")->getWishlistAjaxMode();
|
58 |
+
$wishlistMarkerStatus = $this->helper("ajaxwishlist")->getMarkerStatus();
|
59 |
+
$_wishlistRemoveUrl = $this->helper('wishlist')->getRemoveUrl($_wishlistItem);
|
60 |
+
$wishlistSidebarPosition = $this->helper("ajaxwishlist")->getWishlistSidebarPositionShow();
|
61 |
+
|
62 |
+
|
63 |
+
?>
|
64 |
+
<a href="<?php echo $this->getProductUrl($_item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>" class="product-image">
|
65 |
+
|
66 |
+
<?php if($wishlistAjaxStatus): ?>
|
67 |
+
<?php if($wishlistMarkerStatus): ?>
|
68 |
+
<?php if($product->getId() == $CustomerProductId && $customerId != null):?>
|
69 |
+
|
70 |
+
<div id="wishlist_list">
|
71 |
+
<div class="ajax_loadder_sidebar"> <span id='ajax_loading_sidebar<?php echo $product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif')?>'/></span></div>
|
72 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:visible;" onclick='func_removeSidebarItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $product->getId() ?>" id="wishlist_unselect_<?php echo $product->getId() ?>" />
|
73 |
+
|
74 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="visibility:hidden;" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($product) ?>","<?php echo $product->getId()?>");return false;' name="add_wishlist<?php echo $product->getId() ?>" id="wishlist_select_<?php echo $product->getId() ?>" />
|
75 |
+
</div>
|
76 |
+
|
77 |
+
<?php else: ?>
|
78 |
+
<div id="wishlist_list">
|
79 |
+
<div class="ajax_loadder_sidebar"><span id='ajax_loading_sidebar<?php echo $product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/ajaxWishlist/opc-ajax-loader.gif')?>'/></span></div>
|
80 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" onclick='func_addListItemWishtlist("<?php echo $this->helper('wishlist')->getAddUrl($product) ?>","<?php echo $product->getId()?>");return false;' name="add_wishlist<?php echo $product->getId() ?>" id="wishlist_select_<?php echo $product->getId() ?>" />
|
81 |
+
<?php //after select ?>
|
82 |
+
|
83 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:hidden;" onclick='func_removeSidebarItemWishtlist("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $product->getId() ?>" id="wishlist_unselect_<?php echo $product->getId() ?>" />
|
84 |
+
</div>
|
85 |
+
<?php endif; ?>
|
86 |
+
<?php endif; ?>
|
87 |
+
|
88 |
+
<?php else: ?>
|
89 |
+
|
90 |
+
<?php if($wishlistMarkerStatus): ?>
|
91 |
+
<?php if($product->getId() == $CustomerProductId && $customerId != null):?>
|
92 |
+
|
93 |
+
<div id="wishlist_list">
|
94 |
+
|
95 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:visible;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $product->getId() ?>" id="wishlist_unselect_<?php echo $product->getId() ?>" />
|
96 |
+
|
97 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" style="visibility:hidden;" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($product) ?>","<?php echo $product->getId()?>");return false;' name="add_wishlist<?php echo $product->getId() ?>" id="wishlist_select_<?php echo $product->getId() ?>" />
|
98 |
+
|
99 |
+
</div>
|
100 |
+
|
101 |
+
<?php else: ?>
|
102 |
+
<div id="wishlist_list">
|
103 |
+
|
104 |
+
<input type="button" class="wishlist_button" title="Add Wishlist" onclick='func_addWishlistAjaxMode("<?php echo $this->helper('wishlist')->getAddUrl($product) ?>","<?php echo $product->getId()?>");return false;' name="add_wishlist<?php echo $product->getId() ?>" id="wishlist_select_<?php echo $product->getId() ?>" />
|
105 |
+
<?php //after select ?>
|
106 |
+
|
107 |
+
<input type="button" class="wishlist_button_select" title="Remove Wishlist" style="visibility:hidden;" onclick='func_removeWishlistAjaxMode("<?php echo $_wishlistRemoveUrl; ?>","<?php echo $product->getId()?>","<?php echo $wishlistSidebarPosition; ?>");return false;' name="add_wishlist<?php echo $product->getId() ?>" id="wishlist_unselect_<?php echo $product->getId() ?>" />
|
108 |
+
</div>
|
109 |
+
<?php endif; ?>
|
110 |
+
<?php endif; ?>
|
111 |
+
|
112 |
+
<?php endif; ?>
|
113 |
+
|
114 |
+
<img src="<?php echo $this->helper('catalog/image')->init($product, 'thumbnail')->resize(50); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($product->getName()) ?>" />
|
115 |
+
</a>
|
116 |
+
<div class="product-details">
|
117 |
+
<a href="<?php echo $this->getItemRemoveUrl($_item) ?>" title="<?php echo $this->__('Remove This Item') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the wishlist?') ?>');" class="btn-remove"><?php echo $this->__('Remove This Item') ?></a>
|
118 |
+
<p class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></p>
|
119 |
+
<?php echo $this->getPriceHtml($product, false, '-wishlist') ?>
|
120 |
+
<?php if ($product->isSaleable() && $product->isVisibleInSiteVisibility()): ?>
|
121 |
+
<a href="<?php echo $this->getItemAddToCartUrl($_item) ?>" class="link-cart"><?php echo $this->__('Add to Cart') ?></a>
|
122 |
+
<?php endif; ?>
|
123 |
+
</div>
|
124 |
+
</li>
|
125 |
+
<?php endforeach; ?>
|
126 |
+
</ol>
|
127 |
+
<script type="text/javascript">decorateList('wishlist-sidebar');</script>
|
128 |
+
<div class="actions">
|
129 |
+
<a href="<?php echo $this->helper('wishlist')->getListUrl() ?>"><?php echo $this->__('Go to Wishlist') ?></a>
|
130 |
+
</div>
|
131 |
+
<?php else: ?>
|
132 |
+
<p class="empty"><?php echo $this->__('You have no items in your wishlist.') ?></p>
|
133 |
+
<?php endif ?>
|
134 |
+
</div>
|
135 |
+
</div>
|
136 |
+
<?php endif ?>
|
137 |
+
<style type="text/css">
|
138 |
+
|
139 |
+
.block-wishlist .block-content #wishlist_list .wishlist_button
|
140 |
+
{
|
141 |
+
background: url('<?php echo $this->getSkinUrl("images/ajaxWishlist/star_empty.png")?>') no-repeat;
|
142 |
+
}
|
143 |
+
.block-wishlist .block-content #wishlist_list .wishlist_button_select
|
144 |
+
{
|
145 |
+
background: url('<?php echo $this->getSkinUrl("images/ajaxWishlist/star_select.png")?>') no-repeat;
|
146 |
+
|
147 |
+
}
|
148 |
+
|
149 |
+
|
150 |
+
</style>
|
app/design/frontend/base/default/template/ajaxwishlist/wishlist/view.phtml
ADDED
@@ -0,0 +1,262 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
/* @var $this Mage_Wishlist_Block_Customer_Wishlist */
|
27 |
+
?>
|
28 |
+
<?php
|
29 |
+
if(Mage::helper('ajaxwishlist')->func_wishlistVersion()):
|
30 |
+
?>
|
31 |
+
|
32 |
+
<div class="my-wishlist">
|
33 |
+
<div class="ajax_loadder">
|
34 |
+
<span style="display:none" id="ajax_loading_list">
|
35 |
+
<img src="<?php echo $this->getSkinUrl("images/ajaxWishlist/opc-ajax-loader.gif")?>">
|
36 |
+
</span>
|
37 |
+
</div>
|
38 |
+
<div class="page-title title-buttons">
|
39 |
+
<?php if ($this->helper('wishlist')->isRssAllow() && $this->hasWishlistItems()): ?>
|
40 |
+
<a href="<?php echo $this->helper('wishlist')->getRssUrl(); ?>" class="link-rss"><?php echo $this->__('RSS Feed') ?></a>
|
41 |
+
<?php endif; ?>
|
42 |
+
<h1><?php echo $this->__('My Wishlist') ?></h1>
|
43 |
+
</div>
|
44 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
45 |
+
<?php if ($this->hasWishlistItems()): ?>
|
46 |
+
<form id="wishlist-view-form" action="<?php echo $this->getUrl('*/*/update') ?>" onsubmit="return false" method="post">
|
47 |
+
<fieldset>
|
48 |
+
<?php echo $this->getBlockHtml('formkey')?>
|
49 |
+
<table class="data-table" id="wishlist-table">
|
50 |
+
<col width="1" />
|
51 |
+
<col />
|
52 |
+
<col width="1" />
|
53 |
+
<col width="1" />
|
54 |
+
<col width="1" />
|
55 |
+
<thead>
|
56 |
+
<tr>
|
57 |
+
<th><?php echo $this->__('Product') ?></th>
|
58 |
+
<th><?php echo $this->__('Comment') ?></th>
|
59 |
+
<th class="a-center"><span class="nobr"><?php echo $this->__('Added On') ?></span></th>
|
60 |
+
<th class="a-center"><span class="nobr"><?php echo $this->__('Add to Cart') ?></span></th>
|
61 |
+
<th> </th>
|
62 |
+
</tr>
|
63 |
+
</thead>
|
64 |
+
<tbody>
|
65 |
+
<?php foreach ($this->getWishlistItems() as $item): ?>
|
66 |
+
<?php
|
67 |
+
$product = $item->getProduct();
|
68 |
+
$isVisibleProduct = $product->isVisibleInSiteVisibility();
|
69 |
+
?>
|
70 |
+
<tr>
|
71 |
+
<td>
|
72 |
+
<a class="product-image" href="" onclick="javascript:func_redirectToProduct('<?php echo $this->getProductUrl($item) ?>')" title="<?php echo $this->htmlEscape($product->getName()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(113, 113); ?>" width="113" height="113" alt="<?php echo $this->htmlEscape($product->getName()) ?>" /></a>
|
73 |
+
<h2 class="product-name"><a href="" onclick="javascript:func_redirectToProduct('<?php echo $this->getProductUrl($item) ?>')" ><?php echo $this->htmlEscape($product->getName()) ?></a></h2>
|
74 |
+
<?php echo $this->getPriceHtml($product) ?>
|
75 |
+
<?php echo $this->getDetailsHtml($item) ?>
|
76 |
+
</td>
|
77 |
+
<td>
|
78 |
+
<textarea name="description[<?php echo $item->getWishlistItemId() ?>]" rows="3" cols="5" onfocus="focusComment(this)" onblur="focusComment(this)" title="<?php echo $this->__('Comment') ?>"><?php echo $this->getCommentValue($item); ?></textarea>
|
79 |
+
</td>
|
80 |
+
<td>
|
81 |
+
<span class="nobr"><?php echo $this->getFormatedDate($item->getAddedAt()) ?></span>
|
82 |
+
</td>
|
83 |
+
<td class="a-center">
|
84 |
+
<?php if ($item->canHaveQty() && $isVisibleProduct): ?>
|
85 |
+
<p><input type="text" class="input-text qty" name="qty[<?php echo $item->getId() ?>]" value="<?php echo $this->getAddToCartQty($item) * 1 ?>" /></p>
|
86 |
+
<?php endif; ?>
|
87 |
+
<?php if ($product->isSaleable()): ?>
|
88 |
+
<?php if ($isVisibleProduct): ?>
|
89 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" onclick="addpopupItemToCart('<?php echo $this->getItemAddToCartUrl($item->getId()) ?>','<?php echo $item->getId()?>');" class="button btn-cart"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
90 |
+
<?php endif ?>
|
91 |
+
<?php else: ?>
|
92 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
93 |
+
<?php endif; ?>
|
94 |
+
<?php if ($isVisibleProduct): ?>
|
95 |
+
<p><a href="javascript:void(0);" onclick="javascript:func_redirectToProduct('<?php echo $this->getItemConfigureUrl($item) ?>')" ><?php echo $this->__('Edit') ?></a></p>
|
96 |
+
<?php endif ?>
|
97 |
+
</td>
|
98 |
+
<td>
|
99 |
+
<a href="javascript:void(0);" title="<?php echo $this->__('Remove Item') ?>" onclick="lightviewRemoveWishlistItem('<?php echo $this->getItemRemoveUrl($item); ?>','<?php echo $item->getId() ?>');" class="btn-remove btn-remove2"><?php echo $this->__('Remove item')?></a>
|
100 |
+
</td>
|
101 |
+
</tr>
|
102 |
+
<?php endforeach ?>
|
103 |
+
</tbody>
|
104 |
+
</table>
|
105 |
+
<script type="text/javascript">decorateTable('wishlist-table')</script>
|
106 |
+
<div class="buttons-set buttons-set2">
|
107 |
+
<button type="submit" onclick="func_share_Wishlist()" title="<?php echo $this->__('Share Wishlist') ?>" class="button btn-share"><span><span><?php echo $this->__('Share Wishlist') ?></span></span></button>
|
108 |
+
<?php if($this->isSaleable()):?>
|
109 |
+
<button type="button" title="<?php echo $this->__('Add All to Cart') ?>" onclick="addAllWItemsToCart()" class="button btn-add"><span><span><?php echo $this->__('Add All to Cart') ?></span></span></button>
|
110 |
+
<?php endif;?>
|
111 |
+
<button type="submit" title="<?php echo $this->__('Update Wishlist') ?>" onclick="func_updateWishtlist()" class="button btn-update"><span><span><?php echo $this->__('Update Wishlist') ?></span></span></button>
|
112 |
+
</div>
|
113 |
+
</fieldset>
|
114 |
+
</form>
|
115 |
+
<?php else: ?>
|
116 |
+
<p class="wishlist-empty"><?php echo $this->__('You have no items in your wishlist. Please <a href="javascrip:void(0);" onclick="javascript:func_closeIframePopup()" >Click Here</a> for continue shopping.') ?></p>
|
117 |
+
<?php endif ?>
|
118 |
+
<script type="text/javascript">
|
119 |
+
//<![CDATA[
|
120 |
+
function confirmRemoveWishlistItem() {
|
121 |
+
return confirm('<?php echo $this->__('Are you sure you want to remove this product from your wishlist?') ?>');
|
122 |
+
}
|
123 |
+
|
124 |
+
function focusComment(obj) {
|
125 |
+
if( obj.value == '<?php echo $this->helper('wishlist')->defaultCommentString() ?>' ) {
|
126 |
+
obj.value = '';
|
127 |
+
} else if( obj.value == '' ) {
|
128 |
+
obj.value = '<?php echo $this->helper('wishlist')->defaultCommentString() ?>';
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
function addWItemToCart(itemId) {
|
133 |
+
var url = '<?php echo $this->getItemAddToCartUrl('%item%') ?>';
|
134 |
+
url = url.gsub('%item%', itemId);
|
135 |
+
var form = $('wishlist-view-form');
|
136 |
+
if (form) {
|
137 |
+
var input = form['qty[' + itemId + ']'];
|
138 |
+
if (input) {
|
139 |
+
var separator = (url.indexOf('?') >= 0) ? '&' : '?';
|
140 |
+
url += separator + input.name + '=' + encodeURIComponent(input.value);
|
141 |
+
}
|
142 |
+
}
|
143 |
+
setLocation(url);
|
144 |
+
}
|
145 |
+
|
146 |
+
function addAllWItemsToCart() {
|
147 |
+
var url = '<?php echo $this->getUrl('*/*/allcart') ?>';
|
148 |
+
url = url.replace("ajaxwishlist","wishlist");
|
149 |
+
var separator = (url.indexOf('?') >= 0) ? '&' : '?';
|
150 |
+
$$('#wishlist-view-form .qty').each(
|
151 |
+
function (input, index) {
|
152 |
+
url += separator + input.name + '=' + encodeURIComponent(input.value);
|
153 |
+
separator = '&';
|
154 |
+
}
|
155 |
+
);
|
156 |
+
//setLocation(url);
|
157 |
+
window.parent.location.href = url;
|
158 |
+
setInterval(this.showLoading, 4000);
|
159 |
+
}
|
160 |
+
function showLoading(){
|
161 |
+
|
162 |
+
$("ajax_loading_list").hide();
|
163 |
+
window.parent.document.getElementById("lv_overlay").remove();
|
164 |
+
window.parent.document.getElementById('lightview').remove();
|
165 |
+
|
166 |
+
}
|
167 |
+
//]]>
|
168 |
+
</script>
|
169 |
+
|
170 |
+
</div>
|
171 |
+
<?php
|
172 |
+
|
173 |
+
else:
|
174 |
+
?>
|
175 |
+
|
176 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
177 |
+
|
178 |
+
|
179 |
+
<div class="my-wishlist">
|
180 |
+
<div class="ajax_loadder">
|
181 |
+
<span style="display:none" id="ajax_loading_list">
|
182 |
+
<img src="<?php echo $this->getSkinUrl("images/ajaxWishlist/opc-ajax-loader.gif")?>">
|
183 |
+
</span>
|
184 |
+
</div>
|
185 |
+
<div class="page-title title-buttons">
|
186 |
+
<?php if ($this->helper('wishlist')->isRssAllow() && $this->hasWishlistItems()): ?>
|
187 |
+
<a href="<?php echo $this->helper('wishlist')->getRssUrl($this->getWishlistInstance()->getId()); ?>" class="link-rss"><?php echo $this->__('RSS Feed') ?></a>
|
188 |
+
<?php endif; ?>
|
189 |
+
<h1><?php echo $this->getTitle(); ?></h1>
|
190 |
+
</div>
|
191 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
192 |
+
|
193 |
+
<form id="wishlist-view-form" onsubmit="return false" action="<?php echo $this->getUrl('*/*/update', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>" method="post">
|
194 |
+
<?php echo $this->getChildHtml('top'); ?>
|
195 |
+
<fieldset>
|
196 |
+
<?php if ($this->hasWishlistItems()): ?>
|
197 |
+
<?php echo $this->getBlockHtml('formkey');?>
|
198 |
+
<?php $this->getChild('items')->setItems($this->getWishlistItems()); ?>
|
199 |
+
<?php echo $this->getChildHtml('items');?>
|
200 |
+
<script type="text/javascript">decorateTable('wishlist-table')</script>
|
201 |
+
<?php else: ?>
|
202 |
+
<p class="wishlist-empty"><?php echo $this->__('You have no items in your wishlist. Please <a href="javascrip:void(0);" onclick="javascript:func_closeIframePopup()" >Click Here</a> for continue shopping.') ?></p>
|
203 |
+
<?php endif ?>
|
204 |
+
<div class="buttons-set buttons-set2">
|
205 |
+
<?php echo $this->getChild('control_buttons')->toHtml();?>
|
206 |
+
</div>
|
207 |
+
</fieldset>
|
208 |
+
</form>
|
209 |
+
|
210 |
+
|
211 |
+
</div>
|
212 |
+
<?php echo $this->getChildHtml('bottom'); ?>
|
213 |
+
<!--div class="buttons-set">
|
214 |
+
<?php /* <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo $this->__('Back') ?></a></p> */ ?>
|
215 |
+
</div -->
|
216 |
+
<script type="text/javascript">
|
217 |
+
//<![CDATA[
|
218 |
+
var wishlistForm = new Validation($('wishlist-view-form'));
|
219 |
+
function addAllWItemsToCart() {
|
220 |
+
|
221 |
+
$("ajax_loading_list").show();
|
222 |
+
var url = '<?php echo $this->getUrl('*/*/allcart', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>';
|
223 |
+
url = url.replace("ajaxwishlist","wishlist");
|
224 |
+
var separator = (url.indexOf('?') >= 0) ? '&' : '?';
|
225 |
+
$$('#wishlist-view-form .qty').each(
|
226 |
+
function (input, index) {
|
227 |
+
url += separator + input.name + '=' + encodeURIComponent(input.value);
|
228 |
+
separator = '&';
|
229 |
+
}
|
230 |
+
);
|
231 |
+
window.parent.location.href = url;
|
232 |
+
setInterval(this.showLoading, 4000);
|
233 |
+
|
234 |
+
}
|
235 |
+
|
236 |
+
function showLoading(){
|
237 |
+
|
238 |
+
$("ajax_loading_list").hide();
|
239 |
+
window.parent.document.getElementById("lv_overlay").remove();
|
240 |
+
window.parent.document.getElementById('lightview').remove();
|
241 |
+
|
242 |
+
}
|
243 |
+
|
244 |
+
//]]>
|
245 |
+
</script>
|
246 |
+
<?php endif ?>
|
247 |
+
|
248 |
+
|
249 |
+
|
250 |
+
<?php
|
251 |
+
endif;
|
252 |
+
?>
|
253 |
+
|
254 |
+
|
255 |
+
<script type="text/javascript">
|
256 |
+
elementArray = window.parent.parent.document.getElementsByClassName('lv_Close');
|
257 |
+
for (var i = 0; i < elementArray.length; ++i)
|
258 |
+
{
|
259 |
+
elementArray[i].setAttribute("onclick","window.parent.parent.location.reload();");
|
260 |
+
}
|
261 |
+
|
262 |
+
</script>
|
app/design/frontend/default/default/layout/ajax.xml
DELETED
@@ -1,103 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.0">
|
3 |
-
<catalog_product_view>
|
4 |
-
<reference name="head">
|
5 |
-
<action method="addItem"><type>js</type><name>jquery/jquery-1.6.4.min.js</name></action>
|
6 |
-
<action method="addItem"><type>js</type><name>jquery/noconflict.js</name></action>
|
7 |
-
</reference>
|
8 |
-
<reference name='product.info'>
|
9 |
-
<action method='setTemplate'><template>ajax/catalog/product/view.phtml</template></action>
|
10 |
-
</reference>
|
11 |
-
<reference name='product.info.addtocart'>
|
12 |
-
<action method='setTemplate'><template>ajax/catalog/product/view/addtocart.phtml</template></action>
|
13 |
-
</reference>
|
14 |
-
</catalog_product_view>
|
15 |
-
<catalog_category_default>
|
16 |
-
<reference name="head">
|
17 |
-
<action method="addItem"><type>js</type><name>jquery/jquery-1.6.4.min.js</name></action>
|
18 |
-
<action method="addItem"><type>skin_js</type><name>js/fancybox/jquery.fancybox-1.3.4.js</name></action>
|
19 |
-
<action method="addItem"><type>skin_js</type><name>js/fancybox/jquery.easing-1.3.pack.js</name></action>
|
20 |
-
<action method="addItem"><type>skin_js</type><name>js/fancybox/jquery.mousewheel-3.0.4.pack.js</name></action>
|
21 |
-
<action method="addItem"><type>js</type><name>jquery/noconflict.js</name></action>
|
22 |
-
<action method="addCss"><stylesheet>js/fancybox/jquery.fancybox-1.3.4.css</stylesheet></action>
|
23 |
-
</reference>
|
24 |
-
<reference name='product_list'>
|
25 |
-
<action method='setTemplate'><template>ajax/catalog/product/view/list.phtml</template></action>
|
26 |
-
</reference>
|
27 |
-
</catalog_category_default>
|
28 |
-
<catalog_category_layered>
|
29 |
-
<reference name="head">
|
30 |
-
<action method="addItem"><type>js</type><name>jquery/jquery-1.6.4.min.js</name></action>
|
31 |
-
<action method="addItem"><type>skin_js</type><name>js/fancybox/jquery.fancybox-1.3.4.js</name></action>
|
32 |
-
<action method="addItem"><type>skin_js</type><name>js/fancybox/jquery.easing-1.3.pack.js</name></action>
|
33 |
-
<action method="addItem"><type>skin_js</type><name>js/fancybox/jquery.mousewheel-3.0.4.pack.js</name></action>
|
34 |
-
<action method="addItem"><type>js</type><name>jquery/noconflict.js</name></action>
|
35 |
-
<action method="addCss"><stylesheet>js/fancybox/jquery.fancybox-1.3.4.css</stylesheet></action>
|
36 |
-
</reference>
|
37 |
-
<reference name='product_list'>
|
38 |
-
<action method='setTemplate'><template>ajax/catalog/product/view/list.phtml</template></action>
|
39 |
-
</reference>
|
40 |
-
</catalog_category_layered>
|
41 |
-
<ajax_index_options>
|
42 |
-
<reference name="root">
|
43 |
-
<action method="setTemplate"><template>page/empty.phtml</template></action>
|
44 |
-
</reference>
|
45 |
-
<reference name="head">
|
46 |
-
<action method="addItem"><type>js</type><name>jquery/jquery-1.6.4.min.js</name></action>
|
47 |
-
<action method="addItem"><type>js</type><name>jquery/noconflict.js</name></action>
|
48 |
-
</reference>
|
49 |
-
<reference name="head">
|
50 |
-
<action method="addJs"><script>varien/product.js</script></action>
|
51 |
-
<action method="addJs"><script>varien/configurable.js</script></action>
|
52 |
-
|
53 |
-
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
|
54 |
-
<action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
|
55 |
-
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
|
56 |
-
</reference>
|
57 |
-
<reference name="content">
|
58 |
-
<block type="catalog/product_view" name="product.info" template="ajax/catalog/product/options.phtml">
|
59 |
-
<!--
|
60 |
-
<action method="addReviewSummaryTemplate"><type>default</type><template>review/helper/summary.phtml</template></action>
|
61 |
-
<action method="addReviewSummaryTemplate"><type>short</type><template>review/helper/summary_short.phtml</template></action>
|
62 |
-
<action method="addReviewSummaryTemplate"><type>...</type><template>...</template></action>
|
63 |
-
-->
|
64 |
-
|
65 |
-
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="ajax/catalog/product/view/addtocart.phtml"/>
|
66 |
-
|
67 |
-
<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label">
|
68 |
-
<label>Info Column Options Wrapper</label>
|
69 |
-
<block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/>
|
70 |
-
<block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
|
71 |
-
<action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
|
72 |
-
<action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
|
73 |
-
<action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
|
74 |
-
<action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
|
75 |
-
</block>
|
76 |
-
<block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
|
77 |
-
</block>
|
78 |
-
<block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="catalog/product/view/options/wrapper/bottom.phtml" translate="label">
|
79 |
-
<label>Bottom Block Options Wrapper</label>
|
80 |
-
<action method="insert"><block>product.tierprices</block></action>
|
81 |
-
<block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
|
82 |
-
<action method="append"><block>product.info.addtocart</block></action>
|
83 |
-
<action method="append"><block>product.info.addto</block></action>
|
84 |
-
</block>
|
85 |
-
|
86 |
-
<block type="core/template_facade" name="product.info.container1" as="container1">
|
87 |
-
<action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
|
88 |
-
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
|
89 |
-
<action method="append"><block>product.info.options.wrapper</block></action>
|
90 |
-
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
|
91 |
-
</block>
|
92 |
-
<block type="core/template_facade" name="product.info.container2" as="container2">
|
93 |
-
<action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
|
94 |
-
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
|
95 |
-
<action method="append"><block>product.info.options.wrapper</block></action>
|
96 |
-
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
|
97 |
-
</block>
|
98 |
-
<action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
|
99 |
-
<action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
|
100 |
-
</block>
|
101 |
-
</reference>
|
102 |
-
</ajax_index_options>
|
103 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/ajax/catalog/product/options.phtml
DELETED
@@ -1,109 +0,0 @@
|
|
1 |
-
<style>
|
2 |
-
<!--
|
3 |
-
body.ajax-index-options{
|
4 |
-
width:380px;
|
5 |
-
padding:0px;
|
6 |
-
margin:0px;
|
7 |
-
}
|
8 |
-
body.ajax-index-options .product-shop .product-options-bottom .price-box{
|
9 |
-
float:left;
|
10 |
-
}
|
11 |
-
-->
|
12 |
-
</style>
|
13 |
-
<?php $_helper = $this->helper('catalog/output'); ?>
|
14 |
-
<?php $_product = $this->getProduct(); ?>
|
15 |
-
<script type="text/javascript">
|
16 |
-
var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
|
17 |
-
</script>
|
18 |
-
<div class="product-view" style="width:380px">
|
19 |
-
<div class="product-essential" style="width:330px">
|
20 |
-
<form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
|
21 |
-
<div class="no-display">
|
22 |
-
<input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
|
23 |
-
<input type="hidden" name="related_product" id="related-products-field" value="" />
|
24 |
-
</div>
|
25 |
-
|
26 |
-
|
27 |
-
<div class="product-shop">
|
28 |
-
<div class="product-name">
|
29 |
-
<h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
|
30 |
-
</div>
|
31 |
-
|
32 |
-
<?php echo $this->getChildHtml('product_type_data') ?>
|
33 |
-
|
34 |
-
<?php if (!$this->hasOptions()):?>
|
35 |
-
<div class="add-to-box">
|
36 |
-
<?php if($_product->isSaleable()): ?>
|
37 |
-
<?php echo $this->getChildHtml('addtocart') ?>
|
38 |
-
<?php endif; ?>
|
39 |
-
</div>
|
40 |
-
<?php endif; ?>
|
41 |
-
|
42 |
-
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
|
43 |
-
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
|
44 |
-
<?php endif;?>
|
45 |
-
|
46 |
-
</div>
|
47 |
-
<div class="clearer"></div>
|
48 |
-
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
|
49 |
-
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
|
50 |
-
<?php endif;?>
|
51 |
-
</form>
|
52 |
-
<script type="text/javascript">
|
53 |
-
//<![CDATA[
|
54 |
-
var productAddToCartForm = new VarienForm('product_addtocart_form');
|
55 |
-
productAddToCartForm.submit = function(button, url) {
|
56 |
-
if (this.validator.validate()) {
|
57 |
-
var form = this.form;
|
58 |
-
var oldUrl = form.action;
|
59 |
-
if (url) {
|
60 |
-
form.action = url;
|
61 |
-
}
|
62 |
-
var e = null;
|
63 |
-
// Start of our new ajax code
|
64 |
-
if (!url) {
|
65 |
-
url = jQuery('#product_addtocart_form').attr('action');
|
66 |
-
}
|
67 |
-
url = url.replace("checkout/cart","ajax/index"); // New Code
|
68 |
-
var data = jQuery('#product_addtocart_form').serialize();
|
69 |
-
data += '&isAjax=1';
|
70 |
-
jQuery('#ajax_loader').show();
|
71 |
-
try {
|
72 |
-
jQuery.ajax( {
|
73 |
-
url : url,
|
74 |
-
dataType : 'json',
|
75 |
-
type : 'post',
|
76 |
-
data : data,
|
77 |
-
success : function(data) {
|
78 |
-
jQuery('#ajax_loader').hide();
|
79 |
-
parent.setAjaxData(data,true);
|
80 |
-
}
|
81 |
-
});
|
82 |
-
} catch (e) {
|
83 |
-
}
|
84 |
-
// End of our new ajax code
|
85 |
-
this.form.action = oldUrl;
|
86 |
-
if (e) {
|
87 |
-
throw e;
|
88 |
-
}
|
89 |
-
}
|
90 |
-
}.bind(productAddToCartForm);
|
91 |
-
productAddToCartForm.submitLight = function(button, url){
|
92 |
-
if(this.validator) {
|
93 |
-
var nv = Validation.methods;
|
94 |
-
delete Validation.methods['required-entry'];
|
95 |
-
delete Validation.methods['validate-one-required'];
|
96 |
-
delete Validation.methods['validate-one-required-by-name'];
|
97 |
-
if (this.validator.validate()) {
|
98 |
-
if (url) {
|
99 |
-
this.form.action = url;
|
100 |
-
}
|
101 |
-
this.form.submit();
|
102 |
-
}
|
103 |
-
Object.extend(Validation.methods, nv);
|
104 |
-
}
|
105 |
-
}.bind(productAddToCartForm);
|
106 |
-
//]]>
|
107 |
-
</script>
|
108 |
-
</div>
|
109 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/ajax/catalog/product/view.phtml
DELETED
@@ -1,146 +0,0 @@
|
|
1 |
-
<?php $_helper = $this->helper('catalog/output'); ?>
|
2 |
-
<?php $_product = $this->getProduct(); ?>
|
3 |
-
<script type="text/javascript">
|
4 |
-
var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
|
5 |
-
</script>
|
6 |
-
<div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
|
7 |
-
<div class="product-view">
|
8 |
-
<div class="product-essential">
|
9 |
-
<form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
|
10 |
-
<div class="no-display">
|
11 |
-
<input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
|
12 |
-
<input type="hidden" name="related_product" id="related-products-field" value="" />
|
13 |
-
</div>
|
14 |
-
|
15 |
-
<div class="product-shop">
|
16 |
-
<div class="product-name">
|
17 |
-
<h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
|
18 |
-
</div>
|
19 |
-
|
20 |
-
<?php if ($this->canEmailToFriend()): ?>
|
21 |
-
<p class="email-friend"><a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a></p>
|
22 |
-
<?php endif; ?>
|
23 |
-
|
24 |
-
<?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
|
25 |
-
<?php echo $this->getChildHtml('alert_urls') ?>
|
26 |
-
<?php echo $this->getChildHtml('product_type_data') ?>
|
27 |
-
<?php echo $this->getTierPriceHtml() ?>
|
28 |
-
<?php echo $this->getChildHtml('extrahint') ?>
|
29 |
-
|
30 |
-
<?php if (!$this->hasOptions()):?>
|
31 |
-
<div class="add-to-box">
|
32 |
-
<?php if($_product->isSaleable()): ?>
|
33 |
-
<?php echo $this->getChildHtml('addtocart') ?>
|
34 |
-
<?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
|
35 |
-
<span class="or"><?php echo $this->__('OR') ?></span>
|
36 |
-
<?php endif; ?>
|
37 |
-
<?php endif; ?>
|
38 |
-
<?php echo $this->getChildHtml('addto') ?>
|
39 |
-
</div>
|
40 |
-
<?php echo $this->getChildHtml('extra_buttons') ?>
|
41 |
-
<?php endif; ?>
|
42 |
-
|
43 |
-
<?php if ($_product->getShortDescription()):?>
|
44 |
-
<div class="short-description">
|
45 |
-
<h2><?php echo $this->__('Quick Overview') ?></h2>
|
46 |
-
<div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
|
47 |
-
</div>
|
48 |
-
<?php endif;?>
|
49 |
-
|
50 |
-
<?php echo $this->getChildHtml('other');?>
|
51 |
-
|
52 |
-
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
|
53 |
-
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
|
54 |
-
<?php endif;?>
|
55 |
-
|
56 |
-
</div>
|
57 |
-
|
58 |
-
<div class="product-img-box">
|
59 |
-
<?php echo $this->getChildHtml('media') ?>
|
60 |
-
</div>
|
61 |
-
|
62 |
-
<div class="clearer"></div>
|
63 |
-
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
|
64 |
-
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
|
65 |
-
<?php endif;?>
|
66 |
-
</form>
|
67 |
-
<script type="text/javascript">
|
68 |
-
//<![CDATA[
|
69 |
-
var productAddToCartForm = new VarienForm('product_addtocart_form');
|
70 |
-
productAddToCartForm.submit = function(button, url) {
|
71 |
-
if (this.validator.validate()) {
|
72 |
-
var form = this.form;
|
73 |
-
var oldUrl = form.action;
|
74 |
-
if (url) {
|
75 |
-
form.action = url;
|
76 |
-
}
|
77 |
-
var e = null;
|
78 |
-
// Start of our new ajax code
|
79 |
-
if (!url) {
|
80 |
-
url = jQuery('#product_addtocart_form').attr('action');
|
81 |
-
}
|
82 |
-
url = url.replace("checkout/cart","ajax/index"); // New Code
|
83 |
-
var data = jQuery('#product_addtocart_form').serialize();
|
84 |
-
data += '&isAjax=1';
|
85 |
-
jQuery('#ajax_loader').show();
|
86 |
-
try {
|
87 |
-
jQuery.ajax( {
|
88 |
-
url : url,
|
89 |
-
dataType : 'json',
|
90 |
-
type : 'post',
|
91 |
-
data : data,
|
92 |
-
success : function(data) {
|
93 |
-
jQuery('#ajax_loader').hide();
|
94 |
-
if(data.status == 'ERROR'){
|
95 |
-
alert(data.message);
|
96 |
-
}else{
|
97 |
-
if(jQuery('.block-cart')){
|
98 |
-
jQuery('.block-cart').replaceWith(data.sidebar);
|
99 |
-
}
|
100 |
-
if(jQuery('.header .links')){
|
101 |
-
jQuery('.header .links').replaceWith(data.toplink);
|
102 |
-
}
|
103 |
-
}
|
104 |
-
}
|
105 |
-
});
|
106 |
-
} catch (e) {
|
107 |
-
}
|
108 |
-
// End of our new ajax code
|
109 |
-
this.form.action = oldUrl;
|
110 |
-
if (e) {
|
111 |
-
throw e;
|
112 |
-
}
|
113 |
-
}
|
114 |
-
}.bind(productAddToCartForm);
|
115 |
-
productAddToCartForm.submitLight = function(button, url){
|
116 |
-
if(this.validator) {
|
117 |
-
var nv = Validation.methods;
|
118 |
-
delete Validation.methods['required-entry'];
|
119 |
-
delete Validation.methods['validate-one-required'];
|
120 |
-
delete Validation.methods['validate-one-required-by-name'];
|
121 |
-
if (this.validator.validate()) {
|
122 |
-
if (url) {
|
123 |
-
this.form.action = url;
|
124 |
-
}
|
125 |
-
this.form.submit();
|
126 |
-
}
|
127 |
-
Object.extend(Validation.methods, nv);
|
128 |
-
}
|
129 |
-
}.bind(productAddToCartForm);
|
130 |
-
//]]>
|
131 |
-
</script>
|
132 |
-
</div>
|
133 |
-
|
134 |
-
<div class="product-collateral">
|
135 |
-
<?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
|
136 |
-
<div class="box-collateral <?php echo "box-{$alias}"?>">
|
137 |
-
<?php if ($title = $this->getChildData($alias, 'title')):?>
|
138 |
-
<h2><?php echo $this->escapeHtml($title); ?></h2>
|
139 |
-
<?php endif;?>
|
140 |
-
<?php echo $html; ?>
|
141 |
-
</div>
|
142 |
-
<?php endforeach;?>
|
143 |
-
<?php echo $this->getChildHtml('upsell_products') ?>
|
144 |
-
<?php echo $this->getChildHtml('product_additional_data') ?>
|
145 |
-
</div>
|
146 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/ajax/catalog/product/view/addtocart.phtml
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
<?php $_product = $this->getProduct(); ?>
|
2 |
-
<?php $buttonTitle = $this->__('Add to Cart'); ?>
|
3 |
-
<?php if($_product->isSaleable()): ?>
|
4 |
-
<div class="add-to-cart">
|
5 |
-
<?php if(!$_product->isGrouped()): ?>
|
6 |
-
<label for="qty"><?php echo $this->__('Qty:') ?></label>
|
7 |
-
<input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
|
8 |
-
<?php endif; ?>
|
9 |
-
<button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button>
|
10 |
-
<span id='ajax_loader' style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
11 |
-
|
12 |
-
<?php echo $this->getChildHtml('', true, true) ?>
|
13 |
-
</div>
|
14 |
-
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/ajax/catalog/product/view/list.phtml
DELETED
@@ -1,161 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$_productCollection=$this->getLoadedProductCollection();
|
3 |
-
$_helper = $this->helper('catalog/output');
|
4 |
-
?>
|
5 |
-
<?php if(!$_productCollection->count()): ?>
|
6 |
-
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
|
7 |
-
<?php else: ?>
|
8 |
-
<div class="category-products">
|
9 |
-
<?php echo $this->getToolbarHtml() ?>
|
10 |
-
<?php // List mode ?>
|
11 |
-
<?php if($this->getMode()!='grid'): ?>
|
12 |
-
<?php $_iterator = 0; ?>
|
13 |
-
<ol class="products-list" id="products-list">
|
14 |
-
<?php foreach ($_productCollection as $_product): ?>
|
15 |
-
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
|
16 |
-
<?php // Product Image ?>
|
17 |
-
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
18 |
-
<?php // Product description ?>
|
19 |
-
<div class="product-shop">
|
20 |
-
<div class="f-fix">
|
21 |
-
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
|
22 |
-
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
|
23 |
-
<?php if($_product->getRatingSummary()): ?>
|
24 |
-
<?php echo $this->getReviewsSummaryHtml($_product) ?>
|
25 |
-
<?php endif; ?>
|
26 |
-
<?php echo $this->getPriceHtml($_product, true) ?>
|
27 |
-
<?php if($_product->isSaleable()): ?>
|
28 |
-
<?php if ( !($_product->getTypeInstance(true)->hasRequiredOptions($_product) || $_product->isGrouped()) ) { ?>
|
29 |
-
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocationAjax('<?php echo $this->getAddToCartUrl($_product) ?>','<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
30 |
-
<span id='ajax_loader<?php echo $_product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
31 |
-
<?php } else { ?>
|
32 |
-
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="showOptions('<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
33 |
-
<a href='<?php echo $this->getUrl('ajax/index/options',array('product_id'=>$_product->getId()));?>' class='fancybox' id='fancybox<?php echo $_product->getId()?>' style='display:none'>Test</a>
|
34 |
-
<?php } ?>
|
35 |
-
<?php else: ?>
|
36 |
-
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
37 |
-
<?php endif; ?>
|
38 |
-
<div class="desc std">
|
39 |
-
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
|
40 |
-
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
|
41 |
-
</div>
|
42 |
-
<ul class="add-to-links">
|
43 |
-
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
44 |
-
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
45 |
-
<?php endif; ?>
|
46 |
-
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
47 |
-
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
48 |
-
<?php endif; ?>
|
49 |
-
</ul>
|
50 |
-
</div>
|
51 |
-
</div>
|
52 |
-
</li>
|
53 |
-
<?php endforeach; ?>
|
54 |
-
</ol>
|
55 |
-
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
|
56 |
-
|
57 |
-
<?php else: ?>
|
58 |
-
|
59 |
-
<?php // Grid Mode ?>
|
60 |
-
|
61 |
-
<?php $_collectionSize = $_productCollection->count() ?>
|
62 |
-
<?php $_columnCount = $this->getColumnCount(); ?>
|
63 |
-
<?php $i=0; foreach ($_productCollection as $_product): ?>
|
64 |
-
<?php if ($i++%$_columnCount==0): ?>
|
65 |
-
<ul class="products-grid">
|
66 |
-
<?php endif ?>
|
67 |
-
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
|
68 |
-
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
69 |
-
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
70 |
-
<?php if($_product->getRatingSummary()): ?>
|
71 |
-
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
|
72 |
-
<?php endif; ?>
|
73 |
-
<?php echo $this->getPriceHtml($_product, true) ?>
|
74 |
-
<div class="actions">
|
75 |
-
<?php if($_product->isSaleable()): ?>
|
76 |
-
<?php if ( !($_product->getTypeInstance(true)->hasRequiredOptions($_product) || $_product->isGrouped()) ) { ?>
|
77 |
-
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocationAjax('<?php echo $this->getAddToCartUrl($_product) ?>','<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
78 |
-
<span id='ajax_loader<?php echo $_product->getId()?>' style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
|
79 |
-
<?php } else { ?>
|
80 |
-
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="showOptions('<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
81 |
-
<a href='<?php echo $this->getUrl('ajax/index/options',array('product_id'=>$_product->getId()));?>' class='fancybox' id='fancybox<?php echo $_product->getId()?>' style='display:none'></a>
|
82 |
-
<?php } ?>
|
83 |
-
<?php else: ?>
|
84 |
-
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
85 |
-
<?php endif; ?>
|
86 |
-
<ul class="add-to-links">
|
87 |
-
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
88 |
-
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
89 |
-
<?php endif; ?>
|
90 |
-
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
91 |
-
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
92 |
-
<?php endif; ?>
|
93 |
-
</ul>
|
94 |
-
</div>
|
95 |
-
</li>
|
96 |
-
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
|
97 |
-
</ul>
|
98 |
-
<?php endif ?>
|
99 |
-
<?php endforeach ?>
|
100 |
-
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
|
101 |
-
<?php endif; ?>
|
102 |
-
|
103 |
-
<div class="toolbar-bottom">
|
104 |
-
<?php echo $this->getToolbarHtml() ?>
|
105 |
-
</div>
|
106 |
-
</div>
|
107 |
-
<?php endif; ?>
|
108 |
-
<script type="text/javascript">
|
109 |
-
//jQuery.noConflict();
|
110 |
-
jQuery(document).ready(function(){
|
111 |
-
jQuery('.fancybox').fancybox(
|
112 |
-
{
|
113 |
-
hideOnContentClick : true,
|
114 |
-
width: 382,
|
115 |
-
autoDimensions: true,
|
116 |
-
type : 'iframe',
|
117 |
-
showTitle: false,
|
118 |
-
scrolling: 'no',
|
119 |
-
onComplete: function(){
|
120 |
-
jQuery('#fancybox-frame').load(function() { // wait for frame to load and then gets it's height
|
121 |
-
jQuery('#fancybox-content').height(jQuery(this).contents().find('body').height()+30);
|
122 |
-
jQuery.fancybox.resize();
|
123 |
-
});
|
124 |
-
|
125 |
-
}
|
126 |
-
}
|
127 |
-
);
|
128 |
-
});
|
129 |
-
function showOptions(id){
|
130 |
-
jQuery('#fancybox'+id).trigger('click');
|
131 |
-
}
|
132 |
-
function setAjaxData(data,iframe){
|
133 |
-
if(data.status == 'ERROR'){
|
134 |
-
alert(data.message);
|
135 |
-
}else{
|
136 |
-
if(jQuery('.block-cart')){
|
137 |
-
jQuery('.block-cart').replaceWith(data.sidebar);
|
138 |
-
}
|
139 |
-
if(jQuery('.header .links')){
|
140 |
-
jQuery('.header .links').replaceWith(data.toplink);
|
141 |
-
}
|
142 |
-
jQuery.fancybox.close();
|
143 |
-
}
|
144 |
-
}
|
145 |
-
function setLocationAjax(url,id){
|
146 |
-
url += 'isAjax/1';
|
147 |
-
url = url.replace("checkout/cart","ajax/index");
|
148 |
-
jQuery('#ajax_loader'+id).show();
|
149 |
-
try {
|
150 |
-
jQuery.ajax( {
|
151 |
-
url : url,
|
152 |
-
dataType : 'json',
|
153 |
-
success : function(data) {
|
154 |
-
jQuery('#ajax_loader'+id).hide();
|
155 |
-
setAjaxData(data,false);
|
156 |
-
}
|
157 |
-
});
|
158 |
-
} catch (e) {
|
159 |
-
}
|
160 |
-
}
|
161 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/ajax/checkout/cart/sidebar/default.phtml
DELETED
@@ -1,137 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$_item = $this->getItem();
|
3 |
-
$isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
|
4 |
-
$canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM);
|
5 |
-
?>
|
6 |
-
<li class="item">
|
7 |
-
<?php if ($this->hasProductUrl()): ?>
|
8 |
-
<a href="<?php echo $this->getProductUrl()?>" title="<?php echo $this->htmlEscape($this->getProductName()) ?>" class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" /></a>
|
9 |
-
<?php else: ?>
|
10 |
-
<span class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" /></span>
|
11 |
-
<?php endif; ?>
|
12 |
-
<div class="product-details">
|
13 |
-
<a href="<?php
|
14 |
-
$params = $this->getRequest()->getParams();
|
15 |
-
if($params['isAjax'] == 1){
|
16 |
-
$refererUrl = Mage::registry('referrer_url');
|
17 |
-
if (empty($refererUrl)) {
|
18 |
-
$refererUrl = Mage::getBaseUrl();
|
19 |
-
}
|
20 |
-
$deleteUrl = $this->getUrl(
|
21 |
-
'checkout/cart/delete',
|
22 |
-
array(
|
23 |
-
'id'=>$_item->getId(),
|
24 |
-
Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED => $this->helper('core/url')->getEncodedUrl($refererUrl)
|
25 |
-
)
|
26 |
-
);
|
27 |
-
}else{
|
28 |
-
$deleteUrl = $this->getDeleteUrl();
|
29 |
-
}
|
30 |
-
echo $deleteUrl;
|
31 |
-
?>" title="<?php echo $this->__('Remove This Item') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" class="btn-remove"><?php echo $this->__('Remove This Item') ?></a>
|
32 |
-
<?php if ($isVisibleProduct): ?>
|
33 |
-
<a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo $this->__('Edit item') ?>" class="btn-edit"><?php echo $this->__('Edit item')?></a>
|
34 |
-
<?php endif ?>
|
35 |
-
<p class="product-name"><?php if ($this->hasProductUrl()): ?><a href="<?php echo $this->getProductUrl() ?>"><?php endif; ?><?php echo $this->htmlEscape($this->getProductName()) ?><?php if ($this->hasProductUrl()): ?></a><?php endif; ?></p>
|
36 |
-
<strong><?php echo $this->getQty() ?></strong> x
|
37 |
-
|
38 |
-
<?php if ($canApplyMsrp): ?>
|
39 |
-
|
40 |
-
<span class="map-cart-sidebar-item"><?php echo $this->__('See price before order confirmation.'); ?></span>
|
41 |
-
|
42 |
-
<?php else: ?>
|
43 |
-
|
44 |
-
<?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
|
45 |
-
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
46 |
-
<?php echo $this->__('Excl. Tax'); ?>:
|
47 |
-
<?php endif; ?>
|
48 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
|
49 |
-
<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
|
50 |
-
<?php else: ?>
|
51 |
-
<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
|
52 |
-
<?php endif; ?>
|
53 |
-
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
54 |
-
<br />
|
55 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
|
56 |
-
<small>
|
57 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
58 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
|
59 |
-
<?php endforeach; ?>
|
60 |
-
</small>
|
61 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
|
62 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
63 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
|
64 |
-
<?php endforeach; ?>
|
65 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
|
66 |
-
<small>
|
67 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
68 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
|
69 |
-
<?php endforeach; ?>
|
70 |
-
</small>
|
71 |
-
<?php endif; ?>
|
72 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
|
73 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
|
74 |
-
<?php endif; ?>
|
75 |
-
<?php endif; ?>
|
76 |
-
<?php endif; ?>
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
<?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
|
81 |
-
<?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
|
82 |
-
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
83 |
-
<br /><?php echo $this->__('Incl. Tax'); ?>:
|
84 |
-
<?php endif; ?>
|
85 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
|
86 |
-
<?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
|
87 |
-
<?php else: ?>
|
88 |
-
<?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
|
89 |
-
<?php endif; ?>
|
90 |
-
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
91 |
-
<br />
|
92 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
|
93 |
-
<small>
|
94 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
95 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
|
96 |
-
<?php endforeach; ?>
|
97 |
-
</small>
|
98 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
|
99 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
100 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
|
101 |
-
<?php endforeach; ?>
|
102 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
|
103 |
-
<small>
|
104 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
105 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
|
106 |
-
<?php endforeach; ?>
|
107 |
-
</small>
|
108 |
-
<?php endif; ?>
|
109 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
|
110 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
|
111 |
-
<?php endif; ?>
|
112 |
-
<?php endif; ?>
|
113 |
-
<?php endif; ?>
|
114 |
-
|
115 |
-
<?php endif; //Can apply MSRP ?>
|
116 |
-
|
117 |
-
<?php if ($_options = $this->getOptionList()):?>
|
118 |
-
<div class="truncated">
|
119 |
-
<div class="truncated_full_value">
|
120 |
-
<dl class="item-options">
|
121 |
-
<?php foreach ($_options as $_option) : ?>
|
122 |
-
<dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
|
123 |
-
<dd>
|
124 |
-
<?php if (is_array($_option['value'])): ?>
|
125 |
-
<?php echo nl2br(implode("\n", $_option['value'])) ?>
|
126 |
-
<?php else: ?>
|
127 |
-
<?php echo $_option['value'] ?>
|
128 |
-
<?php endif; ?>
|
129 |
-
</dd>
|
130 |
-
<?php endforeach; ?>
|
131 |
-
</dl>
|
132 |
-
</div>
|
133 |
-
<a href="#" onclick="return false;" class="details"><?php echo $this->__('Details') ?></a>
|
134 |
-
</div>
|
135 |
-
<?php endif; ?>
|
136 |
-
</div>
|
137 |
-
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/ajax/checkout/cart/sidebar/default1.5.phtml
DELETED
@@ -1,153 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/afl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category design
|
22 |
-
* @package base_default
|
23 |
-
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
-
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
-
*/
|
26 |
-
?>
|
27 |
-
<?php
|
28 |
-
$_item = $this->getItem();
|
29 |
-
$isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
|
30 |
-
?>
|
31 |
-
<li class="item">
|
32 |
-
<?php if ($this->hasProductUrl()): ?>
|
33 |
-
<a href="<?php echo $this->getProductUrl()?>" title="<?php echo $this->htmlEscape($this->getProductName()) ?>" class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" /></a>
|
34 |
-
<?php else: ?>
|
35 |
-
<span class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" /></span>
|
36 |
-
<?php endif; ?>
|
37 |
-
<div class="product-details">
|
38 |
-
<a href="<?php
|
39 |
-
$params = $this->getRequest()->getParams();
|
40 |
-
if($params['isAjax'] == 1){
|
41 |
-
$refererUrl = Mage::registry('referrer_url');
|
42 |
-
if (empty($refererUrl)) {
|
43 |
-
$refererUrl = Mage::getBaseUrl();
|
44 |
-
}
|
45 |
-
$deleteUrl = $this->getUrl(
|
46 |
-
'checkout/cart/delete',
|
47 |
-
array(
|
48 |
-
'id'=>$_item->getId(),
|
49 |
-
Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED => $this->helper('core/url')->getEncodedUrl($refererUrl)
|
50 |
-
)
|
51 |
-
);
|
52 |
-
}else{
|
53 |
-
$deleteUrl = $this->getDeleteUrl();
|
54 |
-
}
|
55 |
-
echo $deleteUrl;
|
56 |
-
?>" title="<?php echo $this->__('Remove This Item') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" class="btn-remove"><?php echo $this->__('Remove This Item') ?></a>
|
57 |
-
<?php if ($isVisibleProduct): ?>
|
58 |
-
<a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo $this->__('Edit item') ?>" class="btn-edit"><?php echo $this->__('Edit item')?></a>
|
59 |
-
<?php endif ?>
|
60 |
-
<p class="product-name"><?php if ($this->hasProductUrl()): ?><a href="<?php echo $this->getProductUrl() ?>"><?php endif; ?><?php echo $this->htmlEscape($this->getProductName()) ?><?php if ($this->hasProductUrl()): ?></a><?php endif; ?></p>
|
61 |
-
<strong><?php echo $this->getQty() ?></strong> x
|
62 |
-
|
63 |
-
<?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
|
64 |
-
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
65 |
-
<?php echo $this->__('Excl. Tax'); ?>:
|
66 |
-
<?php endif; ?>
|
67 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
|
68 |
-
<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
|
69 |
-
<?php else: ?>
|
70 |
-
<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
|
71 |
-
<?php endif; ?>
|
72 |
-
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
73 |
-
<br />
|
74 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
|
75 |
-
<small>
|
76 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
77 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
|
78 |
-
<?php endforeach; ?>
|
79 |
-
</small>
|
80 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
|
81 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
82 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
|
83 |
-
<?php endforeach; ?>
|
84 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
|
85 |
-
<small>
|
86 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
87 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
|
88 |
-
<?php endforeach; ?>
|
89 |
-
</small>
|
90 |
-
<?php endif; ?>
|
91 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
|
92 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
|
93 |
-
<?php endif; ?>
|
94 |
-
<?php endif; ?>
|
95 |
-
<?php endif; ?>
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
<?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
|
100 |
-
<?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
|
101 |
-
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
102 |
-
<br /><?php echo $this->__('Incl. Tax'); ?>:
|
103 |
-
<?php endif; ?>
|
104 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
|
105 |
-
<?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
|
106 |
-
<?php else: ?>
|
107 |
-
<?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
|
108 |
-
<?php endif; ?>
|
109 |
-
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
110 |
-
<br />
|
111 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
|
112 |
-
<small>
|
113 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
114 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
|
115 |
-
<?php endforeach; ?>
|
116 |
-
</small>
|
117 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
|
118 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
119 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
|
120 |
-
<?php endforeach; ?>
|
121 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
|
122 |
-
<small>
|
123 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
124 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
|
125 |
-
<?php endforeach; ?>
|
126 |
-
</small>
|
127 |
-
<?php endif; ?>
|
128 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
|
129 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
|
130 |
-
<?php endif; ?>
|
131 |
-
<?php endif; ?>
|
132 |
-
<?php endif; ?>
|
133 |
-
<?php if ($_options = $this->getOptionList()):?>
|
134 |
-
<div class="truncated">
|
135 |
-
<div class="truncated_full_value">
|
136 |
-
<dl class="item-options">
|
137 |
-
<?php foreach ($_options as $_option) : ?>
|
138 |
-
<dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
|
139 |
-
<dd>
|
140 |
-
<?php if (is_array($_option['value'])): ?>
|
141 |
-
<?php echo nl2br(implode("\n", $_option['value'])) ?>
|
142 |
-
<?php else: ?>
|
143 |
-
<?php echo $_option['value'] ?>
|
144 |
-
<?php endif; ?>
|
145 |
-
</dd>
|
146 |
-
<?php endforeach; ?>
|
147 |
-
</dl>
|
148 |
-
</div>
|
149 |
-
<a href="#" onclick="return false;" class="details"><?php echo $this->__('Details') ?></a>
|
150 |
-
</div>
|
151 |
-
<?php endif; ?>
|
152 |
-
</div>
|
153 |
-
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/etc/modules/Amar_Ajax.xml
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Amar_Ajax>
|
5 |
-
<active>true</active>
|
6 |
-
<codePool>local</codePool>
|
7 |
-
</Amar_Ajax>
|
8 |
-
</modules>
|
9 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/etc/modules/Excel_AjaxWishlist.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Excel_AjaxWishlist>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Excel_AjaxWishlist>
|
8 |
+
</modules>
|
9 |
+
</config>
|
js/jquery/jquery-1.6.4.min.js
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */
|
2 |
-
(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(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 bZ(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 bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bA.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(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 bW(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===bP,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=bW(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bW(a,c,d,e,"*",g));return l}function bV(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bL),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 by(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bt:bu;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bf(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function V(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(Q.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 U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(w,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,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=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};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=n.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.6.4",length:0,size:function(){return this.length},toArray:function(){return G.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)?F.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(),B.done(a);return this},eq:function(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(G.apply(this,arguments),"slice",G.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:F,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;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw 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(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){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(x,"ms-").replace(w,y)},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:H?function(a){return a==null?"":H.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)?F.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(!b)return-1;if(I)return I.call(b,a);for(var c=0,d=b.length;c<d;c++)if(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=G.call(arguments,2),g=function(){return a.apply(c,f.concat(G.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.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){J["[object "+b+"]"]=b.toLowerCase()}),A=e.uaMatch(z),A.browser&&(e.browser[A.browser]=!0,e.browser.version=A.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?C=function(){c.removeEventListener("DOMContentLoaded",C,!1),e.ready()}:c.attachEvent&&(C=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",C),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g+"With"](this===b?d:this,[h])}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.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:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([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&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=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=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},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"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return 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(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},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._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u,v;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},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(o);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(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");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(o);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+" ";for(var c=0,d=this.length;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.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.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),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=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},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},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.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(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.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=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(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}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?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.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.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.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 w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete
|
3 |
-
t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,M(a.origType,a.selector),f.extend({},a,{handler:L,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,M(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},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.preventDefault)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()?D:C):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=D;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=D;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=D,this.stopPropagation()},isDefaultPrevented:C,isPropagationStopped:C,isImmediatePropagationStopped:C};var E=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},F=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?F:E,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?F:E)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";(c==="submit"||c==="image")&&f(b).closest("form").length&&J("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&J("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var G,H=function(a){var b=f.nodeName(a,"input")?a.type:"",c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},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)}});var K={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||C,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=w.exec(h),k="",j&&(k=j[0],h=h.replace(w,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,K[h]?(a.push(K[h]+k),h=h+k):h=(K[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+M(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+M(h,m),e)}return this}}),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".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.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&&!j.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&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.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&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,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(i,"")+" ";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(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.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]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),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]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.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!!k(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=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([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}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||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=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":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=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=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(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)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 s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=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}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},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)&&(l.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:[]}},l.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&&(l.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")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[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}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.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 k(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;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var N=/Until$/,O=/^(?:parents|prevUntil|prevAll)/,P=/,/,Q=/^.[^:#\[\.,]*$/,R=Array.prototype.slice,S=f.expr.match.POS,T={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(V(this,a,!1),"not",a)},filter:function(a){return this.pushStack(V(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?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,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=S.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.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(l?l.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(U(c[0])||U(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),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.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 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|object|embed|option|style)/i,bb=/checked\s*(?:[^=]|=\s*.checked.)/i,bc=/\/(java|ecma)script/i,bd=/^\s*<!(?:\[CDATA\[|\-\-)/,be={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,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},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){return this.each(function(){f(this).wrapAll(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(arguments[0]);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(arguments[0]).toArray());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){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},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"&&bb.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?bf(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bl)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!ba.test(a[0])&&(f.support.checkClone||!bb.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean
|
4 |
-
(a,i,e,d)),g&&(f.fragments[a[0]]=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=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bk(k[i]);else bk(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bc.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bm=/alpha\([^)]*\)/i,bn=/opacity=([^)]*)/,bo=/([A-Z]|^ms)/g,bp=/^-?\d+(?:px)?$/i,bq=/^-?\d/,br=/^([\-+])=([\-+.\de]+)/,bs={position:"absolute",visibility:"hidden",display:"block"},bt=["Left","Right"],bu=["Top","Bottom"],bv,bw,bx;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bv(a,"opacity","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=br.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(bv)return bv(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return by(a,b,d);f.swap(a,bs,function(){e=by(a,b,d)});return e}},set:function(a,b){if(!bp.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.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.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,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.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.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(bJ,"")).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||bK.test(this.nodeName)||bE.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(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(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?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},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:bV(bP),ajaxTransport:bV(bQ),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?bZ(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=b$(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.resolveWith(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._Deferred(),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=bD.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.done,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(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.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]!=="*"?", "+bT+"; 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=bW(bQ,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){s<2?w(-1,z):f.error(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)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.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(ca,l),b.url===j&&(e&&(k=k.replace(ca,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 cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,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,cb&&delete cd[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),m.text=h.responseText;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=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("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._data(d,"olddisplay",cr(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(cq("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].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(cq("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){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){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;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),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?(j=cr(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cq("show",1),slideUp:cq("hide",1),slideToggle:cq("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,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},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,b,c){function g(a){return d.step(a)}var d=this,e=f.fx;this.startTime=cn||co(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&f.timers.push(g)&&!cl&&(cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||co(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=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.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cs=/^t(?:able|d|h)$/i,ct=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cu(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cs.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.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=ct.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&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
|
|
|
|
|
|
|
|
js/jquery/noconflict.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
jQuery.noConflict();
|
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ajax_Addtocart</name>
|
4 |
-
<version>0.1
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description
|
11 |
-
<notes>
|
12 |
-
<authors><author><name>
|
13 |
-
<date>
|
14 |
-
<time>13:51
|
15 |
-
<contents><target name="
|
16 |
<compatible/>
|
17 |
-
<dependencies
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ajax_Addtocart</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Magento ajax cart with Wishlist extension</summary>
|
10 |
+
<description><p><b>Magento ajax cart with Wishlist extension</b> allows customers to without waiting for pages to reload each time adding items to Wishlist or Removing items to wishlist and adding items to cart or removing items from cart</p></description>
|
11 |
+
<notes>This is a First Version of Ajax Cart With Wishlist</notes>
|
12 |
+
<authors><author><name>Amar Infotech</name><user>Amar</user><email>info@amarinfotech.com</email></author></authors>
|
13 |
+
<date>2014-05-16</date>
|
14 |
+
<time>13:57:51</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Excel"><dir name="AjaxWishlist"><dir name="Block"><dir name="Adminhtml"><file name="Info.php" hash="a555422a66a781a2c74430dae56939f9"/><file name="Url.php" hash="5397128dcf571227c30f9229cabc2f46"/></dir><file name="AjaxWishlist.php" hash="97ff812df6bd7316be00bf4dcb22b089"/><dir name="Customer"><file name="Wishlist.php" hash="f5ac0d83f8d2682f430b276da3e1a7ed"/></dir></dir><dir name="controllers"><dir name="Checkout"><file name="CartController.php" hash="92d25a5a1439d6bc10544df917055371"/></dir><file name="IndexController.php" hash="10da64c68fa6659cb3eae07ca93c11bc"/></dir><dir name="etc"><file name="adminhtml.xml" hash="768fe375e7c53831670d3676a0428503"/><file name="config.xml" hash="a6d499f6275d0cfe6dd390bf4dbbeb77"/><file name="system.xml" hash="ab03c331300d56a1fbdc58b8d92bf168"/></dir><dir name="Helper"><file name="Data.php" hash="a5bc0fad137a55ab8348f350b44594c4"/></dir><dir name="Model"><file name="Observer.php" hash="45c41880f30153451942d8d30ccb41b7"/><file name="Response.php" hash="f4de1316577aad1f6fc6f30b6de879ff"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Validate.php" hash="17c60a4cb9087c4ad4231ebd532b91cc"/></dir><dir name="Source"><dir name="Dropdown"><file name="Sidebar.php" hash="434b60ca3e41ea23d982fd6e6b16a619"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ajaxwishlist.xml" hash="eeb9d7027cd3ed3be9c0913fef92b962"/></dir><dir name="template"><dir name="ajaxwishlist"><dir name="ajaxcart"><file name="configurable_options.phtml" hash="d40579c8e254a30b009b5bfdd1bd722a"/><file name="grouped_options.phtml" hash="7409b93efccff6dbabd5c4c8a19b0cda"/></dir><dir name="catalog"><dir name="product"><dir name="compare"><file name="sidebar.phtml" hash="e15d91b928ee64cdffe92ecd7360e900"/></dir><dir name="list"><file name="related.phtml" hash="9bfcaabb7f06eb9575d738e73ca6529a"/></dir><file name="list.phtml" hash="812a34255659bc9f761c937701ed1180"/><dir name="view"><file name="addto_jQ.phtml" hash="149972868b6fb959157298b77383464f"/><file name="addto.phtml" hash="b934b40c5d4e50bde753403e647ab0be"/><file name="media.phtml" hash="88faf59c337914eeb10b39efedcf7eb6"/></dir></dir></dir><file name="common.phtml" hash="e25e7df4ac86f980036c47e3305055a0"/><dir name="wishlist"><dir name="button"><file name="share.phtml" hash="c1f84576e1cf718a01cea32536f0c895"/><file name="tocart.phtml" hash="5631b0876822ea16b88f98d35dc559b4"/><file name="update.phtml" hash="3c64549efc4e1175a8b8f9a2eca3af11"/></dir><dir name="item"><dir name="column"><file name="cart.phtml" hash="109b033a84e6884585c5e985092b12c1"/><file name="image.phtml" hash="364fbd6b5150cc3ed558182b45cf50f6"/><file name="info.phtml" hash="63fe9d5b5bde8a362f9880b96abbbe76"/><file name="remove_bk.phtml" hash="54328860de6dc52fb2e4dea2142d4a8b"/><file name="remove.phtml" hash="7ca2a7034f39108c087ccd6bfe649a6f"/></dir><dir name="configure"><file name="addto.phtml" hash="9897e62a637904f305ca2fb1803bbf2c"/></dir><file name="list.phtml" hash="5787c30e88f24ec9392adeccc2741e57"/></dir><file name="sharing.phtml" hash="1981bc96ac9fb3a2ba87e13d1cda7451"/><file name="sidebar.phtml" hash="3a426da745c7976460683c897733195d"/><file name="view.phtml" hash="10a38023aebd20a6eb2fa32238c4fe94"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Excel_AjaxWishlist.xml" hash="8e87880638cadfa52a2e944da7aae21e"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="ajaxwishlist"><dir name="ajaxcart"><file name="growler.css" hash="c13a01e28cb4eb98b1fbc4a419d906cf"/><file name="modalbox.css" hash="c4b79ad9f283e347316aa3294f54e35f"/></dir><file name="ajaxwishlist.css" hash="178e70c7f7c7359f9a677db060d8bb9a"/><dir name="lightview"><file name="lightviewyoung_.css" hash="8630ff7e0e028154c533a2fda17d8bfd"/><file name="lightviewyoung.css" hash="6ccf4c903000a344b60ea16bbe08995c"/></dir></dir></dir><dir name="images"><dir name="ajaxWishlist"><dir name="ajaxcart"><file name="btn_popup-close.png" hash="d8f4d8f8f31e280521dad53025163258"/><file name="right.jpg" hash="f0a9403e6ece29fb745b49fd82310383"/><file name="spinner.gif" hash="58625c045f515052999e13aed5059b07"/><file name="wrong.jpg" hash="131a367c72edf12509e36d75c8e45ec6"/></dir><file name="opc-ajax-loader.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="star_empty.png" hash="c1d1c8f394e98b2d2e1a156a16647d04"/><file name="star_select.png" hash="74f1601ce410c05006a1d7152c27f924"/></dir></dir><dir name="js"><dir name="ajaxwishlist"><dir name="ajaxcart"><file name="ajaxcart.js" hash="6c9ccaf0fb2397523102d2860d269382"/><file name="growler.js" hash="816d275972bbe9c048033643755fb194"/><file name="modalbox.js" hash="d775aab13b070263296a4ae40f9f101b"/></dir><file name="ajaxwishlist.js" hash="742a97402d1830086a77a4625d6fe2e8"/><dir name="images"><dir name="lightview"><file name="close_large.png" hash="645793baeda9d957b627684f4e1a77f5"/><file name="close_small.png" hash="b6f2a59466815a258b229e8e3f5f9c8f"/><file name="controller_close.png" hash="b4ae06e3b296c6482702e6a987ba93a8"/><file name="controller_next.png" hash="d628de4f7127054de58e60ce6159acf9"/><file name="controller_prev.png" hash="fc3a49b204cf11f07b3c0491809b7365"/><file name="controller_slideshow_play.png" hash="847eba3ac14abc5611c3a7adf04e29f0"/><file name="controller_slideshow_stop.png" hash="e708e953c259c0c34f48b5a24cb52514"/><file name="icon-nav.gif" hash="91e5102a5ccd2ffc3c0a6691098fec82"/><file name="icon-nav-right.png" hash="aebb86797ef333a014cf90fd1602fe6a"/><file name="inner_next.png" hash="94e669b7fa9b4b605a90c455d60b8a34"/><file name="inner_prev.png" hash="80f641880cfa89fc1f8602aede1e69d8"/><file name="inner_slideshow_play.png" hash="1e6389744c8635868669114084615cc2"/><file name="inner_slideshow_stop.png" hash="4d03851384955623b5bca14e6d065c2c"/><file name="loading.gif" hash="593d74e4a719b265d428fc1310a3814c"/><file name="next.png" hash="cd6b38591f91f6a8bba704fb0223e36d"/><file name="prev.png" hash="7e052c08b744bc50bc75253d2b3b2207"/><file name="product_img1.png" hash="9faae0fdac6e872d02e8000b1abb9952"/><file name="product_img2.png" hash="9faae0fdac6e872d02e8000b1abb9952"/><file name="product_img.png" hash="9faae0fdac6e872d02e8000b1abb9952"/><file name="topclose.png" hash="1c3b2fbcca32814e9f00ac868f498705"/></dir></dir><dir name="lightview"><file name="builder.js" hash="c6321f204481f259724bd6455c0fdded"/><file name="controls.js" hash="03b502fd8ae202eb164b348749392720"/><file name="dragdrop.js" hash="046759400db7a6096376e50110104edd"/><file name="effects.js" hash="0dea24894889a4c537e1a451a35f03ca"/><file name="lightview.js" hash="7a81c5db29b472a8e1d2433ea3ff8a0e"/><file name="prototype.js" hash="007ae2fe795811f80cedf92fdb591c1b"/><file name="scriptaculous.js" hash="bb679d586e7fccb154156baaef9dfde5"/><file name="slider.js" hash="a9e58cc5f8dd281daa8d8dfee6a78834"/><file name="sound.js" hash="0b22e4379d79b33b696ee3cccf2827b5"/><file name="unittest.js" hash="07c049c24cb838939925425bb555cdf6"/></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Excel_AjaxWishlist</name><channel>Community</channel><min>1.5</min><max>1.8</max></package></required></dependencies>
|
18 |
</package>
|
skin/frontend/base/default/css/ajaxwishlist/ajaxcart/growler.css
ADDED
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#extabs span#tb4 {
|
2 |
+
width: 100px;
|
3 |
+
}
|
4 |
+
div#noticeevents {
|
5 |
+
border: 1px solid #999;
|
6 |
+
background-color: #FFF;
|
7 |
+
height: 100px;
|
8 |
+
overflow: auto;
|
9 |
+
}
|
10 |
+
div#noticeevents div {
|
11 |
+
border-bottom: 1px dotted #DDD;
|
12 |
+
padding: 3px;
|
13 |
+
margin: 0px;
|
14 |
+
}
|
15 |
+
.runner {
|
16 |
+
-moz-border-radius: 5px;
|
17 |
+
-webkit-border-radius: 5px;
|
18 |
+
float: right;
|
19 |
+
font-size: .8em;
|
20 |
+
background-color: #333;
|
21 |
+
color: #FFF;
|
22 |
+
padding: 2px 10px 5px 10px;
|
23 |
+
cursor: pointer;
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
+
/** Growler Notice Custom Styling **/
|
28 |
+
div.Growler-notice {
|
29 |
+
background-color: #000;
|
30 |
+
color: #fff;
|
31 |
+
opacity: .85;
|
32 |
+
filter: alpha(opacity = 85);
|
33 |
+
zoom: 1;
|
34 |
+
width: 235px;
|
35 |
+
padding: 10px;
|
36 |
+
margin-top: 5px;
|
37 |
+
margin-bottom: 5px;
|
38 |
+
margin-left: auto;
|
39 |
+
margin-right: auto;
|
40 |
+
font-family: Tahoma, Arial, Helvetica, sans-serif;
|
41 |
+
font-size: 12px;
|
42 |
+
text-align: left;
|
43 |
+
display: none;
|
44 |
+
-moz-border-radius: 5px;
|
45 |
+
-webkit-border-radius: 5px;
|
46 |
+
min-height: 40px;
|
47 |
+
z-index: 10000;
|
48 |
+
}
|
49 |
+
|
50 |
+
div.Growler-notice-head {
|
51 |
+
font-weight: bold;
|
52 |
+
font-size: 10px;
|
53 |
+
}
|
54 |
+
|
55 |
+
div.Growler-notice-exit {
|
56 |
+
float: right;
|
57 |
+
font-weight: bold;
|
58 |
+
font-size: 12px;
|
59 |
+
cursor: pointer;
|
60 |
+
}
|
61 |
+
|
62 |
+
/** Plain Theme **/
|
63 |
+
div.plain {
|
64 |
+
color: #000;
|
65 |
+
width: 253px;
|
66 |
+
margin-top: 5px;
|
67 |
+
margin-bottom: 5px;
|
68 |
+
text-align: left;
|
69 |
+
display: none;
|
70 |
+
min-height: 40px;
|
71 |
+
background-color: #EDEDED;
|
72 |
+
border: 1px solid #777;
|
73 |
+
}
|
74 |
+
|
75 |
+
div.plain div.Growler-notice-head {
|
76 |
+
font-weight: bold;
|
77 |
+
font-size: 10px;
|
78 |
+
padding: 2px 10px;
|
79 |
+
}
|
80 |
+
|
81 |
+
div.plain div.Growler-notice-exit {
|
82 |
+
float: right;
|
83 |
+
cursor: pointer;
|
84 |
+
margin: 0px;
|
85 |
+
padding: 0px 0px 2px 2px;
|
86 |
+
width: 10px;
|
87 |
+
height: 10px;
|
88 |
+
color: #BFBFBF;
|
89 |
+
}
|
90 |
+
div.plain div.Growler-notice-body {
|
91 |
+
padding: 5px;
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
/** Mac OS X Theme **/
|
96 |
+
div.macosx {
|
97 |
+
color: #000;
|
98 |
+
width: 253px;
|
99 |
+
margin-top: 5px;
|
100 |
+
margin-bottom: 5px;
|
101 |
+
text-align: left;
|
102 |
+
display: none;
|
103 |
+
min-height: 40px;
|
104 |
+
background: #d7d7d7 url(../images/macosx.jpg) repeat-y 0;
|
105 |
+
border: 1px solid #C9C9C9;
|
106 |
+
}
|
107 |
+
|
108 |
+
div.macosx div.Growler-notice-head {
|
109 |
+
font-weight: bold;
|
110 |
+
font-size: 10px;
|
111 |
+
padding: 5px 10px;
|
112 |
+
}
|
113 |
+
|
114 |
+
div.macosx div.Growler-notice-exit {
|
115 |
+
width: 15px;
|
116 |
+
height: 15px;
|
117 |
+
float: left;
|
118 |
+
cursor: pointer;
|
119 |
+
margin: 4px;
|
120 |
+
margin-left: 1px;
|
121 |
+
font-size: 0em;
|
122 |
+
color: transparent;
|
123 |
+
background: transparent url(../images/macosx_exit.png) no-repeat left 0;
|
124 |
+
}
|
125 |
+
div.macosx div.Growler-notice-exit:hover {
|
126 |
+
background: transparent url(../images/macosx_exit_over.png) no-repeat left 0;
|
127 |
+
}
|
128 |
+
div.macosx div.Growler-notice-body {
|
129 |
+
padding: 2px 0 10px 25px;
|
130 |
+
}
|
131 |
+
|
132 |
+
/** Candybars Theme **/
|
133 |
+
div.candybar {
|
134 |
+
color: #000;
|
135 |
+
width: 253px;
|
136 |
+
margin-top: 5px;
|
137 |
+
margin-bottom: 5px;
|
138 |
+
text-align: left;
|
139 |
+
display: none;
|
140 |
+
min-height: 40px;
|
141 |
+
background-color: #F5F7FA;
|
142 |
+
border: 1px solid #19304B;
|
143 |
+
}
|
144 |
+
|
145 |
+
div.candybar div.Growler-notice-head {
|
146 |
+
font-weight: bold;
|
147 |
+
font-size: 10px;
|
148 |
+
background: url(../images/candybars.jpg) repeat-x;
|
149 |
+
padding: 5px 10px;
|
150 |
+
}
|
151 |
+
|
152 |
+
div.candybar div.Growler-notice-exit {
|
153 |
+
float: right;
|
154 |
+
cursor: pointer;
|
155 |
+
margin: 3px;
|
156 |
+
}
|
157 |
+
div.candybar div.Growler-notice-body {
|
158 |
+
border-top: 1px solid #999;
|
159 |
+
padding: 10px;
|
160 |
+
}
|
161 |
+
|
162 |
+
/** Construction Theme **/
|
163 |
+
div.atwork {
|
164 |
+
color: #FFF;
|
165 |
+
width: 253px;
|
166 |
+
margin-top: 5px;
|
167 |
+
margin-bottom: 5px;
|
168 |
+
text-align: left;
|
169 |
+
display: none;
|
170 |
+
min-height: 40px;
|
171 |
+
background: #4d4d4d url(../images/atwork.png) repeat-y 0;
|
172 |
+
border: 1px solid #222;
|
173 |
+
}
|
174 |
+
|
175 |
+
div.atwork div.Growler-notice-head {
|
176 |
+
font-weight: bold;
|
177 |
+
font-size: 12px;
|
178 |
+
padding: 5px 20px;
|
179 |
+
color: #efca23;
|
180 |
+
|
181 |
+
}
|
182 |
+
|
183 |
+
div.atwork div.Growler-notice-exit {
|
184 |
+
float: right;
|
185 |
+
cursor: pointer;
|
186 |
+
margin: 3px;
|
187 |
+
}
|
188 |
+
div.atwork div.Growler-notice-body {
|
189 |
+
padding: 2px 0 10px 25px;
|
190 |
+
}
|
191 |
+
|
skin/frontend/base/default/css/ajaxwishlist/ajaxcart/modalbox.css
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#MB_overlay {
|
2 |
+
position: absolute;
|
3 |
+
margin: auto;
|
4 |
+
top: 0; left: 0;
|
5 |
+
width: 100%; height: 100%;
|
6 |
+
/* z-index: 9999; */
|
7 |
+
z-index: 15;
|
8 |
+
border: 0;
|
9 |
+
background-color: #000!important;
|
10 |
+
}
|
11 |
+
#MB_overlay[id] { position: fixed; }
|
12 |
+
|
13 |
+
#MB_window {
|
14 |
+
position: absolute;
|
15 |
+
top: 0;
|
16 |
+
border: 0 solid;
|
17 |
+
text-align: left;
|
18 |
+
/* z-index: 10000; */
|
19 |
+
z-index: 15;
|
20 |
+
}
|
21 |
+
#MB_window[id] { position: fixed!important; }
|
22 |
+
|
23 |
+
#MB_frame {
|
24 |
+
position: relative;
|
25 |
+
background-color: #EFEFEF;
|
26 |
+
height: 100%;
|
27 |
+
}
|
28 |
+
|
29 |
+
#MB_header {
|
30 |
+
margin: 0;
|
31 |
+
padding: 0;
|
32 |
+
}
|
33 |
+
|
34 |
+
#MB_content {
|
35 |
+
position: relative;
|
36 |
+
padding: 6px .75em;
|
37 |
+
overflow: auto;
|
38 |
+
}
|
39 |
+
|
40 |
+
#MB_caption {
|
41 |
+
font: bold 100% "Lucida Grande", Arial, sans-serif;
|
42 |
+
text-shadow: #FFF 0 1px 0;
|
43 |
+
padding: .5em 2em .5em .75em;
|
44 |
+
margin: 0;
|
45 |
+
text-align: left;
|
46 |
+
}
|
47 |
+
|
48 |
+
#MB_close {
|
49 |
+
display: block;
|
50 |
+
position: absolute;
|
51 |
+
right: 5px; top: 4px;
|
52 |
+
padding: 2px 3px;
|
53 |
+
font-weight: bold;
|
54 |
+
text-decoration: none;
|
55 |
+
font-size: 13px;
|
56 |
+
}
|
57 |
+
#MB_close:hover {
|
58 |
+
background: transparent;
|
59 |
+
}
|
60 |
+
|
61 |
+
#MB_loading {
|
62 |
+
padding: 1.5em;
|
63 |
+
text-indent: -10000px;
|
64 |
+
/* background: transparent url(spinner.gif) 50% 0 no-repeat; */
|
65 |
+
}
|
66 |
+
|
67 |
+
/* Color scheme */
|
68 |
+
#MB_window {
|
69 |
+
background-color: #EFEFEF;
|
70 |
+
color: #000;
|
71 |
+
|
72 |
+
-webkit-box-shadow: 0 0 64px #000;
|
73 |
+
-moz-box-shadow: #000 0 0 64px;
|
74 |
+
box-shadow: 0 0 64px #000;
|
75 |
+
}
|
76 |
+
#MB_frame {
|
77 |
+
padding-bottom: 4px;
|
78 |
+
|
79 |
+
-webkit-border-bottom-left-radius: 4px;
|
80 |
+
-webkit-border-bottom-right-radius: 4px;
|
81 |
+
|
82 |
+
-moz-border-radius-bottomleft: 4px;
|
83 |
+
-moz-border-radius-bottomright: 4px;
|
84 |
+
|
85 |
+
border-bottom-left-radius: 4px;
|
86 |
+
border-bottom-right-radius: 4px;
|
87 |
+
}
|
88 |
+
|
89 |
+
#MB_content { border-top: 1px solid #F9F9F9; }
|
90 |
+
|
91 |
+
#MB_header {
|
92 |
+
background-color: #DDD;
|
93 |
+
border-bottom: 1px solid #CCC;
|
94 |
+
}
|
95 |
+
#MB_caption { color: #000 }
|
96 |
+
#MB_close { color: #777 }
|
97 |
+
#MB_close:hover { color: #000 }
|
98 |
+
|
99 |
+
|
100 |
+
/* Alert message */
|
101 |
+
.MB_alert {
|
102 |
+
margin: 10px 0;
|
103 |
+
text-align: center;
|
104 |
+
}
|
skin/frontend/base/default/css/ajaxwishlist/ajaxwishlist.css
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
/* css of list page : Ajax wishlist button of product list page*/
|
4 |
+
|
5 |
+
.category-products #wishlist_list
|
6 |
+
{
|
7 |
+
text-align: right;
|
8 |
+
width:100%;
|
9 |
+
}
|
10 |
+
.category-products .wishlist_list_view{
|
11 |
+
padding-left: 136px;
|
12 |
+
text-align: left !important;
|
13 |
+
}
|
14 |
+
.category-products .wishlist_list_view .ajax_loadder{
|
15 |
+
float: right;
|
16 |
+
margin-left: -45px !important;
|
17 |
+
margin-top: 5px;
|
18 |
+
position: absolute;
|
19 |
+
width: 22%; }
|
20 |
+
|
21 |
+
.ajax_compare_loading{ float: right;padding-left: 4px;}
|
22 |
+
|
23 |
+
.category-products #wishlist_list .wishlist_button , .category-products #wishlist_list .wishlist_button_select
|
24 |
+
{
|
25 |
+
border: 0 none;
|
26 |
+
float: right;
|
27 |
+
height: 16px;
|
28 |
+
margin-left: -22px;
|
29 |
+
margin-top: 5px;
|
30 |
+
position: absolute;
|
31 |
+
width: 16px;
|
32 |
+
cursor: pointer;
|
33 |
+
}
|
34 |
+
.category-products #wishlist_list .ajax_loadder{
|
35 |
+
|
36 |
+
float: right;
|
37 |
+
margin-left: 5px;
|
38 |
+
margin-top: 5px;
|
39 |
+
position: absolute;
|
40 |
+
width: 22%;
|
41 |
+
}
|
42 |
+
/* css of list page : Ajax wishlist button of product list page end Here*/
|
43 |
+
|
44 |
+
/* css of View page : Ajax wishlist button of product View page of iamge zoom*/
|
45 |
+
|
46 |
+
.product-essential #wishlist_list
|
47 |
+
{
|
48 |
+
text-align: right;
|
49 |
+
width:100%;
|
50 |
+
}
|
51 |
+
.product-essential #wishlist_list .wishlist_button , .product-essential #wishlist_list .wishlist_button_select{
|
52 |
+
|
53 |
+
border: 0 none;
|
54 |
+
float: right;
|
55 |
+
height: 16px;
|
56 |
+
margin-left: -22px;
|
57 |
+
margin-top: 5px;
|
58 |
+
position: absolute;
|
59 |
+
width: 16px;
|
60 |
+
cursor: pointer;
|
61 |
+
|
62 |
+
}
|
63 |
+
.product-essential #wishlist_list .ajax_loadder{
|
64 |
+
|
65 |
+
float: right;
|
66 |
+
margin-left: 10px;
|
67 |
+
margin-top: 5px;
|
68 |
+
position: absolute;
|
69 |
+
width: 17%;
|
70 |
+
}
|
71 |
+
|
72 |
+
/* css of View page : Ajax wishlist button of product View page of iamge zoom end here */
|
73 |
+
|
74 |
+
.block-wishlist .block-content #wishlist_list
|
75 |
+
{
|
76 |
+
text-align: right;
|
77 |
+
width:100%;
|
78 |
+
}
|
79 |
+
.block-wishlist .block-content #wishlist_list .wishlist_button ,.block-wishlist .block-content #wishlist_list .wishlist_button_select
|
80 |
+
{
|
81 |
+
border: 0 none;
|
82 |
+
cursor: pointer;
|
83 |
+
height: 16px;
|
84 |
+
margin-left: -19px;
|
85 |
+
margin-top: 3px;
|
86 |
+
position: absolute;
|
87 |
+
width: 16px;
|
88 |
+
}
|
89 |
+
.block-wishlist .block-content #wishlist_list .ajax_loadder_sidebar{
|
90 |
+
|
91 |
+
float: right;
|
92 |
+
margin-left: 10px;
|
93 |
+
margin-top: 5px;
|
94 |
+
position: absolute;
|
95 |
+
|
96 |
+
}
|
97 |
+
|
98 |
+
|
99 |
+
|
100 |
+
/* related Product */
|
101 |
+
|
102 |
+
.block-related .block-content .block-content #wishlist_list
|
103 |
+
{
|
104 |
+
text-align: right;
|
105 |
+
widht:100%;
|
106 |
+
}
|
107 |
+
.block-related .block-content #wishlist_list .wishlist_button ,.block-related .block-content #wishlist_list .wishlist_button_select
|
108 |
+
{
|
109 |
+
border: 0 none;
|
110 |
+
cursor: pointer;
|
111 |
+
height: 16px;
|
112 |
+
margin-left: 32px;
|
113 |
+
margin-top: 4px;
|
114 |
+
position: absolute;
|
115 |
+
width: 16px;
|
116 |
+
}
|
117 |
+
|
118 |
+
.block-related .block-content #wishlist_list .ajax_loadder{
|
119 |
+
|
120 |
+
float: right;
|
121 |
+
margin-left: 10px;
|
122 |
+
margin-top: 5px;
|
123 |
+
position: absolute;
|
124 |
+
width: 17%;
|
125 |
+
}
|
126 |
+
/* related Product end here */
|
127 |
+
|
128 |
+
|
129 |
+
|
130 |
+
.my-wishlist .ajax_loadder{
|
131 |
+
|
132 |
+
float: right;
|
133 |
+
left: 93%;
|
134 |
+
margin-left: 10px;
|
135 |
+
margin-top: 5px;
|
136 |
+
position: absolute;
|
137 |
+
}
|
138 |
+
.my-wishlist .lightviewQty{
|
139 |
+
text-align: center;
|
140 |
+
clear: both;
|
141 |
+
width: 100%;
|
142 |
+
margin-bottom: 8px;
|
143 |
+
|
144 |
+
}
|
145 |
+
.my-wishlist .data-table .odd,.my-wishlist .data-table .even{
|
146 |
+
|
147 |
+
background: none;
|
148 |
+
}
|
149 |
+
.my-wishlist .data-table thead th
|
150 |
+
{
|
151 |
+
text-align:center;
|
152 |
+
}
|
153 |
+
|
154 |
+
.my-wishlist .wishlist-empty{
|
155 |
+
|
156 |
+
font-size:15px;
|
157 |
+
}
|
158 |
+
|
159 |
+
.link_loader_listview {
|
160 |
+
float: left;
|
161 |
+
padding-left: 5px;
|
162 |
+
}
|
163 |
+
|
164 |
+
.link_loader {
|
165 |
+
float: right;
|
166 |
+
padding-left: 5px;
|
167 |
+
}
|
168 |
+
.link_AddtoWishlist{
|
169 |
+
float: left;
|
170 |
+
width: auto;
|
171 |
+
font-weight:bold;
|
172 |
+
}
|
173 |
+
.comapre_li{
|
174 |
+
clear: both;float: left;width: auto;
|
175 |
+
}
|
176 |
+
/*
|
177 |
+
.product-options-bottom .link_AddtoWishlist{
|
178 |
+
float: none;
|
179 |
+
width: auto;
|
180 |
+
font-weight:bold;
|
181 |
+
}*/
|
182 |
+
|
183 |
+
.product-options-bottom .link_AddtoWishlist{
|
184 |
+
float: left;
|
185 |
+
font-weight: bold;
|
186 |
+
width: 93%;
|
187 |
+
}
|
188 |
+
.product-options-bottom .Wishlst_custom_option
|
189 |
+
{
|
190 |
+
float: none !important;
|
191 |
+
padding-left: 5px;
|
192 |
+
}
|
193 |
+
|
194 |
+
.link_Addtocompare{float:left;}
|
195 |
+
.product-options-bottom .link_Addtocompare{
|
196 |
+
float: none !important;
|
197 |
+
}
|
skin/frontend/base/default/css/ajaxwishlist/lightview/lightviewyoung.css
ADDED
@@ -0,0 +1,483 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* lightview.css
|
2 |
+
http://www.nickstakenburg.com/projects/lightview
|
3 |
+
*/
|
4 |
+
|
5 |
+
#lightview {
|
6 |
+
position: absolute;
|
7 |
+
top: 50%;
|
8 |
+
left: 50%;
|
9 |
+
height: 150px;
|
10 |
+
width: 150px;
|
11 |
+
margin: -75px 0 0 -75px;
|
12 |
+
padding: 0;
|
13 |
+
text-align: left;
|
14 |
+
}
|
15 |
+
|
16 |
+
/* The container that holds everything */
|
17 |
+
.lv_Container {
|
18 |
+
position: relative;
|
19 |
+
width: 100%;
|
20 |
+
height: 100%;
|
21 |
+
background: none;
|
22 |
+
padding: 0;
|
23 |
+
margin: 0;
|
24 |
+
}
|
25 |
+
|
26 |
+
.lv_Button {
|
27 |
+
cursor: pointer;
|
28 |
+
text-decoration: none;
|
29 |
+
border: none;
|
30 |
+
background: none;
|
31 |
+
margin: 0;
|
32 |
+
padding: 0;
|
33 |
+
}
|
34 |
+
|
35 |
+
/* The buttons on the side when you view a gallery */
|
36 |
+
.lv_Sides {
|
37 |
+
position: absolute;
|
38 |
+
top: 50%;
|
39 |
+
left: 0;
|
40 |
+
clear: both;
|
41 |
+
width: 100%;
|
42 |
+
padding: 0;
|
43 |
+
margin: 0;
|
44 |
+
}
|
45 |
+
.lv_Sides * { padding: 0; margin: 0; }
|
46 |
+
.lv_Sides .lv_PrevSide,
|
47 |
+
.lv_Sides .lv_NextSide { position: relative; }
|
48 |
+
|
49 |
+
.lv_PrevSide { float: left; }
|
50 |
+
.lv_NextSide { float: right; }
|
51 |
+
.lv_Sides .lv_Wrapper {
|
52 |
+
width: 100%;
|
53 |
+
height: 100%;
|
54 |
+
cursor: pointer;
|
55 |
+
}
|
56 |
+
.lv_Sides .lv_Button {
|
57 |
+
float: left;
|
58 |
+
background: none;
|
59 |
+
}
|
60 |
+
|
61 |
+
/* The frames above and below the center, that hold the corners.
|
62 |
+
It's recommended not to change anything here, a lot is done in
|
63 |
+
javascript to build further upon this based on your settings.
|
64 |
+
*/
|
65 |
+
.lv_Frames {
|
66 |
+
width: 100%;
|
67 |
+
height: 100%;
|
68 |
+
position: relative;
|
69 |
+
padding: 0;
|
70 |
+
margin: 0;
|
71 |
+
}
|
72 |
+
.lv_Frames .lv_Frame,
|
73 |
+
.lv_Frames .lv_Center,
|
74 |
+
.lv_Frames .lv_PrevNext {
|
75 |
+
margin: 0;
|
76 |
+
padding: 0;
|
77 |
+
}
|
78 |
+
.lv_Frame {
|
79 |
+
width: 100%;
|
80 |
+
display: block;
|
81 |
+
}
|
82 |
+
.lv_Frame * { padding: 0; margin: 0; }
|
83 |
+
.lv_FrameTop {
|
84 |
+
position: absolute;
|
85 |
+
left: 0;
|
86 |
+
width: 100%;
|
87 |
+
display: block;
|
88 |
+
}
|
89 |
+
.lv_FrameBottom {
|
90 |
+
position: relative;
|
91 |
+
float: left;
|
92 |
+
clear: both;
|
93 |
+
}
|
94 |
+
|
95 |
+
.lv_Liquid {
|
96 |
+
position: relative;
|
97 |
+
float: left;
|
98 |
+
width: 100%;
|
99 |
+
overflow: hidden;
|
100 |
+
clear: both;
|
101 |
+
}
|
102 |
+
.lv_Liquid .lv_Filler {
|
103 |
+
position: absolute;
|
104 |
+
height: 100%;
|
105 |
+
width: 2px;
|
106 |
+
top: 0;
|
107 |
+
left: 50%;
|
108 |
+
}
|
109 |
+
|
110 |
+
.lv_Half {
|
111 |
+
display: block;
|
112 |
+
height: 100%;
|
113 |
+
clear: both;
|
114 |
+
line-height: 0px;
|
115 |
+
}
|
116 |
+
.lv_Corner {
|
117 |
+
float: left;
|
118 |
+
position: relative;
|
119 |
+
}
|
120 |
+
.lv_CornerTr, .lv_CornerBr { float: right; }
|
121 |
+
|
122 |
+
.lv_Fill {
|
123 |
+
position: absolute;
|
124 |
+
top: 0;
|
125 |
+
width: 100%;
|
126 |
+
height: 100%;
|
127 |
+
}
|
128 |
+
|
129 |
+
.lv_Half .lv_CornerWrapper {
|
130 |
+
float: left;
|
131 |
+
position: relative;
|
132 |
+
width: 50%;
|
133 |
+
height: 100%;
|
134 |
+
overflow: hidden;
|
135 |
+
}
|
136 |
+
.lv_HalfRight .lv_CornerWrapper { float: right; }
|
137 |
+
|
138 |
+
.lv_Corner { position: relative; }
|
139 |
+
.lv_Corner canvas { position: relative; }
|
140 |
+
.lv_HalfLeft .lv_Corner { float: left; }
|
141 |
+
.lv_HalfRight .lv_Corner {
|
142 |
+
position: relative;
|
143 |
+
float: right;
|
144 |
+
}
|
145 |
+
|
146 |
+
/* To position content correctly in the center with correct
|
147 |
+
rounded corner display we need a few wrappers.
|
148 |
+
This is to get it right on all browsers.
|
149 |
+
*/
|
150 |
+
.lv_Center {
|
151 |
+
position: relative;
|
152 |
+
clear: both;
|
153 |
+
height: 100%;
|
154 |
+
overflow: hidden;
|
155 |
+
background: none;
|
156 |
+
padding: 0;
|
157 |
+
margin: 0;
|
158 |
+
}
|
159 |
+
.lv_WrapUp {
|
160 |
+
position: absolute;
|
161 |
+
left: 0;
|
162 |
+
height: 100%;
|
163 |
+
width: 100%;
|
164 |
+
overflow: hidden;
|
165 |
+
padding: 0;
|
166 |
+
margin: 0;
|
167 |
+
}
|
168 |
+
.lv_WrapDown {
|
169 |
+
position: relative;
|
170 |
+
height: 100%;
|
171 |
+
width: 100%;
|
172 |
+
overflow: hidden;
|
173 |
+
padding: 0;
|
174 |
+
margin: 0;
|
175 |
+
}
|
176 |
+
.lv_WrapCenter {
|
177 |
+
position: relative;
|
178 |
+
padding: 0;
|
179 |
+
margin: 0;
|
180 |
+
}
|
181 |
+
|
182 |
+
/* The loading indicator */
|
183 |
+
.lv_Loading {
|
184 |
+
position: absolute;
|
185 |
+
top: 50%;
|
186 |
+
left: 50%;
|
187 |
+
}
|
188 |
+
.lv_Loading .lv_Button {
|
189 |
+
float: left;
|
190 |
+
height: 100%;
|
191 |
+
width: 100%;
|
192 |
+
}
|
193 |
+
|
194 |
+
.lv_MediaWrapper {
|
195 |
+
position: relative;
|
196 |
+
width: 100%;
|
197 |
+
display: block;
|
198 |
+
overflow: hidden;
|
199 |
+
clear: both;
|
200 |
+
padding: 0;
|
201 |
+
margin: 0;
|
202 |
+
}
|
203 |
+
.lv_MediaWrapper img {
|
204 |
+
position: relative;
|
205 |
+
float: left;
|
206 |
+
padding: 0;
|
207 |
+
margin: 0;
|
208 |
+
}
|
209 |
+
|
210 |
+
/* The overlays on top of images that toggle the previous/next buttons */
|
211 |
+
.lv_PrevNext {
|
212 |
+
position: absolute;
|
213 |
+
top: 0;
|
214 |
+
left: 0;
|
215 |
+
width: 100%;
|
216 |
+
height: 100%;
|
217 |
+
padding: 0;
|
218 |
+
margin: 0;
|
219 |
+
}
|
220 |
+
.lv_PrevNext * { padding: 0; margin: 0; }
|
221 |
+
.lv_PrevNext .lv_Button {
|
222 |
+
position: relative;
|
223 |
+
height: 100%;
|
224 |
+
}
|
225 |
+
.lv_PrevButton { float: left; }
|
226 |
+
.lv_NextButton { float: right; }
|
227 |
+
|
228 |
+
/* The bar that holds title, caption, imagenumber, slideshow and closebutton */
|
229 |
+
.lv_MenuBar {
|
230 |
+
clear: both;
|
231 |
+
position: relative;
|
232 |
+
width: 100%;
|
233 |
+
font: 11px/17px Arial, Helvetica, sans-serif;
|
234 |
+
color: #7a7a7a;
|
235 |
+
padding: 0;
|
236 |
+
margin: 0;
|
237 |
+
text-align: left;
|
238 |
+
}
|
239 |
+
.lv_MenuBar * { padding: 0; margin: 0;}
|
240 |
+
|
241 |
+
|
242 |
+
.lv_Close {
|
243 |
+
position: relative;
|
244 |
+
float: right;
|
245 |
+
overflow: hidden;
|
246 |
+
width: 100%;
|
247 |
+
height: 100%;
|
248 |
+
}
|
249 |
+
|
250 |
+
.lv_Data {
|
251 |
+
position: relative;
|
252 |
+
float: left;
|
253 |
+
padding-bottom: 3px;
|
254 |
+
overflow: hidden;
|
255 |
+
}
|
256 |
+
|
257 |
+
/* simulates padding-left inside .lv_Data
|
258 |
+
.lv_DataText div, .lv_ImgNumber div { margin-left: 3px; } */
|
259 |
+
.lv_innerController { line-height: 15px; }
|
260 |
+
.lv_Data .lv_DataText,
|
261 |
+
.lv_Data .lv_innerPrevNext,
|
262 |
+
.lv_Data .lv_Slideshow {
|
263 |
+
float: left;
|
264 |
+
margin-top: 3px;
|
265 |
+
}
|
266 |
+
.lv_DataText { width: 100%; }
|
267 |
+
.lv_DataText .lv_Title {
|
268 |
+
font-weight: bold;
|
269 |
+
margin-bottom: 2px;
|
270 |
+
}
|
271 |
+
.lv_DataText .lv_Caption { clear: both; }
|
272 |
+
.lv_Data .lv_innerPrevNext .lv_ImgNumber {
|
273 |
+
color: #999;
|
274 |
+
float: left;
|
275 |
+
}
|
276 |
+
|
277 |
+
.lv_Data .lv_innerPrevNext,
|
278 |
+
.lv_Data .lv_Slideshow {
|
279 |
+
position: relative;
|
280 |
+
padding: 0 5px;
|
281 |
+
margin-top: 5px;
|
282 |
+
vertical-align: middle;
|
283 |
+
}
|
284 |
+
.lv_Data .lv_innerPrevNext { padding-left: 0; }
|
285 |
+
.lv_Data .lv_Slideshow { padding-right: 0px; border-left: 1px solid #d7d7d7; }
|
286 |
+
|
287 |
+
.lv_Data .lv_innerPrevNext .lv_Button,
|
288 |
+
.lv_Data .lv_Slideshow .lv_Button { /* play and stop */
|
289 |
+
float: left;
|
290 |
+
background-position: center left;
|
291 |
+
background-repeat: no-repeat;
|
292 |
+
}
|
293 |
+
.lv_innerPrevButton { margin-right: 5px; }
|
294 |
+
.lv_innerNextButton { margin-left: 5px; }
|
295 |
+
|
296 |
+
|
297 |
+
/* the boxes that hold media or external content */
|
298 |
+
.lv_contentTop,
|
299 |
+
.lv_contentBottom {
|
300 |
+
position: relative;
|
301 |
+
float: left;
|
302 |
+
margin: 0;
|
303 |
+
padding: 0;
|
304 |
+
clear: both;
|
305 |
+
}
|
306 |
+
|
307 |
+
#lightview iframe {
|
308 |
+
float: left;
|
309 |
+
border: 0;
|
310 |
+
clear: both;
|
311 |
+
padding: 0;
|
312 |
+
margin: 0;
|
313 |
+
background: none;
|
314 |
+
}
|
315 |
+
|
316 |
+
/* The container that hold buttons above the view, currently only topclose */
|
317 |
+
.lv_topButtons {
|
318 |
+
position: absolute;
|
319 |
+
left: 0;
|
320 |
+
width: 100%;
|
321 |
+
overflow: hidden;
|
322 |
+
margin: 0;
|
323 |
+
padding: 0;
|
324 |
+
}
|
325 |
+
.lv_topcloseButtonImage { cursor: pointer; }
|
326 |
+
|
327 |
+
|
328 |
+
/* The error/warning/download message that will appear when
|
329 |
+
a required plugin is not installed.
|
330 |
+
*/
|
331 |
+
#lightviewError p { padding: 0 0 10px 0; }
|
332 |
+
#lightviewError div {
|
333 |
+
padding: 6px;
|
334 |
+
font: 11px Arial, Helvetica, sans-serif;
|
335 |
+
}
|
336 |
+
#lightviewError .message {
|
337 |
+
background: #fcb5b5;
|
338 |
+
color: #dd1f1f;
|
339 |
+
margin-bottom: 3px;
|
340 |
+
}
|
341 |
+
#lightviewError .type { font-weight: bold; }
|
342 |
+
#lightviewError .pluginspage {
|
343 |
+
background: #b5fcbd;
|
344 |
+
color: #21be30;
|
345 |
+
}
|
346 |
+
#lightviewError a,
|
347 |
+
#lightviewError a:hover,
|
348 |
+
#lightviewError a:visited {
|
349 |
+
color: #21be30;
|
350 |
+
text-decoration: none;
|
351 |
+
background: none;
|
352 |
+
font-weight: bold;
|
353 |
+
border-bottom: 1px solid #7de689;
|
354 |
+
}
|
355 |
+
#lightviewError p {
|
356 |
+
margin-left: 0;
|
357 |
+
padding: 0;
|
358 |
+
}
|
359 |
+
|
360 |
+
#lv_overlay {
|
361 |
+
position: absolute; /* Opera will use fixed */
|
362 |
+
top: 0;
|
363 |
+
left: 0;
|
364 |
+
height: 100%;
|
365 |
+
width: 100%;
|
366 |
+
}
|
367 |
+
|
368 |
+
/* navbar
|
369 |
+
Adds a bar below the view that takes over the default Controller
|
370 |
+
*/
|
371 |
+
#lightviewController {
|
372 |
+
position: fixed;
|
373 |
+
bottom: 0;
|
374 |
+
top: 0;
|
375 |
+
left: 50%;
|
376 |
+
margin: 0;
|
377 |
+
padding: 0;
|
378 |
+
color: #d2d2d2;
|
379 |
+
font: 11px Arial, Helvetica, sans-serif;
|
380 |
+
}
|
381 |
+
* html body #lightviewController { /* IE6 */
|
382 |
+
position: absolute;
|
383 |
+
top: auto;
|
384 |
+
margin-top: expression( (-1 * this.offsetHeight / 2 + (document.documentElement ? document.documentElement.scrollTop : 0) + (Lightview.controllerOffset || 0)) + 'px');
|
385 |
+
}
|
386 |
+
#lightviewController .lv_controllerCenter {
|
387 |
+
display: block;
|
388 |
+
height: 100%;
|
389 |
+
float: left;
|
390 |
+
margin: 0;
|
391 |
+
padding: 0;
|
392 |
+
position: relative;
|
393 |
+
width: auto;
|
394 |
+
}
|
395 |
+
.lv_controllerTop, .lv_controllerMiddle, .lv_controllerBottom {
|
396 |
+
float: left;
|
397 |
+
display: block;
|
398 |
+
position: relative;
|
399 |
+
clear: both;
|
400 |
+
overflow: hidden;
|
401 |
+
margin: 0;
|
402 |
+
padding: 0;
|
403 |
+
}
|
404 |
+
.lv_controllerCornerWrapper {
|
405 |
+
position: absolute;
|
406 |
+
width: 100%;
|
407 |
+
height: 100%;
|
408 |
+
margin: 0;
|
409 |
+
padding: 0;
|
410 |
+
}
|
411 |
+
.lv_controllerCornerWrapperTopLeft,
|
412 |
+
.lv_controllerCornerWrapperBottomLeft { top: 0; left: -100%;}
|
413 |
+
.lv_controllerCornerWrapperTopRight,
|
414 |
+
.lv_controllerCornerWrapperBottomRight { top: 0; left: 100%;}
|
415 |
+
|
416 |
+
#lightviewController .lv_CornerWrapper {
|
417 |
+
width: 100%;
|
418 |
+
}
|
419 |
+
#lightviewController .lv_Corner { float: left; }
|
420 |
+
#lightviewController .lv_Corner {
|
421 |
+
float: right;
|
422 |
+
position: relative;
|
423 |
+
}
|
424 |
+
#lightviewController .lv_CornerTr, #lightviewController .lv_CornerBr { float: left; }
|
425 |
+
.lv_controllerBetweenCorners {
|
426 |
+
position: relative;
|
427 |
+
height: 100%;
|
428 |
+
overflow: hidden;
|
429 |
+
}
|
430 |
+
|
431 |
+
.lv_controllerMiddle {
|
432 |
+
position: relative;
|
433 |
+
height: 100%;
|
434 |
+
float: left;
|
435 |
+
}
|
436 |
+
.lv_controllerCenter .lv_controllerSetNumber
|
437 |
+
.lv_controllerCenter .lv_ButtonWrapper {
|
438 |
+
float: left;
|
439 |
+
display: inline;
|
440 |
+
position: relative;
|
441 |
+
clear: none;
|
442 |
+
}
|
443 |
+
.lv_controllerSetNumber {
|
444 |
+
float: left;
|
445 |
+
text-align: center;
|
446 |
+
}
|
447 |
+
|
448 |
+
#lightviewController .lv_Button {
|
449 |
+
float: left;
|
450 |
+
position: relative;
|
451 |
+
height: 100%;
|
452 |
+
clear: none;
|
453 |
+
}
|
454 |
+
.lv_controllerSetNumber {
|
455 |
+
position: relative;
|
456 |
+
height: 100%;
|
457 |
+
padding-right: 3px;
|
458 |
+
}
|
459 |
+
.lv_controllerPrev,
|
460 |
+
.lv_controllerNext,
|
461 |
+
.lv_controllerSlideshow,
|
462 |
+
.lv_controllerClose {
|
463 |
+
float: left;
|
464 |
+
position: relative;
|
465 |
+
height: 100%;
|
466 |
+
padding-left: 3px;
|
467 |
+
}
|
468 |
+
|
469 |
+
.lv_controllerPrev { border-left: 1px solid #3c3c3c; }
|
470 |
+
#lightviewController .lv_controllerNext { padding-right: 3px; border-right: 1px solid #3c3c3c; }
|
471 |
+
|
472 |
+
* html #lightview { /* IE6 */
|
473 |
+
position: absolute;
|
474 |
+
margin-top: expression( (-1 * this.offsetHeight / 2 + (document.documentElement ? document.documentElement.scrollTop : 0) - (Lightview.controllerHeight || 0)) + 'px');
|
475 |
+
margin-left: expression( -1 * this.offsetWidth / 2 + (document.documentElement ? document.documentElement.scrollLeft : 0) + 'px');
|
476 |
+
}
|
477 |
+
|
478 |
+
/* Always cover 100% of the screen in IE6 */
|
479 |
+
html #lv_overlay {
|
480 |
+
position: absolute;
|
481 |
+
height: expression(((window.Enumerable && window.Enumerable.max) ? [document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight].max() : document.documentElement.scrollHeight) + 'px' );
|
482 |
+
width: expression(((window.Enumerable && window.Enumerable.max) ? [document.body.scrollWidth, document.documentElement.scrollWidth, document.body.offsetWidth, document.documentElement.clientHeight].max() : document.documentElement.scrollWidth) + 'px' );
|
483 |
+
}
|
skin/frontend/base/default/css/ajaxwishlist/lightview/lightviewyoung_.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#lightview{position:absolute;top:50%;left:50%;height:150px;width:150px;margin:-75px 0 0 -75px;padding:0;text-align:left}.lv_Container{position:relative;width:100%;height:100%;background:0 0;padding:0;margin:0}.lv_Button{cursor:pointer;text-decoration:none;border:0;background:0 0;margin:0;padding:0}.lv_Sides{position:absolute;top:50%;left:0;clear:both;width:100%;padding:0;margin:0}.lv_Sides *{padding:0;margin:0}.lv_Sides .lv_NextSide,.lv_Sides .lv_PrevSide{position:relative}.lv_PrevSide{float:left}.lv_NextSide{float:right}.lv_Sides .lv_Wrapper{width:100%;height:100%;cursor:pointer}.lv_Sides .lv_Button{float:left;background:0 0}.lv_Frames{width:100%;height:100%;position:relative;padding:0;margin:0}.lv_Frames .lv_Center,.lv_Frames .lv_Frame,.lv_Frames .lv_PrevNext{margin:0;padding:0}.lv_Frame{width:100%;display:block}.lv_Frame *{padding:0;margin:0}.lv_FrameTop{position:absolute;left:0;width:100%;display:block}.lv_FrameBottom{position:relative;float:left;clear:both}.lv_Liquid{position:relative;float:left;width:100%;overflow:hidden;clear:both}.lv_Liquid .lv_Filler{position:absolute;height:100%;width:2px;top:0;left:50%}.lv_Half{display:block;height:100%;clear:both;line-height:0}.lv_Corner{float:left}.lv_CornerBr,.lv_CornerTr{float:right}.lv_Fill{position:absolute;top:0;width:100%;height:100%}.lv_Half .lv_CornerWrapper{float:left;position:relative;width:50%;height:100%;overflow:hidden}.lv_HalfRight .lv_CornerWrapper{float:right}.lv_Corner,.lv_Corner canvas{position:relative}.lv_HalfLeft .lv_Corner{float:left}.lv_HalfRight .lv_Corner{position:relative;float:right}.lv_Center{position:relative;clear:both;height:393px !important;overflow:hidden;background:0 0;padding:0;margin:0}.lv_WrapUp{position:absolute;left:0;height:100%;width:100%;overflow:hidden;padding:0;margin:0}.lv_WrapDown{position:relative;height:100%;width:100%;overflow:hidden;padding:0;margin:0}.lv_WrapCenter{position:relative;padding:0;margin:0}.lv_Loading{position:absolute;top:50%;left:50%}.lv_Loading .lv_Button{float:left;height:100%;width:100%}.lv_MediaWrapper{position:relative;width:100%;display:block;overflow:hidden;clear:both;padding:0;margin:0}.lv_MediaWrapper img{position:relative;float:left;padding:0;margin:0}.lv_PrevNext{position:absolute;top:0;left:0;width:100%;height:100%;padding:0;margin:0}.lv_PrevNext *{padding:0;margin:0}.lv_PrevNext .lv_Button{position:relative;height:100%}.lv_PrevButton{float:left}.lv_NextButton{float:right}.lv_MenuBar{clear:both;position:relative;width:100%;font:11px/17px Arial,Helvetica,sans-serif;color:#7a7a7a;padding:0;margin:0;text-align:left}.lv_MenuBar *{padding:0;margin:0}.lv_Close{position:relative;float:right;overflow:hidden;width:100%;height:100%}.lv_Data{position:relative;float:left;padding-bottom:3px;overflow:hidden}.lv_innerController{line-height:15px}.lv_Data .lv_DataText,.lv_Data .lv_Slideshow,.lv_Data .lv_innerPrevNext{float:left;margin-top:3px}.lv_DataText{width:100%}.lv_DataText .lv_Title{font-weight:700;margin-bottom:2px}.lv_DataText .lv_Caption{clear:both}.lv_Data .lv_innerPrevNext .lv_ImgNumber{color:#999;float:left}.lv_Data .lv_Slideshow,.lv_Data .lv_innerPrevNext{position:relative;padding:0 5px;margin-top:5px;vertical-align:middle}.lv_Data .lv_innerPrevNext{padding-left:0}.lv_Data .lv_Slideshow{padding-right:0}.lv_Data .lv_Slideshow .lv_Button,.lv_Data .lv_innerPrevNext .lv_Button{float:left;background-position:center left;background-repeat:no-repeat}.lv_innerPrevButton{margin-right:5px}.lv_innerNextButton{margin-left:5px}.lv_contentBottom,.lv_contentTop{height: 365px !important; position:relative; width: 580px !important; float:left;margin:0;padding:0;clear:both}#lightview iframe{height: 365px !important; float:left;width: 580px !important; border:0;clear:both;padding:0;margin:0;background:0 0}.lv_topButtons{position:absolute;left:0;width:100%;overflow:hidden;margin:0;padding:0}.lv_topcloseButtonImage{cursor:pointer}#lightviewError div{padding:6px;font:11px Arial,Helvetica,sans-serif}#lightviewError .message{background:#fcb5b5;color:#dd1f1f;margin-bottom:3px}#lightviewError .type{font-weight:700}#lightviewError .pluginspage{background:#b5fcbd;color:#21be30}#lightviewError a,#lightviewError a:hover,#lightviewError a:visited{color:#21be30;text-decoration:none;background:0 0;font-weight:700;border-bottom:1px solid #7de689}#lightviewError p{margin-left:0;padding:0}#lv_overlay{position:absolute;top:0;left:0;height:100%;width:100%}#lightviewController{position:fixed;bottom:0;top:0;left:50%;margin:0;padding:0;color:#d2d2d2;font:11px Arial,Helvetica,sans-serif}* html body #lightviewController{position:absolute;top:auto;margin-top:expression( (-1 * this.offsetHeight / 2 + (document.documentElement ? document.documentElement.scrollTop : 0) + (Lightview.controllerOffset || 0)) + 'px')}#lightviewController .lv_controllerCenter{display:block;height:100%;float:left;margin:0;padding:0;position:relative;width:auto}.lv_controllerBottom,.lv_controllerMiddle,.lv_controllerTop{float:left;display:block;position:relative;clear:both;overflow:hidden;margin:0;padding:0}.lv_controllerCornerWrapper{position:absolute;width:100%;height:100%;margin:0;padding:0}.lv_controllerCornerWrapperBottomLeft,.lv_controllerCornerWrapperTopLeft{top:0;left:-100%}.lv_controllerCornerWrapperBottomRight,.lv_controllerCornerWrapperTopRight{top:0;left:100%}#lightviewController .lv_CornerWrapper{width:100%}#lightviewController .lv_Corner{float:right;position:relative}#lightviewController .lv_CornerBr,#lightviewController .lv_CornerTr{float:left}.lv_controllerBetweenCorners{position:relative;height:100%;overflow:hidden}.lv_controllerMiddle{position:relative;height:100%;float:left}.lv_controllerCenter .lv_controllerSetNumber .lv_controllerCenter .lv_ButtonWrapper{float:left;display:inline;position:relative;clear:none}.lv_controllerSetNumber{float:left;text-align:center}#lightviewController .lv_Button{float:left;position:relative;height:100%;clear:none}.lv_controllerSetNumber{position:relative;height:100%;padding-right:3px}.lv_controllerClose,.lv_controllerNext,.lv_controllerPrev,.lv_controllerSlideshow{float:left;position:relative;height:100%;padding-left:3px}.lv_controllerPrev{border-left:1px solid #3c3c3c}#lightviewController .lv_controllerNext{padding-right:3px;border-right:1px solid #3c3c3c}* html #lightview{position:absolute;margin-top:expression( (-1 * this.offsetHeight / 2 + (document.documentElement ? document.documentElement.scrollTop : 0) - (Lightview.controllerHeight || 0)) + 'px');margin-left:expression( -1 * this.offsetWidth / 2 + (document.documentElement ? document.documentElement.scrollLeft : 0) + 'px')}html #lv_overlay{position:absolute;height:expression(((window.Enumerable && window.Enumerable.max) ? [document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight].max() : document.documentElement.scrollHeight) + 'px' );width:expression(((window.Enumerable && window.Enumerable.max) ? [document.body.scrollWidth, document.documentElement.scrollWidth, document.body.offsetWidth, document.documentElement.clientHeight].max() : document.documentElement.scrollWidth) + 'px' )}
|
skin/frontend/base/default/images/ajaxWishlist/ajaxcart/btn_popup-close.png
ADDED
Binary file
|
skin/frontend/base/default/images/ajaxWishlist/ajaxcart/right.jpg
ADDED
Binary file
|
skin/frontend/base/default/images/ajaxWishlist/ajaxcart/spinner.gif
ADDED
Binary file
|
skin/frontend/base/default/images/ajaxWishlist/ajaxcart/wrong.jpg
ADDED
Binary file
|
skin/frontend/base/default/images/ajaxWishlist/opc-ajax-loader.gif
ADDED
Binary file
|
skin/frontend/base/default/images/ajaxWishlist/star_empty.png
ADDED
Binary file
|
skin/frontend/base/default/images/ajaxWishlist/star_select.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/ajaxcart/ajaxcart.js
ADDED
@@ -0,0 +1,510 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var ajaxcart = {
|
2 |
+
g: new Growler(),
|
3 |
+
initialize: function() {
|
4 |
+
this.g = new Growler();
|
5 |
+
this.bindEvents();
|
6 |
+
},
|
7 |
+
bindEvents: function () {
|
8 |
+
this.addSubmitEvent();
|
9 |
+
|
10 |
+
$$('a[href*="/checkout/cart/delete/"]').each(function(e){
|
11 |
+
$(e).observe('click', function(event){
|
12 |
+
setLocation($(e).readAttribute('href'));
|
13 |
+
Event.stop(event);
|
14 |
+
});
|
15 |
+
});
|
16 |
+
},
|
17 |
+
ajaxCartSubmit: function (obj) {
|
18 |
+
var _this = this;
|
19 |
+
if(Modalbox !== 'undefined' && Modalbox.initialized)Modalbox.hide();
|
20 |
+
|
21 |
+
try {
|
22 |
+
if(typeof obj == 'string') {
|
23 |
+
var url = obj;
|
24 |
+
|
25 |
+
new Ajax.Request(url, {
|
26 |
+
onCreate : function() {
|
27 |
+
// _this.g.warn("Processing", {
|
28 |
+
// life: 5
|
29 |
+
// });
|
30 |
+
showProccessMessage();
|
31 |
+
},
|
32 |
+
onSuccess : function(response) {
|
33 |
+
// Handle the response content...
|
34 |
+
try{
|
35 |
+
var res = response.responseText.evalJSON();
|
36 |
+
if(res) {
|
37 |
+
//check for group product's option
|
38 |
+
if(res.configurable_options_block) {
|
39 |
+
if(res.r == 'success') {
|
40 |
+
//show group product options block
|
41 |
+
_this.showPopup(res.configurable_options_block);
|
42 |
+
} else {
|
43 |
+
if(typeof res.messages != 'undefined') {
|
44 |
+
//_this.showError(res.messages);
|
45 |
+
closePopupNewsletter();
|
46 |
+
showPopMessage(res.messages);
|
47 |
+
setErrorImage();
|
48 |
+
|
49 |
+
} else {
|
50 |
+
//_this.showError("Something bad happened");
|
51 |
+
closePopupNewsletter();
|
52 |
+
showPopMessage("Something bad happened");
|
53 |
+
setErrorImage();
|
54 |
+
}
|
55 |
+
}
|
56 |
+
} else {
|
57 |
+
if(res.r == 'success') {
|
58 |
+
if(res.message) {
|
59 |
+
//_this.showSuccess(res.message);
|
60 |
+
closePopupNewsletter();
|
61 |
+
showPopMessage(res.message);
|
62 |
+
setSuccessImage();
|
63 |
+
} else {
|
64 |
+
//_this.showSuccess('Item was added into cart.');
|
65 |
+
closePopupNewsletter();
|
66 |
+
showPopMessage("Item was added into cart.");
|
67 |
+
setSuccessImage();
|
68 |
+
}
|
69 |
+
|
70 |
+
//update all blocks here
|
71 |
+
_this.updateBlocks(res.update_blocks);
|
72 |
+
|
73 |
+
} else {
|
74 |
+
if(typeof res.messages != 'undefined') {
|
75 |
+
//_this.showError(res.messages);
|
76 |
+
closePopupNewsletter();
|
77 |
+
showPopMessage(res.messages);
|
78 |
+
setErrorImage();
|
79 |
+
|
80 |
+
} else {
|
81 |
+
//_this.showError("Something bad happened");
|
82 |
+
closePopupNewsletter();
|
83 |
+
showPopMessage("Something bad happened");
|
84 |
+
setErrorImage();
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
} else {
|
89 |
+
document.location.reload(true);
|
90 |
+
}
|
91 |
+
} catch(e) {
|
92 |
+
//window.location.href = url;
|
93 |
+
//document.location.reload(true);
|
94 |
+
}
|
95 |
+
}
|
96 |
+
});
|
97 |
+
} else {
|
98 |
+
if(typeof obj.form.down('input[type=file]') != 'undefined') {
|
99 |
+
|
100 |
+
//use iframe
|
101 |
+
|
102 |
+
obj.form.insert('<iframe id="upload_target" name="upload_target" src="" style="width:0;height:0;border:0px solid #fff;"></iframe>');
|
103 |
+
|
104 |
+
var iframe = $('upload_target');
|
105 |
+
iframe.observe('load', function(){
|
106 |
+
// Handle the response content...
|
107 |
+
try{
|
108 |
+
var doc = iframe.contentDocument ? iframe.contentDocument : (iframe.contentWindow.document || iframe.document);
|
109 |
+
console.log(doc);
|
110 |
+
var res = doc.body.innerText ? doc.body.innerText : doc.body.textContent;
|
111 |
+
res = res.evalJSON();
|
112 |
+
|
113 |
+
if(res) {
|
114 |
+
if(res.r == 'success') {
|
115 |
+
if(res.message) {
|
116 |
+
//_this.showSuccess(res.message);
|
117 |
+
closePopupNewsletter();
|
118 |
+
showPopMessage(res.message);
|
119 |
+
setSuccessImage();
|
120 |
+
|
121 |
+
} else {
|
122 |
+
//_this.showSuccess('Item was added into cart.');
|
123 |
+
closePopupNewsletter();
|
124 |
+
showPopMessage('Item was added into cart.');
|
125 |
+
setSuccessImage();
|
126 |
+
}
|
127 |
+
|
128 |
+
//update all blocks here
|
129 |
+
_this.updateBlocks(res.update_blocks);
|
130 |
+
|
131 |
+
} else {
|
132 |
+
if(typeof res.messages != 'undefined') {
|
133 |
+
//_this.showError(res.messages);
|
134 |
+
closePopupNewsletter();
|
135 |
+
showPopMessage(res.messages);
|
136 |
+
setErrorImage();
|
137 |
+
} else {
|
138 |
+
//_this.showError("Something bad happened");
|
139 |
+
closePopupNewsletter();
|
140 |
+
showPopMessage("Something bad happened");
|
141 |
+
setErrorImage();
|
142 |
+
}
|
143 |
+
}
|
144 |
+
} else {
|
145 |
+
//_this.showError("Something bad happened");
|
146 |
+
closePopupNewsletter();
|
147 |
+
showPopMessage("Something bad happened");
|
148 |
+
setErrorImage();
|
149 |
+
|
150 |
+
}
|
151 |
+
} catch(e) {
|
152 |
+
// console.log(e);
|
153 |
+
//_this.showError("Something bad happened");
|
154 |
+
closePopupNewsletter();
|
155 |
+
showPopMessage("Something bad happened");
|
156 |
+
setErrorImage();
|
157 |
+
}
|
158 |
+
});
|
159 |
+
|
160 |
+
obj.form.target = 'upload_target';
|
161 |
+
|
162 |
+
//show loading
|
163 |
+
// _this.g.warn("Processing", {
|
164 |
+
// life: 5
|
165 |
+
// });
|
166 |
+
|
167 |
+
obj.form.submit();
|
168 |
+
return true;
|
169 |
+
|
170 |
+
} else {
|
171 |
+
//use ajax
|
172 |
+
|
173 |
+
var url = obj.form.action,
|
174 |
+
data = obj.form.serialize();
|
175 |
+
|
176 |
+
new Ajax.Request(url, {
|
177 |
+
method : 'post',
|
178 |
+
postBody : data,
|
179 |
+
onCreate : function() {
|
180 |
+
// _this.g.warn("Processing", {
|
181 |
+
// life: 5
|
182 |
+
// });
|
183 |
+
showProccessMessage();
|
184 |
+
},
|
185 |
+
onSuccess : function(response) {
|
186 |
+
// Handle the response content...
|
187 |
+
try{
|
188 |
+
var res = response.responseText.evalJSON();
|
189 |
+
|
190 |
+
if(res) {
|
191 |
+
if(res.r == 'success') {
|
192 |
+
if(res.message) {
|
193 |
+
//_this.showSuccess(res.message);
|
194 |
+
closePopupNewsletter();
|
195 |
+
showPopMessage(res.message);
|
196 |
+
setSuccessImage();
|
197 |
+
} else {
|
198 |
+
//_this.showSuccess('Item was added into cart.');
|
199 |
+
closePopupNewsletter();
|
200 |
+
showPopMessage('Item was added into cart.');
|
201 |
+
setSuccessImage();
|
202 |
+
}
|
203 |
+
|
204 |
+
//update all blocks here
|
205 |
+
_this.updateBlocks(res.update_blocks);
|
206 |
+
|
207 |
+
} else {
|
208 |
+
if(typeof res.messages != 'undefined') {
|
209 |
+
//_this.showError(res.messages);
|
210 |
+
closePopupNewsletter();
|
211 |
+
showPopMessage(res.message);
|
212 |
+
setErrorImage();
|
213 |
+
} else {
|
214 |
+
//_this.showError("Something bad happened");
|
215 |
+
closePopupNewsletter();
|
216 |
+
showPopMessage("Something bad happened");
|
217 |
+
setErrorImage();
|
218 |
+
}
|
219 |
+
}
|
220 |
+
} else {
|
221 |
+
//_this.showError("Something bad happened");
|
222 |
+
closePopupNewsletter();
|
223 |
+
showPopMessage("Something bad happened");
|
224 |
+
setErrorImage();
|
225 |
+
}
|
226 |
+
} catch(e) {
|
227 |
+
// console.log(e);
|
228 |
+
//_this.showError("Something bad happened");
|
229 |
+
closePopupNewsletter();
|
230 |
+
showPopMessage("Something bad happened");
|
231 |
+
setErrorImage();
|
232 |
+
}
|
233 |
+
}
|
234 |
+
});
|
235 |
+
}
|
236 |
+
}
|
237 |
+
} catch(e) {
|
238 |
+
console.log(e);
|
239 |
+
if(typeof obj == 'string') {
|
240 |
+
window.location.href = obj;
|
241 |
+
} else {
|
242 |
+
document.location.reload(true);
|
243 |
+
}
|
244 |
+
}
|
245 |
+
},
|
246 |
+
|
247 |
+
getConfigurableOptions: function(url) {
|
248 |
+
var _this = this;
|
249 |
+
new Ajax.Request(url, {
|
250 |
+
onCreate : function() {
|
251 |
+
// _this.g.warn("Processing", {
|
252 |
+
// life: 5
|
253 |
+
// });
|
254 |
+
showProccessMessage();
|
255 |
+
},
|
256 |
+
onSuccess : function(response) {
|
257 |
+
// Handle the response content...
|
258 |
+
try{
|
259 |
+
var res = response.responseText.evalJSON();
|
260 |
+
if(res) {
|
261 |
+
if(res.r == 'success') {
|
262 |
+
|
263 |
+
//show configurable options popup
|
264 |
+
closePopupNewsletter();
|
265 |
+
_this.showPopup(res.configurable_options_block);
|
266 |
+
|
267 |
+
} else {
|
268 |
+
if(typeof res.messages != 'undefined') {
|
269 |
+
//_this.showError(res.messages);
|
270 |
+
closePopupNewsletter();
|
271 |
+
showPopMessage(res.messages);
|
272 |
+
setErrorImage();
|
273 |
+
} else {
|
274 |
+
//_this.showError("Something bad happened");
|
275 |
+
closePopupNewsletter();
|
276 |
+
showPopMessage("Something bad happened");
|
277 |
+
setErrorImage();
|
278 |
+
}
|
279 |
+
}
|
280 |
+
} else {
|
281 |
+
document.location.reload(true);
|
282 |
+
}
|
283 |
+
} catch(e) {
|
284 |
+
window.location.href = url;
|
285 |
+
//document.location.reload(true);
|
286 |
+
}
|
287 |
+
}
|
288 |
+
});
|
289 |
+
},
|
290 |
+
|
291 |
+
showSuccess: function(message) {
|
292 |
+
this.g.info(message, {
|
293 |
+
life: 5
|
294 |
+
});
|
295 |
+
},
|
296 |
+
|
297 |
+
showError: function (error) {
|
298 |
+
var _this = this;
|
299 |
+
|
300 |
+
if(typeof error == 'string') {
|
301 |
+
_this.g.error(error, {
|
302 |
+
life: 5
|
303 |
+
});
|
304 |
+
} else {
|
305 |
+
error.each(function(message){
|
306 |
+
_this.g.error(message, {
|
307 |
+
life: 5
|
308 |
+
});
|
309 |
+
});
|
310 |
+
}
|
311 |
+
},
|
312 |
+
|
313 |
+
addSubmitEvent: function () {
|
314 |
+
|
315 |
+
if(typeof productAddToCartForm != 'undefined') {
|
316 |
+
var _this = this;
|
317 |
+
productAddToCartForm.submit = function(url){
|
318 |
+
if(this.validator && this.validator.validate()){
|
319 |
+
_this.ajaxCartSubmit(this);
|
320 |
+
}
|
321 |
+
return false;
|
322 |
+
}
|
323 |
+
|
324 |
+
productAddToCartForm.form.onsubmit = function() {
|
325 |
+
productAddToCartForm.submit();
|
326 |
+
return false;
|
327 |
+
};
|
328 |
+
}
|
329 |
+
},
|
330 |
+
|
331 |
+
updateBlocks: function(blocks) {
|
332 |
+
var _this = this;
|
333 |
+
|
334 |
+
if(blocks) {
|
335 |
+
try{
|
336 |
+
blocks.each(function(block){
|
337 |
+
if(block.key) {
|
338 |
+
var dom_selector = block.key;
|
339 |
+
if($$(dom_selector)) {
|
340 |
+
$$(dom_selector).each(function(e){
|
341 |
+
$(e).replace(block.value);
|
342 |
+
});
|
343 |
+
}
|
344 |
+
}
|
345 |
+
});
|
346 |
+
_this.bindEvents();
|
347 |
+
|
348 |
+
// show details tooltip
|
349 |
+
truncateOptions();
|
350 |
+
} catch(e) {
|
351 |
+
console.log(e);
|
352 |
+
}
|
353 |
+
}
|
354 |
+
|
355 |
+
},
|
356 |
+
|
357 |
+
showPopup: function(block) {
|
358 |
+
try {
|
359 |
+
var _this = this;
|
360 |
+
//$$('body')[0].insert({bottom: new Element('div', {id: 'modalboxOptions'}).update(block)});
|
361 |
+
var element = new Element('div', {
|
362 |
+
id: 'modalboxOptions'
|
363 |
+
}).update(block);
|
364 |
+
|
365 |
+
var viewport = document.viewport.getDimensions();
|
366 |
+
Modalbox.show(element,
|
367 |
+
{
|
368 |
+
title: 'Please Select Options',
|
369 |
+
width: 510,
|
370 |
+
height: viewport.height,
|
371 |
+
afterLoad: function() {
|
372 |
+
_this.extractScripts(block);
|
373 |
+
_this.bindEvents();
|
374 |
+
}
|
375 |
+
});
|
376 |
+
} catch(e) {
|
377 |
+
console.log(e)
|
378 |
+
}
|
379 |
+
},
|
380 |
+
|
381 |
+
extractScripts: function(strings) {
|
382 |
+
var scripts = strings.extractScripts();
|
383 |
+
scripts.each(function(script){
|
384 |
+
try {
|
385 |
+
eval(script.replace(/var /gi, ""));
|
386 |
+
}
|
387 |
+
catch(e){
|
388 |
+
console.log(e);
|
389 |
+
}
|
390 |
+
});
|
391 |
+
}
|
392 |
+
|
393 |
+
};
|
394 |
+
|
395 |
+
var oldSetLocation = setLocation;
|
396 |
+
var setLocation = (function() {
|
397 |
+
return function(url){
|
398 |
+
if( url.search('checkout/cart/add') != -1 ) {
|
399 |
+
//its simple/group/downloadable product
|
400 |
+
ajaxcart.ajaxCartSubmit(url);
|
401 |
+
} else if( url.search('checkout/cart/delete') != -1 ) {
|
402 |
+
ajaxcart.ajaxCartSubmit(url);
|
403 |
+
} else if( url.search('options=cart') != -1 ) {
|
404 |
+
//its configurable/bundle product
|
405 |
+
url += '&ajax=true';
|
406 |
+
ajaxcart.getConfigurableOptions(url);
|
407 |
+
} else {
|
408 |
+
oldSetLocation(url);
|
409 |
+
}
|
410 |
+
};
|
411 |
+
})();
|
412 |
+
|
413 |
+
setPLocation = setLocation;
|
414 |
+
|
415 |
+
document.observe("dom:loaded", function() {
|
416 |
+
ajaxcart.initialize();
|
417 |
+
});
|
418 |
+
|
419 |
+
|
420 |
+
function showPopMessage(message){
|
421 |
+
var baseUrl = window.getBaseUrl();
|
422 |
+
var skinUrl = baseUrl + 'skin/frontend/base/default/';
|
423 |
+
var lightBoxBackground = new Element("div",{"id":"lightBoxBackground"})
|
424 |
+
lightBoxBackground.setStyle({"background": "none repeat scroll 0 0 #ffffff",
|
425 |
+
"height": "100%",
|
426 |
+
"left": 0,
|
427 |
+
"opacity":" 0.5",
|
428 |
+
"position": "absolute",
|
429 |
+
"top": 0,
|
430 |
+
"width": "100%",
|
431 |
+
"z-index":"2147483647"
|
432 |
+
});
|
433 |
+
var bodyTag = document.getElementsByTagName("body");
|
434 |
+
bodyTag[0].insert({"bottom":lightBoxBackground});
|
435 |
+
bodyTag[0].setStyle({"position":"relative"});
|
436 |
+
bodyTag[0].insert({"bottom":'<div id="newsleeterErrorMessage" style="position: fixed;z-index:2147483647; background: none repeat scroll 0% 0% white; left: 37%; border: 4px solid #618499; padding: 1% 1%; width: 27%; top: 37%; height: auto; text-align: center;">\n\
|
437 |
+
<div id="closePopupNewsletter" onclick="closePopupNewsletter();" style="float: right;width:40px;height:40px; margin-top: -8px;"> <a href="javascript:void(0);"><img id="setCloseImage"src="'+skinUrl+'images/ajaxWishlist/ajaxcart/btn_popup-close.png"/></a></div>\n\
|
438 |
+
<div style="background: none repeat scroll 0% 0% rgb(231, 239, 239); padding: 4.1%; font-weight: bolder;">\n\
|
439 |
+
<div style="float: left; margin-top: -5px;"><img id="setsuccessImage" src="'+skinUrl+'images/ajaxWishlist/ajaxcart/right.jpg" height="32" width="32" style="display:none;"><img id="seterrorImage" src="'+skinUrl+'images/ajaxWishlist/ajaxcart/wrong.jpg" height="32" width="32" style="display:none;"></div>\n\
|
440 |
+
'+message+' \n\
|
441 |
+
</div>\n\
|
442 |
+
</div>'});
|
443 |
+
|
444 |
+
}
|
445 |
+
|
446 |
+
function closePopupNewsletter(){
|
447 |
+
|
448 |
+
$("lightBoxBackground").remove();
|
449 |
+
$("newsleeterErrorMessage").remove();
|
450 |
+
|
451 |
+
}
|
452 |
+
function setSuccessImage(){
|
453 |
+
|
454 |
+
$("setsuccessImage").setStyle({"display":"block",
|
455 |
+
|
456 |
+
});
|
457 |
+
}
|
458 |
+
function setErrorImage(){
|
459 |
+
|
460 |
+
$("seterrorImage").setStyle({"display":"block"});
|
461 |
+
}
|
462 |
+
|
463 |
+
|
464 |
+
function showProccessMessage(message)
|
465 |
+
{
|
466 |
+
var baseUrl = window.getBaseUrl();
|
467 |
+
var skinUrl = baseUrl + 'skin/frontend/base/default/';
|
468 |
+
var lightBoxBackground = new Element("div",{"id":"lightBoxBackground"})
|
469 |
+
lightBoxBackground.setStyle({"background": "none repeat scroll 0 0 #ffffff",
|
470 |
+
"height": "100%",
|
471 |
+
"left": 0,
|
472 |
+
"opacity":" 0.5",
|
473 |
+
"position": "absolute",
|
474 |
+
"top": 0,
|
475 |
+
"width": "100%",
|
476 |
+
"z-index":"2147483647"
|
477 |
+
});
|
478 |
+
var bodyTag = document.getElementsByTagName("body");
|
479 |
+
bodyTag[0].insert({"bottom":lightBoxBackground});
|
480 |
+
bodyTag[0].setStyle({"position":"relative"});
|
481 |
+
bodyTag[0].insert({"bottom":'<div id="newsleeterErrorMessage" style="position: fixed;z-index:2147483647; background: none repeat scroll 0% 0% white; left: 37%; border: 4px solid #618499; padding: 1% 1%; width: 27%; top: 37%; height: auto; text-align: center;">\n\
|
482 |
+
<div id="closePopupNewsletter" onclick="closePopupNewsletter();" style="float: right;width:40px;height:40px; margin-top: -8px;"> <a href="javascript:void(0);"><img id="setCloseImage"src="'+skinUrl+'images/ajaxWishlist/ajaxcart/btn_popup-close.png"/></a></div>\n\
|
483 |
+
<div style="background: none repeat scroll 0% 0% rgb(231, 239, 239); padding: 3%; font-weight: bolder;">\n\
|
484 |
+
<img id="setsuccessImage" src="'+skinUrl+'images/ajaxWishlist/ajaxcart/spinner.gif" width="32" width="32">\n\
|
485 |
+
</div>\n\
|
486 |
+
</div>'});
|
487 |
+
|
488 |
+
}
|
489 |
+
|
490 |
+
function getBaseURL() {
|
491 |
+
var url = location.href; // entire url including querystring - also: window.location.href;
|
492 |
+
var baseURL = url.substring(0, url.indexOf('/', 14));
|
493 |
+
;
|
494 |
+
|
495 |
+
if (baseURL.indexOf('http://localhost') != -1) {
|
496 |
+
// Base Url for localhost
|
497 |
+
var url = location.href; // window.location.href;
|
498 |
+
var pathname = location.pathname; // window.location.pathname;
|
499 |
+
var index1 = url.indexOf(pathname);
|
500 |
+
var index2 = url.indexOf("/", index1 + 1);
|
501 |
+
var baseLocalUrl = url.substr(0, index2);
|
502 |
+
|
503 |
+
return baseLocalUrl + "/";
|
504 |
+
}
|
505 |
+
else {
|
506 |
+
// Root Url for domain name
|
507 |
+
return baseURL + "/";
|
508 |
+
}
|
509 |
+
|
510 |
+
}
|
skin/frontend/base/default/js/ajaxwishlist/ajaxcart/growler.js
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Growler 1.0.0
|
3 |
+
*
|
4 |
+
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
5 |
+
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
6 |
+
*
|
7 |
+
* Written by Kevin Armstrong <kevin@kevinandre.com>
|
8 |
+
* Last updated: 2008.10.14
|
9 |
+
*
|
10 |
+
* Growler is a PrototypeJS based class that displays unobtrusive notices on a page.
|
11 |
+
* It functions much like the Growl (http://growl.info) available on the Mac OS X.
|
12 |
+
*
|
13 |
+
* Changes in 1.0.1:
|
14 |
+
* -
|
15 |
+
*
|
16 |
+
* @todo
|
17 |
+
*/
|
18 |
+
Growler = (function(){
|
19 |
+
|
20 |
+
var noticeOptions = {
|
21 |
+
header: ' '
|
22 |
+
,speedin: 0.3
|
23 |
+
,speedout: 0.5
|
24 |
+
,outDirection: { y: -20 }
|
25 |
+
,life: 5
|
26 |
+
,sticky: false
|
27 |
+
,className: ""
|
28 |
+
};
|
29 |
+
var growlerOptions = {
|
30 |
+
location: "tr"
|
31 |
+
,width: "250px"
|
32 |
+
};
|
33 |
+
var IE = (Prototype.Browser.IE) ? parseFloat(navigator.appVersion.split("MSIE ")[1]) || 0 : 0;
|
34 |
+
function removeNotice(n, o){
|
35 |
+
o = o || noticeOptions;
|
36 |
+
new Effect.Parallel([
|
37 |
+
new Effect.Move(n, Object.extend({ sync: true, mode: 'relative' }, o.outDirection)),
|
38 |
+
new Effect.Opacity(n, { sync: true, to: 0 })
|
39 |
+
], {
|
40 |
+
duration: o.speedout
|
41 |
+
,afterFinish: function(){
|
42 |
+
try {
|
43 |
+
var ne = n.down("div.notice-exit");
|
44 |
+
if(ne != undefined){
|
45 |
+
ne.stopObserving("click", removeNotice);
|
46 |
+
}
|
47 |
+
if(o.created && Object.isFunction(o.created)){
|
48 |
+
n.stopObserving("notice:created", o.created);
|
49 |
+
}
|
50 |
+
if(o.destroyed && Object.isFunction(o.destroyed)){
|
51 |
+
n.fire("notice:destroyed");
|
52 |
+
n.stopObserving("notice:destroyed", o.destroyed);
|
53 |
+
}
|
54 |
+
} catch(e){}
|
55 |
+
try {
|
56 |
+
n.remove();
|
57 |
+
} catch(e){}
|
58 |
+
}
|
59 |
+
});
|
60 |
+
}
|
61 |
+
function createNotice(growler, msg, options){
|
62 |
+
var opt = Object.clone(noticeOptions);
|
63 |
+
options = options || {};
|
64 |
+
Object.extend(opt, options);
|
65 |
+
var notice;
|
66 |
+
if (opt.className != ""){
|
67 |
+
notice = new Element("div", {"class": opt.className}).setStyle({display: "block", opacity: 0});
|
68 |
+
} else {
|
69 |
+
notice = new Element("div", {"class": "Growler-notice"}).setStyle({display: "block", opacity: 0});
|
70 |
+
}
|
71 |
+
if(opt.created && Object.isFunction(opt.created)){
|
72 |
+
notice.observe("notice:created", opt.created);
|
73 |
+
}
|
74 |
+
if(opt.destroyed && Object.isFunction(opt.destroyed)){
|
75 |
+
notice.observe("notice:destroyed", opt.destroyed);
|
76 |
+
}
|
77 |
+
if (opt.sticky){
|
78 |
+
var noticeExit = new Element("div", {"class": "Growler-notice-exit"}).update("×");
|
79 |
+
noticeExit.observe("click", function(){ removeNotice(notice, opt); });
|
80 |
+
notice.insert(noticeExit);
|
81 |
+
}
|
82 |
+
notice.insert(new Element("div", {"class": "Growler-notice-head"}).update(opt.header));
|
83 |
+
notice.insert(new Element("div", {"class": "Growler-notice-body"}).update(msg));
|
84 |
+
growler.insert(notice);
|
85 |
+
new Effect.Opacity(notice, { to: 0.85, duration: opt.speedin });
|
86 |
+
if (!opt.sticky){
|
87 |
+
removeNotice.delay(opt.life, notice, opt);
|
88 |
+
}
|
89 |
+
notice.fire("notice:created");
|
90 |
+
return notice;
|
91 |
+
}
|
92 |
+
function specialNotice(g, m, o, t, b, c){
|
93 |
+
o.header = o.header || t;
|
94 |
+
var n = createNotice(g, m, o);
|
95 |
+
n.setStyle({ backgroundColor: b, color: c });
|
96 |
+
return n;
|
97 |
+
}
|
98 |
+
return Class.create({
|
99 |
+
initialize: function(options){
|
100 |
+
var opt = Object.clone(growlerOptions);
|
101 |
+
options = options || {};
|
102 |
+
Object.extend(opt, options);
|
103 |
+
this.growler = new Element("div", { "class": "Growler", "id": "Growler" });
|
104 |
+
this.growler.setStyle({ position: ((IE==6)?"absolute":"fixed"), padding: "10px", "width": opt.width, "z-index": "50000" });
|
105 |
+
if(IE==6){
|
106 |
+
var offset = { w: parseInt(this.growler.style.width)+parseInt(this.growler.style.padding)*3, h: parseInt(this.growler.style.height)+parseInt(this.growler.style.padding)*3 };
|
107 |
+
switch(opt.location){
|
108 |
+
case "br":
|
109 |
+
this.growler.style.setExpression("left", "( 0 - Growler.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px'");
|
110 |
+
this.growler.style.setExpression("top", "( 0 - Growler.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px'");
|
111 |
+
break;
|
112 |
+
case "tl":
|
113 |
+
this.growler.style.setExpression("left", "( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px'");
|
114 |
+
this.growler.style.setExpression("top", "( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px'");
|
115 |
+
break;
|
116 |
+
case "bl":
|
117 |
+
this.growler.style.setExpression("left", "( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px'");
|
118 |
+
this.growler.style.setExpression("top", "( 0 - Growler.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px'");
|
119 |
+
break;
|
120 |
+
default:
|
121 |
+
this.growler.setStyle({right: "auto", bottom: "auto"});
|
122 |
+
this.growler.style.setExpression("left", "( 0 - Growler.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px'");
|
123 |
+
this.growler.style.setExpression("top", "( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px'");
|
124 |
+
break;
|
125 |
+
}
|
126 |
+
} else {
|
127 |
+
switch(opt.location){
|
128 |
+
case "br":
|
129 |
+
this.growler.setStyle({bottom: 0, right: 0});
|
130 |
+
break;
|
131 |
+
case "tl":
|
132 |
+
this.growler.setStyle({top: 0, left: 0});
|
133 |
+
break;
|
134 |
+
case "bl":
|
135 |
+
this.growler.setStyle({top: 0, right: 0});
|
136 |
+
break;
|
137 |
+
case "tc":
|
138 |
+
this.growler.setStyle({top: 0, left: "25%", width: "50%"});
|
139 |
+
break;
|
140 |
+
case "bc":
|
141 |
+
this.growler.setStyle({bottom: 0, left: "25%", width: "50%"});
|
142 |
+
break;
|
143 |
+
default:
|
144 |
+
this.growler.setStyle({top: 0, right: 0});
|
145 |
+
break;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
this.growler.wrap( document.body );
|
149 |
+
}
|
150 |
+
,growl: function(msg, options) {
|
151 |
+
return createNotice(this.growler, msg, options);
|
152 |
+
}
|
153 |
+
,warn: function(msg, options){
|
154 |
+
return specialNotice(this.growler, msg, options, "Warning!", "#F6BD6F", "#000");
|
155 |
+
}
|
156 |
+
,error: function(msg, options){
|
157 |
+
return specialNotice(this.growler, msg, options, "Critical!", "#F66F82", "#000");
|
158 |
+
}
|
159 |
+
,info: function(msg, options){
|
160 |
+
return specialNotice(this.growler, msg, options, "Information!", "#BBF66F", "#000");
|
161 |
+
}
|
162 |
+
,ungrowl: function(n, o){
|
163 |
+
removeNotice(n, o);
|
164 |
+
}
|
165 |
+
});
|
166 |
+
|
167 |
+
})();
|
skin/frontend/base/default/js/ajaxwishlist/ajaxcart/modalbox.js
ADDED
@@ -0,0 +1,450 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
ModalBox - The pop-up window thingie with AJAX, based on prototype and script.aculo.us.
|
3 |
+
|
4 |
+
Copyright Andrey Okonetchnikov (andrej.okonetschnikow@gmail.com), 2006-2007
|
5 |
+
All rights reserved.
|
6 |
+
|
7 |
+
VERSION 1.5.4
|
8 |
+
Last Modified: 07/13/2007
|
9 |
+
*/
|
10 |
+
|
11 |
+
if (!window.Modalbox)
|
12 |
+
var Modalbox = new Object();
|
13 |
+
|
14 |
+
Modalbox.Methods = {
|
15 |
+
focusableElements: new Array,
|
16 |
+
options: {
|
17 |
+
title: "ModalBox Window", // Title of the ModalBox window
|
18 |
+
overlayClose: true, // Close modal box by clicking on overlay
|
19 |
+
width: 500, // Default width in px
|
20 |
+
height: 90, // Default height in px
|
21 |
+
overlayOpacity: .75, // Default overlay opacity
|
22 |
+
overlayDuration: .50, // Default overlay fade in/out duration in seconds
|
23 |
+
slideDownDuration: .75, // Default Modalbox appear slide down effect in seconds
|
24 |
+
slideUpDuration: .35, // Default Modalbox hiding slide up effect in seconds
|
25 |
+
resizeDuration: .35, // Default resize duration seconds
|
26 |
+
inactiveFade: true, // Fades MB window on inactive state
|
27 |
+
loadingString: "Please wait. Loading...", // Default loading string message
|
28 |
+
closeString: "Close window", // Default title attribute for close window link
|
29 |
+
params: {},
|
30 |
+
method: 'get' // Default Ajax request method
|
31 |
+
},
|
32 |
+
_options: new Object,
|
33 |
+
|
34 |
+
setOptions: function(options) {
|
35 |
+
Object.extend(this.options, options || {});
|
36 |
+
},
|
37 |
+
|
38 |
+
_init: function(options) {
|
39 |
+
// Setting up original options with default options
|
40 |
+
Object.extend(this._options, this.options);
|
41 |
+
this.setOptions(options);
|
42 |
+
//Create the overlay
|
43 |
+
this.MBoverlay = Builder.node("div", { id: "MB_overlay", opacity: "0" });
|
44 |
+
//Create the window
|
45 |
+
this.MBwindow = Builder.node("div", {id: "MB_window", style: "display: none;height:475px !important;top:50px"}, [
|
46 |
+
this.MBframe = Builder.node("div", {id: "MB_frame"}, [
|
47 |
+
this.MBheader = Builder.node("div", {id: "MB_header"}, [
|
48 |
+
this.MBcaption = Builder.node("div", {id: "MB_caption"}),
|
49 |
+
this.MBclose = Builder.node("a", {id: "MB_close", title: this.options.closeString, href: "#"}, [
|
50 |
+
Builder.build("<span>×</span>"),
|
51 |
+
]),
|
52 |
+
]),
|
53 |
+
this.MBcontent = Builder.node("div", {id: "MB_content"}, [
|
54 |
+
this.MBloading = Builder.node("div", {id: "MB_loading"}, this.options.loadingString),
|
55 |
+
]),
|
56 |
+
]),
|
57 |
+
]);
|
58 |
+
// Inserting into DOM
|
59 |
+
document.body.insertBefore(this.MBwindow, document.body.childNodes[0]);
|
60 |
+
document.body.insertBefore(this.MBoverlay, document.body.childNodes[0]);
|
61 |
+
|
62 |
+
// Initial scrolling position of the window. To be used for remove scrolling effect during ModalBox appearing
|
63 |
+
this.initScrollX = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
|
64 |
+
this.initScrollY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
|
65 |
+
|
66 |
+
//Adding event observers
|
67 |
+
this.hide = this.hide.bindAsEventListener(this);
|
68 |
+
this.close = this._hide.bindAsEventListener(this);
|
69 |
+
this.kbdHandler = this.kbdHandler.bindAsEventListener(this);
|
70 |
+
this._initObservers();
|
71 |
+
|
72 |
+
this.initialized = true; // Mark as initialized
|
73 |
+
this.active = true; // Mark as active
|
74 |
+
},
|
75 |
+
|
76 |
+
show: function(content, options) {
|
77 |
+
if(!this.initialized) this._init(options); // Check for is already initialized
|
78 |
+
|
79 |
+
this.content = content;
|
80 |
+
this.setOptions(options);
|
81 |
+
|
82 |
+
Element.update(this.MBcaption, this.options.title); // Updating title of the MB
|
83 |
+
|
84 |
+
if(this.MBwindow.style.display == "none") { // First modal box appearing
|
85 |
+
this._appear();
|
86 |
+
this.event("onShow"); // Passing onShow callback
|
87 |
+
}
|
88 |
+
else { // If MB already on the screen, update it
|
89 |
+
this._update();
|
90 |
+
this.event("onUpdate"); // Passing onUpdate callback
|
91 |
+
}
|
92 |
+
},
|
93 |
+
|
94 |
+
hide: function(options) { // External hide method to use from external HTML and JS
|
95 |
+
if(this.initialized) {
|
96 |
+
if(options) Object.extend(this.options, options); // Passing callbacks
|
97 |
+
Effect.SlideUp(this.MBwindow, { duration: this.options.slideUpDuration, afterFinish: this._deinit.bind(this) } );
|
98 |
+
} else throw("Modalbox isn't initialized");
|
99 |
+
},
|
100 |
+
|
101 |
+
_hide: function(event) { // Internal hide method to use inside MB class
|
102 |
+
if(event) Event.stop(event);
|
103 |
+
this.hide();
|
104 |
+
},
|
105 |
+
|
106 |
+
_appear: function() { // First appearing of MB
|
107 |
+
this._toggleSelects();
|
108 |
+
this._setOverlay();
|
109 |
+
this._setWidth();
|
110 |
+
this._setPosition();
|
111 |
+
new Effect.Fade(this.MBoverlay, {
|
112 |
+
from: 0,
|
113 |
+
to: this.options.overlayOpacity,
|
114 |
+
duration: this.options.overlayDuration,
|
115 |
+
afterFinish: function() {
|
116 |
+
new Effect.SlideDown(this.MBwindow, {
|
117 |
+
duration: this.options.slideDownDuration,
|
118 |
+
afterFinish: function(){
|
119 |
+
this._setPosition();
|
120 |
+
this.loadContent();
|
121 |
+
}.bind(this)
|
122 |
+
});
|
123 |
+
}.bind(this)
|
124 |
+
});
|
125 |
+
|
126 |
+
this._setWidthAndPosition = this._setWidthAndPosition.bindAsEventListener(this);
|
127 |
+
Event.observe(window, "resize", this._setWidthAndPosition);
|
128 |
+
},
|
129 |
+
|
130 |
+
resize: function(byWidth, byHeight, options) { // Change size of MB without loading content
|
131 |
+
var wHeight = Element.getHeight(this.MBwindow);
|
132 |
+
var hHeight = Element.getHeight(this.MBheader);
|
133 |
+
var cHeight = Element.getHeight(this.MBcontent);
|
134 |
+
var newHeight = ((wHeight - hHeight + byHeight) < cHeight) ? (cHeight + hHeight - wHeight) : byHeight;
|
135 |
+
this.setOptions(options); // Passing callbacks
|
136 |
+
new Effect.ScaleBy(this.MBwindow, byWidth, newHeight, {
|
137 |
+
duration: this.options.resizeDuration,
|
138 |
+
afterFinish: function() { this.event("afterResize") }.bind(this) // Passing callback
|
139 |
+
});
|
140 |
+
},
|
141 |
+
|
142 |
+
_update: function() { // Updating MB in case of wizards
|
143 |
+
this.currentDims = [this.MBwindow.offsetWidth, this.MBwindow.offsetHeight];
|
144 |
+
if((this.options.width + 10 != this.currentDims[0]) || (this.options.height + 5 != this.currentDims[1]))
|
145 |
+
new Effect.ScaleBy(this.MBwindow,
|
146 |
+
(this.options.width - this.currentDims[0]), //New width calculation
|
147 |
+
(this.options.height - this.currentDims[1]), //New height calculation
|
148 |
+
{
|
149 |
+
duration: this.options.resizeDuration,
|
150 |
+
afterFinish: this._loadAfterResize.bind(this),
|
151 |
+
beforeStart: function(effect) {
|
152 |
+
Element.update(this.MBcontent, "");
|
153 |
+
this.MBcontent.appendChild(this.MBloading);
|
154 |
+
Element.update(this.MBloading, this.options.loadingString);
|
155 |
+
}.bind(this)
|
156 |
+
});
|
157 |
+
else {
|
158 |
+
Element.update(this.MBcontent, "");
|
159 |
+
this.MBcontent.appendChild(this.MBloading);
|
160 |
+
Element.update(this.MBloading, this.options.loadingString);
|
161 |
+
this._loadAfterResize();
|
162 |
+
}
|
163 |
+
},
|
164 |
+
|
165 |
+
loadContent: function () {
|
166 |
+
if(this.event("beforeLoad") != false) { // If callback passed false, skip loading of the content
|
167 |
+
if(typeof this.content == 'string') {
|
168 |
+
|
169 |
+
var htmlRegExp = new RegExp(/<\/?[^>]+>/gi);
|
170 |
+
if(htmlRegExp.test(this.content)) // Plain HTML given as a parameter
|
171 |
+
this._insertContent(this.content);
|
172 |
+
|
173 |
+
else new Ajax.Request( this.content, { method: this.options.method.toLowerCase(), parameters: this.options.params,
|
174 |
+
onComplete: function(transport) {
|
175 |
+
var response = new String(transport.responseText);
|
176 |
+
response.extractScripts().map(function(script) {
|
177 |
+
return eval(script.replace("<!--", "").replace("// -->", ""));
|
178 |
+
}.bind(window));
|
179 |
+
this._insertContent(transport.responseText.stripScripts());
|
180 |
+
}.bind(this)
|
181 |
+
});
|
182 |
+
|
183 |
+
} else if (typeof this.content == 'object') {// HTML Object is given
|
184 |
+
this._insertContent(this.content);
|
185 |
+
} else {
|
186 |
+
Modalbox.hide();
|
187 |
+
throw('Please specify correct URL or HTML element (plain HTML or object)');
|
188 |
+
}
|
189 |
+
}
|
190 |
+
},
|
191 |
+
|
192 |
+
_insertContent: function(content){
|
193 |
+
Element.extend(this.MBcontent);
|
194 |
+
this.MBcontent.update("");
|
195 |
+
if(typeof content == 'string') {
|
196 |
+
//this.MBcontent.hide()
|
197 |
+
//if(console.log){console.log(this.MBcontent.getHeight())};
|
198 |
+
this.MBcontent.hide().update(content);
|
199 |
+
//if(console.log){console.log(this.MBcontent.getHeight())};
|
200 |
+
//this.MBcontent.show();
|
201 |
+
}
|
202 |
+
else if (typeof this.content == 'object') { // HTML Object is given
|
203 |
+
var _htmlObj = content.cloneNode(true); // If node already a part of DOM we'll clone it
|
204 |
+
if(this.content.id) _htmlObj.id = "MB_" + _htmlObj.id; // If clonable element has ID attribute defined, modifying it to prevent duplicates
|
205 |
+
this.MBcontent.hide().appendChild(_htmlObj);
|
206 |
+
this.MBcontent.down().show(); // Toggle visibility for hidden nodes
|
207 |
+
}
|
208 |
+
// Prepare and resize modal box for content
|
209 |
+
if(this.options.height == this._options.height)
|
210 |
+
Modalbox.resize(0, this.MBcontent.getHeight() - Element.getHeight(this.MBwindow) + Element.getHeight(this.MBheader), {
|
211 |
+
afterResize: function(){
|
212 |
+
this.MBcontent.show();
|
213 |
+
this.focusableElements = this._findFocusableElements();
|
214 |
+
this._moveFocus(); // Setting focus on first 'focusable' element in content (input, select, textarea, link or button)
|
215 |
+
this.event("afterLoad"); // Passing callback
|
216 |
+
}.bind(this)
|
217 |
+
});
|
218 |
+
else { // Height is defined. Creating a scrollable window
|
219 |
+
this._setWidth();
|
220 |
+
this.MBcontent.setStyle({overflow: 'auto', height: Element.getHeight(this.MBwindow)-Element.getHeight(this.MBheader) - 11 + 'px'});
|
221 |
+
this.MBcontent.show();
|
222 |
+
this.focusableElements = this._findFocusableElements();
|
223 |
+
this._moveFocus(); // Setting focus on first 'focusable' element in content (input, select, textarea, link or button)
|
224 |
+
this.event("afterLoad"); // Passing callback
|
225 |
+
}
|
226 |
+
|
227 |
+
},
|
228 |
+
|
229 |
+
activate: function(options){
|
230 |
+
this.setOptions(options);
|
231 |
+
this.active = true;
|
232 |
+
Event.observe(this.MBclose, "click", this.close);
|
233 |
+
if(this.options.overlayClose) Event.observe(this.MBoverlay, "click", this.hide);
|
234 |
+
Element.show(this.MBclose);
|
235 |
+
if(this.options.inactiveFade) new Effect.Appear(this.MBwindow, {duration: this.options.slideDownDuration});
|
236 |
+
},
|
237 |
+
|
238 |
+
deactivate: function(options) {
|
239 |
+
this.setOptions(options);
|
240 |
+
this.active = false;
|
241 |
+
Event.stopObserving(this.MBclose, "click", this.close);
|
242 |
+
if(this.options.overlayClose) Event.stopObserving(this.MBoverlay, "click", this.hide);
|
243 |
+
Element.hide(this.MBclose);
|
244 |
+
if(this.options.inactiveFade) new Effect.Fade(this.MBwindow, {duration: this.options.slideUpDuration, to: .75});
|
245 |
+
},
|
246 |
+
|
247 |
+
_initObservers: function(){
|
248 |
+
Event.observe(this.MBclose, "click", this.close);
|
249 |
+
if(this.options.overlayClose) Event.observe(this.MBoverlay, "click", this.hide);
|
250 |
+
Event.observe(document, "keypress", Modalbox.kbdHandler );
|
251 |
+
},
|
252 |
+
|
253 |
+
_removeObservers: function(){
|
254 |
+
Event.stopObserving(this.MBclose, "click", this.close);
|
255 |
+
if(this.options.overlayClose) Event.stopObserving(this.MBoverlay, "click", this.hide);
|
256 |
+
Event.stopObserving(document, "keypress", Modalbox.kbdHandler );
|
257 |
+
},
|
258 |
+
|
259 |
+
_loadAfterResize: function() {
|
260 |
+
this._setWidth();
|
261 |
+
this._setPosition();
|
262 |
+
this.loadContent();
|
263 |
+
},
|
264 |
+
|
265 |
+
_moveFocus: function() { // Setting focus to be looped inside current MB
|
266 |
+
if(this.focusableElements.length > 0)
|
267 |
+
this.focusableElements.first().focus(); // Focus on first focusable element except close button
|
268 |
+
else
|
269 |
+
$("MB_close").focus(); // If no focusable elements exist focus on close button
|
270 |
+
},
|
271 |
+
|
272 |
+
_findFocusableElements: function(){ // Collect form elements or links from MB content
|
273 |
+
return $A($("MB_content").descendants()).findAll(function(node){
|
274 |
+
return (["INPUT", "TEXTAREA", "SELECT", "A", "BUTTON"].include(node.tagName));
|
275 |
+
});
|
276 |
+
},
|
277 |
+
|
278 |
+
kbdHandler: function(e) {
|
279 |
+
var node = Event.element(e);
|
280 |
+
switch(e.keyCode) {
|
281 |
+
case Event.KEY_TAB:
|
282 |
+
if(Event.element(e) == this.focusableElements.last()) {
|
283 |
+
Event.stop(e);
|
284 |
+
this._moveFocus(); // Find last element in MB to handle event on it. If no elements found, uses close ModalBox button
|
285 |
+
}
|
286 |
+
break;
|
287 |
+
case Event.KEY_ESC:
|
288 |
+
if(this.active) this._hide(e);
|
289 |
+
break;
|
290 |
+
case 32:
|
291 |
+
this._preventScroll(e);
|
292 |
+
break;
|
293 |
+
case 0: // For Gecko browsers compatibility
|
294 |
+
if(e.which == 32) this._preventScroll(e);
|
295 |
+
break;
|
296 |
+
case Event.KEY_UP:
|
297 |
+
case Event.KEY_DOWN:
|
298 |
+
case Event.KEY_PAGEDOWN:
|
299 |
+
case Event.KEY_PAGEUP:
|
300 |
+
case Event.KEY_HOME:
|
301 |
+
case Event.KEY_END:
|
302 |
+
// Safari operates in slightly different way. This realization is still buggy in Safari.
|
303 |
+
if(/Safari|KHTML/.test(navigator.userAgent) && !["textarea", "select"].include(node.tagName.toLowerCase()))
|
304 |
+
Event.stop(e);
|
305 |
+
else if( (node.tagName.toLowerCase() == "input" && ["submit", "button"].include(node.type)) || (node.tagName.toLowerCase() == "a") )
|
306 |
+
Event.stop(e);
|
307 |
+
break;
|
308 |
+
}
|
309 |
+
},
|
310 |
+
|
311 |
+
_preventScroll: function(event) { // Disabling scrolling by "space" key
|
312 |
+
if(!["input", "textarea", "select", "button"].include(Event.element(event).tagName.toLowerCase()))
|
313 |
+
Event.stop(event);
|
314 |
+
},
|
315 |
+
|
316 |
+
_deinit: function()
|
317 |
+
{
|
318 |
+
this._toggleSelects(); // Toggle back 'select' elements in IE
|
319 |
+
this._removeObservers();
|
320 |
+
Event.stopObserving(window, "resize", this._setWidthAndPosition );
|
321 |
+
Effect.toggle(this.MBoverlay, 'appear', {duration: this.options.overlayDuration, afterFinish: this._removeElements.bind(this) });
|
322 |
+
Element.setStyle(this.MBcontent, {overflow: '', height: ''});
|
323 |
+
},
|
324 |
+
|
325 |
+
_removeElements: function () {
|
326 |
+
if (navigator.appVersion.match(/\bMSIE\b/)) {
|
327 |
+
this._prepareIE("", ""); // If set to auto MSIE will show horizontal scrolling
|
328 |
+
window.scrollTo(this.initScrollX, this.initScrollY);
|
329 |
+
}
|
330 |
+
Element.remove(this.MBoverlay);
|
331 |
+
Element.remove(this.MBwindow);
|
332 |
+
this.initialized = false;
|
333 |
+
this.event("afterHide"); // Passing afterHide callback
|
334 |
+
this.setOptions(this._options); //Settings options object into intial state
|
335 |
+
},
|
336 |
+
|
337 |
+
_setOverlay: function () {
|
338 |
+
if (navigator.appVersion.match(/\bMSIE\b/)) {
|
339 |
+
this._prepareIE("100%", "hidden");
|
340 |
+
if (!navigator.appVersion.match(/\b7.0\b/)) window.scrollTo(0,0); // Disable scrolling on top for IE7
|
341 |
+
}
|
342 |
+
},
|
343 |
+
|
344 |
+
_setWidth: function () { //Set size
|
345 |
+
Element.setStyle(this.MBwindow, {width: this.options.width + "px", height: this.options.height + "px"});
|
346 |
+
},
|
347 |
+
|
348 |
+
_setPosition: function () {
|
349 |
+
this.MBwindow.style.left = Math.round((Element.getWidth(document.body) - Element.getWidth(this.MBwindow)) / 2 ) + "px";
|
350 |
+
},
|
351 |
+
|
352 |
+
_setWidthAndPosition: function () {
|
353 |
+
this._setWidth();
|
354 |
+
this._setPosition();
|
355 |
+
},
|
356 |
+
|
357 |
+
_getScrollTop: function () { //From: http://www.quirksmode.org/js/doctypes.html
|
358 |
+
var theTop;
|
359 |
+
if (document.documentElement && document.documentElement.scrollTop)
|
360 |
+
theTop = document.documentElement.scrollTop;
|
361 |
+
else if (document.body)
|
362 |
+
theTop = document.body.scrollTop;
|
363 |
+
return theTop;
|
364 |
+
},
|
365 |
+
// For IE browsers -- IE requires height to 100% and overflow hidden (taken from lightbox)
|
366 |
+
_prepareIE: function(height, overflow){
|
367 |
+
var body = document.getElementsByTagName('body')[0];
|
368 |
+
body.style.height = height;
|
369 |
+
body.style.overflow = overflow;
|
370 |
+
|
371 |
+
var html = document.getElementsByTagName('html')[0];
|
372 |
+
html.style.height = height;
|
373 |
+
html.style.overflow = overflow;
|
374 |
+
},
|
375 |
+
// For IE browsers -- hiding all SELECT elements
|
376 |
+
_toggleSelects: function() {
|
377 |
+
if (navigator.appVersion.match(/\bMSIE\b/))
|
378 |
+
$$("select").each( function(select) {
|
379 |
+
select.style.visibility = (select.style.visibility == "") ? "hidden" : "";
|
380 |
+
});
|
381 |
+
},
|
382 |
+
event: function(eventName) {
|
383 |
+
if(this.options[eventName]) {
|
384 |
+
var returnValue = this.options[eventName](); // Executing callback
|
385 |
+
this.options[eventName] = null; // Removing callback after execution
|
386 |
+
if(returnValue != undefined)
|
387 |
+
return returnValue;
|
388 |
+
else
|
389 |
+
return true;
|
390 |
+
}
|
391 |
+
return true;
|
392 |
+
}
|
393 |
+
}
|
394 |
+
|
395 |
+
Object.extend(Modalbox, Modalbox.Methods);
|
396 |
+
|
397 |
+
Effect.ScaleBy = Class.create();
|
398 |
+
Object.extend(Object.extend(Effect.ScaleBy.prototype, Effect.Base.prototype), {
|
399 |
+
initialize: function(element, byWidth, byHeight, options) {
|
400 |
+
this.element = $(element)
|
401 |
+
var options = Object.extend({
|
402 |
+
scaleFromTop: true,
|
403 |
+
scaleMode: 'box', // 'box' or 'contents' or {} with provided values
|
404 |
+
scaleByWidth: byWidth,
|
405 |
+
scaleByHeight: byHeight
|
406 |
+
}, arguments[3] || {});
|
407 |
+
this.start(options);
|
408 |
+
},
|
409 |
+
setup: function() {
|
410 |
+
this.elementPositioning = this.element.getStyle('position');
|
411 |
+
|
412 |
+
this.originalTop = this.element.offsetTop;
|
413 |
+
this.originalLeft = this.element.offsetLeft;
|
414 |
+
|
415 |
+
this.dims = null;
|
416 |
+
if(this.options.scaleMode=='box')
|
417 |
+
this.dims = [this.element.offsetHeight, this.element.offsetWidth];
|
418 |
+
if(/^content/.test(this.options.scaleMode))
|
419 |
+
this.dims = [this.element.scrollHeight, this.element.scrollWidth];
|
420 |
+
if(!this.dims)
|
421 |
+
this.dims = [this.options.scaleMode.originalHeight,
|
422 |
+
this.options.scaleMode.originalWidth];
|
423 |
+
|
424 |
+
this.deltaY = this.options.scaleByHeight;
|
425 |
+
this.deltaX = this.options.scaleByWidth;
|
426 |
+
},
|
427 |
+
update: function(position) {
|
428 |
+
var currentHeight = this.dims[0] + (this.deltaY * position);
|
429 |
+
var currentWidth = this.dims[1] + (this.deltaX * position);
|
430 |
+
|
431 |
+
this.setDimensions(currentHeight, currentWidth);
|
432 |
+
},
|
433 |
+
|
434 |
+
setDimensions: function(height, width) {
|
435 |
+
var d = {};
|
436 |
+
d.width = width + 'px';
|
437 |
+
d.height = height + 'px';
|
438 |
+
|
439 |
+
var topd = Math.round((height - this.dims[0])/2);
|
440 |
+
var leftd = Math.round((width - this.dims[1])/2);
|
441 |
+
if(this.elementPositioning == 'absolute' || this.elementPositioning == 'fixed') {
|
442 |
+
if(!this.options.scaleFromTop) d.top = this.originalTop-topd + 'px';
|
443 |
+
d.left = this.originalLeft-leftd + 'px';
|
444 |
+
} else {
|
445 |
+
if(!this.options.scaleFromTop) d.top = -topd + 'px';
|
446 |
+
d.left = -leftd + 'px';
|
447 |
+
}
|
448 |
+
this.element.setStyle(d);
|
449 |
+
}
|
450 |
+
});
|
skin/frontend/base/default/js/ajaxwishlist/ajaxwishlist.js
ADDED
@@ -0,0 +1,968 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* All Js OF Ajax Wishlist */
|
3 |
+
|
4 |
+
function ajaxCompare(url,id){
|
5 |
+
url = url.replace("catalog/product_compare/add","ajaxwishlist/index/compare");
|
6 |
+
url += '?isAjax/1/';
|
7 |
+
|
8 |
+
$('ajax_compare_loading'+id).show();
|
9 |
+
new Ajax.Request(url, {
|
10 |
+
method: 'POST',
|
11 |
+
dataType : 'json',
|
12 |
+
requestHeaders: {
|
13 |
+
Accept: 'application/json'
|
14 |
+
},
|
15 |
+
onSuccess: function(transport) {
|
16 |
+
$('ajax_compare_loading'+id).hide();
|
17 |
+
var response = transport.responseText.evalJSON(true);
|
18 |
+
|
19 |
+
if(response.status == 'ERROR'){
|
20 |
+
|
21 |
+
func_errorMsg(response.message);
|
22 |
+
|
23 |
+
$('ajax_compare_loading'+id).hide();
|
24 |
+
|
25 |
+
|
26 |
+
}else{
|
27 |
+
|
28 |
+
$('ajax_compare_loading'+id).hide();
|
29 |
+
func_successMsg(response.message);
|
30 |
+
|
31 |
+
|
32 |
+
if($$('.block-compare').length == 1){
|
33 |
+
|
34 |
+
$$(".block-compare").each(function(element){
|
35 |
+
element.replace(response.sidebar);
|
36 |
+
});
|
37 |
+
|
38 |
+
|
39 |
+
}
|
40 |
+
else{
|
41 |
+
|
42 |
+
|
43 |
+
if($$('.col-right').length == 1 && $$('.col-left').length == 0){
|
44 |
+
|
45 |
+
$$(".col-right").each(function(element){
|
46 |
+
element.insert(response.sidebar);
|
47 |
+
});
|
48 |
+
}
|
49 |
+
|
50 |
+
if($$('.col-left').length == 1 && $$('.col-right').length == 0){
|
51 |
+
|
52 |
+
$$(".col-left").each(function(element){
|
53 |
+
element.insert(response.sidebar);
|
54 |
+
});
|
55 |
+
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
});
|
61 |
+
|
62 |
+
|
63 |
+
}
|
64 |
+
|
65 |
+
function ajaxWishlist(url,id,position){
|
66 |
+
|
67 |
+
url = url.replace("wishlist/index","ajaxwishlist/index");
|
68 |
+
url += 'isAjax/1/';
|
69 |
+
$('ajax_loading'+id).show();
|
70 |
+
new Ajax.Request(url, {
|
71 |
+
method: 'POST',
|
72 |
+
dataType : 'json',
|
73 |
+
requestHeaders: {
|
74 |
+
Accept: 'application/json'
|
75 |
+
},
|
76 |
+
onSuccess: function(transport) {
|
77 |
+
$('ajax_loading'+id).hide();
|
78 |
+
var response = transport.responseText.evalJSON(true);
|
79 |
+
|
80 |
+
if(response.status == 'ERROR'){
|
81 |
+
|
82 |
+
func_errorMsg(response.message);
|
83 |
+
|
84 |
+
$('ajax_loading'+id).hide();
|
85 |
+
|
86 |
+
}else{
|
87 |
+
|
88 |
+
$$("ul.links").each(function(element){
|
89 |
+
|
90 |
+
element.replace(response.toplink);
|
91 |
+
});
|
92 |
+
|
93 |
+
if($$('div.block-wishlist').length == 1){
|
94 |
+
|
95 |
+
if(position != ""){
|
96 |
+
$$("div.block-wishlist").each(function(element){
|
97 |
+
element.replace(response.sidebar);
|
98 |
+
});
|
99 |
+
}
|
100 |
+
|
101 |
+
}
|
102 |
+
else{
|
103 |
+
|
104 |
+
if(position == "right")
|
105 |
+
{
|
106 |
+
//if($$('.col-right').length == 1 && $$('.col-left').length == 1){
|
107 |
+
|
108 |
+
$$(".col-right").each(function(element){
|
109 |
+
element.insert(response.sidebar);
|
110 |
+
});
|
111 |
+
//}
|
112 |
+
}
|
113 |
+
|
114 |
+
if(position == "left")
|
115 |
+
{
|
116 |
+
// if($$('.col-left').length == 1 && $$('.col-right').length == 1){
|
117 |
+
|
118 |
+
$$(".col-left").each(function(element){
|
119 |
+
element.insert(response.sidebar);
|
120 |
+
});
|
121 |
+
|
122 |
+
//}
|
123 |
+
}
|
124 |
+
|
125 |
+
// if($$('.col-right').length == 1 && $$('.col-left').length == 0){
|
126 |
+
//
|
127 |
+
// $$(".col-right").each(function(element){
|
128 |
+
// element.insert(response.sidebar);
|
129 |
+
// });
|
130 |
+
// }
|
131 |
+
//
|
132 |
+
// if($$('.col-left').length == 1 && $$('.col-right').length == 0){
|
133 |
+
//
|
134 |
+
// $$(".col-left").each(function(element){
|
135 |
+
// element.insert(response.sidebar);
|
136 |
+
// });
|
137 |
+
//
|
138 |
+
// }
|
139 |
+
|
140 |
+
}
|
141 |
+
|
142 |
+
url = url.replace("ajaxwishlist/index/add/product/"+id+"/","wishlist/index/remove/item/"+response.item_id+"/");
|
143 |
+
|
144 |
+
$("Remove_Link_"+id).down("a").setAttribute("onclick",'func_removeItemFromLink("'+url+'","'+id+'","'+position+'")')
|
145 |
+
$("wishlist_unselect_"+id).setAttribute("onclick",'func_removeListItemWishtlist("'+url+'","'+id+'","'+position+'")')
|
146 |
+
|
147 |
+
func_successMsg(response.message);
|
148 |
+
|
149 |
+
$('ajax_loading'+id).hide();
|
150 |
+
|
151 |
+
clickNeedhelp(id);
|
152 |
+
|
153 |
+
|
154 |
+
$("wishlist_select_"+id).setStyle({
|
155 |
+
"visibility":"hidden"
|
156 |
+
});
|
157 |
+
$("wishlist_unselect_"+id).setStyle({
|
158 |
+
"visibility":"visible"
|
159 |
+
});
|
160 |
+
|
161 |
+
$("Add_Item_Link_"+id).setStyle({
|
162 |
+
"display":"none"
|
163 |
+
});
|
164 |
+
$("Remove_Link_"+id).setStyle({
|
165 |
+
"display":"block"
|
166 |
+
});
|
167 |
+
|
168 |
+
|
169 |
+
$("Add_Item_Link_"+id).down("a").setStyle({
|
170 |
+
"display":"none"
|
171 |
+
});
|
172 |
+
|
173 |
+
|
174 |
+
$("Remove_Link_"+id).down("a").setStyle({
|
175 |
+
"display":"block"
|
176 |
+
});
|
177 |
+
|
178 |
+
if($("MB_window").length == 1)
|
179 |
+
{
|
180 |
+
$("MB_window").remove();
|
181 |
+
}
|
182 |
+
|
183 |
+
}
|
184 |
+
}
|
185 |
+
});
|
186 |
+
}
|
187 |
+
|
188 |
+
|
189 |
+
|
190 |
+
function func_addListItemWishtlist(url,id,position){
|
191 |
+
|
192 |
+
url = url.replace("wishlist/index","ajaxwishlist/index");
|
193 |
+
url += 'isAjax/1/';
|
194 |
+
$('ajax_loading_list'+id).show();
|
195 |
+
new Ajax.Request(url, {
|
196 |
+
method: 'POST',
|
197 |
+
dataType : 'json',
|
198 |
+
requestHeaders: {
|
199 |
+
Accept: 'application/json'
|
200 |
+
},
|
201 |
+
onSuccess: function(transport) {
|
202 |
+
|
203 |
+
var response = transport.responseText.evalJSON(true);
|
204 |
+
|
205 |
+
if(response.status == 'ERROR'){
|
206 |
+
|
207 |
+
func_errorMsg(response.message);
|
208 |
+
|
209 |
+
$('ajax_loading_list'+id).hide();
|
210 |
+
|
211 |
+
}else{
|
212 |
+
|
213 |
+
$('ajax_loading_list'+id).hide();
|
214 |
+
|
215 |
+
|
216 |
+
func_successMsg(response.message);
|
217 |
+
|
218 |
+
clickNeedhelp(id);
|
219 |
+
url = url.replace("ajaxwishlist/index/add/product/"+id+"/","wishlist/index/remove/item/"+response.item_id+"/");
|
220 |
+
|
221 |
+
$("wishlist_select_"+id).setStyle({
|
222 |
+
"visibility":"hidden"
|
223 |
+
});
|
224 |
+
$("wishlist_unselect_"+id).setStyle({
|
225 |
+
"visibility":"visible"
|
226 |
+
});
|
227 |
+
|
228 |
+
$("Remove_Link_"+id).setStyle({
|
229 |
+
"display":"block"
|
230 |
+
});
|
231 |
+
$("Add_Item_Link_"+id).setStyle({
|
232 |
+
"display":"none"
|
233 |
+
});
|
234 |
+
|
235 |
+
$("Add_Item_Link_"+id).down("a").setStyle({
|
236 |
+
"display":"none"
|
237 |
+
});
|
238 |
+
|
239 |
+
|
240 |
+
$("Remove_Link_"+id).down("a").setStyle({
|
241 |
+
"display":"block"
|
242 |
+
});
|
243 |
+
|
244 |
+
$("wishlist_unselect_"+id).setAttribute("onclick",'func_removeListItemWishtlist("'+url+'","'+id+'","'+position+'")');
|
245 |
+
$("Remove_Link_"+id).down("a").setAttribute("onclick",'func_removeItemFromLink("'+url+'","'+id+'","'+position+'")');
|
246 |
+
|
247 |
+
|
248 |
+
|
249 |
+
$$("ul.links").each(function(element){
|
250 |
+
|
251 |
+
element.replace(response.toplink);
|
252 |
+
});
|
253 |
+
|
254 |
+
if($$('.block-wishlist').length == 1){
|
255 |
+
|
256 |
+
if(position != ""){
|
257 |
+
|
258 |
+
$$(".block-wishlist").each(function(element){
|
259 |
+
element.replace(response.sidebar);
|
260 |
+
});
|
261 |
+
}
|
262 |
+
}
|
263 |
+
else{
|
264 |
+
|
265 |
+
if(position == "right")
|
266 |
+
{
|
267 |
+
//if($$('.col-right').length == 1 && $$('.col-left').length == 1){
|
268 |
+
|
269 |
+
$$(".col-right").each(function(element){
|
270 |
+
element.insert(response.sidebar);
|
271 |
+
});
|
272 |
+
//}
|
273 |
+
}
|
274 |
+
|
275 |
+
if(position == "left")
|
276 |
+
{
|
277 |
+
//if($$('.col-left').length == 1 && $$('.col-right').length == 1){
|
278 |
+
|
279 |
+
$$(".col-left").each(function(element){
|
280 |
+
element.insert(response.sidebar);
|
281 |
+
});
|
282 |
+
|
283 |
+
// }
|
284 |
+
}
|
285 |
+
|
286 |
+
|
287 |
+
// if($$('.col-right').length == 1 && $$('.col-left').length == 0){
|
288 |
+
//
|
289 |
+
// $$(".col-right").each(function(element){
|
290 |
+
// element.insert(response.sidebar);
|
291 |
+
// });
|
292 |
+
// }
|
293 |
+
//
|
294 |
+
// if($$('.col-left').length == 1 && $$('.col-right').length == 0){
|
295 |
+
//
|
296 |
+
// $$(".col-left").each(function(element){
|
297 |
+
// element.insert(response.sidebar);
|
298 |
+
// });
|
299 |
+
//
|
300 |
+
// }
|
301 |
+
}
|
302 |
+
}
|
303 |
+
}
|
304 |
+
});
|
305 |
+
}
|
306 |
+
|
307 |
+
function func_removeListItemWishtlist(url,id,position){
|
308 |
+
|
309 |
+
url = url.replace("wishlist/index","ajaxwishlist/index");
|
310 |
+
url += 'isAjax/1/';
|
311 |
+
$('ajax_loading_list'+id).show();
|
312 |
+
new Ajax.Request(url, {
|
313 |
+
method: 'POST',
|
314 |
+
dataType : 'json',
|
315 |
+
requestHeaders: {
|
316 |
+
Accept: 'application/json'
|
317 |
+
},
|
318 |
+
onSuccess: function(transport) {
|
319 |
+
$('ajax_loading_list'+id).hide();
|
320 |
+
var response = transport.responseText.evalJSON(true);
|
321 |
+
|
322 |
+
if(response.status == 'ERROR'){
|
323 |
+
|
324 |
+
func_errorMsg(response.message);
|
325 |
+
|
326 |
+
$('ajax_loading_list'+id).hide();
|
327 |
+
|
328 |
+
}else{
|
329 |
+
|
330 |
+
$('ajax_loading_list'+id).hide();
|
331 |
+
|
332 |
+
|
333 |
+
func_successMsg(response.message);
|
334 |
+
if(response.flag=="true")
|
335 |
+
{
|
336 |
+
var removeAttributeLink = $("Remove_Link_"+id).down("a").readAttribute("onclick");
|
337 |
+
var prevLink = "item/"+response.previous;
|
338 |
+
var currLink = "item/"+response.current;
|
339 |
+
var addAttributeLink = removeAttributeLink.replace(prevLink, currLink);
|
340 |
+
$("Remove_Link_"+id).down("a").setAttribute('onclick', addAttributeLink);
|
341 |
+
var removeAttributeButton = $("wishlist_unselect_"+id).readAttribute("onclick");
|
342 |
+
var prevButton = "item/"+response.previous;
|
343 |
+
var currButton = "item/"+response.current;
|
344 |
+
var addAttributeButton = removeAttributeButton.replace(prevButton, currButton);
|
345 |
+
$("wishlist_unselect_"+id).setAttribute('onclick', addAttributeButton);
|
346 |
+
}
|
347 |
+
else
|
348 |
+
{
|
349 |
+
|
350 |
+
$("wishlist_select_"+id).setStyle({
|
351 |
+
"visibility":"visible"
|
352 |
+
});
|
353 |
+
$("wishlist_unselect_"+id).setStyle({
|
354 |
+
"visibility":"hidden"
|
355 |
+
});
|
356 |
+
$("Remove_Link_"+id).setStyle({
|
357 |
+
"display":"none"
|
358 |
+
});
|
359 |
+
$("Add_Item_Link_"+id).setStyle({
|
360 |
+
"display":"block"
|
361 |
+
});
|
362 |
+
$("Add_Item_Link_"+id).down("a").setStyle({
|
363 |
+
"display":"block"
|
364 |
+
});
|
365 |
+
$("Remove_Link_"+id).down("a").setStyle({
|
366 |
+
"display":"none"
|
367 |
+
});
|
368 |
+
|
369 |
+
}
|
370 |
+
|
371 |
+
|
372 |
+
|
373 |
+
|
374 |
+
|
375 |
+
$$("ul.links").each(function(element){
|
376 |
+
|
377 |
+
element.replace(response.toplink);
|
378 |
+
});
|
379 |
+
|
380 |
+
if($$('.block-wishlist').length == 1){
|
381 |
+
|
382 |
+
$$(".block-wishlist").each(function(element){
|
383 |
+
element.replace(response.sidebar);
|
384 |
+
});
|
385 |
+
}
|
386 |
+
else{
|
387 |
+
|
388 |
+
if(position == "right")
|
389 |
+
{
|
390 |
+
// if($$('.col-right').length == 1 && $$('.col-left').length == 1){
|
391 |
+
|
392 |
+
$$(".col-right").each(function(element){
|
393 |
+
element.insert(response.sidebar);
|
394 |
+
});
|
395 |
+
// }
|
396 |
+
}
|
397 |
+
|
398 |
+
if(position == "left")
|
399 |
+
{
|
400 |
+
//if($$('.col-left').length == 1 && $$('.col-right').length == 1){
|
401 |
+
|
402 |
+
$$(".col-left").each(function(element){
|
403 |
+
element.insert(response.sidebar);
|
404 |
+
});
|
405 |
+
|
406 |
+
//}
|
407 |
+
}
|
408 |
+
//
|
409 |
+
//
|
410 |
+
// if($$('.col-right').length == 1 && $$('.col-left').length == 0){
|
411 |
+
//
|
412 |
+
// $$(".col-right").each(function(element){
|
413 |
+
// element.insert(response.sidebar);
|
414 |
+
// });
|
415 |
+
// }
|
416 |
+
//
|
417 |
+
// if($$('.col-left').length == 1 && $$('.col-right').length == 0){
|
418 |
+
//
|
419 |
+
// $$(".col-left").each(function(element){
|
420 |
+
// element.insert(response.sidebar);
|
421 |
+
// });
|
422 |
+
//
|
423 |
+
// }
|
424 |
+
}
|
425 |
+
}
|
426 |
+
}
|
427 |
+
});
|
428 |
+
}
|
429 |
+
|
430 |
+
// Remvoe Functionality for Product List Page Link : Add To Wishlist
|
431 |
+
|
432 |
+
|
433 |
+
function func_removeItemFromLink(url,id,position){
|
434 |
+
|
435 |
+
url = url.replace("wishlist/index","ajaxwishlist/index");
|
436 |
+
url += 'isAjax/1/';
|
437 |
+
$('ajax_loading_remove'+id).show();
|
438 |
+
new Ajax.Request(url, {
|
439 |
+
method: 'POST',
|
440 |
+
dataType : 'json',
|
441 |
+
requestHeaders: {
|
442 |
+
Accept: 'application/json'
|
443 |
+
},
|
444 |
+
onSuccess: function(transport) {
|
445 |
+
$('ajax_loading_remove'+id).hide();
|
446 |
+
var response = transport.responseText.evalJSON(true);
|
447 |
+
|
448 |
+
if(response.status == 'ERROR'){
|
449 |
+
|
450 |
+
func_errorMsg(response.message);
|
451 |
+
|
452 |
+
$('ajax_loading_remove'+id).hide();
|
453 |
+
|
454 |
+
}else
|
455 |
+
{
|
456 |
+
$('ajax_loading_remove'+id).hide();
|
457 |
+
func_successMsg(response.message);
|
458 |
+
|
459 |
+
if(response.flag=="true")
|
460 |
+
{
|
461 |
+
var removeAttributeLink = $("Remove_Link_"+id).down("a").readAttribute("onclick");
|
462 |
+
var prevLink = "item/"+response.previous;
|
463 |
+
var currLink = "item/"+response.current;
|
464 |
+
var addAttributeLink = removeAttributeLink.replace(prevLink, currLink);
|
465 |
+
$("Remove_Link_"+id).down("a").setAttribute('onclick', addAttributeLink);
|
466 |
+
var removeAttributeButton = $("wishlist_unselect_"+id).readAttribute("onclick");
|
467 |
+
var prevButton = "item/"+response.previous;
|
468 |
+
var currButton = "item/"+response.current;
|
469 |
+
var addAttributeButton = removeAttributeButton.replace(prevButton, currButton);
|
470 |
+
$("wishlist_unselect_"+id).setAttribute('onclick', addAttributeButton);
|
471 |
+
}
|
472 |
+
else
|
473 |
+
{
|
474 |
+
$("wishlist_select_"+id).setStyle({
|
475 |
+
"visibility":"visible"
|
476 |
+
});
|
477 |
+
$("wishlist_unselect_"+id).setStyle({
|
478 |
+
"visibility":"hidden"
|
479 |
+
});
|
480 |
+
$("Remove_Link_"+id).setStyle({
|
481 |
+
"display":"none"
|
482 |
+
});
|
483 |
+
$("Remove_Link_"+id).down("a").setStyle({
|
484 |
+
"display":"none"
|
485 |
+
});
|
486 |
+
$("Add_Item_Link_"+id).down("a").setStyle({
|
487 |
+
"display":"block"
|
488 |
+
});
|
489 |
+
|
490 |
+
$("Add_Item_Link_"+id).setStyle({
|
491 |
+
"display":"block"
|
492 |
+
});
|
493 |
+
|
494 |
+
}
|
495 |
+
|
496 |
+
|
497 |
+
$$("ul.links").each(function(element){
|
498 |
+
|
499 |
+
element.replace(response.toplink);
|
500 |
+
});
|
501 |
+
|
502 |
+
if($$('.block-wishlist').length == 1){
|
503 |
+
if(position != ""){
|
504 |
+
$$(".block-wishlist").each(function(element){
|
505 |
+
element.replace(response.sidebar);
|
506 |
+
});
|
507 |
+
}
|
508 |
+
}
|
509 |
+
else
|
510 |
+
{
|
511 |
+
|
512 |
+
if(position == "right")
|
513 |
+
{
|
514 |
+
// if($$('.col-right').length == 1 && $$('.col-left').length == 1){
|
515 |
+
|
516 |
+
$$(".col-right").each(function(element){
|
517 |
+
element.insert(response.sidebar);
|
518 |
+
});
|
519 |
+
// }
|
520 |
+
}
|
521 |
+
|
522 |
+
if(position == "left")
|
523 |
+
{
|
524 |
+
// if($$('.col-left').length == 1 && $$('.col-right').length == 1){
|
525 |
+
|
526 |
+
$$(".col-left").each(function(element){
|
527 |
+
element.insert(response.sidebar);
|
528 |
+
});
|
529 |
+
|
530 |
+
// }
|
531 |
+
}
|
532 |
+
|
533 |
+
|
534 |
+
// if($$('.col-right').length == 1 && $$('.col-left').length == 0){
|
535 |
+
//
|
536 |
+
// $$(".col-right").each(function(element){
|
537 |
+
// element.insert(response.sidebar);
|
538 |
+
// });
|
539 |
+
// }
|
540 |
+
//
|
541 |
+
// if($$('.col-left').length == 1 && $$('.col-right').length == 0){
|
542 |
+
//
|
543 |
+
// $$(".col-left").each(function(element){
|
544 |
+
// element.insert(response.sidebar);
|
545 |
+
// });
|
546 |
+
//
|
547 |
+
// }
|
548 |
+
}
|
549 |
+
|
550 |
+
|
551 |
+
}
|
552 |
+
}
|
553 |
+
});
|
554 |
+
}
|
555 |
+
|
556 |
+
|
557 |
+
// End Here
|
558 |
+
//
|
559 |
+
// Remvoe Functionality for Sidebar
|
560 |
+
|
561 |
+
function func_removeSidebarItemWishtlist(url,id,position){
|
562 |
+
|
563 |
+
url = url.replace("wishlist/index","ajaxwishlist/index");
|
564 |
+
url += 'isAjax/1/';
|
565 |
+
$('ajax_loading_sidebar'+id).show();
|
566 |
+
new Ajax.Request(url, {
|
567 |
+
method: 'POST',
|
568 |
+
dataType : 'json',
|
569 |
+
requestHeaders: {
|
570 |
+
Accept: 'application/json'
|
571 |
+
},
|
572 |
+
onSuccess: function(transport) {
|
573 |
+
$('ajax_loading_sidebar'+id).hide();
|
574 |
+
var response = transport.responseText.evalJSON(true);
|
575 |
+
|
576 |
+
if(response.status == 'ERROR'){
|
577 |
+
|
578 |
+
func_errorMsg(response.message);
|
579 |
+
|
580 |
+
$('ajax_loading_sidebar'+id).hide();
|
581 |
+
|
582 |
+
}else{
|
583 |
+
|
584 |
+
$('ajax_loading_sidebar'+id).hide();
|
585 |
+
|
586 |
+
|
587 |
+
func_successMsg(response.message);
|
588 |
+
|
589 |
+
|
590 |
+
|
591 |
+
$("wishlist_select_"+id).setStyle({
|
592 |
+
"visibility":"visible"
|
593 |
+
});
|
594 |
+
$("wishlist_unselect_"+id).setStyle({
|
595 |
+
"visibility":"hidden"
|
596 |
+
});
|
597 |
+
|
598 |
+
$("Add_Item_Link_"+id).setStyle({
|
599 |
+
"display":"block"
|
600 |
+
});
|
601 |
+
$("Remove_Link_"+id).setStyle({
|
602 |
+
"display":"none"
|
603 |
+
});
|
604 |
+
|
605 |
+
$("Remove_Link_"+id).down("a").setStyle({
|
606 |
+
"display":"none"
|
607 |
+
});
|
608 |
+
$("Add_Item_Link_"+id).down("a").setStyle({
|
609 |
+
"display":"block"
|
610 |
+
});
|
611 |
+
|
612 |
+
$$("ul.links").each(function(element){
|
613 |
+
|
614 |
+
element.replace(response.toplink);
|
615 |
+
});
|
616 |
+
|
617 |
+
if($$('.block-wishlist').length == 1){
|
618 |
+
|
619 |
+
$$(".block-wishlist").each(function(element){
|
620 |
+
element.replace(response.sidebar);
|
621 |
+
});
|
622 |
+
}
|
623 |
+
else{
|
624 |
+
|
625 |
+
if(position == "right")
|
626 |
+
{
|
627 |
+
// if($$('.col-right').length == 1 && $$('.col-left').length == 1){
|
628 |
+
|
629 |
+
$$(".col-right").each(function(element){
|
630 |
+
element.insert(response.sidebar);
|
631 |
+
});
|
632 |
+
// }
|
633 |
+
}
|
634 |
+
|
635 |
+
if(position == "left")
|
636 |
+
{
|
637 |
+
// if($$('.col-left').length == 1 && $$('.col-right').length == 1){
|
638 |
+
|
639 |
+
$$(".col-left").each(function(element){
|
640 |
+
element.insert(response.sidebar);
|
641 |
+
});
|
642 |
+
|
643 |
+
// }
|
644 |
+
}
|
645 |
+
|
646 |
+
|
647 |
+
// if($$('.col-right').length == 1 && $$('.col-left').length == 0){
|
648 |
+
//
|
649 |
+
// $$(".col-right").each(function(element){
|
650 |
+
// element.insert(response.sidebar);
|
651 |
+
// });
|
652 |
+
// }
|
653 |
+
//
|
654 |
+
// if($$('.col-left').length == 1 && $$('.col-right').length == 0){
|
655 |
+
//
|
656 |
+
// $$(".col-left").each(function(element){
|
657 |
+
// element.insert(response.sidebar);
|
658 |
+
// });
|
659 |
+
//
|
660 |
+
// }
|
661 |
+
|
662 |
+
}
|
663 |
+
|
664 |
+
|
665 |
+
}
|
666 |
+
}
|
667 |
+
});
|
668 |
+
}
|
669 |
+
|
670 |
+
|
671 |
+
|
672 |
+
// call this function when Ajax Mode Status is No from admin
|
673 |
+
|
674 |
+
function func_addWishlistAjaxMode(url,id)
|
675 |
+
{
|
676 |
+
//url = url.replace("wishlist/index","ajaxwishlist/index");
|
677 |
+
window.location.href = url;
|
678 |
+
}
|
679 |
+
|
680 |
+
function func_removeWishlistAjaxMode(url,id){
|
681 |
+
|
682 |
+
//url = url.replace("wishlist/index","ajaxwishlist/index");
|
683 |
+
window.location.href = url;
|
684 |
+
}
|
685 |
+
|
686 |
+
|
687 |
+
|
688 |
+
// End here
|
689 |
+
|
690 |
+
|
691 |
+
function clickNeedhelp(id)
|
692 |
+
{
|
693 |
+
|
694 |
+
var click_ev = document.createEvent("MouseEvent");
|
695 |
+
click_ev.initEvent("click", true /* bubble */, true /* cancelable */);
|
696 |
+
$('popup_wishlist_'+id).dispatchEvent(click_ev);
|
697 |
+
|
698 |
+
}
|
699 |
+
|
700 |
+
|
701 |
+
/* update Wishlist item */
|
702 |
+
|
703 |
+
|
704 |
+
function func_updateWishtlist(){
|
705 |
+
|
706 |
+
//url = url.replace("wishlist/index/update","ajaxwishlist/index/update");
|
707 |
+
var url = $("wishlist-view-form").readAttribute("action");
|
708 |
+
|
709 |
+
url += 'isAjax/1/';
|
710 |
+
$('ajax_loading_list').show();
|
711 |
+
new Ajax.Request(url, {
|
712 |
+
method: 'POST',
|
713 |
+
dataType : 'json',
|
714 |
+
parameters: $('wishlist-view-form').serialize(true),
|
715 |
+
requestHeaders: {
|
716 |
+
Accept: 'application/json'
|
717 |
+
},
|
718 |
+
onSuccess: function(transport) {
|
719 |
+
|
720 |
+
var response = transport.responseText.evalJSON(true);
|
721 |
+
|
722 |
+
if(response == null)
|
723 |
+
{
|
724 |
+
$('ajax_loading_list').hide();
|
725 |
+
func_IframeSuccessMsg("update wishlist Successfully");
|
726 |
+
}
|
727 |
+
if(response.status == 'ERROR'){
|
728 |
+
|
729 |
+
func_IframeErrorMsg(response.message);
|
730 |
+
|
731 |
+
$('ajax_loading_list').hide();
|
732 |
+
|
733 |
+
}else{
|
734 |
+
|
735 |
+
$('ajax_loading_list').hide();
|
736 |
+
|
737 |
+
func_IframeSuccessMsg(response.message);
|
738 |
+
|
739 |
+
}
|
740 |
+
}
|
741 |
+
});
|
742 |
+
}
|
743 |
+
|
744 |
+
function lightviewRemoveWishlistItem(url,id)
|
745 |
+
{
|
746 |
+
url = url.replace("wishlist/index/remove","ajaxwishlist/index/iframeRemoveItem");
|
747 |
+
url += 'isAjax/1/';
|
748 |
+
$('ajax_loading_list').show();
|
749 |
+
new Ajax.Request(url, {
|
750 |
+
method: 'POST',
|
751 |
+
dataType : 'json',
|
752 |
+
requestHeaders: {
|
753 |
+
Accept: 'application/json'
|
754 |
+
},
|
755 |
+
onSuccess: function(transport) {
|
756 |
+
$('ajax_loading_list').hide();
|
757 |
+
var response = transport.responseText.evalJSON(true);
|
758 |
+
|
759 |
+
if(response.status == 'ERROR'){
|
760 |
+
|
761 |
+
func_IframeErrorMsg(response.message);
|
762 |
+
|
763 |
+
$('ajax_loading_list').hide();
|
764 |
+
|
765 |
+
}else{
|
766 |
+
|
767 |
+
$('ajax_loading_list').hide();
|
768 |
+
|
769 |
+
|
770 |
+
if($$('.my-wishlist').length == 1){
|
771 |
+
|
772 |
+
$$(".my-wishlist").each(function(element){
|
773 |
+
element.replace(response.wishlist);
|
774 |
+
});
|
775 |
+
}
|
776 |
+
|
777 |
+
|
778 |
+
func_IframeSuccessMsg(response.message);
|
779 |
+
|
780 |
+
|
781 |
+
}
|
782 |
+
}
|
783 |
+
});
|
784 |
+
|
785 |
+
}
|
786 |
+
|
787 |
+
/* Add Wishlist Item to Shopping Cart */
|
788 |
+
|
789 |
+
function addpopupItemToCart(url,itemId) {
|
790 |
+
|
791 |
+
url = url.replace("wishlist","ajaxwishlist");
|
792 |
+
|
793 |
+
url = url.gsub('%item%', itemId);
|
794 |
+
var form = $('wishlist-view-form');
|
795 |
+
if (form) {
|
796 |
+
var input = form['qty[' + itemId + ']'];
|
797 |
+
if (input) {
|
798 |
+
var separator = (url.indexOf('?') >= 0) ? '&' : '?';
|
799 |
+
url += separator + input.name + '=' + encodeURIComponent(input.value);
|
800 |
+
}
|
801 |
+
}
|
802 |
+
//setLocation(url);
|
803 |
+
|
804 |
+
url += 'isAjax/1/';
|
805 |
+
$('ajax_loading_list').show();
|
806 |
+
new Ajax.Request(url, {
|
807 |
+
method: 'POST',
|
808 |
+
dataType : 'json',
|
809 |
+
requestHeaders: {
|
810 |
+
Accept: 'application/json'
|
811 |
+
},
|
812 |
+
onSuccess: function(transport) {
|
813 |
+
$('ajax_loading_list').hide();
|
814 |
+
var response = transport.responseText.evalJSON(true);
|
815 |
+
|
816 |
+
if(response.status == 'ERROR'){
|
817 |
+
|
818 |
+
func_IframeErrorMsg(response.message);
|
819 |
+
|
820 |
+
$('ajax_loading_list').hide();
|
821 |
+
|
822 |
+
}else{
|
823 |
+
|
824 |
+
$('ajax_loading_list').hide();
|
825 |
+
|
826 |
+
func_IframeSuccessMsg(response.message);
|
827 |
+
window.location.reload();
|
828 |
+
}
|
829 |
+
}
|
830 |
+
});
|
831 |
+
|
832 |
+
|
833 |
+
}
|
834 |
+
|
835 |
+
|
836 |
+
|
837 |
+
|
838 |
+
|
839 |
+
function func_closeIframePopup()
|
840 |
+
{
|
841 |
+
window.parent.location.href = window.parent.location.href;
|
842 |
+
window.parent.document.getElementById("lv_overlay").remove();
|
843 |
+
window.parent.document.getElementById('lightview').remove();
|
844 |
+
}
|
845 |
+
|
846 |
+
function func_share_Wishlist()
|
847 |
+
{
|
848 |
+
var url = $("wishlist-view-form").readAttribute("action");
|
849 |
+
url = url.replace("update","share");
|
850 |
+
window.parent.location.href = url;
|
851 |
+
$('ajax_loading_list').show();
|
852 |
+
setInterval(this.func_removeLightBox, 4000);
|
853 |
+
|
854 |
+
}
|
855 |
+
|
856 |
+
function func_redirectToProduct(url)
|
857 |
+
{
|
858 |
+
|
859 |
+
window.parent.location.href = url;
|
860 |
+
$('ajax_loading_list').show();
|
861 |
+
setInterval(this.func_removeLightBox, 4000);
|
862 |
+
|
863 |
+
}
|
864 |
+
|
865 |
+
function func_removeLightBox()
|
866 |
+
{
|
867 |
+
$('ajax_loading_list').hide();
|
868 |
+
window.parent.document.getElementById("lv_overlay").remove();
|
869 |
+
window.parent.document.getElementById('lightview').remove();
|
870 |
+
|
871 |
+
}
|
872 |
+
|
873 |
+
|
874 |
+
function func_successMsg(response)
|
875 |
+
{
|
876 |
+
|
877 |
+
var errorMsg = "";
|
878 |
+
errorMsg += '<ul class="messages"><li class="success-msg"><ul><li><span>'+ response +'</span></li></ul></li></ul>';
|
879 |
+
|
880 |
+
if($$('.col-main').length == 1){
|
881 |
+
$$(".col-main").each(function(element){
|
882 |
+
$$("ul.messages").each(function(element){
|
883 |
+
element.remove();
|
884 |
+
});
|
885 |
+
element.insert({
|
886 |
+
"top":errorMsg
|
887 |
+
});
|
888 |
+
});
|
889 |
+
func_hideMessage();
|
890 |
+
return true;
|
891 |
+
}
|
892 |
+
|
893 |
+
}
|
894 |
+
|
895 |
+
function func_errorMsg(response)
|
896 |
+
{
|
897 |
+
|
898 |
+
var errorMsg = "";
|
899 |
+
errorMsg += '<ul class="messages"><li class="error-msg"><ul><li><span>'+ response +'</span></li></ul></li></ul>';
|
900 |
+
|
901 |
+
if($$('.col-main').length == 1){
|
902 |
+
$$(".col-main").each(function(element){
|
903 |
+
$$("ul.messages").each(function(element){
|
904 |
+
element.remove();
|
905 |
+
});
|
906 |
+
element.insert({
|
907 |
+
"top":errorMsg
|
908 |
+
});
|
909 |
+
});
|
910 |
+
func_hideMessage();
|
911 |
+
return true;
|
912 |
+
}
|
913 |
+
|
914 |
+
}
|
915 |
+
|
916 |
+
|
917 |
+
|
918 |
+
|
919 |
+
function func_IframeErrorMsg(response)
|
920 |
+
{
|
921 |
+
|
922 |
+
var errorMsg = "";
|
923 |
+
errorMsg += '<ul class="messages"><li class="error-msg"><ul><li><span>'+ response +'</span></li></ul></li></ul>';
|
924 |
+
|
925 |
+
if($$('.my-wishlist').length == 1){
|
926 |
+
$$(".my-wishlist").each(function(element){
|
927 |
+
$$("ul.messages").each(function(element){
|
928 |
+
element.remove();
|
929 |
+
});
|
930 |
+
element.insert({
|
931 |
+
"top":errorMsg
|
932 |
+
});
|
933 |
+
});
|
934 |
+
func_hideMessage();
|
935 |
+
return true;
|
936 |
+
}
|
937 |
+
|
938 |
+
}
|
939 |
+
|
940 |
+
function func_IframeSuccessMsg(response)
|
941 |
+
{
|
942 |
+
var errorMsg = "";
|
943 |
+
errorMsg += '<ul class="messages"><li class="success-msg"><ul><li><span>'+ response +'</span></li></ul></li></ul>';
|
944 |
+
|
945 |
+
if($$('.my-wishlist').length == 1){
|
946 |
+
$$(".my-wishlist").each(function(element){
|
947 |
+
$$("ul.messages").each(function(element){
|
948 |
+
element.remove();
|
949 |
+
});
|
950 |
+
element.insert({
|
951 |
+
"top":errorMsg
|
952 |
+
});
|
953 |
+
});
|
954 |
+
func_hideMessage();
|
955 |
+
return true;
|
956 |
+
}
|
957 |
+
|
958 |
+
}
|
959 |
+
|
960 |
+
function func_hideMessage()
|
961 |
+
{
|
962 |
+
$$("ul.messages").each(function(element){
|
963 |
+
element.fade({ duration: 5.0});
|
964 |
+
});
|
965 |
+
|
966 |
+
}
|
967 |
+
|
968 |
+
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/close_large.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/close_small.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/controller_close.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/controller_next.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/controller_prev.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/controller_slideshow_play.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/controller_slideshow_stop.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/icon-nav-right.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/icon-nav.gif
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/inner_next.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/inner_prev.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/inner_slideshow_play.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/inner_slideshow_stop.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/loading.gif
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/next.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/prev.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/product_img.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/product_img1.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/product_img2.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/images/lightview/topclose.png
ADDED
Binary file
|
skin/frontend/base/default/js/ajaxwishlist/lightview/builder.js
ADDED
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// script.aculo.us builder.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
|
2 |
+
|
3 |
+
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
4 |
+
//
|
5 |
+
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
6 |
+
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
7 |
+
|
8 |
+
var Builder = {
|
9 |
+
NODEMAP: {
|
10 |
+
AREA: 'map',
|
11 |
+
CAPTION: 'table',
|
12 |
+
COL: 'table',
|
13 |
+
COLGROUP: 'table',
|
14 |
+
LEGEND: 'fieldset',
|
15 |
+
OPTGROUP: 'select',
|
16 |
+
OPTION: 'select',
|
17 |
+
PARAM: 'object',
|
18 |
+
TBODY: 'table',
|
19 |
+
TD: 'table',
|
20 |
+
TFOOT: 'table',
|
21 |
+
TH: 'table',
|
22 |
+
THEAD: 'table',
|
23 |
+
TR: 'table'
|
24 |
+
},
|
25 |
+
// note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken,
|
26 |
+
// due to a Firefox bug
|
27 |
+
node: function(elementName) {
|
28 |
+
elementName = elementName.toUpperCase();
|
29 |
+
|
30 |
+
// try innerHTML approach
|
31 |
+
var parentTag = this.NODEMAP[elementName] || 'div';
|
32 |
+
var parentElement = document.createElement(parentTag);
|
33 |
+
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
|
34 |
+
parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
|
35 |
+
} catch(e) {}
|
36 |
+
var element = parentElement.firstChild || null;
|
37 |
+
|
38 |
+
// see if browser added wrapping tags
|
39 |
+
if(element && (element.tagName.toUpperCase() != elementName))
|
40 |
+
element = element.getElementsByTagName(elementName)[0];
|
41 |
+
|
42 |
+
// fallback to createElement approach
|
43 |
+
if(!element) element = document.createElement(elementName);
|
44 |
+
|
45 |
+
// abort if nothing could be created
|
46 |
+
if(!element) return;
|
47 |
+
|
48 |
+
// attributes (or text)
|
49 |
+
if(arguments[1])
|
50 |
+
if(this._isStringOrNumber(arguments[1]) ||
|
51 |
+
(arguments[1] instanceof Array) ||
|
52 |
+
arguments[1].tagName) {
|
53 |
+
this._children(element, arguments[1]);
|
54 |
+
} else {
|
55 |
+
var attrs = this._attributes(arguments[1]);
|
56 |
+
if(attrs.length) {
|
57 |
+
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
|
58 |
+
parentElement.innerHTML = "<" +elementName + " " +
|
59 |
+
attrs + "></" + elementName + ">";
|
60 |
+
} catch(e) {}
|
61 |
+
element = parentElement.firstChild || null;
|
62 |
+
// workaround firefox 1.0.X bug
|
63 |
+
if(!element) {
|
64 |
+
element = document.createElement(elementName);
|
65 |
+
for(attr in arguments[1])
|
66 |
+
element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
|
67 |
+
}
|
68 |
+
if(element.tagName.toUpperCase() != elementName)
|
69 |
+
element = parentElement.getElementsByTagName(elementName)[0];
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
// text, or array of children
|
74 |
+
if(arguments[2])
|
75 |
+
this._children(element, arguments[2]);
|
76 |
+
|
77 |
+
return $(element);
|
78 |
+
},
|
79 |
+
_text: function(text) {
|
80 |
+
return document.createTextNode(text);
|
81 |
+
},
|
82 |
+
|
83 |
+
ATTR_MAP: {
|
84 |
+
'className': 'class',
|
85 |
+
'htmlFor': 'for'
|
86 |
+
},
|
87 |
+
|
88 |
+
_attributes: function(attributes) {
|
89 |
+
var attrs = [];
|
90 |
+
for(attribute in attributes)
|
91 |
+
attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
|
92 |
+
'="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"');
|
93 |
+
return attrs.join(" ");
|
94 |
+
},
|
95 |
+
_children: function(element, children) {
|
96 |
+
if(children.tagName) {
|
97 |
+
element.appendChild(children);
|
98 |
+
return;
|
99 |
+
}
|
100 |
+
if(typeof children=='object') { // array can hold nodes and text
|
101 |
+
children.flatten().each( function(e) {
|
102 |
+
if(typeof e=='object')
|
103 |
+
element.appendChild(e);
|
104 |
+
else
|
105 |
+
if(Builder._isStringOrNumber(e))
|
106 |
+
element.appendChild(Builder._text(e));
|
107 |
+
});
|
108 |
+
} else
|
109 |
+
if(Builder._isStringOrNumber(children))
|
110 |
+
element.appendChild(Builder._text(children));
|
111 |
+
},
|
112 |
+
_isStringOrNumber: function(param) {
|
113 |
+
return(typeof param=='string' || typeof param=='number');
|
114 |
+
},
|
115 |
+
build: function(html) {
|
116 |
+
var element = this.node('div');
|
117 |
+
$(element).update(html.strip());
|
118 |
+
return element.down();
|
119 |
+
},
|
120 |
+
dump: function(scope) {
|
121 |
+
if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
|
122 |
+
|
123 |
+
var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
|
124 |
+
"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
|
125 |
+
"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
|
126 |
+
"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
|
127 |
+
"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
|
128 |
+
"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
|
129 |
+
|
130 |
+
tags.each( function(tag){
|
131 |
+
scope[tag] = function() {
|
132 |
+
return Builder.node.apply(Builder, [tag].concat($A(arguments)));
|
133 |
+
};
|
134 |
+
});
|
135 |
+
}
|
136 |
+
};
|
skin/frontend/base/default/js/ajaxwishlist/lightview/controls.js
ADDED
@@ -0,0 +1,965 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// script.aculo.us controls.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
|
2 |
+
|
3 |
+
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
4 |
+
// (c) 2005-2010 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
|
5 |
+
// (c) 2005-2010 Jon Tirsen (http://www.tirsen.com)
|
6 |
+
// Contributors:
|
7 |
+
// Richard Livsey
|
8 |
+
// Rahul Bhargava
|
9 |
+
// Rob Wills
|
10 |
+
//
|
11 |
+
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
12 |
+
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
13 |
+
|
14 |
+
// Autocompleter.Base handles all the autocompletion functionality
|
15 |
+
// that's independent of the data source for autocompletion. This
|
16 |
+
// includes drawing the autocompletion menu, observing keyboard
|
17 |
+
// and mouse events, and similar.
|
18 |
+
//
|
19 |
+
// Specific autocompleters need to provide, at the very least,
|
20 |
+
// a getUpdatedChoices function that will be invoked every time
|
21 |
+
// the text inside the monitored textbox changes. This method
|
22 |
+
// should get the text for which to provide autocompletion by
|
23 |
+
// invoking this.getToken(), NOT by directly accessing
|
24 |
+
// this.element.value. This is to allow incremental tokenized
|
25 |
+
// autocompletion. Specific auto-completion logic (AJAX, etc)
|
26 |
+
// belongs in getUpdatedChoices.
|
27 |
+
//
|
28 |
+
// Tokenized incremental autocompletion is enabled automatically
|
29 |
+
// when an autocompleter is instantiated with the 'tokens' option
|
30 |
+
// in the options parameter, e.g.:
|
31 |
+
// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
|
32 |
+
// will incrementally autocomplete with a comma as the token.
|
33 |
+
// Additionally, ',' in the above example can be replaced with
|
34 |
+
// a token array, e.g. { tokens: [',', '\n'] } which
|
35 |
+
// enables autocompletion on multiple tokens. This is most
|
36 |
+
// useful when one of the tokens is \n (a newline), as it
|
37 |
+
// allows smart autocompletion after linebreaks.
|
38 |
+
|
39 |
+
if(typeof Effect == 'undefined')
|
40 |
+
throw("controls.js requires including script.aculo.us' effects.js library");
|
41 |
+
|
42 |
+
var Autocompleter = { };
|
43 |
+
Autocompleter.Base = Class.create({
|
44 |
+
baseInitialize: function(element, update, options) {
|
45 |
+
element = $(element);
|
46 |
+
this.element = element;
|
47 |
+
this.update = $(update);
|
48 |
+
this.hasFocus = false;
|
49 |
+
this.changed = false;
|
50 |
+
this.active = false;
|
51 |
+
this.index = 0;
|
52 |
+
this.entryCount = 0;
|
53 |
+
this.oldElementValue = this.element.value;
|
54 |
+
|
55 |
+
if(this.setOptions)
|
56 |
+
this.setOptions(options);
|
57 |
+
else
|
58 |
+
this.options = options || { };
|
59 |
+
|
60 |
+
this.options.paramName = this.options.paramName || this.element.name;
|
61 |
+
this.options.tokens = this.options.tokens || [];
|
62 |
+
this.options.frequency = this.options.frequency || 0.4;
|
63 |
+
this.options.minChars = this.options.minChars || 1;
|
64 |
+
this.options.onShow = this.options.onShow ||
|
65 |
+
function(element, update){
|
66 |
+
if(!update.style.position || update.style.position=='absolute') {
|
67 |
+
update.style.position = 'absolute';
|
68 |
+
Position.clone(element, update, {
|
69 |
+
setHeight: false,
|
70 |
+
offsetTop: element.offsetHeight
|
71 |
+
});
|
72 |
+
}
|
73 |
+
Effect.Appear(update,{duration:0.15});
|
74 |
+
};
|
75 |
+
this.options.onHide = this.options.onHide ||
|
76 |
+
function(element, update){ new Effect.Fade(update,{duration:0.15}) };
|
77 |
+
|
78 |
+
if(typeof(this.options.tokens) == 'string')
|
79 |
+
this.options.tokens = new Array(this.options.tokens);
|
80 |
+
// Force carriage returns as token delimiters anyway
|
81 |
+
if (!this.options.tokens.include('\n'))
|
82 |
+
this.options.tokens.push('\n');
|
83 |
+
|
84 |
+
this.observer = null;
|
85 |
+
|
86 |
+
this.element.setAttribute('autocomplete','off');
|
87 |
+
|
88 |
+
Element.hide(this.update);
|
89 |
+
|
90 |
+
Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this));
|
91 |
+
Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this));
|
92 |
+
},
|
93 |
+
|
94 |
+
show: function() {
|
95 |
+
if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
|
96 |
+
if(!this.iefix &&
|
97 |
+
(Prototype.Browser.IE) &&
|
98 |
+
(Element.getStyle(this.update, 'position')=='absolute')) {
|
99 |
+
new Insertion.After(this.update,
|
100 |
+
'<iframe id="' + this.update.id + '_iefix" '+
|
101 |
+
'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
|
102 |
+
'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
|
103 |
+
this.iefix = $(this.update.id+'_iefix');
|
104 |
+
}
|
105 |
+
if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
|
106 |
+
},
|
107 |
+
|
108 |
+
fixIEOverlapping: function() {
|
109 |
+
Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
|
110 |
+
this.iefix.style.zIndex = 1;
|
111 |
+
this.update.style.zIndex = 2;
|
112 |
+
Element.show(this.iefix);
|
113 |
+
},
|
114 |
+
|
115 |
+
hide: function() {
|
116 |
+
this.stopIndicator();
|
117 |
+
if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
|
118 |
+
if(this.iefix) Element.hide(this.iefix);
|
119 |
+
},
|
120 |
+
|
121 |
+
startIndicator: function() {
|
122 |
+
if(this.options.indicator) Element.show(this.options.indicator);
|
123 |
+
},
|
124 |
+
|
125 |
+
stopIndicator: function() {
|
126 |
+
if(this.options.indicator) Element.hide(this.options.indicator);
|
127 |
+
},
|
128 |
+
|
129 |
+
onKeyPress: function(event) {
|
130 |
+
if(this.active)
|
131 |
+
switch(event.keyCode) {
|
132 |
+
case Event.KEY_TAB:
|
133 |
+
case Event.KEY_RETURN:
|
134 |
+
this.selectEntry();
|
135 |
+
Event.stop(event);
|
136 |
+
case Event.KEY_ESC:
|
137 |
+
this.hide();
|
138 |
+
this.active = false;
|
139 |
+
Event.stop(event);
|
140 |
+
return;
|
141 |
+
case Event.KEY_LEFT:
|
142 |
+
case Event.KEY_RIGHT:
|
143 |
+
return;
|
144 |
+
case Event.KEY_UP:
|
145 |
+
this.markPrevious();
|
146 |
+
this.render();
|
147 |
+
Event.stop(event);
|
148 |
+
return;
|
149 |
+
case Event.KEY_DOWN:
|
150 |
+
this.markNext();
|
151 |
+
this.render();
|
152 |
+
Event.stop(event);
|
153 |
+
return;
|
154 |
+
}
|
155 |
+
else
|
156 |
+
if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
|
157 |
+
(Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return;
|
158 |
+
|
159 |
+
this.changed = true;
|
160 |
+
this.hasFocus = true;
|
161 |
+
|
162 |
+
if(this.observer) clearTimeout(this.observer);
|
163 |
+
this.observer =
|
164 |
+
setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
|
165 |
+
},
|
166 |
+
|
167 |
+
activate: function() {
|
168 |
+
this.changed = false;
|
169 |
+
this.hasFocus = true;
|
170 |
+
this.getUpdatedChoices();
|
171 |
+
},
|
172 |
+
|
173 |
+
onHover: function(event) {
|
174 |
+
var element = Event.findElement(event, 'LI');
|
175 |
+
if(this.index != element.autocompleteIndex)
|
176 |
+
{
|
177 |
+
this.index = element.autocompleteIndex;
|
178 |
+
this.render();
|
179 |
+
}
|
180 |
+
Event.stop(event);
|
181 |
+
},
|
182 |
+
|
183 |
+
onClick: function(event) {
|
184 |
+
var element = Event.findElement(event, 'LI');
|
185 |
+
this.index = element.autocompleteIndex;
|
186 |
+
this.selectEntry();
|
187 |
+
this.hide();
|
188 |
+
},
|
189 |
+
|
190 |
+
onBlur: function(event) {
|
191 |
+
// needed to make click events working
|
192 |
+
setTimeout(this.hide.bind(this), 250);
|
193 |
+
this.hasFocus = false;
|
194 |
+
this.active = false;
|
195 |
+
},
|
196 |
+
|
197 |
+
render: function() {
|
198 |
+
if(this.entryCount > 0) {
|
199 |
+
for (var i = 0; i < this.entryCount; i++)
|
200 |
+
this.index==i ?
|
201 |
+
Element.addClassName(this.getEntry(i),"selected") :
|
202 |
+
Element.removeClassName(this.getEntry(i),"selected");
|
203 |
+
if(this.hasFocus) {
|
204 |
+
this.show();
|
205 |
+
this.active = true;
|
206 |
+
}
|
207 |
+
} else {
|
208 |
+
this.active = false;
|
209 |
+
this.hide();
|
210 |
+
}
|
211 |
+
},
|
212 |
+
|
213 |
+
markPrevious: function() {
|
214 |
+
if(this.index > 0) this.index--;
|
215 |
+
else this.index = this.entryCount-1;
|
216 |
+
this.getEntry(this.index).scrollIntoView(true);
|
217 |
+
},
|
218 |
+
|
219 |
+
markNext: function() {
|
220 |
+
if(this.index < this.entryCount-1) this.index++;
|
221 |
+
else this.index = 0;
|
222 |
+
this.getEntry(this.index).scrollIntoView(false);
|
223 |
+
},
|
224 |
+
|
225 |
+
getEntry: function(index) {
|
226 |
+
return this.update.firstChild.childNodes[index];
|
227 |
+
},
|
228 |
+
|
229 |
+
getCurrentEntry: function() {
|
230 |
+
return this.getEntry(this.index);
|
231 |
+
},
|
232 |
+
|
233 |
+
selectEntry: function() {
|
234 |
+
this.active = false;
|
235 |
+
this.updateElement(this.getCurrentEntry());
|
236 |
+
},
|
237 |
+
|
238 |
+
updateElement: function(selectedElement) {
|
239 |
+
if (this.options.updateElement) {
|
240 |
+
this.options.updateElement(selectedElement);
|
241 |
+
return;
|
242 |
+
}
|
243 |
+
var value = '';
|
244 |
+
if (this.options.select) {
|
245 |
+
var nodes = $(selectedElement).select('.' + this.options.select) || [];
|
246 |
+
if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
|
247 |
+
} else
|
248 |
+
value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
|
249 |
+
|
250 |
+
var bounds = this.getTokenBounds();
|
251 |
+
if (bounds[0] != -1) {
|
252 |
+
var newValue = this.element.value.substr(0, bounds[0]);
|
253 |
+
var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/);
|
254 |
+
if (whitespace)
|
255 |
+
newValue += whitespace[0];
|
256 |
+
this.element.value = newValue + value + this.element.value.substr(bounds[1]);
|
257 |
+
} else {
|
258 |
+
this.element.value = value;
|
259 |
+
}
|
260 |
+
this.oldElementValue = this.element.value;
|
261 |
+
this.element.focus();
|
262 |
+
|
263 |
+
if (this.options.afterUpdateElement)
|
264 |
+
this.options.afterUpdateElement(this.element, selectedElement);
|
265 |
+
},
|
266 |
+
|
267 |
+
updateChoices: function(choices) {
|
268 |
+
if(!this.changed && this.hasFocus) {
|
269 |
+
this.update.innerHTML = choices;
|
270 |
+
Element.cleanWhitespace(this.update);
|
271 |
+
Element.cleanWhitespace(this.update.down());
|
272 |
+
|
273 |
+
if(this.update.firstChild && this.update.down().childNodes) {
|
274 |
+
this.entryCount =
|
275 |
+
this.update.down().childNodes.length;
|
276 |
+
for (var i = 0; i < this.entryCount; i++) {
|
277 |
+
var entry = this.getEntry(i);
|
278 |
+
entry.autocompleteIndex = i;
|
279 |
+
this.addObservers(entry);
|
280 |
+
}
|
281 |
+
} else {
|
282 |
+
this.entryCount = 0;
|
283 |
+
}
|
284 |
+
|
285 |
+
this.stopIndicator();
|
286 |
+
this.index = 0;
|
287 |
+
|
288 |
+
if(this.entryCount==1 && this.options.autoSelect) {
|
289 |
+
this.selectEntry();
|
290 |
+
this.hide();
|
291 |
+
} else {
|
292 |
+
this.render();
|
293 |
+
}
|
294 |
+
}
|
295 |
+
},
|
296 |
+
|
297 |
+
addObservers: function(element) {
|
298 |
+
Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
|
299 |
+
Event.observe(element, "click", this.onClick.bindAsEventListener(this));
|
300 |
+
},
|
301 |
+
|
302 |
+
onObserverEvent: function() {
|
303 |
+
this.changed = false;
|
304 |
+
this.tokenBounds = null;
|
305 |
+
if(this.getToken().length>=this.options.minChars) {
|
306 |
+
this.getUpdatedChoices();
|
307 |
+
} else {
|
308 |
+
this.active = false;
|
309 |
+
this.hide();
|
310 |
+
}
|
311 |
+
this.oldElementValue = this.element.value;
|
312 |
+
},
|
313 |
+
|
314 |
+
getToken: function() {
|
315 |
+
var bounds = this.getTokenBounds();
|
316 |
+
return this.element.value.substring(bounds[0], bounds[1]).strip();
|
317 |
+
},
|
318 |
+
|
319 |
+
getTokenBounds: function() {
|
320 |
+
if (null != this.tokenBounds) return this.tokenBounds;
|
321 |
+
var value = this.element.value;
|
322 |
+
if (value.strip().empty()) return [-1, 0];
|
323 |
+
var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue);
|
324 |
+
var offset = (diff == this.oldElementValue.length ? 1 : 0);
|
325 |
+
var prevTokenPos = -1, nextTokenPos = value.length;
|
326 |
+
var tp;
|
327 |
+
for (var index = 0, l = this.options.tokens.length; index < l; ++index) {
|
328 |
+
tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1);
|
329 |
+
if (tp > prevTokenPos) prevTokenPos = tp;
|
330 |
+
tp = value.indexOf(this.options.tokens[index], diff + offset);
|
331 |
+
if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp;
|
332 |
+
}
|
333 |
+
return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]);
|
334 |
+
}
|
335 |
+
});
|
336 |
+
|
337 |
+
Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) {
|
338 |
+
var boundary = Math.min(newS.length, oldS.length);
|
339 |
+
for (var index = 0; index < boundary; ++index)
|
340 |
+
if (newS[index] != oldS[index])
|
341 |
+
return index;
|
342 |
+
return boundary;
|
343 |
+
};
|
344 |
+
|
345 |
+
Ajax.Autocompleter = Class.create(Autocompleter.Base, {
|
346 |
+
initialize: function(element, update, url, options) {
|
347 |
+
this.baseInitialize(element, update, options);
|
348 |
+
this.options.asynchronous = true;
|
349 |
+
this.options.onComplete = this.onComplete.bind(this);
|
350 |
+
this.options.defaultParams = this.options.parameters || null;
|
351 |
+
this.url = url;
|
352 |
+
},
|
353 |
+
|
354 |
+
getUpdatedChoices: function() {
|
355 |
+
this.startIndicator();
|
356 |
+
|
357 |
+
var entry = encodeURIComponent(this.options.paramName) + '=' +
|
358 |
+
encodeURIComponent(this.getToken());
|
359 |
+
|
360 |
+
this.options.parameters = this.options.callback ?
|
361 |
+
this.options.callback(this.element, entry) : entry;
|
362 |
+
|
363 |
+
if(this.options.defaultParams)
|
364 |
+
this.options.parameters += '&' + this.options.defaultParams;
|
365 |
+
|
366 |
+
new Ajax.Request(this.url, this.options);
|
367 |
+
},
|
368 |
+
|
369 |
+
onComplete: function(request) {
|
370 |
+
this.updateChoices(request.responseText);
|
371 |
+
}
|
372 |
+
});
|
373 |
+
|
374 |
+
// The local array autocompleter. Used when you'd prefer to
|
375 |
+
// inject an array of autocompletion options into the page, rather
|
376 |
+
// than sending out Ajax queries, which can be quite slow sometimes.
|
377 |
+
//
|
378 |
+
// The constructor takes four parameters. The first two are, as usual,
|
379 |
+
// the id of the monitored textbox, and id of the autocompletion menu.
|
380 |
+
// The third is the array you want to autocomplete from, and the fourth
|
381 |
+
// is the options block.
|
382 |
+
//
|
383 |
+
// Extra local autocompletion options:
|
384 |
+
// - choices - How many autocompletion choices to offer
|
385 |
+
//
|
386 |
+
// - partialSearch - If false, the autocompleter will match entered
|
387 |
+
// text only at the beginning of strings in the
|
388 |
+
// autocomplete array. Defaults to true, which will
|
389 |
+
// match text at the beginning of any *word* in the
|
390 |
+
// strings in the autocomplete array. If you want to
|
391 |
+
// search anywhere in the string, additionally set
|
392 |
+
// the option fullSearch to true (default: off).
|
393 |
+
//
|
394 |
+
// - fullSsearch - Search anywhere in autocomplete array strings.
|
395 |
+
//
|
396 |
+
// - partialChars - How many characters to enter before triggering
|
397 |
+
// a partial match (unlike minChars, which defines
|
398 |
+
// how many characters are required to do any match
|
399 |
+
// at all). Defaults to 2.
|
400 |
+
//
|
401 |
+
// - ignoreCase - Whether to ignore case when autocompleting.
|
402 |
+
// Defaults to true.
|
403 |
+
//
|
404 |
+
// It's possible to pass in a custom function as the 'selector'
|
405 |
+
// option, if you prefer to write your own autocompletion logic.
|
406 |
+
// In that case, the other options above will not apply unless
|
407 |
+
// you support them.
|
408 |
+
|
409 |
+
Autocompleter.Local = Class.create(Autocompleter.Base, {
|
410 |
+
initialize: function(element, update, array, options) {
|
411 |
+
this.baseInitialize(element, update, options);
|
412 |
+
this.options.array = array;
|
413 |
+
},
|
414 |
+
|
415 |
+
getUpdatedChoices: function() {
|
416 |
+
this.updateChoices(this.options.selector(this));
|
417 |
+
},
|
418 |
+
|
419 |
+
setOptions: function(options) {
|
420 |
+
this.options = Object.extend({
|
421 |
+
choices: 10,
|
422 |
+
partialSearch: true,
|
423 |
+
partialChars: 2,
|
424 |
+
ignoreCase: true,
|
425 |
+
fullSearch: false,
|
426 |
+
selector: function(instance) {
|
427 |
+
var ret = []; // Beginning matches
|
428 |
+
var partial = []; // Inside matches
|
429 |
+
var entry = instance.getToken();
|
430 |
+
var count = 0;
|
431 |
+
|
432 |
+
for (var i = 0; i < instance.options.array.length &&
|
433 |
+
ret.length < instance.options.choices ; i++) {
|
434 |
+
|
435 |
+
var elem = instance.options.array[i];
|
436 |
+
var foundPos = instance.options.ignoreCase ?
|
437 |
+
elem.toLowerCase().indexOf(entry.toLowerCase()) :
|
438 |
+
elem.indexOf(entry);
|
439 |
+
|
440 |
+
while (foundPos != -1) {
|
441 |
+
if (foundPos == 0 && elem.length != entry.length) {
|
442 |
+
ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" +
|
443 |
+
elem.substr(entry.length) + "</li>");
|
444 |
+
break;
|
445 |
+
} else if (entry.length >= instance.options.partialChars &&
|
446 |
+
instance.options.partialSearch && foundPos != -1) {
|
447 |
+
if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) {
|
448 |
+
partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" +
|
449 |
+
elem.substr(foundPos, entry.length) + "</strong>" + elem.substr(
|
450 |
+
foundPos + entry.length) + "</li>");
|
451 |
+
break;
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
+
foundPos = instance.options.ignoreCase ?
|
456 |
+
elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) :
|
457 |
+
elem.indexOf(entry, foundPos + 1);
|
458 |
+
|
459 |
+
}
|
460 |
+
}
|
461 |
+
if (partial.length)
|
462 |
+
ret = ret.concat(partial.slice(0, instance.options.choices - ret.length));
|
463 |
+
return "<ul>" + ret.join('') + "</ul>";
|
464 |
+
}
|
465 |
+
}, options || { });
|
466 |
+
}
|
467 |
+
});
|
468 |
+
|
469 |
+
// AJAX in-place editor and collection editor
|
470 |
+
// Full rewrite by Christophe Porteneuve <tdd@tddsworld.com> (April 2007).
|
471 |
+
|
472 |
+
// Use this if you notice weird scrolling problems on some browsers,
|
473 |
+
// the DOM might be a bit confused when this gets called so do this
|
474 |
+
// waits 1 ms (with setTimeout) until it does the activation
|
475 |
+
Field.scrollFreeActivate = function(field) {
|
476 |
+
setTimeout(function() {
|
477 |
+
Field.activate(field);
|
478 |
+
}, 1);
|
479 |
+
};
|
480 |
+
|
481 |
+
Ajax.InPlaceEditor = Class.create({
|
482 |
+
initialize: function(element, url, options) {
|
483 |
+
this.url = url;
|
484 |
+
this.element = element = $(element);
|
485 |
+
this.prepareOptions();
|
486 |
+
this._controls = { };
|
487 |
+
arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!!
|
488 |
+
Object.extend(this.options, options || { });
|
489 |
+
if (!this.options.formId && this.element.id) {
|
490 |
+
this.options.formId = this.element.id + '-inplaceeditor';
|
491 |
+
if ($(this.options.formId))
|
492 |
+
this.options.formId = '';
|
493 |
+
}
|
494 |
+
if (this.options.externalControl)
|
495 |
+
this.options.externalControl = $(this.options.externalControl);
|
496 |
+
if (!this.options.externalControl)
|
497 |
+
this.options.externalControlOnly = false;
|
498 |
+
this._originalBackground = this.element.getStyle('background-color') || 'transparent';
|
499 |
+
this.element.title = this.options.clickToEditText;
|
500 |
+
this._boundCancelHandler = this.handleFormCancellation.bind(this);
|
501 |
+
this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this);
|
502 |
+
this._boundFailureHandler = this.handleAJAXFailure.bind(this);
|
503 |
+
this._boundSubmitHandler = this.handleFormSubmission.bind(this);
|
504 |
+
this._boundWrapperHandler = this.wrapUp.bind(this);
|
505 |
+
this.registerListeners();
|
506 |
+
},
|
507 |
+
checkForEscapeOrReturn: function(e) {
|
508 |
+
if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return;
|
509 |
+
if (Event.KEY_ESC == e.keyCode)
|
510 |
+
this.handleFormCancellation(e);
|
511 |
+
else if (Event.KEY_RETURN == e.keyCode)
|
512 |
+
this.handleFormSubmission(e);
|
513 |
+
},
|
514 |
+
createControl: function(mode, handler, extraClasses) {
|
515 |
+
var control = this.options[mode + 'Control'];
|
516 |
+
var text = this.options[mode + 'Text'];
|
517 |
+
if ('button' == control) {
|
518 |
+
var btn = document.createElement('input');
|
519 |
+
btn.type = 'submit';
|
520 |
+
btn.value = text;
|
521 |
+
btn.className = 'editor_' + mode + '_button';
|
522 |
+
if ('cancel' == mode)
|
523 |
+
btn.onclick = this._boundCancelHandler;
|
524 |
+
this._form.appendChild(btn);
|
525 |
+
this._controls[mode] = btn;
|
526 |
+
} else if ('link' == control) {
|
527 |
+
var link = document.createElement('a');
|
528 |
+
link.href = '#';
|
529 |
+
link.appendChild(document.createTextNode(text));
|
530 |
+
link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler;
|
531 |
+
link.className = 'editor_' + mode + '_link';
|
532 |
+
if (extraClasses)
|
533 |
+
link.className += ' ' + extraClasses;
|
534 |
+
this._form.appendChild(link);
|
535 |
+
this._controls[mode] = link;
|
536 |
+
}
|
537 |
+
},
|
538 |
+
createEditField: function() {
|
539 |
+
var text = (this.options.loadTextURL ? this.options.loadingText : this.getText());
|
540 |
+
var fld;
|
541 |
+
if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) {
|
542 |
+
fld = document.createElement('input');
|
543 |
+
fld.type = 'text';
|
544 |
+
var size = this.options.size || this.options.cols || 0;
|
545 |
+
if (0 < size) fld.size = size;
|
546 |
+
} else {
|
547 |
+
fld = document.createElement('textarea');
|
548 |
+
fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows);
|
549 |
+
fld.cols = this.options.cols || 40;
|
550 |
+
}
|
551 |
+
fld.name = this.options.paramName;
|
552 |
+
fld.value = text; // No HTML breaks conversion anymore
|
553 |
+
fld.className = 'editor_field';
|
554 |
+
if (this.options.submitOnBlur)
|
555 |
+
fld.onblur = this._boundSubmitHandler;
|
556 |
+
this._controls.editor = fld;
|
557 |
+
if (this.options.loadTextURL)
|
558 |
+
this.loadExternalText();
|
559 |
+
this._form.appendChild(this._controls.editor);
|
560 |
+
},
|
561 |
+
createForm: function() {
|
562 |
+
var ipe = this;
|
563 |
+
function addText(mode, condition) {
|
564 |
+
var text = ipe.options['text' + mode + 'Controls'];
|
565 |
+
if (!text || condition === false) return;
|
566 |
+
ipe._form.appendChild(document.createTextNode(text));
|
567 |
+
};
|
568 |
+
this._form = $(document.createElement('form'));
|
569 |
+
this._form.id = this.options.formId;
|
570 |
+
this._form.addClassName(this.options.formClassName);
|
571 |
+
this._form.onsubmit = this._boundSubmitHandler;
|
572 |
+
this.createEditField();
|
573 |
+
if ('textarea' == this._controls.editor.tagName.toLowerCase())
|
574 |
+
this._form.appendChild(document.createElement('br'));
|
575 |
+
if (this.options.onFormCustomization)
|
576 |
+
this.options.onFormCustomization(this, this._form);
|
577 |
+
addText('Before', this.options.okControl || this.options.cancelControl);
|
578 |
+
this.createControl('ok', this._boundSubmitHandler);
|
579 |
+
addText('Between', this.options.okControl && this.options.cancelControl);
|
580 |
+
this.createControl('cancel', this._boundCancelHandler, 'editor_cancel');
|
581 |
+
addText('After', this.options.okControl || this.options.cancelControl);
|
582 |
+
},
|
583 |
+
destroy: function() {
|
584 |
+
if (this._oldInnerHTML)
|
585 |
+
this.element.innerHTML = this._oldInnerHTML;
|
586 |
+
this.leaveEditMode();
|
587 |
+
this.unregisterListeners();
|
588 |
+
},
|
589 |
+
enterEditMode: function(e) {
|
590 |
+
if (this._saving || this._editing) return;
|
591 |
+
this._editing = true;
|
592 |
+
this.triggerCallback('onEnterEditMode');
|
593 |
+
if (this.options.externalControl)
|
594 |
+
this.options.externalControl.hide();
|
595 |
+
this.element.hide();
|
596 |
+
this.createForm();
|
597 |
+
this.element.parentNode.insertBefore(this._form, this.element);
|
598 |
+
if (!this.options.loadTextURL)
|
599 |
+
this.postProcessEditField();
|
600 |
+
if (e) Event.stop(e);
|
601 |
+
},
|
602 |
+
enterHover: function(e) {
|
603 |
+
if (this.options.hoverClassName)
|
604 |
+
this.element.addClassName(this.options.hoverClassName);
|
605 |
+
if (this._saving) return;
|
606 |
+
this.triggerCallback('onEnterHover');
|
607 |
+
},
|
608 |
+
getText: function() {
|
609 |
+
return this.element.innerHTML.unescapeHTML();
|
610 |
+
},
|
611 |
+
handleAJAXFailure: function(transport) {
|
612 |
+
this.triggerCallback('onFailure', transport);
|
613 |
+
if (this._oldInnerHTML) {
|
614 |
+
this.element.innerHTML = this._oldInnerHTML;
|
615 |
+
this._oldInnerHTML = null;
|
616 |
+
}
|
617 |
+
},
|
618 |
+
handleFormCancellation: function(e) {
|
619 |
+
this.wrapUp();
|
620 |
+
if (e) Event.stop(e);
|
621 |
+
},
|
622 |
+
handleFormSubmission: function(e) {
|
623 |
+
var form = this._form;
|
624 |
+
var value = $F(this._controls.editor);
|
625 |
+
this.prepareSubmission();
|
626 |
+
var params = this.options.callback(form, value) || '';
|
627 |
+
if (Object.isString(params))
|
628 |
+
params = params.toQueryParams();
|
629 |
+
params.editorId = this.element.id;
|
630 |
+
if (this.options.htmlResponse) {
|
631 |
+
var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions);
|
632 |
+
Object.extend(options, {
|
633 |
+
parameters: params,
|
634 |
+
onComplete: this._boundWrapperHandler,
|
635 |
+
onFailure: this._boundFailureHandler
|
636 |
+
});
|
637 |
+
new Ajax.Updater({ success: this.element }, this.url, options);
|
638 |
+
} else {
|
639 |
+
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
|
640 |
+
Object.extend(options, {
|
641 |
+
parameters: params,
|
642 |
+
onComplete: this._boundWrapperHandler,
|
643 |
+
onFailure: this._boundFailureHandler
|
644 |
+
});
|
645 |
+
new Ajax.Request(this.url, options);
|
646 |
+
}
|
647 |
+
if (e) Event.stop(e);
|
648 |
+
},
|
649 |
+
leaveEditMode: function() {
|
650 |
+
this.element.removeClassName(this.options.savingClassName);
|
651 |
+
this.removeForm();
|
652 |
+
this.leaveHover();
|
653 |
+
this.element.style.backgroundColor = this._originalBackground;
|
654 |
+
this.element.show();
|
655 |
+
if (this.options.externalControl)
|
656 |
+
this.options.externalControl.show();
|
657 |
+
this._saving = false;
|
658 |
+
this._editing = false;
|
659 |
+
this._oldInnerHTML = null;
|
660 |
+
this.triggerCallback('onLeaveEditMode');
|
661 |
+
},
|
662 |
+
leaveHover: function(e) {
|
663 |
+
if (this.options.hoverClassName)
|
664 |
+
this.element.removeClassName(this.options.hoverClassName);
|
665 |
+
if (this._saving) return;
|
666 |
+
this.triggerCallback('onLeaveHover');
|
667 |
+
},
|
668 |
+
loadExternalText: function() {
|
669 |
+
this._form.addClassName(this.options.loadingClassName);
|
670 |
+
this._controls.editor.disabled = true;
|
671 |
+
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
|
672 |
+
Object.extend(options, {
|
673 |
+
parameters: 'editorId=' + encodeURIComponent(this.element.id),
|
674 |
+
onComplete: Prototype.emptyFunction,
|
675 |
+
onSuccess: function(transport) {
|
676 |
+
this._form.removeClassName(this.options.loadingClassName);
|
677 |
+
var text = transport.responseText;
|
678 |
+
if (this.options.stripLoadedTextTags)
|
679 |
+
text = text.stripTags();
|
680 |
+
this._controls.editor.value = text;
|
681 |
+
this._controls.editor.disabled = false;
|
682 |
+
this.postProcessEditField();
|
683 |
+
}.bind(this),
|
684 |
+
onFailure: this._boundFailureHandler
|
685 |
+
});
|
686 |
+
new Ajax.Request(this.options.loadTextURL, options);
|
687 |
+
},
|
688 |
+
postProcessEditField: function() {
|
689 |
+
var fpc = this.options.fieldPostCreation;
|
690 |
+
if (fpc)
|
691 |
+
$(this._controls.editor)['focus' == fpc ? 'focus' : 'activate']();
|
692 |
+
},
|
693 |
+
prepareOptions: function() {
|
694 |
+
this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions);
|
695 |
+
Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks);
|
696 |
+
[this._extraDefaultOptions].flatten().compact().each(function(defs) {
|
697 |
+
Object.extend(this.options, defs);
|
698 |
+
}.bind(this));
|
699 |
+
},
|
700 |
+
prepareSubmission: function() {
|
701 |
+
this._saving = true;
|
702 |
+
this.removeForm();
|
703 |
+
this.leaveHover();
|
704 |
+
this.showSaving();
|
705 |
+
},
|
706 |
+
registerListeners: function() {
|
707 |
+
this._listeners = { };
|
708 |
+
var listener;
|
709 |
+
$H(Ajax.InPlaceEditor.Listeners).each(function(pair) {
|
710 |
+
listener = this[pair.value].bind(this);
|
711 |
+
this._listeners[pair.key] = listener;
|
712 |
+
if (!this.options.externalControlOnly)
|
713 |
+
this.element.observe(pair.key, listener);
|
714 |
+
if (this.options.externalControl)
|
715 |
+
this.options.externalControl.observe(pair.key, listener);
|
716 |
+
}.bind(this));
|
717 |
+
},
|
718 |
+
removeForm: function() {
|
719 |
+
if (!this._form) return;
|
720 |
+
this._form.remove();
|
721 |
+
this._form = null;
|
722 |
+
this._controls = { };
|
723 |
+
},
|
724 |
+
showSaving: function() {
|
725 |
+
this._oldInnerHTML = this.element.innerHTML;
|
726 |
+
this.element.innerHTML = this.options.savingText;
|
727 |
+
this.element.addClassName(this.options.savingClassName);
|
728 |
+
this.element.style.backgroundColor = this._originalBackground;
|
729 |
+
this.element.show();
|
730 |
+
},
|
731 |
+
triggerCallback: function(cbName, arg) {
|
732 |
+
if ('function' == typeof this.options[cbName]) {
|
733 |
+
this.options[cbName](this, arg);
|
734 |
+
}
|
735 |
+
},
|
736 |
+
unregisterListeners: function() {
|
737 |
+
$H(this._listeners).each(function(pair) {
|
738 |
+
if (!this.options.externalControlOnly)
|
739 |
+
this.element.stopObserving(pair.key, pair.value);
|
740 |
+
if (this.options.externalControl)
|
741 |
+
this.options.externalControl.stopObserving(pair.key, pair.value);
|
742 |
+
}.bind(this));
|
743 |
+
},
|
744 |
+
wrapUp: function(transport) {
|
745 |
+
this.leaveEditMode();
|
746 |
+
// Can't use triggerCallback due to backward compatibility: requires
|
747 |
+
// binding + direct element
|
748 |
+
this._boundComplete(transport, this.element);
|
749 |
+
}
|
750 |
+
});
|
751 |
+
|
752 |
+
Object.extend(Ajax.InPlaceEditor.prototype, {
|
753 |
+
dispose: Ajax.InPlaceEditor.prototype.destroy
|
754 |
+
});
|
755 |
+
|
756 |
+
Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, {
|
757 |
+
initialize: function($super, element, url, options) {
|
758 |
+
this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions;
|
759 |
+
$super(element, url, options);
|
760 |
+
},
|
761 |
+
|
762 |
+
createEditField: function() {
|
763 |
+
var list = document.createElement('select');
|
764 |
+
list.name = this.options.paramName;
|
765 |
+
list.size = 1;
|
766 |
+
this._controls.editor = list;
|
767 |
+
this._collection = this.options.collection || [];
|
768 |
+
if (this.options.loadCollectionURL)
|
769 |
+
this.loadCollection();
|
770 |
+
else
|
771 |
+
this.checkForExternalText();
|
772 |
+
this._form.appendChild(this._controls.editor);
|
773 |
+
},
|
774 |
+
|
775 |
+
loadCollection: function() {
|
776 |
+
this._form.addClassName(this.options.loadingClassName);
|
777 |
+
this.showLoadingText(this.options.loadingCollectionText);
|
778 |
+
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
|
779 |
+
Object.extend(options, {
|
780 |
+
parameters: 'editorId=' + encodeURIComponent(this.element.id),
|
781 |
+
onComplete: Prototype.emptyFunction,
|
782 |
+
onSuccess: function(transport) {
|
783 |
+
var js = transport.responseText.strip();
|
784 |
+
if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check
|
785 |
+
throw('Server returned an invalid collection representation.');
|
786 |
+
this._collection = eval(js);
|
787 |
+
this.checkForExternalText();
|
788 |
+
}.bind(this),
|
789 |
+
onFailure: this.onFailure
|
790 |
+
});
|
791 |
+
new Ajax.Request(this.options.loadCollectionURL, options);
|
792 |
+
},
|
793 |
+
|
794 |
+
showLoadingText: function(text) {
|
795 |
+
this._controls.editor.disabled = true;
|
796 |
+
var tempOption = this._controls.editor.firstChild;
|
797 |
+
if (!tempOption) {
|
798 |
+
tempOption = document.createElement('option');
|
799 |
+
tempOption.value = '';
|
800 |
+
this._controls.editor.appendChild(tempOption);
|
801 |
+
tempOption.selected = true;
|
802 |
+
}
|
803 |
+
tempOption.update((text || '').stripScripts().stripTags());
|
804 |
+
},
|
805 |
+
|
806 |
+
checkForExternalText: function() {
|
807 |
+
this._text = this.getText();
|
808 |
+
if (this.options.loadTextURL)
|
809 |
+
this.loadExternalText();
|
810 |
+
else
|
811 |
+
this.buildOptionList();
|
812 |
+
},
|
813 |
+
|
814 |
+
loadExternalText: function() {
|
815 |
+
this.showLoadingText(this.options.loadingText);
|
816 |
+
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
|
817 |
+
Object.extend(options, {
|
818 |
+
parameters: 'editorId=' + encodeURIComponent(this.element.id),
|
819 |
+
onComplete: Prototype.emptyFunction,
|
820 |
+
onSuccess: function(transport) {
|
821 |
+
this._text = transport.responseText.strip();
|
822 |
+
this.buildOptionList();
|
823 |
+
}.bind(this),
|
824 |
+
onFailure: this.onFailure
|
825 |
+
});
|
826 |
+
new Ajax.Request(this.options.loadTextURL, options);
|
827 |
+
},
|
828 |
+
|
829 |
+
buildOptionList: function() {
|
830 |
+
this._form.removeClassName(this.options.loadingClassName);
|
831 |
+
this._collection = this._collection.map(function(entry) {
|
832 |
+
return 2 === entry.length ? entry : [entry, entry].flatten();
|
833 |
+
});
|
834 |
+
var marker = ('value' in this.options) ? this.options.value : this._text;
|
835 |
+
var textFound = this._collection.any(function(entry) {
|
836 |
+
return entry[0] == marker;
|
837 |
+
}.bind(this));
|
838 |
+
this._controls.editor.update('');
|
839 |
+
var option;
|
840 |
+
this._collection.each(function(entry, index) {
|
841 |
+
option = document.createElement('option');
|
842 |
+
option.value = entry[0];
|
843 |
+
option.selected = textFound ? entry[0] == marker : 0 == index;
|
844 |
+
option.appendChild(document.createTextNode(entry[1]));
|
845 |
+
this._controls.editor.appendChild(option);
|
846 |
+
}.bind(this));
|
847 |
+
this._controls.editor.disabled = false;
|
848 |
+
Field.scrollFreeActivate(this._controls.editor);
|
849 |
+
}
|
850 |
+
});
|
851 |
+
|
852 |
+
//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! ****
|
853 |
+
//**** This only exists for a while, in order to let ****
|
854 |
+
//**** users adapt to the new API. Read up on the new ****
|
855 |
+
//**** API and convert your code to it ASAP! ****
|
856 |
+
|
857 |
+
Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) {
|
858 |
+
if (!options) return;
|
859 |
+
function fallback(name, expr) {
|
860 |
+
if (name in options || expr === undefined) return;
|
861 |
+
options[name] = expr;
|
862 |
+
};
|
863 |
+
fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' :
|
864 |
+
options.cancelLink == options.cancelButton == false ? false : undefined)));
|
865 |
+
fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' :
|
866 |
+
options.okLink == options.okButton == false ? false : undefined)));
|
867 |
+
fallback('highlightColor', options.highlightcolor);
|
868 |
+
fallback('highlightEndColor', options.highlightendcolor);
|
869 |
+
};
|
870 |
+
|
871 |
+
Object.extend(Ajax.InPlaceEditor, {
|
872 |
+
DefaultOptions: {
|
873 |
+
ajaxOptions: { },
|
874 |
+
autoRows: 3, // Use when multi-line w/ rows == 1
|
875 |
+
cancelControl: 'link', // 'link'|'button'|false
|
876 |
+
cancelText: 'cancel',
|
877 |
+
clickToEditText: 'Click to edit',
|
878 |
+
externalControl: null, // id|elt
|
879 |
+
externalControlOnly: false,
|
880 |
+
fieldPostCreation: 'activate', // 'activate'|'focus'|false
|
881 |
+
formClassName: 'inplaceeditor-form',
|
882 |
+
formId: null, // id|elt
|
883 |
+
highlightColor: '#ffff99',
|
884 |
+
highlightEndColor: '#ffffff',
|
885 |
+
hoverClassName: '',
|
886 |
+
htmlResponse: true,
|
887 |
+
loadingClassName: 'inplaceeditor-loading',
|
888 |
+
loadingText: 'Loading...',
|
889 |
+
okControl: 'button', // 'link'|'button'|false
|
890 |
+
okText: 'ok',
|
891 |
+
paramName: 'value',
|
892 |
+
rows: 1, // If 1 and multi-line, uses autoRows
|
893 |
+
savingClassName: 'inplaceeditor-saving',
|
894 |
+
savingText: 'Saving...',
|
895 |
+
size: 0,
|
896 |
+
stripLoadedTextTags: false,
|
897 |
+
submitOnBlur: false,
|
898 |
+
textAfterControls: '',
|
899 |
+
textBeforeControls: '',
|
900 |
+
textBetweenControls: ''
|
901 |
+
},
|
902 |
+
DefaultCallbacks: {
|
903 |
+
callback: function(form) {
|
904 |
+
return Form.serialize(form);
|
905 |
+
},
|
906 |
+
onComplete: function(transport, element) {
|
907 |
+
// For backward compatibility, this one is bound to the IPE, and passes
|
908 |
+
// the element directly. It was too often customized, so we don't break it.
|
909 |
+
new Effect.Highlight(element, {
|
910 |
+
startcolor: this.options.highlightColor, keepBackgroundImage: true });
|
911 |
+
},
|
912 |
+
onEnterEditMode: null,
|
913 |
+
onEnterHover: function(ipe) {
|
914 |
+
ipe.element.style.backgroundColor = ipe.options.highlightColor;
|
915 |
+
if (ipe._effect)
|
916 |
+
ipe._effect.cancel();
|
917 |
+
},
|
918 |
+
onFailure: function(transport, ipe) {
|
919 |
+
alert('Error communication with the server: ' + transport.responseText.stripTags());
|
920 |
+
},
|
921 |
+
onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls.
|
922 |
+
onLeaveEditMode: null,
|
923 |
+
onLeaveHover: function(ipe) {
|
924 |
+
ipe._effect = new Effect.Highlight(ipe.element, {
|
925 |
+
startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor,
|
926 |
+
restorecolor: ipe._originalBackground, keepBackgroundImage: true
|
927 |
+
});
|
928 |
+
}
|
929 |
+
},
|
930 |
+
Listeners: {
|
931 |
+
click: 'enterEditMode',
|
932 |
+
keydown: 'checkForEscapeOrReturn',
|
933 |
+
mouseover: 'enterHover',
|
934 |
+
mouseout: 'leaveHover'
|
935 |
+
}
|
936 |
+
});
|
937 |
+
|
938 |
+
Ajax.InPlaceCollectionEditor.DefaultOptions = {
|
939 |
+
loadingCollectionText: 'Loading options...'
|
940 |
+
};
|
941 |
+
|
942 |
+
// Delayed observer, like Form.Element.Observer,
|
943 |
+
// but waits for delay after last key input
|
944 |
+
// Ideal for live-search fields
|
945 |
+
|
946 |
+
Form.Element.DelayedObserver = Class.create({
|
947 |
+
initialize: function(element, delay, callback) {
|
948 |
+
this.delay = delay || 0.5;
|
949 |
+
this.element = $(element);
|
950 |
+
this.callback = callback;
|
951 |
+
this.timer = null;
|
952 |
+
this.lastValue = $F(this.element);
|
953 |
+
Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this));
|
954 |
+
},
|
955 |
+
delayedListener: function(event) {
|
956 |
+
if(this.lastValue == $F(this.element)) return;
|
957 |
+
if(this.timer) clearTimeout(this.timer);
|
958 |
+
this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000);
|
959 |
+
this.lastValue = $F(this.element);
|
960 |
+
},
|
961 |
+
onTimerEvent: function() {
|
962 |
+
this.timer = null;
|
963 |
+
this.callback(this.element, $F(this.element));
|
964 |
+
}
|
965 |
+
});
|
skin/frontend/base/default/js/ajaxwishlist/lightview/dragdrop.js
ADDED
@@ -0,0 +1,974 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// script.aculo.us dragdrop.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
|
2 |
+
|
3 |
+
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
4 |
+
//
|
5 |
+
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
6 |
+
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
7 |
+
|
8 |
+
if(Object.isUndefined(Effect))
|
9 |
+
throw("dragdrop.js requires including script.aculo.us' effects.js library");
|
10 |
+
|
11 |
+
var Droppables = {
|
12 |
+
drops: [],
|
13 |
+
|
14 |
+
remove: function(element) {
|
15 |
+
this.drops = this.drops.reject(function(d) { return d.element==$(element) });
|
16 |
+
},
|
17 |
+
|
18 |
+
add: function(element) {
|
19 |
+
element = $(element);
|
20 |
+
var options = Object.extend({
|
21 |
+
greedy: true,
|
22 |
+
hoverclass: null,
|
23 |
+
tree: false
|
24 |
+
}, arguments[1] || { });
|
25 |
+
|
26 |
+
// cache containers
|
27 |
+
if(options.containment) {
|
28 |
+
options._containers = [];
|
29 |
+
var containment = options.containment;
|
30 |
+
if(Object.isArray(containment)) {
|
31 |
+
containment.each( function(c) { options._containers.push($(c)) });
|
32 |
+
} else {
|
33 |
+
options._containers.push($(containment));
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
if(options.accept) options.accept = [options.accept].flatten();
|
38 |
+
|
39 |
+
Element.makePositioned(element); // fix IE
|
40 |
+
options.element = element;
|
41 |
+
|
42 |
+
this.drops.push(options);
|
43 |
+
},
|
44 |
+
|
45 |
+
findDeepestChild: function(drops) {
|
46 |
+
deepest = drops[0];
|
47 |
+
|
48 |
+
for (i = 1; i < drops.length; ++i)
|
49 |
+
if (Element.isParent(drops[i].element, deepest.element))
|
50 |
+
deepest = drops[i];
|
51 |
+
|
52 |
+
return deepest;
|
53 |
+
},
|
54 |
+
|
55 |
+
isContained: function(element, drop) {
|
56 |
+
var containmentNode;
|
57 |
+
if(drop.tree) {
|
58 |
+
containmentNode = element.treeNode;
|
59 |
+
} else {
|
60 |
+
containmentNode = element.parentNode;
|
61 |
+
}
|
62 |
+
return drop._containers.detect(function(c) { return containmentNode == c });
|
63 |
+
},
|
64 |
+
|
65 |
+
isAffected: function(point, element, drop) {
|
66 |
+
return (
|
67 |
+
(drop.element!=element) &&
|
68 |
+
((!drop._containers) ||
|
69 |
+
this.isContained(element, drop)) &&
|
70 |
+
((!drop.accept) ||
|
71 |
+
(Element.classNames(element).detect(
|
72 |
+
function(v) { return drop.accept.include(v) } ) )) &&
|
73 |
+
Position.within(drop.element, point[0], point[1]) );
|
74 |
+
},
|
75 |
+
|
76 |
+
deactivate: function(drop) {
|
77 |
+
if(drop.hoverclass)
|
78 |
+
Element.removeClassName(drop.element, drop.hoverclass);
|
79 |
+
this.last_active = null;
|
80 |
+
},
|
81 |
+
|
82 |
+
activate: function(drop) {
|
83 |
+
if(drop.hoverclass)
|
84 |
+
Element.addClassName(drop.element, drop.hoverclass);
|
85 |
+
this.last_active = drop;
|
86 |
+
},
|
87 |
+
|
88 |
+
show: function(point, element) {
|
89 |
+
if(!this.drops.length) return;
|
90 |
+
var drop, affected = [];
|
91 |
+
|
92 |
+
this.drops.each( function(drop) {
|
93 |
+
if(Droppables.isAffected(point, element, drop))
|
94 |
+
affected.push(drop);
|
95 |
+
});
|
96 |
+
|
97 |
+
if(affected.length>0)
|
98 |
+
drop = Droppables.findDeepestChild(affected);
|
99 |
+
|
100 |
+
if(this.last_active && this.last_active != drop) this.deactivate(this.last_active);
|
101 |
+
if (drop) {
|
102 |
+
Position.within(drop.element, point[0], point[1]);
|
103 |
+
if(drop.onHover)
|
104 |
+
drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
|
105 |
+
|
106 |
+
if (drop != this.last_active) Droppables.activate(drop);
|
107 |
+
}
|
108 |
+
},
|
109 |
+
|
110 |
+
fire: function(event, element) {
|
111 |
+
if(!this.last_active) return;
|
112 |
+
Position.prepare();
|
113 |
+
|
114 |
+
if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
|
115 |
+
if (this.last_active.onDrop) {
|
116 |
+
this.last_active.onDrop(element, this.last_active.element, event);
|
117 |
+
return true;
|
118 |
+
}
|
119 |
+
},
|
120 |
+
|
121 |
+
reset: function() {
|
122 |
+
if(this.last_active)
|
123 |
+
this.deactivate(this.last_active);
|
124 |
+
}
|
125 |
+
};
|
126 |
+
|
127 |
+
var Draggables = {
|
128 |
+
drags: [],
|
129 |
+
observers: [],
|
130 |
+
|
131 |
+
register: function(draggable) {
|
132 |
+
if(this.drags.length == 0) {
|
133 |
+
this.eventMouseUp = this.endDrag.bindAsEventListener(this);
|
134 |
+
this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
|
135 |
+
this.eventKeypress = this.keyPress.bindAsEventListener(this);
|
136 |
+
|
137 |
+
Event.observe(document, "mouseup", this.eventMouseUp);
|
138 |
+
Event.observe(document, "mousemove", this.eventMouseMove);
|
139 |
+
Event.observe(document, "keypress", this.eventKeypress);
|
140 |
+
}
|
141 |
+
this.drags.push(draggable);
|
142 |
+
},
|
143 |
+
|
144 |
+
unregister: function(draggable) {
|
145 |
+
this.drags = this.drags.reject(function(d) { return d==draggable });
|
146 |
+
if(this.drags.length == 0) {
|
147 |
+
Event.stopObserving(document, "mouseup", this.eventMouseUp);
|
148 |
+
Event.stopObserving(document, "mousemove", this.eventMouseMove);
|
149 |
+
Event.stopObserving(document, "keypress", this.eventKeypress);
|
150 |
+
}
|
151 |
+
},
|
152 |
+
|
153 |
+
activate: function(draggable) {
|
154 |
+
if(draggable.options.delay) {
|
155 |
+
this._timeout = setTimeout(function() {
|
156 |
+
Draggables._timeout = null;
|
157 |
+
window.focus();
|
158 |
+
Draggables.activeDraggable = draggable;
|
159 |
+
}.bind(this), draggable.options.delay);
|
160 |
+
} else {
|
161 |
+
window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
|
162 |
+
this.activeDraggable = draggable;
|
163 |
+
}
|
164 |
+
},
|
165 |
+
|
166 |
+
deactivate: function() {
|
167 |
+
this.activeDraggable = null;
|
168 |
+
},
|
169 |
+
|
170 |
+
updateDrag: function(event) {
|
171 |
+
if(!this.activeDraggable) return;
|
172 |
+
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
173 |
+
// Mozilla-based browsers fire successive mousemove events with
|
174 |
+
// the same coordinates, prevent needless redrawing (moz bug?)
|
175 |
+
if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
|
176 |
+
this._lastPointer = pointer;
|
177 |
+
|
178 |
+
this.activeDraggable.updateDrag(event, pointer);
|
179 |
+
},
|
180 |
+
|
181 |
+
endDrag: function(event) {
|
182 |
+
if(this._timeout) {
|
183 |
+
clearTimeout(this._timeout);
|
184 |
+
this._timeout = null;
|
185 |
+
}
|
186 |
+
if(!this.activeDraggable) return;
|
187 |
+
this._lastPointer = null;
|
188 |
+
this.activeDraggable.endDrag(event);
|
189 |
+
this.activeDraggable = null;
|
190 |
+
},
|
191 |
+
|
192 |
+
keyPress: function(event) {
|
193 |
+
if(this.activeDraggable)
|
194 |
+
this.activeDraggable.keyPress(event);
|
195 |
+
},
|
196 |
+
|
197 |
+
addObserver: function(observer) {
|
198 |
+
this.observers.push(observer);
|
199 |
+
this._cacheObserverCallbacks();
|
200 |
+
},
|
201 |
+
|
202 |
+
removeObserver: function(element) { // element instead of observer fixes mem leaks
|
203 |
+
this.observers = this.observers.reject( function(o) { return o.element==element });
|
204 |
+
this._cacheObserverCallbacks();
|
205 |
+
},
|
206 |
+
|
207 |
+
notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag'
|
208 |
+
if(this[eventName+'Count'] > 0)
|
209 |
+
this.observers.each( function(o) {
|
210 |
+
if(o[eventName]) o[eventName](eventName, draggable, event);
|
211 |
+
});
|
212 |
+
if(draggable.options[eventName]) draggable.options[eventName](draggable, event);
|
213 |
+
},
|
214 |
+
|
215 |
+
_cacheObserverCallbacks: function() {
|
216 |
+
['onStart','onEnd','onDrag'].each( function(eventName) {
|
217 |
+
Draggables[eventName+'Count'] = Draggables.observers.select(
|
218 |
+
function(o) { return o[eventName]; }
|
219 |
+
).length;
|
220 |
+
});
|
221 |
+
}
|
222 |
+
};
|
223 |
+
|
224 |
+
/*--------------------------------------------------------------------------*/
|
225 |
+
|
226 |
+
var Draggable = Class.create({
|
227 |
+
initialize: function(element) {
|
228 |
+
var defaults = {
|
229 |
+
handle: false,
|
230 |
+
reverteffect: function(element, top_offset, left_offset) {
|
231 |
+
var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;
|
232 |
+
new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur,
|
233 |
+
queue: {scope:'_draggable', position:'end'}
|
234 |
+
});
|
235 |
+
},
|
236 |
+
endeffect: function(element) {
|
237 |
+
var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0;
|
238 |
+
new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity,
|
239 |
+
queue: {scope:'_draggable', position:'end'},
|
240 |
+
afterFinish: function(){
|
241 |
+
Draggable._dragging[element] = false
|
242 |
+
}
|
243 |
+
});
|
244 |
+
},
|
245 |
+
zindex: 1000,
|
246 |
+
revert: false,
|
247 |
+
quiet: false,
|
248 |
+
scroll: false,
|
249 |
+
scrollSensitivity: 20,
|
250 |
+
scrollSpeed: 15,
|
251 |
+
snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] }
|
252 |
+
delay: 0
|
253 |
+
};
|
254 |
+
|
255 |
+
if(!arguments[1] || Object.isUndefined(arguments[1].endeffect))
|
256 |
+
Object.extend(defaults, {
|
257 |
+
starteffect: function(element) {
|
258 |
+
element._opacity = Element.getOpacity(element);
|
259 |
+
Draggable._dragging[element] = true;
|
260 |
+
new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
|
261 |
+
}
|
262 |
+
});
|
263 |
+
|
264 |
+
var options = Object.extend(defaults, arguments[1] || { });
|
265 |
+
|
266 |
+
this.element = $(element);
|
267 |
+
|
268 |
+
if(options.handle && Object.isString(options.handle))
|
269 |
+
this.handle = this.element.down('.'+options.handle, 0);
|
270 |
+
|
271 |
+
if(!this.handle) this.handle = $(options.handle);
|
272 |
+
if(!this.handle) this.handle = this.element;
|
273 |
+
|
274 |
+
if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) {
|
275 |
+
options.scroll = $(options.scroll);
|
276 |
+
this._isScrollChild = Element.childOf(this.element, options.scroll);
|
277 |
+
}
|
278 |
+
|
279 |
+
Element.makePositioned(this.element); // fix IE
|
280 |
+
|
281 |
+
this.options = options;
|
282 |
+
this.dragging = false;
|
283 |
+
|
284 |
+
this.eventMouseDown = this.initDrag.bindAsEventListener(this);
|
285 |
+
Event.observe(this.handle, "mousedown", this.eventMouseDown);
|
286 |
+
|
287 |
+
Draggables.register(this);
|
288 |
+
},
|
289 |
+
|
290 |
+
destroy: function() {
|
291 |
+
Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
|
292 |
+
Draggables.unregister(this);
|
293 |
+
},
|
294 |
+
|
295 |
+
currentDelta: function() {
|
296 |
+
return([
|
297 |
+
parseInt(Element.getStyle(this.element,'left') || '0'),
|
298 |
+
parseInt(Element.getStyle(this.element,'top') || '0')]);
|
299 |
+
},
|
300 |
+
|
301 |
+
initDrag: function(event) {
|
302 |
+
if(!Object.isUndefined(Draggable._dragging[this.element]) &&
|
303 |
+
Draggable._dragging[this.element]) return;
|
304 |
+
if(Event.isLeftClick(event)) {
|
305 |
+
// abort on form elements, fixes a Firefox issue
|
306 |
+
var src = Event.element(event);
|
307 |
+
if((tag_name = src.tagName.toUpperCase()) && (
|
308 |
+
tag_name=='INPUT' ||
|
309 |
+
tag_name=='SELECT' ||
|
310 |
+
tag_name=='OPTION' ||
|
311 |
+
tag_name=='BUTTON' ||
|
312 |
+
tag_name=='TEXTAREA')) return;
|
313 |
+
|
314 |
+
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
315 |
+
var pos = this.element.cumulativeOffset();
|
316 |
+
this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
|
317 |
+
|
318 |
+
Draggables.activate(this);
|
319 |
+
Event.stop(event);
|
320 |
+
}
|
321 |
+
},
|
322 |
+
|
323 |
+
startDrag: function(event) {
|
324 |
+
this.dragging = true;
|
325 |
+
if(!this.delta)
|
326 |
+
this.delta = this.currentDelta();
|
327 |
+
|
328 |
+
if(this.options.zindex) {
|
329 |
+
this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
|
330 |
+
this.element.style.zIndex = this.options.zindex;
|
331 |
+
}
|
332 |
+
|
333 |
+
if(this.options.ghosting) {
|
334 |
+
this._clone = this.element.cloneNode(true);
|
335 |
+
this._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
|
336 |
+
if (!this._originallyAbsolute)
|
337 |
+
Position.absolutize(this.element);
|
338 |
+
this.element.parentNode.insertBefore(this._clone, this.element);
|
339 |
+
}
|
340 |
+
|
341 |
+
if(this.options.scroll) {
|
342 |
+
if (this.options.scroll == window) {
|
343 |
+
var where = this._getWindowScroll(this.options.scroll);
|
344 |
+
this.originalScrollLeft = where.left;
|
345 |
+
this.originalScrollTop = where.top;
|
346 |
+
} else {
|
347 |
+
this.originalScrollLeft = this.options.scroll.scrollLeft;
|
348 |
+
this.originalScrollTop = this.options.scroll.scrollTop;
|
349 |
+
}
|
350 |
+
}
|
351 |
+
|
352 |
+
Draggables.notify('onStart', this, event);
|
353 |
+
|
354 |
+
if(this.options.starteffect) this.options.starteffect(this.element);
|
355 |
+
},
|
356 |
+
|
357 |
+
updateDrag: function(event, pointer) {
|
358 |
+
if(!this.dragging) this.startDrag(event);
|
359 |
+
|
360 |
+
if(!this.options.quiet){
|
361 |
+
Position.prepare();
|
362 |
+
Droppables.show(pointer, this.element);
|
363 |
+
}
|
364 |
+
|
365 |
+
Draggables.notify('onDrag', this, event);
|
366 |
+
|
367 |
+
this.draw(pointer);
|
368 |
+
if(this.options.change) this.options.change(this);
|
369 |
+
|
370 |
+
if(this.options.scroll) {
|
371 |
+
this.stopScrolling();
|
372 |
+
|
373 |
+
var p;
|
374 |
+
if (this.options.scroll == window) {
|
375 |
+
with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
|
376 |
+
} else {
|
377 |
+
p = Position.page(this.options.scroll).toArray();
|
378 |
+
p[0] += this.options.scroll.scrollLeft + Position.deltaX;
|
379 |
+
p[1] += this.options.scroll.scrollTop + Position.deltaY;
|
380 |
+
p.push(p[0]+this.options.scroll.offsetWidth);
|
381 |
+
p.push(p[1]+this.options.scroll.offsetHeight);
|
382 |
+
}
|
383 |
+
var speed = [0,0];
|
384 |
+
if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity);
|
385 |
+
if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity);
|
386 |
+
if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity);
|
387 |
+
if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity);
|
388 |
+
this.startScrolling(speed);
|
389 |
+
}
|
390 |
+
|
391 |
+
// fix AppleWebKit rendering
|
392 |
+
if(Prototype.Browser.WebKit) window.scrollBy(0,0);
|
393 |
+
|
394 |
+
Event.stop(event);
|
395 |
+
},
|
396 |
+
|
397 |
+
finishDrag: function(event, success) {
|
398 |
+
this.dragging = false;
|
399 |
+
|
400 |
+
if(this.options.quiet){
|
401 |
+
Position.prepare();
|
402 |
+
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
403 |
+
Droppables.show(pointer, this.element);
|
404 |
+
}
|
405 |
+
|
406 |
+
if(this.options.ghosting) {
|
407 |
+
if (!this._originallyAbsolute)
|
408 |
+
Position.relativize(this.element);
|
409 |
+
delete this._originallyAbsolute;
|
410 |
+
Element.remove(this._clone);
|
411 |
+
this._clone = null;
|
412 |
+
}
|
413 |
+
|
414 |
+
var dropped = false;
|
415 |
+
if(success) {
|
416 |
+
dropped = Droppables.fire(event, this.element);
|
417 |
+
if (!dropped) dropped = false;
|
418 |
+
}
|
419 |
+
if(dropped && this.options.onDropped) this.options.onDropped(this.element);
|
420 |
+
Draggables.notify('onEnd', this, event);
|
421 |
+
|
422 |
+
var revert = this.options.revert;
|
423 |
+
if(revert && Object.isFunction(revert)) revert = revert(this.element);
|
424 |
+
|
425 |
+
var d = this.currentDelta();
|
426 |
+
if(revert && this.options.reverteffect) {
|
427 |
+
if (dropped == 0 || revert != 'failure')
|
428 |
+
this.options.reverteffect(this.element,
|
429 |
+
d[1]-this.delta[1], d[0]-this.delta[0]);
|
430 |
+
} else {
|
431 |
+
this.delta = d;
|
432 |
+
}
|
433 |
+
|
434 |
+
if(this.options.zindex)
|
435 |
+
this.element.style.zIndex = this.originalZ;
|
436 |
+
|
437 |
+
if(this.options.endeffect)
|
438 |
+
this.options.endeffect(this.element);
|
439 |
+
|
440 |
+
Draggables.deactivate(this);
|
441 |
+
Droppables.reset();
|
442 |
+
},
|
443 |
+
|
444 |
+
keyPress: function(event) {
|
445 |
+
if(event.keyCode!=Event.KEY_ESC) return;
|
446 |
+
this.finishDrag(event, false);
|
447 |
+
Event.stop(event);
|
448 |
+
},
|
449 |
+
|
450 |
+
endDrag: function(event) {
|
451 |
+
if(!this.dragging) return;
|
452 |
+
this.stopScrolling();
|
453 |
+
this.finishDrag(event, true);
|
454 |
+
Event.stop(event);
|
455 |
+
},
|
456 |
+
|
457 |
+
draw: function(point) {
|
458 |
+
var pos = this.element.cumulativeOffset();
|
459 |
+
if(this.options.ghosting) {
|
460 |
+
var r = Position.realOffset(this.element);
|
461 |
+
pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
|
462 |
+
}
|
463 |
+
|
464 |
+
var d = this.currentDelta();
|
465 |
+
pos[0] -= d[0]; pos[1] -= d[1];
|
466 |
+
|
467 |
+
if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) {
|
468 |
+
pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft;
|
469 |
+
pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop;
|
470 |
+
}
|
471 |
+
|
472 |
+
var p = [0,1].map(function(i){
|
473 |
+
return (point[i]-pos[i]-this.offset[i])
|
474 |
+
}.bind(this));
|
475 |
+
|
476 |
+
if(this.options.snap) {
|
477 |
+
if(Object.isFunction(this.options.snap)) {
|
478 |
+
p = this.options.snap(p[0],p[1],this);
|
479 |
+
} else {
|
480 |
+
if(Object.isArray(this.options.snap)) {
|
481 |
+
p = p.map( function(v, i) {
|
482 |
+
return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this));
|
483 |
+
} else {
|
484 |
+
p = p.map( function(v) {
|
485 |
+
return (v/this.options.snap).round()*this.options.snap }.bind(this));
|
486 |
+
}
|
487 |
+
}}
|
488 |
+
|
489 |
+
var style = this.element.style;
|
490 |
+
if((!this.options.constraint) || (this.options.constraint=='horizontal'))
|
491 |
+
style.left = p[0] + "px";
|
492 |
+
if((!this.options.constraint) || (this.options.constraint=='vertical'))
|
493 |
+
style.top = p[1] + "px";
|
494 |
+
|
495 |
+
if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering
|
496 |
+
},
|
497 |
+
|
498 |
+
stopScrolling: function() {
|
499 |
+
if(this.scrollInterval) {
|
500 |
+
clearInterval(this.scrollInterval);
|
501 |
+
this.scrollInterval = null;
|
502 |
+
Draggables._lastScrollPointer = null;
|
503 |
+
}
|
504 |
+
},
|
505 |
+
|
506 |
+
startScrolling: function(speed) {
|
507 |
+
if(!(speed[0] || speed[1])) return;
|
508 |
+
this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];
|
509 |
+
this.lastScrolled = new Date();
|
510 |
+
this.scrollInterval = setInterval(this.scroll.bind(this), 10);
|
511 |
+
},
|
512 |
+
|
513 |
+
scroll: function() {
|
514 |
+
var current = new Date();
|
515 |
+
var delta = current - this.lastScrolled;
|
516 |
+
this.lastScrolled = current;
|
517 |
+
if(this.options.scroll == window) {
|
518 |
+
with (this._getWindowScroll(this.options.scroll)) {
|
519 |
+
if (this.scrollSpeed[0] || this.scrollSpeed[1]) {
|
520 |
+
var d = delta / 1000;
|
521 |
+
this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] );
|
522 |
+
}
|
523 |
+
}
|
524 |
+
} else {
|
525 |
+
this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000;
|
526 |
+
this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000;
|
527 |
+
}
|
528 |
+
|
529 |
+
Position.prepare();
|
530 |
+
Droppables.show(Draggables._lastPointer, this.element);
|
531 |
+
Draggables.notify('onDrag', this);
|
532 |
+
if (this._isScrollChild) {
|
533 |
+
Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer);
|
534 |
+
Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000;
|
535 |
+
Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000;
|
536 |
+
if (Draggables._lastScrollPointer[0] < 0)
|
537 |
+
Draggables._lastScrollPointer[0] = 0;
|
538 |
+
if (Draggables._lastScrollPointer[1] < 0)
|
539 |
+
Draggables._lastScrollPointer[1] = 0;
|
540 |
+
this.draw(Draggables._lastScrollPointer);
|
541 |
+
}
|
542 |
+
|
543 |
+
if(this.options.change) this.options.change(this);
|
544 |
+
},
|
545 |
+
|
546 |
+
_getWindowScroll: function(w) {
|
547 |
+
var T, L, W, H;
|
548 |
+
with (w.document) {
|
549 |
+
if (w.document.documentElement && documentElement.scrollTop) {
|
550 |
+
T = documentElement.scrollTop;
|
551 |
+
L = documentElement.scrollLeft;
|
552 |
+
} else if (w.document.body) {
|
553 |
+
T = body.scrollTop;
|
554 |
+
L = body.scrollLeft;
|
555 |
+
}
|
556 |
+
if (w.innerWidth) {
|
557 |
+
W = w.innerWidth;
|
558 |
+
H = w.innerHeight;
|
559 |
+
} else if (w.document.documentElement && documentElement.clientWidth) {
|
560 |
+
W = documentElement.clientWidth;
|
561 |
+
H = documentElement.clientHeight;
|
562 |
+
} else {
|
563 |
+
W = body.offsetWidth;
|
564 |
+
H = body.offsetHeight;
|
565 |
+
}
|
566 |
+
}
|
567 |
+
return { top: T, left: L, width: W, height: H };
|
568 |
+
}
|
569 |
+
});
|
570 |
+
|
571 |
+
Draggable._dragging = { };
|
572 |
+
|
573 |
+
/*--------------------------------------------------------------------------*/
|
574 |
+
|
575 |
+
var SortableObserver = Class.create({
|
576 |
+
initialize: function(element, observer) {
|
577 |
+
this.element = $(element);
|
578 |
+
this.observer = observer;
|
579 |
+
this.lastValue = Sortable.serialize(this.element);
|
580 |
+
},
|
581 |
+
|
582 |
+
onStart: function() {
|
583 |
+
this.lastValue = Sortable.serialize(this.element);
|
584 |
+
},
|
585 |
+
|
586 |
+
onEnd: function() {
|
587 |
+
Sortable.unmark();
|
588 |
+
if(this.lastValue != Sortable.serialize(this.element))
|
589 |
+
this.observer(this.element)
|
590 |
+
}
|
591 |
+
});
|
592 |
+
|
593 |
+
var Sortable = {
|
594 |
+
SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,
|
595 |
+
|
596 |
+
sortables: { },
|
597 |
+
|
598 |
+
_findRootElement: function(element) {
|
599 |
+
while (element.tagName.toUpperCase() != "BODY") {
|
600 |
+
if(element.id && Sortable.sortables[element.id]) return element;
|
601 |
+
element = element.parentNode;
|
602 |
+
}
|
603 |
+
},
|
604 |
+
|
605 |
+
options: function(element) {
|
606 |
+
element = Sortable._findRootElement($(element));
|
607 |
+
if(!element) return;
|
608 |
+
return Sortable.sortables[element.id];
|
609 |
+
},
|
610 |
+
|
611 |
+
destroy: function(element){
|
612 |
+
element = $(element);
|
613 |
+
var s = Sortable.sortables[element.id];
|
614 |
+
|
615 |
+
if(s) {
|
616 |
+
Draggables.removeObserver(s.element);
|
617 |
+
s.droppables.each(function(d){ Droppables.remove(d) });
|
618 |
+
s.draggables.invoke('destroy');
|
619 |
+
|
620 |
+
delete Sortable.sortables[s.element.id];
|
621 |
+
}
|
622 |
+
},
|
623 |
+
|
624 |
+
create: function(element) {
|
625 |
+
element = $(element);
|
626 |
+
var options = Object.extend({
|
627 |
+
element: element,
|
628 |
+
tag: 'li', // assumes li children, override with tag: 'tagname'
|
629 |
+
dropOnEmpty: false,
|
630 |
+
tree: false,
|
631 |
+
treeTag: 'ul',
|
632 |
+
overlap: 'vertical', // one of 'vertical', 'horizontal'
|
633 |
+
constraint: 'vertical', // one of 'vertical', 'horizontal', false
|
634 |
+
containment: element, // also takes array of elements (or id's); or false
|
635 |
+
handle: false, // or a CSS class
|
636 |
+
only: false,
|
637 |
+
delay: 0,
|
638 |
+
hoverclass: null,
|
639 |
+
ghosting: false,
|
640 |
+
quiet: false,
|
641 |
+
scroll: false,
|
642 |
+
scrollSensitivity: 20,
|
643 |
+
scrollSpeed: 15,
|
644 |
+
format: this.SERIALIZE_RULE,
|
645 |
+
|
646 |
+
// these take arrays of elements or ids and can be
|
647 |
+
// used for better initialization performance
|
648 |
+
elements: false,
|
649 |
+
handles: false,
|
650 |
+
|
651 |
+
onChange: Prototype.emptyFunction,
|
652 |
+
onUpdate: Prototype.emptyFunction
|
653 |
+
}, arguments[1] || { });
|
654 |
+
|
655 |
+
// clear any old sortable with same element
|
656 |
+
this.destroy(element);
|
657 |
+
|
658 |
+
// build options for the draggables
|
659 |
+
var options_for_draggable = {
|
660 |
+
revert: true,
|
661 |
+
quiet: options.quiet,
|
662 |
+
scroll: options.scroll,
|
663 |
+
scrollSpeed: options.scrollSpeed,
|
664 |
+
scrollSensitivity: options.scrollSensitivity,
|
665 |
+
delay: options.delay,
|
666 |
+
ghosting: options.ghosting,
|
667 |
+
constraint: options.constraint,
|
668 |
+
handle: options.handle };
|
669 |
+
|
670 |
+
if(options.starteffect)
|
671 |
+
options_for_draggable.starteffect = options.starteffect;
|
672 |
+
|
673 |
+
if(options.reverteffect)
|
674 |
+
options_for_draggable.reverteffect = options.reverteffect;
|
675 |
+
else
|
676 |
+
if(options.ghosting) options_for_draggable.reverteffect = function(element) {
|
677 |
+
element.style.top = 0;
|
678 |
+
element.style.left = 0;
|
679 |
+
};
|
680 |
+
|
681 |
+
if(options.endeffect)
|
682 |
+
options_for_draggable.endeffect = options.endeffect;
|
683 |
+
|
684 |
+
if(options.zindex)
|
685 |
+
options_for_draggable.zindex = options.zindex;
|
686 |
+
|
687 |
+
// build options for the droppables
|
688 |
+
var options_for_droppable = {
|
689 |
+
overlap: options.overlap,
|
690 |
+
containment: options.containment,
|
691 |
+
tree: options.tree,
|
692 |
+
hoverclass: options.hoverclass,
|
693 |
+
onHover: Sortable.onHover
|
694 |
+
};
|
695 |
+
|
696 |
+
var options_for_tree = {
|
697 |
+
onHover: Sortable.onEmptyHover,
|
698 |
+
overlap: options.overlap,
|
699 |
+
containment: options.containment,
|
700 |
+
hoverclass: options.hoverclass
|
701 |
+
};
|
702 |
+
|
703 |
+
// fix for gecko engine
|
704 |
+
Element.cleanWhitespace(element);
|
705 |
+
|
706 |
+
options.draggables = [];
|
707 |
+
options.droppables = [];
|
708 |
+
|
709 |
+
// drop on empty handling
|
710 |
+
if(options.dropOnEmpty || options.tree) {
|
711 |
+
Droppables.add(element, options_for_tree);
|
712 |
+
options.droppables.push(element);
|
713 |
+
}
|
714 |
+
|
715 |
+
(options.elements || this.findElements(element, options) || []).each( function(e,i) {
|
716 |
+
var handle = options.handles ? $(options.handles[i]) :
|
717 |
+
(options.handle ? $(e).select('.' + options.handle)[0] : e);
|
718 |
+
options.draggables.push(
|
719 |
+
new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
|
720 |
+
Droppables.add(e, options_for_droppable);
|
721 |
+
if(options.tree) e.treeNode = element;
|
722 |
+
options.droppables.push(e);
|
723 |
+
});
|
724 |
+
|
725 |
+
if(options.tree) {
|
726 |
+
(Sortable.findTreeElements(element, options) || []).each( function(e) {
|
727 |
+
Droppables.add(e, options_for_tree);
|
728 |
+
e.treeNode = element;
|
729 |
+
options.droppables.push(e);
|
730 |
+
});
|
731 |
+
}
|
732 |
+
|
733 |
+
// keep reference
|
734 |
+
this.sortables[element.identify()] = options;
|
735 |
+
|
736 |
+
// for onupdate
|
737 |
+
Draggables.addObserver(new SortableObserver(element, options.onUpdate));
|
738 |
+
|
739 |
+
},
|
740 |
+
|
741 |
+
// return all suitable-for-sortable elements in a guaranteed order
|
742 |
+
findElements: function(element, options) {
|
743 |
+
return Element.findChildren(
|
744 |
+
element, options.only, options.tree ? true : false, options.tag);
|
745 |
+
},
|
746 |
+
|
747 |
+
findTreeElements: function(element, options) {
|
748 |
+
return Element.findChildren(
|
749 |
+
element, options.only, options.tree ? true : false, options.treeTag);
|
750 |
+
},
|
751 |
+
|
752 |
+
onHover: function(element, dropon, overlap) {
|
753 |
+
if(Element.isParent(dropon, element)) return;
|
754 |
+
|
755 |
+
if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) {
|
756 |
+
return;
|
757 |
+
} else if(overlap>0.5) {
|
758 |
+
Sortable.mark(dropon, 'before');
|
759 |
+
if(dropon.previousSibling != element) {
|
760 |
+
var oldParentNode = element.parentNode;
|
761 |
+
element.style.visibility = "hidden"; // fix gecko rendering
|
762 |
+
dropon.parentNode.insertBefore(element, dropon);
|
763 |
+
if(dropon.parentNode!=oldParentNode)
|
764 |
+
Sortable.options(oldParentNode).onChange(element);
|
765 |
+
Sortable.options(dropon.parentNode).onChange(element);
|
766 |
+
}
|
767 |
+
} else {
|
768 |
+
Sortable.mark(dropon, 'after');
|
769 |
+
var nextElement = dropon.nextSibling || null;
|
770 |
+
if(nextElement != element) {
|
771 |
+
var oldParentNode = element.parentNode;
|
772 |
+
element.style.visibility = "hidden"; // fix gecko rendering
|
773 |
+
dropon.parentNode.insertBefore(element, nextElement);
|
774 |
+
if(dropon.parentNode!=oldParentNode)
|
775 |
+
Sortable.options(oldParentNode).onChange(element);
|
776 |
+
Sortable.options(dropon.parentNode).onChange(element);
|
777 |
+
}
|
778 |
+
}
|
779 |
+
},
|
780 |
+
|
781 |
+
onEmptyHover: function(element, dropon, overlap) {
|
782 |
+
var oldParentNode = element.parentNode;
|
783 |
+
var droponOptions = Sortable.options(dropon);
|
784 |
+
|
785 |
+
if(!Element.isParent(dropon, element)) {
|
786 |
+
var index;
|
787 |
+
|
788 |
+
var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only});
|
789 |
+
var child = null;
|
790 |
+
|
791 |
+
if(children) {
|
792 |
+
var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap);
|
793 |
+
|
794 |
+
for (index = 0; index < children.length; index += 1) {
|
795 |
+
if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) {
|
796 |
+
offset -= Element.offsetSize (children[index], droponOptions.overlap);
|
797 |
+
} else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) {
|
798 |
+
child = index + 1 < children.length ? children[index + 1] : null;
|
799 |
+
break;
|
800 |
+
} else {
|
801 |
+
child = children[index];
|
802 |
+
break;
|
803 |
+
}
|
804 |
+
}
|
805 |
+
}
|
806 |
+
|
807 |
+
dropon.insertBefore(element, child);
|
808 |
+
|
809 |
+
Sortable.options(oldParentNode).onChange(element);
|
810 |
+
droponOptions.onChange(element);
|
811 |
+
}
|
812 |
+
},
|
813 |
+
|
814 |
+
unmark: function() {
|
815 |
+
if(Sortable._marker) Sortable._marker.hide();
|
816 |
+
},
|
817 |
+
|
818 |
+
mark: function(dropon, position) {
|
819 |
+
// mark on ghosting only
|
820 |
+
var sortable = Sortable.options(dropon.parentNode);
|
821 |
+
if(sortable && !sortable.ghosting) return;
|
822 |
+
|
823 |
+
if(!Sortable._marker) {
|
824 |
+
Sortable._marker =
|
825 |
+
($('dropmarker') || Element.extend(document.createElement('DIV'))).
|
826 |
+
hide().addClassName('dropmarker').setStyle({position:'absolute'});
|
827 |
+
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
|
828 |
+
}
|
829 |
+
var offsets = dropon.cumulativeOffset();
|
830 |
+
Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'});
|
831 |
+
|
832 |
+
if(position=='after')
|
833 |
+
if(sortable.overlap == 'horizontal')
|
834 |
+
Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'});
|
835 |
+
else
|
836 |
+
Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'});
|
837 |
+
|
838 |
+
Sortable._marker.show();
|
839 |
+
},
|
840 |
+
|
841 |
+
_tree: function(element, options, parent) {
|
842 |
+
var children = Sortable.findElements(element, options) || [];
|
843 |
+
|
844 |
+
for (var i = 0; i < children.length; ++i) {
|
845 |
+
var match = children[i].id.match(options.format);
|
846 |
+
|
847 |
+
if (!match) continue;
|
848 |
+
|
849 |
+
var child = {
|
850 |
+
id: encodeURIComponent(match ? match[1] : null),
|
851 |
+
element: element,
|
852 |
+
parent: parent,
|
853 |
+
children: [],
|
854 |
+
position: parent.children.length,
|
855 |
+
container: $(children[i]).down(options.treeTag)
|
856 |
+
};
|
857 |
+
|
858 |
+
/* Get the element containing the children and recurse over it */
|
859 |
+
if (child.container)
|
860 |
+
this._tree(child.container, options, child);
|
861 |
+
|
862 |
+
parent.children.push (child);
|
863 |
+
}
|
864 |
+
|
865 |
+
return parent;
|
866 |
+
},
|
867 |
+
|
868 |
+
tree: function(element) {
|
869 |
+
element = $(element);
|
870 |
+
var sortableOptions = this.options(element);
|
871 |
+
var options = Object.extend({
|
872 |
+
tag: sortableOptions.tag,
|
873 |
+
treeTag: sortableOptions.treeTag,
|
874 |
+
only: sortableOptions.only,
|
875 |
+
name: element.id,
|
876 |
+
format: sortableOptions.format
|
877 |
+
}, arguments[1] || { });
|
878 |
+
|
879 |
+
var root = {
|
880 |
+
id: null,
|
881 |
+
parent: null,
|
882 |
+
children: [],
|
883 |
+
container: element,
|
884 |
+
position: 0
|
885 |
+
};
|
886 |
+
|
887 |
+
return Sortable._tree(element, options, root);
|
888 |
+
},
|
889 |
+
|
890 |
+
/* Construct a [i] index for a particular node */
|
891 |
+
_constructIndex: function(node) {
|
892 |
+
var index = '';
|
893 |
+
do {
|
894 |
+
if (node.id) index = '[' + node.position + ']' + index;
|
895 |
+
} while ((node = node.parent) != null);
|
896 |
+
return index;
|
897 |
+
},
|
898 |
+
|
899 |
+
sequence: function(element) {
|
900 |
+
element = $(element);
|
901 |
+
var options = Object.extend(this.options(element), arguments[1] || { });
|
902 |
+
|
903 |
+
return $(this.findElements(element, options) || []).map( function(item) {
|
904 |
+
return item.id.match(options.format) ? item.id.match(options.format)[1] : '';
|
905 |
+
});
|
906 |
+
},
|
907 |
+
|
908 |
+
setSequence: function(element, new_sequence) {
|
909 |
+
element = $(element);
|
910 |
+
var options = Object.extend(this.options(element), arguments[2] || { });
|
911 |
+
|
912 |
+
var nodeMap = { };
|
913 |
+
this.findElements(element, options).each( function(n) {
|
914 |
+
if (n.id.match(options.format))
|
915 |
+
nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode];
|
916 |
+
n.parentNode.removeChild(n);
|
917 |
+
});
|
918 |
+
|
919 |
+
new_sequence.each(function(ident) {
|
920 |
+
var n = nodeMap[ident];
|
921 |
+
if (n) {
|
922 |
+
n[1].appendChild(n[0]);
|
923 |
+
delete nodeMap[ident];
|
924 |
+
}
|
925 |
+
});
|
926 |
+
},
|
927 |
+
|
928 |
+
serialize: function(element) {
|
929 |
+
element = $(element);
|
930 |
+
var options = Object.extend(Sortable.options(element), arguments[1] || { });
|
931 |
+
var name = encodeURIComponent(
|
932 |
+
(arguments[1] && arguments[1].name) ? arguments[1].name : element.id);
|
933 |
+
|
934 |
+
if (options.tree) {
|
935 |
+
return Sortable.tree(element, arguments[1]).children.map( function (item) {
|
936 |
+
return [name + Sortable._constructIndex(item) + "[id]=" +
|
937 |
+
encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
|
938 |
+
}).flatten().join('&');
|
939 |
+
} else {
|
940 |
+
return Sortable.sequence(element, arguments[1]).map( function(item) {
|
941 |
+
return name + "[]=" + encodeURIComponent(item);
|
942 |
+
}).join('&');
|
943 |
+
}
|
944 |
+
}
|
945 |
+
};
|
946 |
+
|
947 |
+
// Returns true if child is contained within element
|
948 |
+
Element.isParent = function(child, element) {
|
949 |
+
if (!child.parentNode || child == element) return false;
|
950 |
+
if (child.parentNode == element) return true;
|
951 |
+
return Element.isParent(child.parentNode, element);
|
952 |
+
};
|
953 |
+
|
954 |
+
Element.findChildren = function(element, only, recursive, tagName) {
|
955 |
+
if(!element.hasChildNodes()) return null;
|
956 |
+
tagName = tagName.toUpperCase();
|
957 |
+
if(only) only = [only].flatten();
|
958 |
+
var elements = [];
|
959 |
+
$A(element.childNodes).each( function(e) {
|
960 |
+
if(e.tagName && e.tagName.toUpperCase()==tagName &&
|
961 |
+
(!only || (Element.classNames(e).detect(function(v) { return only.include(v) }))))
|
962 |
+
elements.push(e);
|
963 |
+
if(recursive) {
|
964 |
+
var grandchildren = Element.findChildren(e, only, recursive, tagName);
|
965 |
+
if(grandchildren) elements.push(grandchildren);
|
966 |
+
}
|
967 |
+
});
|
968 |
+
|
969 |
+
return (elements.length>0 ? elements.flatten() : []);
|
970 |
+
};
|
971 |
+
|
972 |
+
Element.offsetSize = function (element, type) {
|
973 |
+
return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];
|
974 |
+
};
|
skin/frontend/base/default/js/ajaxwishlist/lightview/effects.js
ADDED
@@ -0,0 +1,1123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// script.aculo.us effects.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
|
2 |
+
|
3 |
+
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
4 |
+
// Contributors:
|
5 |
+
// Justin Palmer (http://encytemedia.com/)
|
6 |
+
// Mark Pilgrim (http://diveintomark.org/)
|
7 |
+
// Martin Bialasinki
|
8 |
+
//
|
9 |
+
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
10 |
+
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
11 |
+
|
12 |
+
// converts rgb() and #xxx to #xxxxxx format,
|
13 |
+
// returns self (or first argument) if not convertable
|
14 |
+
String.prototype.parseColor = function() {
|
15 |
+
var color = '#';
|
16 |
+
if (this.slice(0,4) == 'rgb(') {
|
17 |
+
var cols = this.slice(4,this.length-1).split(',');
|
18 |
+
var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
|
19 |
+
} else {
|
20 |
+
if (this.slice(0,1) == '#') {
|
21 |
+
if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();
|
22 |
+
if (this.length==7) color = this.toLowerCase();
|
23 |
+
}
|
24 |
+
}
|
25 |
+
return (color.length==7 ? color : (arguments[0] || this));
|
26 |
+
};
|
27 |
+
|
28 |
+
/*--------------------------------------------------------------------------*/
|
29 |
+
|
30 |
+
Element.collectTextNodes = function(element) {
|
31 |
+
return $A($(element).childNodes).collect( function(node) {
|
32 |
+
return (node.nodeType==3 ? node.nodeValue :
|
33 |
+
(node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
|
34 |
+
}).flatten().join('');
|
35 |
+
};
|
36 |
+
|
37 |
+
Element.collectTextNodesIgnoreClass = function(element, className) {
|
38 |
+
return $A($(element).childNodes).collect( function(node) {
|
39 |
+
return (node.nodeType==3 ? node.nodeValue :
|
40 |
+
((node.hasChildNodes() && !Element.hasClassName(node,className)) ?
|
41 |
+
Element.collectTextNodesIgnoreClass(node, className) : ''));
|
42 |
+
}).flatten().join('');
|
43 |
+
};
|
44 |
+
|
45 |
+
Element.setContentZoom = function(element, percent) {
|
46 |
+
element = $(element);
|
47 |
+
element.setStyle({fontSize: (percent/100) + 'em'});
|
48 |
+
if (Prototype.Browser.WebKit) window.scrollBy(0,0);
|
49 |
+
return element;
|
50 |
+
};
|
51 |
+
|
52 |
+
Element.getInlineOpacity = function(element){
|
53 |
+
return $(element).style.opacity || '';
|
54 |
+
};
|
55 |
+
|
56 |
+
Element.forceRerendering = function(element) {
|
57 |
+
try {
|
58 |
+
element = $(element);
|
59 |
+
var n = document.createTextNode(' ');
|
60 |
+
element.appendChild(n);
|
61 |
+
element.removeChild(n);
|
62 |
+
} catch(e) { }
|
63 |
+
};
|
64 |
+
|
65 |
+
/*--------------------------------------------------------------------------*/
|
66 |
+
|
67 |
+
var Effect = {
|
68 |
+
_elementDoesNotExistError: {
|
69 |
+
name: 'ElementDoesNotExistError',
|
70 |
+
message: 'The specified DOM element does not exist, but is required for this effect to operate'
|
71 |
+
},
|
72 |
+
Transitions: {
|
73 |
+
linear: Prototype.K,
|
74 |
+
sinoidal: function(pos) {
|
75 |
+
return (-Math.cos(pos*Math.PI)/2) + .5;
|
76 |
+
},
|
77 |
+
reverse: function(pos) {
|
78 |
+
return 1-pos;
|
79 |
+
},
|
80 |
+
flicker: function(pos) {
|
81 |
+
var pos = ((-Math.cos(pos*Math.PI)/4) + .75) + Math.random()/4;
|
82 |
+
return pos > 1 ? 1 : pos;
|
83 |
+
},
|
84 |
+
wobble: function(pos) {
|
85 |
+
return (-Math.cos(pos*Math.PI*(9*pos))/2) + .5;
|
86 |
+
},
|
87 |
+
pulse: function(pos, pulses) {
|
88 |
+
return (-Math.cos((pos*((pulses||5)-.5)*2)*Math.PI)/2) + .5;
|
89 |
+
},
|
90 |
+
spring: function(pos) {
|
91 |
+
return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6));
|
92 |
+
},
|
93 |
+
none: function(pos) {
|
94 |
+
return 0;
|
95 |
+
},
|
96 |
+
full: function(pos) {
|
97 |
+
return 1;
|
98 |
+
}
|
99 |
+
},
|
100 |
+
DefaultOptions: {
|
101 |
+
duration: 1.0, // seconds
|
102 |
+
fps: 100, // 100= assume 66fps max.
|
103 |
+
sync: false, // true for combining
|
104 |
+
from: 0.0,
|
105 |
+
to: 1.0,
|
106 |
+
delay: 0.0,
|
107 |
+
queue: 'parallel'
|
108 |
+
},
|
109 |
+
tagifyText: function(element) {
|
110 |
+
var tagifyStyle = 'position:relative';
|
111 |
+
if (Prototype.Browser.IE) tagifyStyle += ';zoom:1';
|
112 |
+
|
113 |
+
element = $(element);
|
114 |
+
$A(element.childNodes).each( function(child) {
|
115 |
+
if (child.nodeType==3) {
|
116 |
+
child.nodeValue.toArray().each( function(character) {
|
117 |
+
element.insertBefore(
|
118 |
+
new Element('span', {style: tagifyStyle}).update(
|
119 |
+
character == ' ' ? String.fromCharCode(160) : character),
|
120 |
+
child);
|
121 |
+
});
|
122 |
+
Element.remove(child);
|
123 |
+
}
|
124 |
+
});
|
125 |
+
},
|
126 |
+
multiple: function(element, effect) {
|
127 |
+
var elements;
|
128 |
+
if (((typeof element == 'object') ||
|
129 |
+
Object.isFunction(element)) &&
|
130 |
+
(element.length))
|
131 |
+
elements = element;
|
132 |
+
else
|
133 |
+
elements = $(element).childNodes;
|
134 |
+
|
135 |
+
var options = Object.extend({
|
136 |
+
speed: 0.1,
|
137 |
+
delay: 0.0
|
138 |
+
}, arguments[2] || { });
|
139 |
+
var masterDelay = options.delay;
|
140 |
+
|
141 |
+
$A(elements).each( function(element, index) {
|
142 |
+
new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay }));
|
143 |
+
});
|
144 |
+
},
|
145 |
+
PAIRS: {
|
146 |
+
'slide': ['SlideDown','SlideUp'],
|
147 |
+
'blind': ['BlindDown','BlindUp'],
|
148 |
+
'appear': ['Appear','Fade']
|
149 |
+
},
|
150 |
+
toggle: function(element, effect, options) {
|
151 |
+
element = $(element);
|
152 |
+
effect = (effect || 'appear').toLowerCase();
|
153 |
+
|
154 |
+
return Effect[ Effect.PAIRS[ effect ][ element.visible() ? 1 : 0 ] ](element, Object.extend({
|
155 |
+
queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
|
156 |
+
}, options || {}));
|
157 |
+
}
|
158 |
+
};
|
159 |
+
|
160 |
+
Effect.DefaultOptions.transition = Effect.Transitions.sinoidal;
|
161 |
+
|
162 |
+
/* ------------- core effects ------------- */
|
163 |
+
|
164 |
+
Effect.ScopedQueue = Class.create(Enumerable, {
|
165 |
+
initialize: function() {
|
166 |
+
this.effects = [];
|
167 |
+
this.interval = null;
|
168 |
+
},
|
169 |
+
_each: function(iterator) {
|
170 |
+
this.effects._each(iterator);
|
171 |
+
},
|
172 |
+
add: function(effect) {
|
173 |
+
var timestamp = new Date().getTime();
|
174 |
+
|
175 |
+
var position = Object.isString(effect.options.queue) ?
|
176 |
+
effect.options.queue : effect.options.queue.position;
|
177 |
+
|
178 |
+
switch(position) {
|
179 |
+
case 'front':
|
180 |
+
// move unstarted effects after this effect
|
181 |
+
this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
|
182 |
+
e.startOn += effect.finishOn;
|
183 |
+
e.finishOn += effect.finishOn;
|
184 |
+
});
|
185 |
+
break;
|
186 |
+
case 'with-last':
|
187 |
+
timestamp = this.effects.pluck('startOn').max() || timestamp;
|
188 |
+
break;
|
189 |
+
case 'end':
|
190 |
+
// start effect after last queued effect has finished
|
191 |
+
timestamp = this.effects.pluck('finishOn').max() || timestamp;
|
192 |
+
break;
|
193 |
+
}
|
194 |
+
|
195 |
+
effect.startOn += timestamp;
|
196 |
+
effect.finishOn += timestamp;
|
197 |
+
|
198 |
+
if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
|
199 |
+
this.effects.push(effect);
|
200 |
+
|
201 |
+
if (!this.interval)
|
202 |
+
this.interval = setInterval(this.loop.bind(this), 15);
|
203 |
+
},
|
204 |
+
remove: function(effect) {
|
205 |
+
this.effects = this.effects.reject(function(e) { return e==effect });
|
206 |
+
if (this.effects.length == 0) {
|
207 |
+
clearInterval(this.interval);
|
208 |
+
this.interval = null;
|
209 |
+
}
|
210 |
+
},
|
211 |
+
loop: function() {
|
212 |
+
var timePos = new Date().getTime();
|
213 |
+
for(var i=0, len=this.effects.length;i<len;i++)
|
214 |
+
this.effects[i] && this.effects[i].loop(timePos);
|
215 |
+
}
|
216 |
+
});
|
217 |
+
|
218 |
+
Effect.Queues = {
|
219 |
+
instances: $H(),
|
220 |
+
get: function(queueName) {
|
221 |
+
if (!Object.isString(queueName)) return queueName;
|
222 |
+
|
223 |
+
return this.instances.get(queueName) ||
|
224 |
+
this.instances.set(queueName, new Effect.ScopedQueue());
|
225 |
+
}
|
226 |
+
};
|
227 |
+
Effect.Queue = Effect.Queues.get('global');
|
228 |
+
|
229 |
+
Effect.Base = Class.create({
|
230 |
+
position: null,
|
231 |
+
start: function(options) {
|
232 |
+
if (options && options.transition === false) options.transition = Effect.Transitions.linear;
|
233 |
+
this.options = Object.extend(Object.extend({ },Effect.DefaultOptions), options || { });
|
234 |
+
this.currentFrame = 0;
|
235 |
+
this.state = 'idle';
|
236 |
+
this.startOn = this.options.delay*1000;
|
237 |
+
this.finishOn = this.startOn+(this.options.duration*1000);
|
238 |
+
this.fromToDelta = this.options.to-this.options.from;
|
239 |
+
this.totalTime = this.finishOn-this.startOn;
|
240 |
+
this.totalFrames = this.options.fps*this.options.duration;
|
241 |
+
|
242 |
+
this.render = (function() {
|
243 |
+
function dispatch(effect, eventName) {
|
244 |
+
if (effect.options[eventName + 'Internal'])
|
245 |
+
effect.options[eventName + 'Internal'](effect);
|
246 |
+
if (effect.options[eventName])
|
247 |
+
effect.options[eventName](effect);
|
248 |
+
}
|
249 |
+
|
250 |
+
return function(pos) {
|
251 |
+
if (this.state === "idle") {
|
252 |
+
this.state = "running";
|
253 |
+
dispatch(this, 'beforeSetup');
|
254 |
+
if (this.setup) this.setup();
|
255 |
+
dispatch(this, 'afterSetup');
|
256 |
+
}
|
257 |
+
if (this.state === "running") {
|
258 |
+
pos = (this.options.transition(pos) * this.fromToDelta) + this.options.from;
|
259 |
+
this.position = pos;
|
260 |
+
dispatch(this, 'beforeUpdate');
|
261 |
+
if (this.update) this.update(pos);
|
262 |
+
dispatch(this, 'afterUpdate');
|
263 |
+
}
|
264 |
+
};
|
265 |
+
})();
|
266 |
+
|
267 |
+
this.event('beforeStart');
|
268 |
+
if (!this.options.sync)
|
269 |
+
Effect.Queues.get(Object.isString(this.options.queue) ?
|
270 |
+
'global' : this.options.queue.scope).add(this);
|
271 |
+
},
|
272 |
+
loop: function(timePos) {
|
273 |
+
if (timePos >= this.startOn) {
|
274 |
+
if (timePos >= this.finishOn) {
|
275 |
+
this.render(1.0);
|
276 |
+
this.cancel();
|
277 |
+
this.event('beforeFinish');
|
278 |
+
if (this.finish) this.finish();
|
279 |
+
this.event('afterFinish');
|
280 |
+
return;
|
281 |
+
}
|
282 |
+
var pos = (timePos - this.startOn) / this.totalTime,
|
283 |
+
frame = (pos * this.totalFrames).round();
|
284 |
+
if (frame > this.currentFrame) {
|
285 |
+
this.render(pos);
|
286 |
+
this.currentFrame = frame;
|
287 |
+
}
|
288 |
+
}
|
289 |
+
},
|
290 |
+
cancel: function() {
|
291 |
+
if (!this.options.sync)
|
292 |
+
Effect.Queues.get(Object.isString(this.options.queue) ?
|
293 |
+
'global' : this.options.queue.scope).remove(this);
|
294 |
+
this.state = 'finished';
|
295 |
+
},
|
296 |
+
event: function(eventName) {
|
297 |
+
if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this);
|
298 |
+
if (this.options[eventName]) this.options[eventName](this);
|
299 |
+
},
|
300 |
+
inspect: function() {
|
301 |
+
var data = $H();
|
302 |
+
for(property in this)
|
303 |
+
if (!Object.isFunction(this[property])) data.set(property, this[property]);
|
304 |
+
return '#<Effect:' + data.inspect() + ',options:' + $H(this.options).inspect() + '>';
|
305 |
+
}
|
306 |
+
});
|
307 |
+
|
308 |
+
Effect.Parallel = Class.create(Effect.Base, {
|
309 |
+
initialize: function(effects) {
|
310 |
+
this.effects = effects || [];
|
311 |
+
this.start(arguments[1]);
|
312 |
+
},
|
313 |
+
update: function(position) {
|
314 |
+
this.effects.invoke('render', position);
|
315 |
+
},
|
316 |
+
finish: function(position) {
|
317 |
+
this.effects.each( function(effect) {
|
318 |
+
effect.render(1.0);
|
319 |
+
effect.cancel();
|
320 |
+
effect.event('beforeFinish');
|
321 |
+
if (effect.finish) effect.finish(position);
|
322 |
+
effect.event('afterFinish');
|
323 |
+
});
|
324 |
+
}
|
325 |
+
});
|
326 |
+
|
327 |
+
Effect.Tween = Class.create(Effect.Base, {
|
328 |
+
initialize: function(object, from, to) {
|
329 |
+
object = Object.isString(object) ? $(object) : object;
|
330 |
+
var args = $A(arguments), method = args.last(),
|
331 |
+
options = args.length == 5 ? args[3] : null;
|
332 |
+
this.method = Object.isFunction(method) ? method.bind(object) :
|
333 |
+
Object.isFunction(object[method]) ? object[method].bind(object) :
|
334 |
+
function(value) { object[method] = value };
|
335 |
+
this.start(Object.extend({ from: from, to: to }, options || { }));
|
336 |
+
},
|
337 |
+
update: function(position) {
|
338 |
+
this.method(position);
|
339 |
+
}
|
340 |
+
});
|
341 |
+
|
342 |
+
Effect.Event = Class.create(Effect.Base, {
|
343 |
+
initialize: function() {
|
344 |
+
this.start(Object.extend({ duration: 0 }, arguments[0] || { }));
|
345 |
+
},
|
346 |
+
update: Prototype.emptyFunction
|
347 |
+
});
|
348 |
+
|
349 |
+
Effect.Opacity = Class.create(Effect.Base, {
|
350 |
+
initialize: function(element) {
|
351 |
+
this.element = $(element);
|
352 |
+
if (!this.element) throw(Effect._elementDoesNotExistError);
|
353 |
+
// make this work on IE on elements without 'layout'
|
354 |
+
if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
|
355 |
+
this.element.setStyle({zoom: 1});
|
356 |
+
var options = Object.extend({
|
357 |
+
from: this.element.getOpacity() || 0.0,
|
358 |
+
to: 1.0
|
359 |
+
}, arguments[1] || { });
|
360 |
+
this.start(options);
|
361 |
+
},
|
362 |
+
update: function(position) {
|
363 |
+
this.element.setOpacity(position);
|
364 |
+
}
|
365 |
+
});
|
366 |
+
|
367 |
+
Effect.Move = Class.create(Effect.Base, {
|
368 |
+
initialize: function(element) {
|
369 |
+
this.element = $(element);
|
370 |
+
if (!this.element) throw(Effect._elementDoesNotExistError);
|
371 |
+
var options = Object.extend({
|
372 |
+
x: 0,
|
373 |
+
y: 0,
|
374 |
+
mode: 'relative'
|
375 |
+
}, arguments[1] || { });
|
376 |
+
this.start(options);
|
377 |
+
},
|
378 |
+
setup: function() {
|
379 |
+
this.element.makePositioned();
|
380 |
+
this.originalLeft = parseFloat(this.element.getStyle('left') || '0');
|
381 |
+
this.originalTop = parseFloat(this.element.getStyle('top') || '0');
|
382 |
+
if (this.options.mode == 'absolute') {
|
383 |
+
this.options.x = this.options.x - this.originalLeft;
|
384 |
+
this.options.y = this.options.y - this.originalTop;
|
385 |
+
}
|
386 |
+
},
|
387 |
+
update: function(position) {
|
388 |
+
this.element.setStyle({
|
389 |
+
left: (this.options.x * position + this.originalLeft).round() + 'px',
|
390 |
+
top: (this.options.y * position + this.originalTop).round() + 'px'
|
391 |
+
});
|
392 |
+
}
|
393 |
+
});
|
394 |
+
|
395 |
+
// for backwards compatibility
|
396 |
+
Effect.MoveBy = function(element, toTop, toLeft) {
|
397 |
+
return new Effect.Move(element,
|
398 |
+
Object.extend({ x: toLeft, y: toTop }, arguments[3] || { }));
|
399 |
+
};
|
400 |
+
|
401 |
+
Effect.Scale = Class.create(Effect.Base, {
|
402 |
+
initialize: function(element, percent) {
|
403 |
+
this.element = $(element);
|
404 |
+
if (!this.element) throw(Effect._elementDoesNotExistError);
|
405 |
+
var options = Object.extend({
|
406 |
+
scaleX: true,
|
407 |
+
scaleY: true,
|
408 |
+
scaleContent: true,
|
409 |
+
scaleFromCenter: false,
|
410 |
+
scaleMode: 'box', // 'box' or 'contents' or { } with provided values
|
411 |
+
scaleFrom: 100.0,
|
412 |
+
scaleTo: percent
|
413 |
+
}, arguments[2] || { });
|
414 |
+
this.start(options);
|
415 |
+
},
|
416 |
+
setup: function() {
|
417 |
+
this.restoreAfterFinish = this.options.restoreAfterFinish || false;
|
418 |
+
this.elementPositioning = this.element.getStyle('position');
|
419 |
+
|
420 |
+
this.originalStyle = { };
|
421 |
+
['top','left','width','height','fontSize'].each( function(k) {
|
422 |
+
this.originalStyle[k] = this.element.style[k];
|
423 |
+
}.bind(this));
|
424 |
+
|
425 |
+
this.originalTop = this.element.offsetTop;
|
426 |
+
this.originalLeft = this.element.offsetLeft;
|
427 |
+
|
428 |
+
var fontSize = this.element.getStyle('font-size') || '100%';
|
429 |
+
['em','px','%','pt'].each( function(fontSizeType) {
|
430 |
+
if (fontSize.indexOf(fontSizeType)>0) {
|
431 |
+
this.fontSize = parseFloat(fontSize);
|
432 |
+
this.fontSizeType = fontSizeType;
|
433 |
+
}
|
434 |
+
}.bind(this));
|
435 |
+
|
436 |
+
this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
|
437 |
+
|
438 |
+
this.dims = null;
|
439 |
+
if (this.options.scaleMode=='box')
|
440 |
+
this.dims = [this.element.offsetHeight, this.element.offsetWidth];
|
441 |
+
if (/^content/.test(this.options.scaleMode))
|
442 |
+
this.dims = [this.element.scrollHeight, this.element.scrollWidth];
|
443 |
+
if (!this.dims)
|
444 |
+
this.dims = [this.options.scaleMode.originalHeight,
|
445 |
+
this.options.scaleMode.originalWidth];
|
446 |
+
},
|
447 |
+
update: function(position) {
|
448 |
+
var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position);
|
449 |
+
if (this.options.scaleContent && this.fontSize)
|
450 |
+
this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType });
|
451 |
+
this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale);
|
452 |
+
},
|
453 |
+
finish: function(position) {
|
454 |
+
if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
|
455 |
+
},
|
456 |
+
setDimensions: function(height, width) {
|
457 |
+
var d = { };
|
458 |
+
if (this.options.scaleX) d.width = width.round() + 'px';
|
459 |
+
if (this.options.scaleY) d.height = height.round() + 'px';
|
460 |
+
if (this.options.scaleFromCenter) {
|
461 |
+
var topd = (height - this.dims[0])/2;
|
462 |
+
var leftd = (width - this.dims[1])/2;
|
463 |
+
if (this.elementPositioning == 'absolute') {
|
464 |
+
if (this.options.scaleY) d.top = this.originalTop-topd + 'px';
|
465 |
+
if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px';
|
466 |
+
} else {
|
467 |
+
if (this.options.scaleY) d.top = -topd + 'px';
|
468 |
+
if (this.options.scaleX) d.left = -leftd + 'px';
|
469 |
+
}
|
470 |
+
}
|
471 |
+
this.element.setStyle(d);
|
472 |
+
}
|
473 |
+
});
|
474 |
+
|
475 |
+
Effect.Highlight = Class.create(Effect.Base, {
|
476 |
+
initialize: function(element) {
|
477 |
+
this.element = $(element);
|
478 |
+
if (!this.element) throw(Effect._elementDoesNotExistError);
|
479 |
+
var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { });
|
480 |
+
this.start(options);
|
481 |
+
},
|
482 |
+
setup: function() {
|
483 |
+
// Prevent executing on elements not in the layout flow
|
484 |
+
if (this.element.getStyle('display')=='none') { this.cancel(); return; }
|
485 |
+
// Disable background image during the effect
|
486 |
+
this.oldStyle = { };
|
487 |
+
if (!this.options.keepBackgroundImage) {
|
488 |
+
this.oldStyle.backgroundImage = this.element.getStyle('background-image');
|
489 |
+
this.element.setStyle({backgroundImage: 'none'});
|
490 |
+
}
|
491 |
+
if (!this.options.endcolor)
|
492 |
+
this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
|
493 |
+
if (!this.options.restorecolor)
|
494 |
+
this.options.restorecolor = this.element.getStyle('background-color');
|
495 |
+
// init color calculations
|
496 |
+
this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this));
|
497 |
+
this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this));
|
498 |
+
},
|
499 |
+
update: function(position) {
|
500 |
+
this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){
|
501 |
+
return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) });
|
502 |
+
},
|
503 |
+
finish: function() {
|
504 |
+
this.element.setStyle(Object.extend(this.oldStyle, {
|
505 |
+
backgroundColor: this.options.restorecolor
|
506 |
+
}));
|
507 |
+
}
|
508 |
+
});
|
509 |
+
|
510 |
+
Effect.ScrollTo = function(element) {
|
511 |
+
var options = arguments[1] || { },
|
512 |
+
scrollOffsets = document.viewport.getScrollOffsets(),
|
513 |
+
elementOffsets = $(element).cumulativeOffset();
|
514 |
+
|
515 |
+
if (options.offset) elementOffsets[1] += options.offset;
|
516 |
+
|
517 |
+
return new Effect.Tween(null,
|
518 |
+
scrollOffsets.top,
|
519 |
+
elementOffsets[1],
|
520 |
+
options,
|
521 |
+
function(p){ scrollTo(scrollOffsets.left, p.round()); }
|
522 |
+
);
|
523 |
+
};
|
524 |
+
|
525 |
+
/* ------------- combination effects ------------- */
|
526 |
+
|
527 |
+
Effect.Fade = function(element) {
|
528 |
+
element = $(element);
|
529 |
+
var oldOpacity = element.getInlineOpacity();
|
530 |
+
var options = Object.extend({
|
531 |
+
from: element.getOpacity() || 1.0,
|
532 |
+
to: 0.0,
|
533 |
+
afterFinishInternal: function(effect) {
|
534 |
+
if (effect.options.to!=0) return;
|
535 |
+
effect.element.hide().setStyle({opacity: oldOpacity});
|
536 |
+
}
|
537 |
+
}, arguments[1] || { });
|
538 |
+
return new Effect.Opacity(element,options);
|
539 |
+
};
|
540 |
+
|
541 |
+
Effect.Appear = function(element) {
|
542 |
+
element = $(element);
|
543 |
+
var options = Object.extend({
|
544 |
+
from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0),
|
545 |
+
to: 1.0,
|
546 |
+
// force Safari to render floated elements properly
|
547 |
+
afterFinishInternal: function(effect) {
|
548 |
+
effect.element.forceRerendering();
|
549 |
+
},
|
550 |
+
beforeSetup: function(effect) {
|
551 |
+
effect.element.setOpacity(effect.options.from).show();
|
552 |
+
}}, arguments[1] || { });
|
553 |
+
return new Effect.Opacity(element,options);
|
554 |
+
};
|
555 |
+
|
556 |
+
Effect.Puff = function(element) {
|
557 |
+
element = $(element);
|
558 |
+
var oldStyle = {
|
559 |
+
opacity: element.getInlineOpacity(),
|
560 |
+
position: element.getStyle('position'),
|
561 |
+
top: element.style.top,
|
562 |
+
left: element.style.left,
|
563 |
+
width: element.style.width,
|
564 |
+
height: element.style.height
|
565 |
+
};
|
566 |
+
return new Effect.Parallel(
|
567 |
+
[ new Effect.Scale(element, 200,
|
568 |
+
{ sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }),
|
569 |
+
new Effect.Opacity(element, { sync: true, to: 0.0 } ) ],
|
570 |
+
Object.extend({ duration: 1.0,
|
571 |
+
beforeSetupInternal: function(effect) {
|
572 |
+
Position.absolutize(effect.effects[0].element);
|
573 |
+
},
|
574 |
+
afterFinishInternal: function(effect) {
|
575 |
+
effect.effects[0].element.hide().setStyle(oldStyle); }
|
576 |
+
}, arguments[1] || { })
|
577 |
+
);
|
578 |
+
};
|
579 |
+
|
580 |
+
Effect.BlindUp = function(element) {
|
581 |
+
element = $(element);
|
582 |
+
element.makeClipping();
|
583 |
+
return new Effect.Scale(element, 0,
|
584 |
+
Object.extend({ scaleContent: false,
|
585 |
+
scaleX: false,
|
586 |
+
restoreAfterFinish: true,
|
587 |
+
afterFinishInternal: function(effect) {
|
588 |
+
effect.element.hide().undoClipping();
|
589 |
+
}
|
590 |
+
}, arguments[1] || { })
|
591 |
+
);
|
592 |
+
};
|
593 |
+
|
594 |
+
Effect.BlindDown = function(element) {
|
595 |
+
element = $(element);
|
596 |
+
var elementDimensions = element.getDimensions();
|
597 |
+
return new Effect.Scale(element, 100, Object.extend({
|
598 |
+
scaleContent: false,
|
599 |
+
scaleX: false,
|
600 |
+
scaleFrom: 0,
|
601 |
+
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
602 |
+
restoreAfterFinish: true,
|
603 |
+
afterSetup: function(effect) {
|
604 |
+
effect.element.makeClipping().setStyle({height: '0px'}).show();
|
605 |
+
},
|
606 |
+
afterFinishInternal: function(effect) {
|
607 |
+
effect.element.undoClipping();
|
608 |
+
}
|
609 |
+
}, arguments[1] || { }));
|
610 |
+
};
|
611 |
+
|
612 |
+
Effect.SwitchOff = function(element) {
|
613 |
+
element = $(element);
|
614 |
+
var oldOpacity = element.getInlineOpacity();
|
615 |
+
return new Effect.Appear(element, Object.extend({
|
616 |
+
duration: 0.4,
|
617 |
+
from: 0,
|
618 |
+
transition: Effect.Transitions.flicker,
|
619 |
+
afterFinishInternal: function(effect) {
|
620 |
+
new Effect.Scale(effect.element, 1, {
|
621 |
+
duration: 0.3, scaleFromCenter: true,
|
622 |
+
scaleX: false, scaleContent: false, restoreAfterFinish: true,
|
623 |
+
beforeSetup: function(effect) {
|
624 |
+
effect.element.makePositioned().makeClipping();
|
625 |
+
},
|
626 |
+
afterFinishInternal: function(effect) {
|
627 |
+
effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
|
628 |
+
}
|
629 |
+
});
|
630 |
+
}
|
631 |
+
}, arguments[1] || { }));
|
632 |
+
};
|
633 |
+
|
634 |
+
Effect.DropOut = function(element) {
|
635 |
+
element = $(element);
|
636 |
+
var oldStyle = {
|
637 |
+
top: element.getStyle('top'),
|
638 |
+
left: element.getStyle('left'),
|
639 |
+
opacity: element.getInlineOpacity() };
|
640 |
+
return new Effect.Parallel(
|
641 |
+
[ new Effect.Move(element, {x: 0, y: 100, sync: true }),
|
642 |
+
new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
|
643 |
+
Object.extend(
|
644 |
+
{ duration: 0.5,
|
645 |
+
beforeSetup: function(effect) {
|
646 |
+
effect.effects[0].element.makePositioned();
|
647 |
+
},
|
648 |
+
afterFinishInternal: function(effect) {
|
649 |
+
effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
|
650 |
+
}
|
651 |
+
}, arguments[1] || { }));
|
652 |
+
};
|
653 |
+
|
654 |
+
Effect.Shake = function(element) {
|
655 |
+
element = $(element);
|
656 |
+
var options = Object.extend({
|
657 |
+
distance: 20,
|
658 |
+
duration: 0.5
|
659 |
+
}, arguments[1] || {});
|
660 |
+
var distance = parseFloat(options.distance);
|
661 |
+
var split = parseFloat(options.duration) / 10.0;
|
662 |
+
var oldStyle = {
|
663 |
+
top: element.getStyle('top'),
|
664 |
+
left: element.getStyle('left') };
|
665 |
+
return new Effect.Move(element,
|
666 |
+
{ x: distance, y: 0, duration: split, afterFinishInternal: function(effect) {
|
667 |
+
new Effect.Move(effect.element,
|
668 |
+
{ x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) {
|
669 |
+
new Effect.Move(effect.element,
|
670 |
+
{ x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) {
|
671 |
+
new Effect.Move(effect.element,
|
672 |
+
{ x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) {
|
673 |
+
new Effect.Move(effect.element,
|
674 |
+
{ x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) {
|
675 |
+
new Effect.Move(effect.element,
|
676 |
+
{ x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) {
|
677 |
+
effect.element.undoPositioned().setStyle(oldStyle);
|
678 |
+
}}); }}); }}); }}); }}); }});
|
679 |
+
};
|
680 |
+
|
681 |
+
Effect.SlideDown = function(element) {
|
682 |
+
element = $(element).cleanWhitespace();
|
683 |
+
// SlideDown need to have the content of the element wrapped in a container element with fixed height!
|
684 |
+
var oldInnerBottom = element.down().getStyle('bottom');
|
685 |
+
var elementDimensions = element.getDimensions();
|
686 |
+
return new Effect.Scale(element, 100, Object.extend({
|
687 |
+
scaleContent: false,
|
688 |
+
scaleX: false,
|
689 |
+
scaleFrom: window.opera ? 0 : 1,
|
690 |
+
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
691 |
+
restoreAfterFinish: true,
|
692 |
+
afterSetup: function(effect) {
|
693 |
+
effect.element.makePositioned();
|
694 |
+
effect.element.down().makePositioned();
|
695 |
+
if (window.opera) effect.element.setStyle({top: ''});
|
696 |
+
effect.element.makeClipping().setStyle({height: '0px'}).show();
|
697 |
+
},
|
698 |
+
afterUpdateInternal: function(effect) {
|
699 |
+
effect.element.down().setStyle({bottom:
|
700 |
+
(effect.dims[0] - effect.element.clientHeight) + 'px' });
|
701 |
+
},
|
702 |
+
afterFinishInternal: function(effect) {
|
703 |
+
effect.element.undoClipping().undoPositioned();
|
704 |
+
effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); }
|
705 |
+
}, arguments[1] || { })
|
706 |
+
);
|
707 |
+
};
|
708 |
+
|
709 |
+
Effect.SlideUp = function(element) {
|
710 |
+
element = $(element).cleanWhitespace();
|
711 |
+
var oldInnerBottom = element.down().getStyle('bottom');
|
712 |
+
var elementDimensions = element.getDimensions();
|
713 |
+
return new Effect.Scale(element, window.opera ? 0 : 1,
|
714 |
+
Object.extend({ scaleContent: false,
|
715 |
+
scaleX: false,
|
716 |
+
scaleMode: 'box',
|
717 |
+
scaleFrom: 100,
|
718 |
+
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
719 |
+
restoreAfterFinish: true,
|
720 |
+
afterSetup: function(effect) {
|
721 |
+
effect.element.makePositioned();
|
722 |
+
effect.element.down().makePositioned();
|
723 |
+
if (window.opera) effect.element.setStyle({top: ''});
|
724 |
+
effect.element.makeClipping().show();
|
725 |
+
},
|
726 |
+
afterUpdateInternal: function(effect) {
|
727 |
+
effect.element.down().setStyle({bottom:
|
728 |
+
(effect.dims[0] - effect.element.clientHeight) + 'px' });
|
729 |
+
},
|
730 |
+
afterFinishInternal: function(effect) {
|
731 |
+
effect.element.hide().undoClipping().undoPositioned();
|
732 |
+
effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom});
|
733 |
+
}
|
734 |
+
}, arguments[1] || { })
|
735 |
+
);
|
736 |
+
};
|
737 |
+
|
738 |
+
// Bug in opera makes the TD containing this element expand for a instance after finish
|
739 |
+
Effect.Squish = function(element) {
|
740 |
+
return new Effect.Scale(element, window.opera ? 1 : 0, {
|
741 |
+
restoreAfterFinish: true,
|
742 |
+
beforeSetup: function(effect) {
|
743 |
+
effect.element.makeClipping();
|
744 |
+
},
|
745 |
+
afterFinishInternal: function(effect) {
|
746 |
+
effect.element.hide().undoClipping();
|
747 |
+
}
|
748 |
+
});
|
749 |
+
};
|
750 |
+
|
751 |
+
Effect.Grow = function(element) {
|
752 |
+
element = $(element);
|
753 |
+
var options = Object.extend({
|
754 |
+
direction: 'center',
|
755 |
+
moveTransition: Effect.Transitions.sinoidal,
|
756 |
+
scaleTransition: Effect.Transitions.sinoidal,
|
757 |
+
opacityTransition: Effect.Transitions.full
|
758 |
+
}, arguments[1] || { });
|
759 |
+
var oldStyle = {
|
760 |
+
top: element.style.top,
|
761 |
+
left: element.style.left,
|
762 |
+
height: element.style.height,
|
763 |
+
width: element.style.width,
|
764 |
+
opacity: element.getInlineOpacity() };
|
765 |
+
|
766 |
+
var dims = element.getDimensions();
|
767 |
+
var initialMoveX, initialMoveY;
|
768 |
+
var moveX, moveY;
|
769 |
+
|
770 |
+
switch (options.direction) {
|
771 |
+
case 'top-left':
|
772 |
+
initialMoveX = initialMoveY = moveX = moveY = 0;
|
773 |
+
break;
|
774 |
+
case 'top-right':
|
775 |
+
initialMoveX = dims.width;
|
776 |
+
initialMoveY = moveY = 0;
|
777 |
+
moveX = -dims.width;
|
778 |
+
break;
|
779 |
+
case 'bottom-left':
|
780 |
+
initialMoveX = moveX = 0;
|
781 |
+
initialMoveY = dims.height;
|
782 |
+
moveY = -dims.height;
|
783 |
+
break;
|
784 |
+
case 'bottom-right':
|
785 |
+
initialMoveX = dims.width;
|
786 |
+
initialMoveY = dims.height;
|
787 |
+
moveX = -dims.width;
|
788 |
+
moveY = -dims.height;
|
789 |
+
break;
|
790 |
+
case 'center':
|
791 |
+
initialMoveX = dims.width / 2;
|
792 |
+
initialMoveY = dims.height / 2;
|
793 |
+
moveX = -dims.width / 2;
|
794 |
+
moveY = -dims.height / 2;
|
795 |
+
break;
|
796 |
+
}
|
797 |
+
|
798 |
+
return new Effect.Move(element, {
|
799 |
+
x: initialMoveX,
|
800 |
+
y: initialMoveY,
|
801 |
+
duration: 0.01,
|
802 |
+
beforeSetup: function(effect) {
|
803 |
+
effect.element.hide().makeClipping().makePositioned();
|
804 |
+
},
|
805 |
+
afterFinishInternal: function(effect) {
|
806 |
+
new Effect.Parallel(
|
807 |
+
[ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
|
808 |
+
new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
|
809 |
+
new Effect.Scale(effect.element, 100, {
|
810 |
+
scaleMode: { originalHeight: dims.height, originalWidth: dims.width },
|
811 |
+
sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
|
812 |
+
], Object.extend({
|
813 |
+
beforeSetup: function(effect) {
|
814 |
+
effect.effects[0].element.setStyle({height: '0px'}).show();
|
815 |
+
},
|
816 |
+
afterFinishInternal: function(effect) {
|
817 |
+
effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);
|
818 |
+
}
|
819 |
+
}, options)
|
820 |
+
);
|
821 |
+
}
|
822 |
+
});
|
823 |
+
};
|
824 |
+
|
825 |
+
Effect.Shrink = function(element) {
|
826 |
+
element = $(element);
|
827 |
+
var options = Object.extend({
|
828 |
+
direction: 'center',
|
829 |
+
moveTransition: Effect.Transitions.sinoidal,
|
830 |
+
scaleTransition: Effect.Transitions.sinoidal,
|
831 |
+
opacityTransition: Effect.Transitions.none
|
832 |
+
}, arguments[1] || { });
|
833 |
+
var oldStyle = {
|
834 |
+
top: element.style.top,
|
835 |
+
left: element.style.left,
|
836 |
+
height: element.style.height,
|
837 |
+
width: element.style.width,
|
838 |
+
opacity: element.getInlineOpacity() };
|
839 |
+
|
840 |
+
var dims = element.getDimensions();
|
841 |
+
var moveX, moveY;
|
842 |
+
|
843 |
+
switch (options.direction) {
|
844 |
+
case 'top-left':
|
845 |
+
moveX = moveY = 0;
|
846 |
+
break;
|
847 |
+
case 'top-right':
|
848 |
+
moveX = dims.width;
|
849 |
+
moveY = 0;
|
850 |
+
break;
|
851 |
+
case 'bottom-left':
|
852 |
+
moveX = 0;
|
853 |
+
moveY = dims.height;
|
854 |
+
break;
|
855 |
+
case 'bottom-right':
|
856 |
+
moveX = dims.width;
|
857 |
+
moveY = dims.height;
|
858 |
+
break;
|
859 |
+
case 'center':
|
860 |
+
moveX = dims.width / 2;
|
861 |
+
moveY = dims.height / 2;
|
862 |
+
break;
|
863 |
+
}
|
864 |
+
|
865 |
+
return new Effect.Parallel(
|
866 |
+
[ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
|
867 |
+
new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
|
868 |
+
new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
|
869 |
+
], Object.extend({
|
870 |
+
beforeStartInternal: function(effect) {
|
871 |
+
effect.effects[0].element.makePositioned().makeClipping();
|
872 |
+
},
|
873 |
+
afterFinishInternal: function(effect) {
|
874 |
+
effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
|
875 |
+
}, options)
|
876 |
+
);
|
877 |
+
};
|
878 |
+
|
879 |
+
Effect.Pulsate = function(element) {
|
880 |
+
element = $(element);
|
881 |
+
var options = arguments[1] || { },
|
882 |
+
oldOpacity = element.getInlineOpacity(),
|
883 |
+
transition = options.transition || Effect.Transitions.linear,
|
884 |
+
reverser = function(pos){
|
885 |
+
return 1 - transition((-Math.cos((pos*(options.pulses||5)*2)*Math.PI)/2) + .5);
|
886 |
+
};
|
887 |
+
|
888 |
+
return new Effect.Opacity(element,
|
889 |
+
Object.extend(Object.extend({ duration: 2.0, from: 0,
|
890 |
+
afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
|
891 |
+
}, options), {transition: reverser}));
|
892 |
+
};
|
893 |
+
|
894 |
+
Effect.Fold = function(element) {
|
895 |
+
element = $(element);
|
896 |
+
var oldStyle = {
|
897 |
+
top: element.style.top,
|
898 |
+
left: element.style.left,
|
899 |
+
width: element.style.width,
|
900 |
+
height: element.style.height };
|
901 |
+
element.makeClipping();
|
902 |
+
return new Effect.Scale(element, 5, Object.extend({
|
903 |
+
scaleContent: false,
|
904 |
+
scaleX: false,
|
905 |
+
afterFinishInternal: function(effect) {
|
906 |
+
new Effect.Scale(element, 1, {
|
907 |
+
scaleContent: false,
|
908 |
+
scaleY: false,
|
909 |
+
afterFinishInternal: function(effect) {
|
910 |
+
effect.element.hide().undoClipping().setStyle(oldStyle);
|
911 |
+
} });
|
912 |
+
}}, arguments[1] || { }));
|
913 |
+
};
|
914 |
+
|
915 |
+
Effect.Morph = Class.create(Effect.Base, {
|
916 |
+
initialize: function(element) {
|
917 |
+
this.element = $(element);
|
918 |
+
if (!this.element) throw(Effect._elementDoesNotExistError);
|
919 |
+
var options = Object.extend({
|
920 |
+
style: { }
|
921 |
+
}, arguments[1] || { });
|
922 |
+
|
923 |
+
if (!Object.isString(options.style)) this.style = $H(options.style);
|
924 |
+
else {
|
925 |
+
if (options.style.include(':'))
|
926 |
+
this.style = options.style.parseStyle();
|
927 |
+
else {
|
928 |
+
this.element.addClassName(options.style);
|
929 |
+
this.style = $H(this.element.getStyles());
|
930 |
+
this.element.removeClassName(options.style);
|
931 |
+
var css = this.element.getStyles();
|
932 |
+
this.style = this.style.reject(function(style) {
|
933 |
+
return style.value == css[style.key];
|
934 |
+
});
|
935 |
+
options.afterFinishInternal = function(effect) {
|
936 |
+
effect.element.addClassName(effect.options.style);
|
937 |
+
effect.transforms.each(function(transform) {
|
938 |
+
effect.element.style[transform.style] = '';
|
939 |
+
});
|
940 |
+
};
|
941 |
+
}
|
942 |
+
}
|
943 |
+
this.start(options);
|
944 |
+
},
|
945 |
+
|
946 |
+
setup: function(){
|
947 |
+
function parseColor(color){
|
948 |
+
if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
|
949 |
+
color = color.parseColor();
|
950 |
+
return $R(0,2).map(function(i){
|
951 |
+
return parseInt( color.slice(i*2+1,i*2+3), 16 );
|
952 |
+
});
|
953 |
+
}
|
954 |
+
this.transforms = this.style.map(function(pair){
|
955 |
+
var property = pair[0], value = pair[1], unit = null;
|
956 |
+
|
957 |
+
if (value.parseColor('#zzzzzz') != '#zzzzzz') {
|
958 |
+
value = value.parseColor();
|
959 |
+
unit = 'color';
|
960 |
+
} else if (property == 'opacity') {
|
961 |
+
value = parseFloat(value);
|
962 |
+
if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
|
963 |
+
this.element.setStyle({zoom: 1});
|
964 |
+
} else if (Element.CSS_LENGTH.test(value)) {
|
965 |
+
var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/);
|
966 |
+
value = parseFloat(components[1]);
|
967 |
+
unit = (components.length == 3) ? components[2] : null;
|
968 |
+
}
|
969 |
+
|
970 |
+
var originalValue = this.element.getStyle(property);
|
971 |
+
return {
|
972 |
+
style: property.camelize(),
|
973 |
+
originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0),
|
974 |
+
targetValue: unit=='color' ? parseColor(value) : value,
|
975 |
+
unit: unit
|
976 |
+
};
|
977 |
+
}.bind(this)).reject(function(transform){
|
978 |
+
return (
|
979 |
+
(transform.originalValue == transform.targetValue) ||
|
980 |
+
(
|
981 |
+
transform.unit != 'color' &&
|
982 |
+
(isNaN(transform.originalValue) || isNaN(transform.targetValue))
|
983 |
+
)
|
984 |
+
);
|
985 |
+
});
|
986 |
+
},
|
987 |
+
update: function(position) {
|
988 |
+
var style = { }, transform, i = this.transforms.length;
|
989 |
+
while(i--)
|
990 |
+
style[(transform = this.transforms[i]).style] =
|
991 |
+
transform.unit=='color' ? '#'+
|
992 |
+
(Math.round(transform.originalValue[0]+
|
993 |
+
(transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() +
|
994 |
+
(Math.round(transform.originalValue[1]+
|
995 |
+
(transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() +
|
996 |
+
(Math.round(transform.originalValue[2]+
|
997 |
+
(transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() :
|
998 |
+
(transform.originalValue +
|
999 |
+
(transform.targetValue - transform.originalValue) * position).toFixed(3) +
|
1000 |
+
(transform.unit === null ? '' : transform.unit);
|
1001 |
+
this.element.setStyle(style, true);
|
1002 |
+
}
|
1003 |
+
});
|
1004 |
+
|
1005 |
+
Effect.Transform = Class.create({
|
1006 |
+
initialize: function(tracks){
|
1007 |
+
this.tracks = [];
|
1008 |
+
this.options = arguments[1] || { };
|
1009 |
+
this.addTracks(tracks);
|
1010 |
+
},
|
1011 |
+
addTracks: function(tracks){
|
1012 |
+
tracks.each(function(track){
|
1013 |
+
track = $H(track);
|
1014 |
+
var data = track.values().first();
|
1015 |
+
this.tracks.push($H({
|
1016 |
+
ids: track.keys().first(),
|
1017 |
+
effect: Effect.Morph,
|
1018 |
+
options: { style: data }
|
1019 |
+
}));
|
1020 |
+
}.bind(this));
|
1021 |
+
return this;
|
1022 |
+
},
|
1023 |
+
play: function(){
|
1024 |
+
return new Effect.Parallel(
|
1025 |
+
this.tracks.map(function(track){
|
1026 |
+
var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options');
|
1027 |
+
var elements = [$(ids) || $$(ids)].flatten();
|
1028 |
+
return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) });
|
1029 |
+
}).flatten(),
|
1030 |
+
this.options
|
1031 |
+
);
|
1032 |
+
}
|
1033 |
+
});
|
1034 |
+
|
1035 |
+
Element.CSS_PROPERTIES = $w(
|
1036 |
+
'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' +
|
1037 |
+
'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
|
1038 |
+
'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
|
1039 |
+
'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
|
1040 |
+
'fontSize fontWeight height left letterSpacing lineHeight ' +
|
1041 |
+
'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+
|
1042 |
+
'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
|
1043 |
+
'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
|
1044 |
+
'right textIndent top width wordSpacing zIndex');
|
1045 |
+
|
1046 |
+
Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
|
1047 |
+
|
1048 |
+
String.__parseStyleElement = document.createElement('div');
|
1049 |
+
String.prototype.parseStyle = function(){
|
1050 |
+
var style, styleRules = $H();
|
1051 |
+
if (Prototype.Browser.WebKit)
|
1052 |
+
style = new Element('div',{style:this}).style;
|
1053 |
+
else {
|
1054 |
+
String.__parseStyleElement.innerHTML = '<div style="' + this + '"></div>';
|
1055 |
+
style = String.__parseStyleElement.childNodes[0].style;
|
1056 |
+
}
|
1057 |
+
|
1058 |
+
Element.CSS_PROPERTIES.each(function(property){
|
1059 |
+
if (style[property]) styleRules.set(property, style[property]);
|
1060 |
+
});
|
1061 |
+
|
1062 |
+
if (Prototype.Browser.IE && this.include('opacity'))
|
1063 |
+
styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);
|
1064 |
+
|
1065 |
+
return styleRules;
|
1066 |
+
};
|
1067 |
+
|
1068 |
+
if (document.defaultView && document.defaultView.getComputedStyle) {
|
1069 |
+
Element.getStyles = function(element) {
|
1070 |
+
var css = document.defaultView.getComputedStyle($(element), null);
|
1071 |
+
return Element.CSS_PROPERTIES.inject({ }, function(styles, property) {
|
1072 |
+
styles[property] = css[property];
|
1073 |
+
return styles;
|
1074 |
+
});
|
1075 |
+
};
|
1076 |
+
} else {
|
1077 |
+
Element.getStyles = function(element) {
|
1078 |
+
element = $(element);
|
1079 |
+
var css = element.currentStyle, styles;
|
1080 |
+
styles = Element.CSS_PROPERTIES.inject({ }, function(results, property) {
|
1081 |
+
results[property] = css[property];
|
1082 |
+
return results;
|
1083 |
+
});
|
1084 |
+
if (!styles.opacity) styles.opacity = element.getOpacity();
|
1085 |
+
return styles;
|
1086 |
+
};
|
1087 |
+
}
|
1088 |
+
|
1089 |
+
Effect.Methods = {
|
1090 |
+
morph: function(element, style) {
|
1091 |
+
element = $(element);
|
1092 |
+
new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { }));
|
1093 |
+
return element;
|
1094 |
+
},
|
1095 |
+
visualEffect: function(element, effect, options) {
|
1096 |
+
element = $(element);
|
1097 |
+
var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1);
|
1098 |
+
new Effect[klass](element, options);
|
1099 |
+
return element;
|
1100 |
+
},
|
1101 |
+
highlight: function(element, options) {
|
1102 |
+
element = $(element);
|
1103 |
+
new Effect.Highlight(element, options);
|
1104 |
+
return element;
|
1105 |
+
}
|
1106 |
+
};
|
1107 |
+
|
1108 |
+
$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+
|
1109 |
+
'pulsate shake puff squish switchOff dropOut').each(
|
1110 |
+
function(effect) {
|
1111 |
+
Effect.Methods[effect] = function(element, options){
|
1112 |
+
element = $(element);
|
1113 |
+
Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options);
|
1114 |
+
return element;
|
1115 |
+
};
|
1116 |
+
}
|
1117 |
+
);
|
1118 |
+
|
1119 |
+
$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each(
|
1120 |
+
function(f) { Effect.Methods[f] = Element[f]; }
|
1121 |
+
);
|
1122 |
+
|
1123 |
+
Element.addMethods(Effect.Methods);
|
skin/frontend/base/default/js/ajaxwishlist/lightview/lightview.js
ADDED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Lightview 2.8.0 - 28-10-2011
|
2 |
+
* Copyright (c) 2008-2011 Nick Stakenburg (http://www.nickstakenburg.com)
|
3 |
+
*
|
4 |
+
* Licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License
|
5 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/
|
6 |
+
*
|
7 |
+
* More information on this project:
|
8 |
+
* http://www.nickstakenburg.com/projects/lightview/
|
9 |
+
*
|
10 |
+
*/
|
11 |
+
|
12 |
+
;
|
13 |
+
var Lightview = {
|
14 |
+
Version: '2.8.0',
|
15 |
+
// Configuration
|
16 |
+
options: {
|
17 |
+
backgroundColor: '#ffffff', // Background color of the view
|
18 |
+
border: 12, // Size of the border
|
19 |
+
buttons: {
|
20 |
+
opacity: {// Opacity of inner buttons
|
21 |
+
disabled: 0.4,
|
22 |
+
normal: 0.75,
|
23 |
+
hover: 1
|
24 |
+
},
|
25 |
+
side: {display: true}, // Toggle side buttons
|
26 |
+
innerPreviousNext: {display: true}, // Toggle the inner previous and next button
|
27 |
+
slideshow: {display: true}, // Toggle slideshow button
|
28 |
+
topclose: {side: 'right'} // 'right' or 'left'
|
29 |
+
},
|
30 |
+
controller: {// The controller is used on sets
|
31 |
+
backgroundColor: '#4d4d4d',
|
32 |
+
border: 6,
|
33 |
+
buttons: {
|
34 |
+
innerPreviousNext: true,
|
35 |
+
side: false
|
36 |
+
},
|
37 |
+
margin: 18,
|
38 |
+
opacity: 0.7,
|
39 |
+
radius: 6,
|
40 |
+
setNumberTemplate: '#{position} / #{total}'
|
41 |
+
},
|
42 |
+
cyclic: false, // Makes galleries cyclic, no end/begin
|
43 |
+
effectDurations: {
|
44 |
+
resize: .45,
|
45 |
+
sideButtons: {
|
46 |
+
show: .2,
|
47 |
+
hide: .2
|
48 |
+
},
|
49 |
+
content: {
|
50 |
+
appear: .2,
|
51 |
+
fade: .2
|
52 |
+
}
|
53 |
+
},
|
54 |
+
images: '../images/lightview/', // The directory of the images, from this file
|
55 |
+
imgNumberTemplate: '#{position} / #{total}',
|
56 |
+
keyboard: true, // Toggle keyboard buttons
|
57 |
+
menubarPadding: 6, // Space between menubar and content in px
|
58 |
+
overlay: {// Overlay
|
59 |
+
background: '#000', // Background color, Mac Firefox & Mac Safari use overlay.png
|
60 |
+
close: true,
|
61 |
+
opacity: 0.75,
|
62 |
+
display: true
|
63 |
+
},
|
64 |
+
preloadHover: false, // Preload images on mouseover
|
65 |
+
radius: 12, // Corner radius of the border
|
66 |
+
removeTitles: true, // Set to false if you want to keep title attributes intact
|
67 |
+
slideshowDelay: 5, // Delay in seconds before showing the next slide
|
68 |
+
titleSplit: '::', // The characters you want to split title with
|
69 |
+
transition: function(pos) { // Or your own transition
|
70 |
+
return ((pos /= 0.5) < 1 ? 0.5 * Math.pow(pos, 4) :
|
71 |
+
-0.5 * ((pos -= 2) * Math.pow(pos, 3) - 2));
|
72 |
+
},
|
73 |
+
viewport: true, // Stay within the viewport, true is recommended
|
74 |
+
zIndex: 5000, // zIndex of #lightview, #overlay is this -1
|
75 |
+
|
76 |
+
startDimensions: {// Dimensions Lightview starts at
|
77 |
+
width: 100,
|
78 |
+
height: 100
|
79 |
+
},
|
80 |
+
closeDimensions: {// Modify if you've changed the close button images
|
81 |
+
large: {width: 77, height: 22},
|
82 |
+
small: {width: 25, height: 22}
|
83 |
+
},
|
84 |
+
sideDimensions: {// Modify if you've changed the side button images
|
85 |
+
width: 16,
|
86 |
+
height: 22
|
87 |
+
},
|
88 |
+
defaultOptions: {// Default options for each type of view
|
89 |
+
image: {
|
90 |
+
menubar: 'bottom',
|
91 |
+
closeButton: 'large'
|
92 |
+
},
|
93 |
+
gallery: {
|
94 |
+
menubar: 'bottom',
|
95 |
+
closeButton: 'large'
|
96 |
+
},
|
97 |
+
ajax: {
|
98 |
+
width: 400,
|
99 |
+
height: 300,
|
100 |
+
menubar: 'top',
|
101 |
+
closeButton: 'small',
|
102 |
+
overflow: 'auto'
|
103 |
+
},
|
104 |
+
iframe: {
|
105 |
+
width: 400,
|
106 |
+
height: 300,
|
107 |
+
menubar: 'top',
|
108 |
+
scrolling: true,
|
109 |
+
closeButton: 'small'
|
110 |
+
},
|
111 |
+
inline: {
|
112 |
+
width: 400,
|
113 |
+
height: 300,
|
114 |
+
menubar: 'top',
|
115 |
+
closeButton: 'small',
|
116 |
+
overflow: 'auto'
|
117 |
+
},
|
118 |
+
flash: {
|
119 |
+
width: 400,
|
120 |
+
height: 300,
|
121 |
+
menubar: 'bottom',
|
122 |
+
closeButton: 'large'
|
123 |
+
},
|
124 |
+
quicktime: {
|
125 |
+
width: 480,
|
126 |
+
height: 220,
|
127 |
+
autoplay: true,
|
128 |
+
controls: true,
|
129 |
+
closeButton: 'large'
|
130 |
+
}
|
131 |
+
}
|
132 |
+
},
|
133 |
+
classids: {
|
134 |
+
quicktime: 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
|
135 |
+
flash: 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
|
136 |
+
},
|
137 |
+
codebases: {
|
138 |
+
quicktime: 'http://www.apple.com/qtactivex/qtplugin.cab',
|
139 |
+
flash: 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0'
|
140 |
+
},
|
141 |
+
errors: {
|
142 |
+
requiresPlugin: "<div class='message'>The content your are attempting to view requires the <span class='type'>#{type}</span> plugin.</div><div class='pluginspage'><p>Please download and install the required plugin from:</p><a href='#{pluginspage}' target='_blank'>#{pluginspage}</a></div>"
|
143 |
+
},
|
144 |
+
mimetypes: {
|
145 |
+
quicktime: 'video/quicktime',
|
146 |
+
flash: 'application/x-shockwave-flash'
|
147 |
+
},
|
148 |
+
pluginspages: {
|
149 |
+
quicktime: 'http://www.apple.com/quicktime/download',
|
150 |
+
flash: 'http://www.adobe.com/go/getflashplayer'
|
151 |
+
},
|
152 |
+
// used with auto detection
|
153 |
+
typeExtensions: {
|
154 |
+
flash: 'swf',
|
155 |
+
image: 'bmp gif jpeg jpg png',
|
156 |
+
iframe: 'asp aspx cgi cfm htm html jsp php pl php3 php4 php5 phtml rb rhtml shtml txt',
|
157 |
+
quicktime: 'avi mov mpg mpeg movie'
|
158 |
+
}
|
159 |
+
};
|
160 |
+
|
161 |
+
eval(function(p, a, c, k, e, r) {
|
162 |
+
e = function(c) {
|
163 |
+
return(c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
|
164 |
+
};
|
165 |
+
if (!''.replace(/^/, String)) {
|
166 |
+
while (c--)
|
167 |
+
r[e(c)] = k[c] || e(c);
|
168 |
+
k = [function(e) {
|
169 |
+
return r[e]
|
170 |
+
}];
|
171 |
+
e = function() {
|
172 |
+
return'\\w+'
|
173 |
+
};
|
174 |
+
c = 1
|
175 |
+
}
|
176 |
+
;
|
177 |
+
while (c--)
|
178 |
+
if (k[c])
|
179 |
+
p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
|
180 |
+
return p
|
181 |
+
}('(9(){9 p(a,b){(""+b).1e==1&&(b="0"+b);D c=(""+a).1e,d=(""+b).1e;J c<d&&(a="0".5H(d-c)+a),{R:a,2S:b}}9 h(a){D b={};J S.5I(a).X(9(c){b[c]=a[c]+"B"}),b}D n=!!U.89("2T").4s,k=1b.1K.2n&&9(a){J(a=/8a ([\\d.]+)/.8b(a))?3R(a[1]):-1}(2C.3S)<7,l=1b.1K.4t&&!U.3k,m=1b.1K.5J&&9(){D a=2C.3S.3l(/8c\\:(\\d+)/);J a&&3R(a[1])<2}(2C.3S),o=!!2C.3S.3l(/8d/i)&&(l||m);S.19(L.r.2U,{1L:{N:.15,22:.15}}),S.19(L,{8e:"1.7",8f:"1.8.3",I:{R:"4u",2V:"K"},4v:9(a){(8g 1q[a]=="8h"||6.4w(1q[a].8i)<6.4w(6["5K"+a]))&&8j("L 8k "+a+" >= "+6["5K"+a])},4w:9(a){D b=a.2o(/5L.*|\\./g,""),b=4x(b+"0".5H(4-b.1e));J a.1P("5L")>-1?b-1:b},4y:9(){6.4v("1b"),1q.2D&&1q.$&&1q.$==1q.2D&&8l("L 8m 2D 4z 5M 8n 8o 2D.4A 5N, 8p 8q 2W be 5N 4B L 2W 8r.\\n\\8s 4z 8t 2D.4A 5O 8u 4z 5M 2D 8v, 8w 2W 8x 8y 8z?")&&(1q.8A.Y="8B://8C.8D.5P/2D.4A/"),1q.P&&!1q.5Q&&6.4v("5Q");M(/^(8E?:\\/\\/|\\/)/.3T(6.r.10))6.10=6.r.10;1w{D a=/K(?:-[\\w\\d.]+)?\\.8F(.*)/;6.10=(($$("8G[1k]").5R(9(b){J b.1k.3l(a)})||{}).1k||"").2o(a,"")+6.r.10}n||(U.4C>=8&&!U.5S.3m?U.5S.8H("3m","8I:8J-8K-5P:8L","#4D#5T"):U.11("4E:3n",9(){U.8M().8N="3m\\\\:*{8O:3o(#4D#5T)}"}))},4F:9(){6.2E=6.r.2E,6.12=6.2E>6.r.12?6.2E:6.r.12,6.1M=6.r.1M,6.1C=6.r.1C,6.3U()}}),S.19(L,{5U:14,1R:9(){D a=8P.8Q;a.4G++,a.4G==6.5U&&17.4H.5V(U.1S,"K:3n")}}),L.1R.4G=0,S.19(L,{3U:9(){6.K=u C("F",{2F:"K"});D a,b,c=h(6.1C);l&&(6.K.T=9(){J 6.v("18:-2X;W:-2X;1a:1D;"),6},6.K.N=9(){J 6.v("1a:1f"),6},6.K.1f=9(){J 6.1E("1a")=="1f"&&3R(6.1E("W").2o("B",""))>-5W}),$(U.1S).E(6.23=(u C("F",{2F:"5X"})).v({2p:6.r.2p-1,R:!m&&!k?"3V":"2G",2Y:o?"3o("+6.10+"23.1j) W 18 2Z":6.r.23.2Y}).1c(o?1:6.r.23.1s).T()).E(6.K.v({2p:6.r.2p,W:"-2X",18:"-2X"}).1c(0).E(6.5Y=(u C("F",{G:"8R"})).E(6.30=(u C("F",{G:"8S"})).E(6.5Z=(u C("F",{G:"8T"})).v(b=S.19({1x:-1*6.1C.y+"B"},c)).E(6.3W=(u C("F",{G:"4I"})).v(S.19({1x:6.1C.y+"B"},c)).E(u C("F",{G:"1t"})))).E(6.60=(u C("F",{G:"8U"})).v(S.19({61:-1*6.1C.y+"B"},c)).E(6.3X=(u C("F",{G:"4I"})).v(b).E(u C("F",{G:"1t"}))))).E(6.62=(u C("F",{G:"63"})).E(6.3p=(u C("F",{G:"4I 8V"})).E(6.8W=u C("F",{G:"1t"})))).E((u C("F",{G:"8X"})).E((u C("F",{G:"64 8Y"})).E(a=(u C("F",{G:"8Z"})).v({z:6.12+"B"}).E((u C("F",{G:"65 90"})).E((u C("F",{G:"66"})).E(u C("F",{G:"24"})).E((u C("F",{G:"2H"})).v({18:6.12+"B"})))).E(u C("F",{G:"67"})).E((u C("F",{G:"65 91"})).E((u C("F",{G:"66"})).v("1y-W: "+ -1*6.12+"B").E(u C("F",{G:"24"})).E((u C("F",{G:"2H"})).v("18: "+ -1*6.12+"B")))))).E(6.3Y=(u C("F",{G:"92"})).v("z: "+(93-6.12)+"B").E((u C("F",{G:"94"})).E((u C("F",{G:"68"})).v("1y-W: "+6.12+"B").E(6.2q=(u C("F",{G:"95"})).1c(0).v("31: 0 "+6.12+"B").E(6.69=u C("F",{G:"96 2H"})).E(6.1d=(u C("F",{G:"97 6a"})).E(6.2r=(u C("F",{G:"1t 6b"})).v(h(6.r.1M.3Z)).v({2Y:6.r.O}).1c(6.r.1r.1s.2I)).E(6.2s=(u C("F",{G:"98"})).E(6.4J=(u C("F",{G:"99"})).E(6.1u=u C("F",{G:"9a"})).E(6.1T=u C("F",{G:"9b"}))).E(6.4K=(u C("F",{G:"9c"})).E(6.3q=(u C("F",{G:"9d"})).E(6.4L=(u C("F",{G:"1t 9e"})).1c(6.r.1r.1s.2I).v({O:6.r.O}).1z(6.10+"9f.1j",{O:6.r.O})).E(6.3r=u C("F",{G:"9g"})).E(6.4M=(u C("F",{G:"1t 9h"})).1c(6.r.1r.1s.2I).v({O:6.r.O}).1z(6.10+"9i.1j",{O:6.r.O}))).E(6.2g=(u C("F",{G:"9j"})).E(6.2J=(u C("F",{G:"1t"})).1c(6.r.1r.1s.2I).v({O:6.r.O}).1z(6.10+"6c.1j",{O:6.r.O})))))).E(6.6d=u C("F",{G:"9k "}))))).E(6.32=(u C("F",{G:"6e"})).E(6.9l=(u C("F",{G:"1t"})).v("2Y: 3o("+6.10+"32.4N) W 18 40-2Z")))).E((u C("F",{G:"64 9m"})).E(a.9n(!0))).E(6.1F=(u C("d",{G:"9o"})).T().v("1y-W: "+6.12+"B; 2Y: 3o("+6.10+"9p.4N) W 18 2Z"))))).E((u C("F",{2F:"3s"})).T());D d=u 1U;d.1l=9(){d.1l=1b.26,6.1C={y:d.y,z:d.z};D a=h(6.1C),b;6.30.v({1V:0-(d.z/2).1W()+"B",z:d.z+"B"}),6.5Z.v(b=S.19({1x:-1*6.1C.y+"B"},a)),6.3W.v(S.19({1x:a.y},a)),6.60.v(S.19({61:-1*6.1C.y+"B"},a)),6.3X.v(b),6.1R()}.H(6),d.1k=6.10+"27.1j",$w("2q 1u 1T 3r").3t(9(a){6[a].v({O:6.r.O})}.H(6));D e=6.5Y.28(".24");$w("6f 6g bl br").X(9(a,b){6.2E>0?6.4O(e[b],a):e[b].E(u C("F",{G:"2H"})),e[b].v({y:6.12+"B",z:6.12+"B"}).6h("24"+a.1A()),6.1R()}.H(6)),6.K.28(".67",".2H",".68").33("v",{O:6.r.O});D f={};$w("27 1g 1L").X(9(a){6[a+"34"].2K=a;D b=6.10+a+".1j";a=="1L"?(f[a]=u 1U,f[a].1l=9(){f[a].1l=1b.26,6.1M[a]={y:f[a].y,z:f[a].z};D c=6.r.1r.1L.2K,d=S.19({"6i":c,1V:6.1M[a].z+"B"},h(6.1M[a]));d["31"+c.1A()]=6.12+"B",6[a+"34"].v(d),6.62.v({z:f[a].z+"B",W:-1*6.1M[a].z+"B"}),6[a+"34"].6j().1z(b).v(h(6.1M[a])),6.1R()}.H(6),f[a].1k=6.10+a+".1j"):6[a+"34"].1z(b)},6);D g={};$w("3Z 4P").X(9(a){g[a]=u 1U,g[a].1l=9(){g[a].1l=1b.26,6.1M[a]={y:g[a].y,z:g[a].z},6.1R()}.H(6),g[a].1k=6.10+"6k"+a+".1j"},6);D i=u 1U;i.1l=9(){i.1l=1b.26,6.32.v({y:i.y+"B",z:i.z+"B",1V:-0.5*i.z+.5*6.12+"B",1x:-0.5*i.y+"B"}),6.1R()}.H(6),i.1k=6.10+"32.4N";D j=u 1U;j.1l=9(){j.1l=1b.26;D a={y:j.y+"B",z:j.z+"B"};6.2g.v(a),6.2J.v(a),6.1R()}.H(6),j.1k=6.10+"6l.1j",$w("27 1g").X(9(a){D b=a.1A(),c=u 1U;c.1l=9(){c.1l=1b.26,6["35"+b+"36"].v({y:c.y+"B",z:c.z+"B"}),6.1R()}.H(6),c.1k=6.10+"9q"+a+".1j",6["35"+b+"36"].1F=a},6),$w("2g 3q 3r").X(9(a){6[a].T=6[a].T.1m(9(a,b){J 6.2L.R="2G",a(b),6}),6[a].N=6[a].N.1m(9(a,b){J 6.2L.R="9r",a(b),6})},6),6.K.28("*").33("v",{2p:6.r.2p+1}),6.K.T(),6.1R()},6m:9(){P.2h.2i("K").3t(9(a){a.6n()}),6.1v=1o,6.q.1G()?(6.6o=6.6p,6.Q&&!6.Q.1f()&&(6.Q.v("1a:1D").N(),6.2M.1c(0))):(6.6o=1o,6.Q.T()),!6.q.r.1L&&6.3p.6q("1f")&&6.41(!1),6.6r(),6.6s(),u P.17({I:6.I,1h:9(){$w("W 3u").X(9(a){D b=a.1A();6["2N"+b].1X();D c={};6["2N"+b]=(u C("F",{G:"9s"+b})).T(),c[a]=6["2N"+b],6.2q.E(c)}.H(6))}.H(6)}),6.4Q(),6.13=1o},4R:9(){6.3v&&6.3w&&(6.3w.E({6t:6.3v.v({29:6.3v.6u})}),6.3w.1X(),6.3w=1o)},N:9(a,b){6.1p=1o;D c=S.6v(a);M(S.6w(a)||c){M(c&&a.38("#")){6.N({Y:a,r:S.19({42:!0},b||{})});J}6.1p=$(a);M(!6.1p)J;6.1p.9t(),6.q=6.1p.1N||u L.3x(6.1p)}1w a.Y?(6.1p=$(U.1S),6.q=u L.3x(a)):S.6x(a)&&(6.1p=6.43(6.q.1H)[a],6.q=6.1p.1N);M(6.q.Y){6.6m();M(6.q.1Y()||6.q.1G())M(6.6y(6.q.1H),6.13=6.4S(6.q.1H),6.q.1G())6.44=6.13.1e>1?6.6z:0,6.2t=6.13.9u(9(a){J a.2u()});6.3y(),6.4T();M(6.q.Y!="#3s"&&S.5I(L.4U).6A(" ").1P(6.q.V)>=0&&!L.4U[6.q.V])J $("3s").1n((u 45(6.9v.9w)).3k({V:6.q.V.1A(),4V:6.4W[6.q.V]})),c=$("3s").1Z(),6.N({Y:"#3s",1u:6.q.V.1A()+" 9x 9y",r:c}),!1;c=S.19({1d:"3u",1L:!1,4X:"9z",3z:6.q.1Y()&&6.r.1r.3z.29,4Y:6.r.4Y,2g:6.q.1Y()&&6.r.1r.2g.29||6.2t,2a:"1D",6B:6.r.23.9A,2v:6.r.2v},6.r.9B[6.q.V]||{}),6.q.r=S.19(c,6.q.r),6.q.1G()&&(6.q.r.1L=6.13.1e<=1),!6.q.1u&&!(6.q.1T||6.13&&6.13.1e>1)&&6.q.r.1L&&(6.q.r.1d=!1),6.1I="2N"+(6.q.r.1d=="W"?"6C":"6D");M(6.q.2u()){M(!n&&!6.q.6E){6.q.6E=!0;D d=(u C("3m:3a",{1k:6.q.Y,29:"9C"})).v("z:4Z;y:4Z;");$(U.1S).E(d),C.1X.22(.1,d)}M(6.q.1Y()||6.q.1G())6.R=6.13.1P(6.q),6.6F();(6.1O=6.q.46)?6.47():(6.51(),d=u 1U,d.1l=9(){d.1l=1b.26,6.48(),6.1O={y:d.y,z:d.z},6.47()}.H(6),d.1k=6.q.Y)}1w 6.q.1G()&&(6.R=6.13.1P(6.q)),6.1O=6.q.r.6G?U.2v.1Z():{y:6.q.r.y,z:6.q.r.z},6.47()}},49:9(){9 a(a,b,c){a=$(a),c=h(c),a.1n((u C("6H",{2F:"2j",1k:b,9D:"",9E:"40"})).v(c))}D b=9(){9 b(b,c,d){D b=$(b),e=h(d),f=u 1U;f.1l=9(){2T=u C("2T",e),b.1n(2T);3A{2T.4s("2d").9F(f,0,0,d.y,d.z)}3B(h){a(b,c,d)}}.H(6),f.1k=c}9 c(a,b,c){a=$(a),a.1n((u C("F")).v(h(c)).v({6I:\'6J:6K.6L.6M(1k="\'+b+\'", 4a="52")\'}))}J n?b:c}();J 9(){6.6N(6.q.Y);D c=6.1v||6.1O;M(6.q.2u())6[6.1I].v(h(c)),6.1v?b(6[6.1I],6.q.Y,c):a(6[6.1I],6.q.Y,c);1w M(6.q.53())3C(6.q.V){2b"3D":D c=S.54(6.q.r.3D)||{},d=9(){6.48(),6.q.r.42&&(6[6.1I].v({y:"1B",z:"1B"}),6.1O=6.55(6[6.1I])),u P.17({I:6.I,1h:6.4b.H(6)})}.H(6);c.56=c.56?c.56.1m(9(a,b){d(),a(b)}):d,6.51(),u 9G.9H(6[6.1I],6.q.Y,c);2O;2b"2c":6.1v&&(c.z-=6.2P.z),6[6.1I].1n(6.2c=(u C("2c",{9I:0,9J:0,1k:6.q.Y,2F:"2j",20:"9K"+(6O.9L()*9M).1W(),6P:6.q.r&&6.q.r.6P?"1B":"40"})).v(S.19({12:0,1y:0,31:0},h(c))));2O;2b"4c":c=6.q.Y,c=$(c.57(c.1P("#")+1));M(!c||!c.3E)2O;D e=c.1Z();c.E({6t:6.3w=(u C(c.3E)).T()}),c.6u=c.1E("29"),6.3v=c.N(),6[6.1I].1n(6.3v),6[6.1I].28("28, 3b, 58").X(9(a){6.3F.X(9(b){b.1p==a&&a.v({1a:b.1a})})}.H(6)),6.q.r.42&&(6.1O=e,u P.17({I:6.I,1h:6.4b.H(6)}))}1w{e={1J:"3b",2F:"2j",y:c.y,z:c.z};3C(6.q.V){2b"3c":S.19(e,{4V:6.4W[6.q.V],3d:[{1J:"2e",20:"6Q",2k:6.q.r.6Q},{1J:"2e",20:"52",2k:"9N"},{1J:"2e",20:"Q",2k:6.q.r.59},{1J:"2e",20:"9O",2k:!0},{1J:"2e",20:"1k",2k:6.q.Y},{1J:"2e",20:"6R",2k:6.q.r.6R||!1}]}),S.19(e,1b.1K.2n?{9P:6.9Q[6.q.V],9R:6.9S[6.q.V]}:{2s:6.q.Y,V:6.6S[6.q.V]});2O;2b"3G":S.19(e,{2s:6.q.Y,V:6.6S[6.q.V],9T:"9U",4X:6.q.r.4X,4V:6.4W[6.q.V],3d:[{1J:"2e",20:"9V",2k:6.q.Y},{1J:"2e",20:"9W",2k:"9X"}]}),6.q.r.6T&&e.3d.3H({1J:"2e",20:"9Y",2k:6.q.r.6T})}6[6.1I].v(h(c)).1n(6.5a(e)).v("1a:1D").N(),6.q.4d()&&9(){3A{"6U"6V $("2j")&&$("2j").6U(6.q.r.59)}3B(a){}}.H(6).5V()}}}(),55:9(a){D a=$(a),b=a.9Z(),c=[],d=[];J b.3H(a),b.X(9(b){b!=a&&b.1f()||(c.3H(b),d.3H({29:b.1E("29"),R:b.1E("R"),1a:b.1E("1a")}),b.v({29:"a0",R:"2G",1a:"1f"}))}),b={y:a.a1,z:a.a2},c.X(9(a,b){a.v(d[b])}),b},4e:9(){D a=$("2j");M(a)3C(a.3E.4f()){2b"3b":M(1b.1K.4t&&6.q.4d()){3A{a.6W()}3B(b){}a.a3=""}a.6X?a.1X():a=1b.26;2O;2b"2c":a.1X(),1b.1K.5J&&1q.6Y.2j&&5b 1q.6Y.2j;2O;4D:a.1X()}$w("6D 6C").X(9(a){6["2N"+a].v("y:1B;z:1B;").1n("").T()},6)},6Z:9(){D a=6.1v||6.1O;M(6.q.r.59)3C(6.q.V){2b"3c":a.z+=16}6[(6.1v?"70":"i")+"71"]=a},47:9(){u P.17({I:6.I,1h:6.4g.H(6)})},4g:9(){6.2Q(),6.q.5c()||6.48(),6.q.r.42&&6.q.72()||6.q.5c()||6.4b(),6.q.4h()||u P.17({I:6.I,1h:6.49.H(6)}),6.q.r.1L&&u P.17({I:6.I,1h:6.41.H(6,!0)})},73:9(){u P.17({I:6.I,1h:6.74.H(6)}),6.q.4h()&&u P.17({22:.2,I:6.I,1h:6.49.H(6)}),6.3e&&u P.17({I:6.I,1h:6.75.H(6)}),(6.q.4d()||6.q.a4())&&u P.17({I:6.I,22:.1,1h:C.v.H(6,6[6.1I],"1a:1f")})},2l:9(){P.2h.2i(L.I.2V).5d.1e||6.N(6.2w().2l)},1g:9(){P.2h.2i(L.I.2V).5d.1e||6.N(6.2w().1g)},4b:9(){6.6Z();D a=6.5e(),b=6.76();6.q.r.2v&&(a.y>b.y||a.z>b.z)?6.q.r.6G?(6.1v=b,6.2Q(),a=b):(a=6.77(),6.q.4i()?(b=[b.z/a.z,b.y/a.y,1].a5(),6.1v={y:(6.1O.y*b).1W(),z:(6.1O.z*b).1W()}):6.1v={y:a.y>b.y?b.y:a.y,z:a.z>b.z?b.z:a.z},6.2Q(),a=S.54(6.1v),6.q.4i()&&(a.z+=6.2P.z)):(6.2Q(),6.1v=1o),6.5f(a)},3f:9(a){6.5f(a,{1Q:0})},5f:9(){D a,b,c,d,e,f=9(){D e,f,g;J g=k?9(d){6.K.v({y:(a.y+d*b).3I(0)+"B",z:(a.z+d*c).3I(0)+"B"}),6.3Y.v({z:f-1*6.12+"B"})}:m?9(){D a=6.4j(),b=U.2v.78();6.K.v({R:"2G",1x:0,1V:0,y:e+"B",z:f+"B",18:(b[0]+a.y/2-e/2).3J()+"B",W:(b[1]+a.z/2-f/2).3J()+"B"}),6.3Y.v({z:f-1*6.12+"B"})}:9(){6.K.v({R:"3V",y:e+"B",z:f+"B",1x:((0-e)/2).1W()+"B",1V:((0-f)/2-d).1W()+"B"}),6.3Y.v({z:f-1*6.12+"B"})},9(d){e=(a.y+d*b).3I(0),f=(a.z+d*c).3I(0),g.4k(6,d)}}();J 9(g,h){D i=h||{};a=6.K.1Z(),e=2*6.12,y=g.y?g.y+e:a.y,z=g.z?g.z+e:a.z,6.5g();M(a.y==y&&a.z==z)u P.17({I:6.I,1h:6.5h.H(6,g)});1w{D j={y:y+"B",z:z+"B"};b=y-a.y,c=z-a.z,4x(6.K.1E("1x").2o("B","")),4x(6.K.1E("1V").2o("B","")),d=6.Q.1f()?6.44/2:0,k||S.19(j,{1x:0-y/2+"B",1V:0-z/2+"B"}),i.1Q==0?f.4k(6,1):6.5i=u P.79(6.K,0,1,S.19({1Q:6.r.2U.3f,I:6.I,7a:6.r.7a,1h:6.5h.H(6,g)},i),f.H(6))}}}(),5h:9(a){M(6.2P){D b=6[6.1I],c;6.q.r.2a=="1B"&&(c=b.1Z()),b.v({z:a.z-6.2P.z+"B",y:a.y+"B"});M(6.q.r.2a!="1D"&&(6.q.5c()||6.q.72()))M(1b.1K.2n)M(6.q.r.2a=="1B"){D d=b.1Z();b.v("2a:1f");D e={7b:"1D",7c:"1D"},f=0;c.z>a.z&&(e.7c="1B",e.y=d.y-15,e.a6="7d",f=15),c.y-f>a.y&&(e.7b="1B",e.z=d.z-15,e.a7="7d"),b.v(e)}1w b.v({2a:6.q.r.2a});1w b.v({2a:6.q.r.2a});1w b.v("2a:1D");6.3y(),6.5i=1o,6.73()}},74:9(){u P.17({I:6.I,7e:6.5g.H(6)}),u P.17({I:6.I,1h:9(){6[6.1I].N(),6.2Q(),6.1d.1f()&&6.1d.v("1a:1f").1c(1)}.H(6)}),u P.a8([u P.7f(6.2q,{7g:!0,5j:0,2W:1}),u P.5k(6.30,{7g:!0})],{I:6.I,1Q:6.r.2U.2N.4T,1h:9(){6.1p&&6.1p.4H("K:a9")}.H(6)}),(6.q.1Y()||6.2t&&6.r.Q.1r.2K)&&u P.17({I:6.I,1h:6.7h.H(6)})},6s:9(){9 a(){6.4R(),6.4e()}9 b(a){6.2q.1c(a),6.30.1c(a)}J 9(){6.K.1f()?u P.79(6.K,1,0,{1Q:.2,I:6.I,1h:a.H(6)},b.H(6)):(6.2q.1c(0),6.30.1c(0),6.4e())}}(),7i:9(){$w("4K 2s 4J 1u 1T 3r 3q 4M 4L 2g 2r").X(9(a){C.T(6[a])},6),6.1d.v("1a:1D").1c(0)},2Q:9(){6.7i(),6.q.r.1d?6.1d.N():(6.2P={y:0,z:0},6.5l=0,6.1d.T());M(6.q.1u||6.q.1T)6.4J.N(),6.2s.N();6.q.1u&&6.1u.1n(6.q.1u).N(),6.q.1T&&6.1T.1n(6.q.1T).N();M(6.13&&6.13.1e>1)M(6.q.1G()){D a=p(6.R+1,6.13.1e);6.2f.1n((u 45(6.r.Q.7j)).3k({R:a.R,2S:a.2S})),6.Q.1E("1a")=="1D"&&(6.Q.v("1a:1f"),6.5m&&P.2h.2i("K").1X(6.5m),6.5m=u P.5k(6.2M,{I:6.I,1Q:.1}))}1w 6.2s.N(),6.q.2u()&&(6.4K.N(),6.3q.N(),a=p(6.R+1,6.13.1e),6.3r.N().1n((u 45(6.r.aa)).3k({R:a.R,2S:a.2S})),6.q.r.2g&&(6.2J.N(),6.2g.N()));D b=6.q.1G();M((6.q.r.3z||b)&&6.13.1e>1){D c={27:6.r.2x||6.R!=0,1g:6.r.2x||(6.q.1Y()||b)&&6.2w().1g!=0};$w("27 1g").X(9(a){D d=a.1A(),e=c[a]?"7k":"1B";b?6["Q"+d].v({5n:e}).1c(c[a]?1:6.r.1r.1s.5o):6["35"+d+"36"].v({5n:e}).1c(c[a]?6.r.1r.1s.2I:6.r.1r.1s.5o)}.H(6));M(6.q.r.3z||6.r.Q.3z)6.4L.N(),6.4M.N(),6.3q.N()}6.3K.1c(6.2t?1:6.r.1r.1s.5o).v({5n:6.2t?"7k":"1B"}),6.7l(),6.1d.ab().5R(C.1f)||(6.1d.T(),6.q.r.1d=!1),6.7m()},7l:9(){D a=6.1M.4P.y,b=6.1M.3Z.y,c=6.1v?6.1v.y:6.1O.y,d=0,e=6.q.r.2r||"3Z",f=6.r.ac;6.q.r.1L||6.q.1G()||!6.q.r.2r?f=1o:c>=5p+a&&c<5p+b?(f="4P",d=a):c>=5p+b&&(f=e,d=6.1M[e].y),d>0?(6.2s.N(),6.2r.v({y:d+"B"}).N()):6.2r.T(),f&&6.2r.1z(6.10+"6k"+f+".1j",{O:6.r.O}),6.5l=d},51:9(){6.32.N()},48:9(){6.7n&&P.2h.2i("K").1X(6.7n),u P.7o(6.32,{1Q:.2,I:6.I,22:.2})},7p:9(){M(6.q.2u()){D a=6.r.2x&&6.13.1e>1||6.R!=0,b=6.r.2x&&6.13.1e>1||(6.q.1Y()||6.q.1G())&&6.2w().1g!=0;6.3W[a?"N":"T"](),6.3X[b?"N":"T"]();D c=6.1v||6.1O;6.1F.v({z:c.z+"B",1V:6.12+(6.q.r.1d=="W"?6.1d.5q():0)+"B"}),c=(c.y/2-1+6.12).3J(),a&&(6.1F.E(6.2y=(u C("F",{G:"1t ad"})).v({y:c+"B"})),6.2y.2K="27"),b&&(6.1F.E(6.2z=(u C("F",{G:"1t ae"})).v({y:c+"B"})),6.2z.2K="1g"),(a||b)&&6.1F.N()}},7h:9(){6.q&&6.r.1r.2K.29&&6.q.2u()&&(6.7p(),6.1F.N())},5g:9(){6.2y&&(6.2y=1o),6.2z&&(6.2z=1o),6.1F.1n("").T(),6.3W.T().v({1x:6.1C.y+"B"}),6.3X.T().v({1x:-1*6.1C.y+"B"})},4T:9(){9 a(){6.K.1c(1)}J l||(a=a.1m(9(a,b){a(b),6.K.N()})),9(){6.K.1E("1s")==0&&(6.r.23.29?u P.5k(6.23,{1Q:.2,5j:0,2W:o?1:6.r.23.1s,I:6.I,7e:6.5r.H(6),1h:a.H(6)}):a.4k(6))}}(),T:9(){1b.1K.2n&&6.2c&&6.q.4h()&&6.2c.1X();M(l&&6.q.4d()){D a=$$("3b#2j")[0];M(a)3A{a.6W()}3B(b){}}6.K.1E("1s")!=0&&(6.2R(),6.1F.T(),(!1b.1K.2n||!6.q.4h())&&6.2q.T(),P.2h.2i("5s").5d.1e>0||(P.2h.2i("K").X(9(a){a.6n()}),u P.17({I:6.I,1h:6.4R.H(6)}),u P.7f(6.K,{1Q:.1,5j:1,2W:0,I:{R:"4u",2V:"5s"}}),u P.7o(6.23,{1Q:.16,I:{R:"4u",2V:"5s"},1h:6.7q.H(6)})))},7q:9(){6.4e(),6.K.T(),6.2q.1c(0).N(),6.1F.1n("").T(),6.69.1n("").T(),6.6d.1n("").T(),6.4Q(),6.7r(),6.41(!1,0),u P.17({I:6.I,1h:6.3f.H(6,6.r.af)}),u P.17({I:6.I,1h:9(){6.1p&&6.1p.4H("K:1D"),$w("1p 13 q 1v 2t ag 2N").3t(9(a){6[a]=1o}.H(6))}.H(6)})},7m:9(){6.1d.v("31:0;");D a={},a=6[(6.1v?"70":"i")+"71"].y;6.1d.v({y:a+"B"}),6.2s.v({y:a-6.5l-1+"B"}),a=6.55(6.1d);M(6.q.r.1d)3C(a.z+=6.r.5t,6.q.r.1d){2b"3u":6.1d.v("31:"+6.r.5t+"B 0 0 0");2O;2b"W":6.1d.v("31: 0 0 "+6.r.5t+"B 0")}6.1d.v({y:"7s%"}),6.2P=6.q.r.1d?a:{y:a.y,z:0}},3y:9(){D a,b,c;J c=k?9(){6.K.v({W:"50%",18:"50%"})}:l||m?9(){D b=6.4j(),c=U.2v.78();6.K.v({1x:0,1V:0,18:(c[0]+b.y/2-a.y/2).3J()+"B",W:(c[1]+b.z/2-a.z/2).3J()+"B"})}:9(){6.K.v({R:"3V",18:"50%",W:"50%",1x:(0-a.y/2).1W()+"B",1V:(0-a.z/2-b).1W()+"B"})},9(){a=6.K.1Z(),b=6.Q.1f()?6.44/2:0,c.4k(6)}}(),7t:9(){6.2R(),6.3e=!0,6.1g.H(6).22(.25),6.2J.1z(6.10+"6l.1j",{O:6.r.O}).T(),6.3K.1z(6.10+"7u.1j",{O:6.r.Q.O})},2R:9(){6.3e&&(6.3e=!1),6.5u&&ah(6.5u),6.2J.1z(6.10+"6c.1j",{O:6.r.O}),6.3K.1z(6.10+"7v.1j",{O:6.r.Q.O})},5v:9(){(!6.q.1G()||6.2t)&&6[(6.3e?"4l":"4F")+"ai"]()},75:9(){6.3e&&(6.5u=6.1g.H(6).22(6.r.aj))},ak:9(){$$("a[2A~=K], 3g[2A~=K]").X(9(a){D b=a.1N;b&&(b.3L&&a.7w("1u",b.3L),a.1N=1o)})},43:9(a){D b=a.1P("][");J b>-1&&(a=a.57(0,b+1)),$$(\'a[1H^="\'+a+\'"], 3g[1H^="\'+a+\'"]\')},4S:9(a){J 6.43(a).7x("1N")},7y:9(){$(U.1S).11("2m",6.7z.1i(6)),$w("2B 3h").X(9(a){6.1F.11(a,9(a){D b=a.3i("F");b&&(6.2y&&6.2y==b||6.2z&&6.2z==b)&&6.4m(a)}.1i(6))}.H(6)),6.1F.11("2m",9(a){(a=a.3i("F"))&&(a=6.2y&&6.2y==a?"2l":6.2z&&6.2z==a?"1g":1o)&&6[a].1m(9(a,b){6.2R(),a(b)}).H(6)()}.1i(6)),$w("27 1g").X(9(a){D b=a.1A(),c=9(a,b){6.2R(),a(b)},d=9(a,b){D c=b.1p().1F;(c=="27"&&(6.r.2x||6.R!=0)||c=="1g"&&(6.r.2x||(6.q.1Y()||6.q.1G())&&6.2w().1g!=0))&&a(b)};6[a+"34"].11("2B",6.4m.1i(6)).11("3h",6.4m.1i(6)).11("2m",6[a=="1g"?a:"2l"].1m(c).1i(6)),6["35"+b+"36"].11("2m",6[a=="1g"?a:"2l"].1m(d).1m(c).1i(6)).11("2B",C.1c.7A(6["35"+b+"36"],6.r.1r.1s.7B).1m(d).1i(6)).11("3h",C.1c.7A(6["35"+b+"36"],6.r.1r.1s.2I).1m(d).1i(6)),6["Q"+b].11("2m",6[a=="1g"?a:"2l"].1m(d).1m(c).1i(6))},6);D a=[6.2r,6.2J];l?a.33("1c",1):a.X(9(a){a.11("2B",C.1c.H(6,a,6.r.1r.1s.7B)).11("3h",C.1c.H(6,a,6.r.1r.1s.2I))},6),6.2J.11("2m",6.5v.1i(6)),6.3K.11("2m",6.5v.1i(6));M(l||m)a=9(a,b){6.K.1E("W").5w(0)!="-"&&a(b)},17.11(1q,"3M",6.3y.1m(a).1i(6)),17.11(1q,"3f",6.3y.1m(a).1i(6));m&&17.11(1q,"3f",6.5r.1i(6)),k&&(a=9(){6.Q&&6.Q.v({18:((U.7C.al||0)+U.2v.7D()/2).1W()+"B"})},17.11(1q,"3M",a.1i(6)),17.11(1q,"3f",a.1i(6))),6.r.am&&(6.7E=9(a){D b=a.3i("a[2A~=K], 3g[2A~=K]");b&&(a.4l(),b.1N||u L.3x(b),6.7F(b))}.1i(6),$(U.1S).11("2B",6.7E))},41:9(a){M(!a||!6.3p.6q("1f"))6.7G&&P.2h.2i("an").1X(6.ao),6.7G=u P.7H(6.3p,{2L:{1V:(a?0:6.1M.1L.z)+"B"},1Q:a?6.r.2U.1L.N:0,I:6.I,22:a?6.r.2U.1L.22:0,1h:9(){6.3p.ap("1f",a)}.H(6)})},7I:9(){D a={};J $w("y z").X(9(b){D c=b.1A(),d=U.7C;a[b]=1b.1K.2n?[d["aq"+c],d["3M"+c]].ar():1b.1K.4t?U.1S["3M"+c]:d["3M"+c]}),a},5r:9(){m&&6.23.v(h(6.7I()))},7z:9(){J 9(a){6.q&&6.q.r&&a.3i(".6b, .63 .1t, .6e, .7J"+(6.q.r.6B?", #5X":""))&&6.T()}}(),4m:9(a){D b=a.7K.2K,c=6.1C.y,c={1x:(a.V=="2B"?0:b=="27"?c:-1*c)+"B"};6.3N||(6.3N={}),6.3N[b]&&P.2h.2i("7L"+b).1X(6.3N[b]),6.3N[b]=u P.7H(6[b+"34"],{2L:c,1Q:6.r.2U.30[a.V=="3h"?"T":"N"],I:{2V:"7L"+b,as:1},22:a.V=="3h"?.1:0})},2w:9(){M(6.13){D a=6.R,b=6.13.1e;J{2l:a<=0?b-1:a-1,1g:a>=b-1?0:a+1}}},4O:9(a,b,c){D c=c||6.r,d=c.2E,e=c.12;R={W:b.5w(0)=="t",18:b.5w(1)=="l"},n?(b=u C("2T",{G:"at"+b.1A(),y:e+"B",z:e+"B"}),b.v("6i:18"),a.E(b),a=b.4s("2d"),a.au=c.O,a.av(R.18?d:e-d,R.W?d:e-d,d,0,6O.aw*2,!0),a.ax(),a.7M(R.18?d:0,0,e-d,e),a.7M(0,R.W?d:0,e,e-d)):(c=(u C("3m:ay",{az:c.O,aA:"4Z",aB:c.O,aC:(d/e*.5).3I(2)})).v({y:2*e-1+"B",z:2*e-1+"B",R:"2G",18:(R.18?0:-1*e)+"B",W:(R.W?0:-1*e)+"B"}),a.E(c),c.7N=c.7N)},6r:9(){9 a(){J $$("3b, 58, 28")}J 1b.1K.2n&&U.4C>=8&&(a=9(){J U.aD("3b, 58, 28")}),9(){M(!6.5x){D b=a();6.3F=[];4B(D c=0,d=b.1e;c<d;c++){D e=b[c];6.3F.3H({1p:e,1a:e.2L.1a}),e.2L.1a="1D"}6.5x=!0}}}(),7r:9(){6.3F.X(9(a){a.1p.2L.1a=a.1a}),5b 6.3F,6.5x=!1},5e:9(){J{y:6.1O.y,z:6.1O.z+6.2P.z}},77:9(){D a=6.5e(),b=2*6.12;J{y:a.y+b,z:a.z+b}},76:9(){D a=2*6.1C.z+21,b=6.4j();J{y:b.y-a,z:b.z-a}},4j:9(){D a=U.2v.1Z();J 6.Q&&6.Q.1f()&&6.13&&6.13.1e>1&&(a.z-=6.44),a}}),9(){9 a(a,b){6.q&&a(b)}$w("2Q 49").X(9(b){6[b]=6[b].1m(a)},L)}(),S.19(L,{7O:9(){6.q.r.4Y&&(6.4n=6.7P.1i(6),U.11("7Q",6.4n))},4Q:9(){6.4n&&U.aE("7Q",6.4n)},7P:9(a){D b=aF.aG(a.7R).4f(),c=a.7R,d=(6.q.1Y()||6.2t)&&!6.5i,e=6.q.r.2g;6.q.4i()?(a.4l(),a=c==17.7S||["x","c"].5y(b)?"T":c==37&&d&&(6.r.2x||6.R!=0)?"2l":c==39&&d&&(6.r.2x||6.2w().1g!=0)?"1g":b=="p"&&e&&d?"7t":b=="s"&&e&&d?"2R":1o,b!="s"&&6.2R()):a=c==17.7S?"T":1o,a&&6[a](),d&&(c==17.aH&&6.13.aI()!=6.q&&6.N(0),c==17.aJ&&6.13.aK()!=6.q&&6.N(6.13.1e-1))}}),L.4g=L.4g.1m(9(a,b){6.7O(),a(b)}),S.19(L,{6y:9(a){(a=6.43(a))&&a.3t(L.3O)},6F:9(){M(6.13.1e!=0){D a=6.2w();6.7T([a.1g,a.2l])}},7T:9(a){D b=6.13&&6.13.5y(a)||S.aL(a)?6.13:a.1H?6.4S(a.1H):1o;b&&$A(S.6x(a)?[a]:a.V?[b.1P(a)]:a).aM().X(9(a){6.5z(b[a])},6)},7U:9(a,b){a.46={y:b.y,z:b.z}},5z:9(a){M(!a.46&&!a.4o&&a.Y){D b=u 1U;b.1l=9(){b.1l=1b.26,a.4o=1o,6.7U(a,b)}.H(6),a.4o=!0,b.1k=a.Y}},7F:9(a){(a=a.1N)&&a.46||a.4o||!a.2u()||6.5z(a)}}),C.aN({1z:9(a,b,c){J a=$(a),c=S.19({7V:"W 18",2Z:"40-2Z",4a:"52",O:""},c||{}),a.v(k?{6I:"6J:6K.6L.6M(1k=\'"+b+"\'\', 4a=\'"+c.4a+"\')"}:{2Y:c.O+" 3o("+b+") "+c.7V+" "+c.2Z}),a}}),S.19(L,{5A:9(a){D b;J $w("3G 3a 2c 3c").X(9(c){aO("\\\\.("+6.aP[c].2o(/\\s+/g,"|")+")(\\\\?.*)?","i").3T(a)&&(b=c)}.H(6)),b?b:a.38("#")?"4c":U.7W&&U.7W!=a.2o(/(^.*\\/\\/)|(:.*)|(\\/.*)/g,"")?"2c":"3a"},6N:9(a){J(a=a.aQ(/\\?.*/,"").3l(/\\.([^.]{3,4})$/))?a[1]:1o},5a:9(a){D b="<"+a.1J,c;4B(c 6V a)["3d","5B","1J"].5y(c)||(b+=" "+c+\'="\'+a[c]+\'"\');J/^(?:3g|aR|aS|br|aT|aU|aV|6H|7X|aW|aX|aY|2e|aZ|b0|b1)$/i.3T(a.1J)?b+="/>":(b+=">",a.3d&&a.3d.X(9(a){b+=6.5a(a)}.H(6)),a.5B&&(b+=a.5B),b+="</"+a.1J+">"),b}}),9(){U.11("4E:3n",9(){9 a(a){D c=!1;M(b)c=$A(2C.5C).7x("20").6A(",").1P(a)>=0;1w 3A{c=u b2(a)}3B(d){}J!!c}D b=2C.5C&&2C.5C.1e;1q.L.4U=b?{3G:a("b3 b4"),3c:a("5D")}:{3G:a("7Y.7Y"),3c:a("5D.5D")}})}(),L.3x=b5.b6({b7:9(a){M(!a.1N){D b=S.6w(a);b&&!a.1N&&(a.1N=6,a.1u)&&(a.1N.3L=a.1u,L.r.7Z&&a.b8("1u","")),6.Y=b?a.80("Y"):a.Y,6.Y.1P("#")>=0&&(6.Y=6.Y.57(6.Y.1P("#")));D c=b?a.80("1H"):a.1H;M(c)M(6.1H=c,c.38("3P"))6.V="3P";1w M(c.38("4p"))M(c.b9("][")){D c=c.81("]["),d=c[1].3l(/([a-ba-Z]*)/)[1];d&&(6.V=d,c=c[0]+"]",a.7w("1H",c),6.1H=c)}1w 6.V=L.5A(6.Y);1w 6.V=c;1w 6.1H=6.V=L.5A(6.Y);$w("3D 3G 3P 2c 3a 4c 3c 82 83 4p").3t(9(a){D b=a.1A(),c=a.4f();"3a 3P 83 82 4p".1P(a)<0&&(6["5O"+b]=9(){J 6.V==c}.H(6))}.H(6)),b&&a.1N.3L?(a=a.1N.3L.81(L.r.bb).33("bc"),a[0]&&(6.1u=a[0]),a[1]&&(6.1T=a[1]),6.r=(a=a[2])&&S.6v(a)?bd("({"+a+"})"):{}):(6.1u=a.1u,6.1T=a.1T,6.r=a.r||{}),6.r.5E&&(6.r.3D=S.54(6.r.5E),5b 6.r.5E)}},1Y:9(){J 6.V.38("3P")},1G:9(){J 6.1H.38("4p")},2u:9(){J 6.1Y()||6.V=="3a"},53:9(){J"2c 4c 3D".1P(6.V)>=0},4i:9(){J!6.53()}}),L.3O=9(a){D b=$(a);J u L.3x(a),b},9(){9 a(a){D b=a.3i("a[2A~=K], 3g[2A~=K]");b&&(a.4l(),6.3O(b),6.N(b))}9 b(a){(a=a.3i("a[2A~=K], 3g[2A~=K]"))&&6.3O(a)}9 c(a){D b;b=a.7K;D c=a.V;(a=a.bf)&&a.3E&&(c==="4y"||c==="bg"||c==="2m"&&a.3E.4f()==="7X"&&a.V==="bh")&&(b=a),b.bi==bj.bk&&(b=b.6X);M(c=b)b?(c=b.G,c=c.1e>0&&(c=="K"||/(^|\\s)K(\\s|$)/.3T(c))):c=bm 0;c&&6.3O(b)}U.11("K:3n",9(){$(U.1S).11("2m",a.1i(L)),L.r.7Z&&1b.1K.2n&&U.4C>=8?$(U.1S).11("2B",c.1i(L)):$(U.1S).11("2B",b.1i(L))})}(),S.19(L,{4q:9(){D a=6.r.Q,b=a.12;$(U.1S).E(6.Q=(u C("F",{2F:"bn"})).v({2p:6.r.2p+1,bo:a.1y+"B",R:"2G",1a:"1D"}).E(6.bp=(u C("F",{G:"bq"})).E((u C("F",{G:"4r bs"})).v("1y-18: "+b+"B").E(u C("F",{G:"24"}))).E((u C("F",{G:"5F"})).v({1y:"0 "+b+"B",z:b+"B"})).E((u C("F",{G:"4r bt"})).v("1y-18: -"+b+"B").E(u C("F",{G:"24"})))).E(6.3j=(u C("F",{G:"5G 6a"})).E(6.2M=(u C("F",{G:"bu"})).v("1y: 0 "+b+"B").E((u C("F",{G:"bv"})).E(6.2f=u C("F"))).E((u C("F",{G:"3Q bw"})).E(6.bx=(u C("F",{G:"1t"})).1z(6.10+"84.1j",{O:a.O}))).E((u C("F",{G:"3Q by"})).E(6.bz=(u C("F",{G:"1t"})).1z(6.10+"bA.1j",{O:a.O}))).E((u C("F",{G:"3Q bB"})).E(6.3K=(u C("F",{G:"1t"})).1z(6.10+"7v.1j",{O:a.O}))).E((u C("F",{G:"3Q 7J"})).E(6.bC=(u C("F",{G:"1t"})).1z(6.10+"bD.1j",{O:a.O}))))).E(6.bE=(u C("F",{G:"bF"})).E((u C("F",{G:"4r bG"})).v("1y-18: "+b+"B").E(u C("F",{G:"24"}))).E((u C("F",{G:"5F"})).v({1y:"0 "+b+"B",z:b+"B"})).E((u C("F",{G:"4r bH"})).v("1y-18: -"+b+"B").E(u C("F",{G:"24"}))))),$w("27 1g").X(9(a){6["Q"+a.1A()].1F=a},6),l&&(6.Q.T=9(){J 6.v("18:-2X;W:-2X;1a:1D;"),6},6.Q.N=9(){J 6.v("1a:1f"),6},6.Q.1f=9(){J 6.1E("1a")=="1f"&&3R(6.1E("W").2o("B",""))>-5W}),6.Q.28(".3Q F").33("v",h(6.85));D c=6.Q.28(".24");$w("6f 6g bl br").X(9(b,d){a.2E>0?6.4O(c[d],b,a):c[d].E(u C("F",{G:"2H"})),c[d].v({y:a.12+"B",z:a.12+"B"}).6h("24"+b.1A())},6),6.Q.6j(".5G").v("y:7s%;"),6.Q.v(k?{R:"2G",W:"1B",18:""}:{R:"3V",W:"1B",18:"50%"}),6.Q.28(".5F",".5G",".1t",".2H").33("v",{O:a.O}),6.2f.1n((u 45(a.7j)).3k({R:86,2S:86})),6.2f.v({y:6.2f.7D()+"B",z:6.2M.5q()+"B"}),6.87(),6.2f.1n(""),6.Q.T().v("1a:1f"),6.7y(),6.1R()},87:9(){D a,b,c=6.r.Q,d=c.12;k?(a=6.2M.1Z(),b=a.y+2*d,6.2M.v({y:a.y+"B",1y:0}),6.3j.v("y:1B;"),6.2M.v({bI:d+"B"}),6.3j.v({y:b+"B"}),$w("W 3u").X(9(a){6["Q"+a.1A()].v({y:b+"B"})},6),6.Q.v("1y-18:-"+(b/2).1W()+"B")):(6.3j.v("y:1B"),a=6.3j.1Z(),6.2f.bJ().v({88:a.z+"B",y:6.2f.1Z().y+"B"}),6.Q.v({y:a.y+"B",1x:0-(a.y/2).1W()+"B"}),6.3j.v({y:a.y+"B"}),$w("W 3u").X(9(b){6["Q"+b.1A()].v({y:a.y+"B"})},6)),6.6z=c.1y+a.z+2*d,6.6p=6.Q.5q(),6.2f.v({88:a.z+"B"})}}),L.4q=L.4q.1m(9(a,b){D c=u 1U;c.1l=9(){c.1l=1b.26,6.85={y:c.y,z:c.z},a(b)}.H(6),c.1k=6.10+"84.1j",(u 1U).1k=6.10+"7u.1j"}),L.3U=L.3U.1m(9(a,b){a(b),6.4q()}),L.T=L.T.1m(9(a,b){6.q&&6.q.1G()&&(6.Q.T(),6.2f.1n("")),a(b)})})(),L.4y(),U.11("4E:3n",L.4F.H(L))', 62, 728, '||||||this|||function|||||||||||||||||view|options|||new|setStyle|||width|height||px|Element|var|insert|div|className|bind|queue|return|lightview|Lightview|if|show|backgroundColor|Effect|controller|position|Object|hide|document|type|top|each|href||images|observe|border|views||||Event|left|extend|visibility|Prototype|setOpacity|menubar|length|visible|next|afterFinish|bindAsEventListener|png|src|onload|wrap|update|null|element|window|buttons|opacity|lv_Button|title|scaledInnerDimensions|else|marginLeft|margin|setPngBackground|capitalize|auto|sideDimensions|hidden|getStyle|prevnext|isSet|rel|_contentPosition|tag|Browser|topclose|closeDimensions|_view|innerDimensions|indexOf|duration|_lightviewLoadedEvent|body|caption|Image|marginTop|round|remove|isGallery|getDimensions|name||delay|overlay|lv_Corner||emptyFunction|prev|select|display|overflow|case|iframe||param|setNumber|slideshow|Queues|get|lightviewContent|value|previous|click|IE|replace|zIndex|center|closeButton|data|isSetGallery|isImage|viewport|getSurroundingIndexes|cyclic|prevButton|nextButton|class|mouseover|navigator|jQuery|radius|id|absolute|lv_Fill|normal|slideshowButton|side|style|controllerCenter|content|break|menubarDimensions|fillMenuBar|stopSlideshow|total|canvas|effectDurations|scope|to|9500px|background|repeat|sideButtons|padding|loading|invoke|ButtonImage|inner|Button||startsWith||image|object|quicktime|children|sliding|resize|area|mouseout|findElement|controllerMiddle|evaluate|match|ns_vml|loaded|url|topcloseButtonImage|innerPrevNext|imgNumber|lightviewError|_each|bottom|inlineContent|inlineMarker|View|restoreCenter|innerPreviousNext|try|catch|switch|ajax|tagName|overlappingRestore|flash|push|toFixed|floor|controllerSlideshow|_title|scroll|sideEffect|Extend|gallery|lv_ButtonWrapper|parseFloat|userAgent|test|build|fixed|prevButtonImage|nextButtonImage|resizeCenter|large|no|toggleTopClose|autosize|getSet|controllerOffset|Template|preloadedDimensions|afterEffect|stopLoading|insertContent|sizingMethod|resizeWithinViewport|inline|isQuicktime|clearContent|toLowerCase|afterShow|isIframe|isMedia|getViewportDimensions|call|stop|toggleSideButton|keyboardEvent|isPreloading|set|buildController|lv_controllerCornerWrapper|getContext|WebKit|end|require|convertVersionString|parseInt|load|on|noConflict|for|documentMode|default|dom|start|counter|fire|lv_Wrapper|dataText|innerController|innerPrevButton|innerNextButton|gif|createCorner|small|disableKeyboardNavigation|restoreInlineContent|getViews|appear|Plugin|pluginspage|pluginspages|wmode|keyboard|1px||startLoading|scale|isExternal|clone|getHiddenDimensions|onComplete|substr|embed|controls|createHTML|delete|isAjax|effects|getInnerDimensions|_resize|hidePrevNext|_afterResize|resizing|from|Appear|closeButtonWidth|_controllerCenterEffect|cursor|disabled|180|getHeight|maxOverlay|lightview_hide|menubarPadding|slideTimer|toggleSlideshow|charAt|preventingOverlap|member|preloadImageDimensions|detectType|html|plugins|QuickTime|ajaxOptions|lv_controllerBetweenCorners|lv_controllerMiddle|times|keys|Gecko|REQUIRED_|_|the|enabled|is|com|Scriptaculous|find|namespaces|VML|_lightviewLoadedEvents|defer|9500|lv_overlay|container|prevSide|nextSide|marginRight|topButtons|lv_topButtons|lv_Frame|lv_Half|lv_CornerWrapper|lv_Filler|lv_WrapDown|contentTop|clearfix|lv_Close|inner_slideshow_play|contentBottom|lv_Loading|tl|tr|addClassName|float|down|close_|inner_slideshow_stop|prepare|cancel|controllerHeight|_controllerHeight|retrieve|hideOverlapping|hideContent|before|_inlineDisplayRestore|isString|isElement|isNumber|extendSet|_controllerOffset|join|overlayClose|Bottom|Top|_VMLPreloaded|preloadSurroundingImages|fullscreen|img|filter|progid|DXImageTransform|Microsoft|AlphaImageLoader|detectExtension|Math|scrolling|autoplay|loop|mimetypes|flashvars|SetControllerVisible|in|Stop|parentNode|frames|adjustDimensionsToView|scaledI|nnerDimensions|isInline|finishShow|showContent|nextSlide|getBounds|getOuterDimensions|getScrollOffsets|Tween|transition|overflowX|overflowY|15px|beforeStart|Opacity|sync|showPrevNext|hideData|setNumberTemplate|pointer|setCloseButtons|setMenubarDimensions|loadingEffect|Fade|setPrevNext|afterHide|showOverlapping|100|startSlideshow|controller_slideshow_stop|controller_slideshow_play|writeAttribute|pluck|addObservers|delegateClose|curry|hover|documentElement|getWidth|_preloadImageHover|preloadImageHover|_topCloseEffect|Morph|getScrollDimensions|lv_controllerClose|target|lightview_side|fillRect|outerHTML|enableKeyboardNavigation|keyboardDown|keydown|keyCode|KEY_ESC|preloadFromSet|setPreloadedDimensions|align|domain|input|ShockwaveFlash|removeTitles|getAttribute|split|external|media|controller_prev|controllerButtonDimensions|999|_fixateController|lineHeight|createElement|MSIE|exec|rv|mac|REQUIRED_Prototype|REQUIRED_Scriptaculous|typeof|undefined|Version|alert|requires|confirm|detected|page|without|it|has|work|nDocumentation|enabling|available|website|want|go|there|now|location|http|api|jquery|https|js|script|add|urn|schemas|microsoft|vml|createStyleSheet|cssText|behavior|arguments|callee|lv_Container|lv_Sides|lv_PrevSide|lv_NextSide|lv_topcloseButtonImage|topcloseButton|lv_Frames|lv_FrameTop|lv_Liquid|lv_HalfLeft|lv_HalfRight|lv_Center|150|lv_WrapUp|lv_WrapCenter|lv_contentTop|lv_MenuBar|lv_Data|lv_DataText|lv_Title|lv_Caption|lv_innerController|lv_innerPrevNext|lv_innerPrevButton|inner_prev|lv_ImgNumber|lv_innerNextButton|inner_next|lv_Slideshow|lv_contentBottom|loadingButton|lv_FrameBottom|cloneNode|lv_PrevNext|blank|inner_|relative|lv_content|blur|all|errors|requiresPlugin|plugin|required|transparent|close|defaultOptions|none|alt|galleryimg|drawImage|Ajax|Updater|frameBorder|hspace|lightviewContent_|random|99999|tofit|enablejavascript|codebase|codebases|classid|classids|quality|high|movie|allowFullScreen|true|FlashVars|ancestors|block|clientWidth|clientHeight|innerHTML|isFlash|min|paddingRight|paddingBottom|Parallel|opened|imgNumberTemplate|childElements|borderColor|lv_PrevButton|lv_NextButton|startDimensions|_openEffect|clearTimeout|Slideshow|slideshowDelay|updateViews|scrollLeft|preloadHover|lightview_topCloseEffect|topCloseEffect|store|offset|max|limit|cornerCanvas|fillStyle|arc|PI|fill|roundrect|fillcolor|strokeWeight|strokeColor|arcSize|querySelectorAll|stopObserving|String|fromCharCode|KEY_HOME|first|KEY_END|last|isArray|uniq|addMethods|RegExp|typeExtensions|gsub|base|basefont|col|frame|hr|link|isindex|meta|range|spacer|wbr|ActiveXObject|Shockwave|Flash|Class|create|initialize|setAttribute|include|zA|titleSplit|strip|eval||currentTarget|error|radio|nodeType|Node|TEXT_NODE||void|lightviewController|marginBottom|controllerTop|lv_controllerTop||lv_controllerCornerWrapperTopLeft|lv_controllerCornerWrapperTopRight|lv_controllerCenter|lv_controllerSetNumber|lv_controllerPrev|controllerPrev|lv_controllerNext|controllerNext|controller_next|lv_controllerSlideshow|controllerClose|controller_close|controllerBottom|lv_controllerBottom|lv_controllerCornerWrapperBottomLeft|lv_controllerCornerWrapperBottomRight|paddingLeft|up'.split('|'), 0, {}));
|
skin/frontend/base/default/js/ajaxwishlist/lightview/prototype.js
ADDED
@@ -0,0 +1,6081 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Prototype JavaScript framework, version 1.7
|
2 |
+
* (c) 2005-2010 Sam Stephenson
|
3 |
+
*
|
4 |
+
* Prototype is freely distributable under the terms of an MIT-style license.
|
5 |
+
* For details, see the Prototype web site: http://www.prototypejs.org/
|
6 |
+
*
|
7 |
+
*--------------------------------------------------------------------------*/
|
8 |
+
|
9 |
+
var Prototype = {
|
10 |
+
|
11 |
+
Version: '1.7',
|
12 |
+
|
13 |
+
Browser: (function(){
|
14 |
+
var ua = navigator.userAgent;
|
15 |
+
var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
|
16 |
+
return {
|
17 |
+
IE: !!window.attachEvent && !isOpera,
|
18 |
+
Opera: isOpera,
|
19 |
+
WebKit: ua.indexOf('AppleWebKit/') > -1,
|
20 |
+
Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
|
21 |
+
MobileSafari: /Apple.*Mobile/.test(ua)
|
22 |
+
}
|
23 |
+
})(),
|
24 |
+
|
25 |
+
BrowserFeatures: {
|
26 |
+
XPath: !!document.evaluate,
|
27 |
+
|
28 |
+
SelectorsAPI: !!document.querySelector,
|
29 |
+
|
30 |
+
ElementExtensions: (function() {
|
31 |
+
var constructor = window.Element || window.HTMLElement;
|
32 |
+
return !!(constructor && constructor.prototype);
|
33 |
+
})(),
|
34 |
+
SpecificElementExtensions: (function() {
|
35 |
+
if (typeof window.HTMLDivElement !== 'undefined')
|
36 |
+
return true;
|
37 |
+
|
38 |
+
var div = document.createElement('div'),
|
39 |
+
form = document.createElement('form'),
|
40 |
+
isSupported = false;
|
41 |
+
|
42 |
+
if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) {
|
43 |
+
isSupported = true;
|
44 |
+
}
|
45 |
+
|
46 |
+
div = form = null;
|
47 |
+
|
48 |
+
return isSupported;
|
49 |
+
})()
|
50 |
+
},
|
51 |
+
|
52 |
+
ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
|
53 |
+
JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
|
54 |
+
|
55 |
+
emptyFunction: function() { },
|
56 |
+
|
57 |
+
K: function(x) { return x }
|
58 |
+
};
|
59 |
+
|
60 |
+
if (Prototype.Browser.MobileSafari)
|
61 |
+
Prototype.BrowserFeatures.SpecificElementExtensions = false;
|
62 |
+
/* Based on Alex Arnell's inheritance implementation. */
|
63 |
+
|
64 |
+
var Class = (function() {
|
65 |
+
|
66 |
+
var IS_DONTENUM_BUGGY = (function(){
|
67 |
+
for (var p in { toString: 1 }) {
|
68 |
+
if (p === 'toString') return false;
|
69 |
+
}
|
70 |
+
return true;
|
71 |
+
})();
|
72 |
+
|
73 |
+
function subclass() {};
|
74 |
+
function create() {
|
75 |
+
var parent = null, properties = $A(arguments);
|
76 |
+
if (Object.isFunction(properties[0]))
|
77 |
+
parent = properties.shift();
|
78 |
+
|
79 |
+
function klass() {
|
80 |
+
this.initialize.apply(this, arguments);
|
81 |
+
}
|
82 |
+
|
83 |
+
Object.extend(klass, Class.Methods);
|
84 |
+
klass.superclass = parent;
|
85 |
+
klass.subclasses = [];
|
86 |
+
|
87 |
+
if (parent) {
|
88 |
+
subclass.prototype = parent.prototype;
|
89 |
+
klass.prototype = new subclass;
|
90 |
+
parent.subclasses.push(klass);
|
91 |
+
}
|
92 |
+
|
93 |
+
for (var i = 0, length = properties.length; i < length; i++)
|
94 |
+
klass.addMethods(properties[i]);
|
95 |
+
|
96 |
+
if (!klass.prototype.initialize)
|
97 |
+
klass.prototype.initialize = Prototype.emptyFunction;
|
98 |
+
|
99 |
+
klass.prototype.constructor = klass;
|
100 |
+
return klass;
|
101 |
+
}
|
102 |
+
|
103 |
+
function addMethods(source) {
|
104 |
+
var ancestor = this.superclass && this.superclass.prototype,
|
105 |
+
properties = Object.keys(source);
|
106 |
+
|
107 |
+
if (IS_DONTENUM_BUGGY) {
|
108 |
+
if (source.toString != Object.prototype.toString)
|
109 |
+
properties.push("toString");
|
110 |
+
if (source.valueOf != Object.prototype.valueOf)
|
111 |
+
properties.push("valueOf");
|
112 |
+
}
|
113 |
+
|
114 |
+
for (var i = 0, length = properties.length; i < length; i++) {
|
115 |
+
var property = properties[i], value = source[property];
|
116 |
+
if (ancestor && Object.isFunction(value) &&
|
117 |
+
value.argumentNames()[0] == "$super") {
|
118 |
+
var method = value;
|
119 |
+
value = (function(m) {
|
120 |
+
return function() { return ancestor[m].apply(this, arguments); };
|
121 |
+
})(property).wrap(method);
|
122 |
+
|
123 |
+
value.valueOf = method.valueOf.bind(method);
|
124 |
+
value.toString = method.toString.bind(method);
|
125 |
+
}
|
126 |
+
this.prototype[property] = value;
|
127 |
+
}
|
128 |
+
|
129 |
+
return this;
|
130 |
+
}
|
131 |
+
|
132 |
+
return {
|
133 |
+
create: create,
|
134 |
+
Methods: {
|
135 |
+
addMethods: addMethods
|
136 |
+
}
|
137 |
+
};
|
138 |
+
})();
|
139 |
+
(function() {
|
140 |
+
|
141 |
+
var _toString = Object.prototype.toString,
|
142 |
+
NULL_TYPE = 'Null',
|
143 |
+
UNDEFINED_TYPE = 'Undefined',
|
144 |
+
BOOLEAN_TYPE = 'Boolean',
|
145 |
+
NUMBER_TYPE = 'Number',
|
146 |
+
STRING_TYPE = 'String',
|
147 |
+
OBJECT_TYPE = 'Object',
|
148 |
+
FUNCTION_CLASS = '[object Function]',
|
149 |
+
BOOLEAN_CLASS = '[object Boolean]',
|
150 |
+
NUMBER_CLASS = '[object Number]',
|
151 |
+
STRING_CLASS = '[object String]',
|
152 |
+
ARRAY_CLASS = '[object Array]',
|
153 |
+
DATE_CLASS = '[object Date]',
|
154 |
+
NATIVE_JSON_STRINGIFY_SUPPORT = window.JSON &&
|
155 |
+
typeof JSON.stringify === 'function' &&
|
156 |
+
JSON.stringify(0) === '0' &&
|
157 |
+
typeof JSON.stringify(Prototype.K) === 'undefined';
|
158 |
+
|
159 |
+
function Type(o) {
|
160 |
+
switch(o) {
|
161 |
+
case null: return NULL_TYPE;
|
162 |
+
case (void 0): return UNDEFINED_TYPE;
|
163 |
+
}
|
164 |
+
var type = typeof o;
|
165 |
+
switch(type) {
|
166 |
+
case 'boolean': return BOOLEAN_TYPE;
|
167 |
+
case 'number': return NUMBER_TYPE;
|
168 |
+
case 'string': return STRING_TYPE;
|
169 |
+
}
|
170 |
+
return OBJECT_TYPE;
|
171 |
+
}
|
172 |
+
|
173 |
+
function extend(destination, source) {
|
174 |
+
for (var property in source)
|
175 |
+
destination[property] = source[property];
|
176 |
+
return destination;
|
177 |
+
}
|
178 |
+
|
179 |
+
function inspect(object) {
|
180 |
+
try {
|
181 |
+
if (isUndefined(object)) return 'undefined';
|
182 |
+
if (object === null) return 'null';
|
183 |
+
return object.inspect ? object.inspect() : String(object);
|
184 |
+
} catch (e) {
|
185 |
+
if (e instanceof RangeError) return '...';
|
186 |
+
throw e;
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
function toJSON(value) {
|
191 |
+
return Str('', { '': value }, []);
|
192 |
+
}
|
193 |
+
|
194 |
+
function Str(key, holder, stack) {
|
195 |
+
var value = holder[key],
|
196 |
+
type = typeof value;
|
197 |
+
|
198 |
+
if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
|
199 |
+
value = value.toJSON(key);
|
200 |
+
}
|
201 |
+
|
202 |
+
var _class = _toString.call(value);
|
203 |
+
|
204 |
+
switch (_class) {
|
205 |
+
case NUMBER_CLASS:
|
206 |
+
case BOOLEAN_CLASS:
|
207 |
+
case STRING_CLASS:
|
208 |
+
value = value.valueOf();
|
209 |
+
}
|
210 |
+
|
211 |
+
switch (value) {
|
212 |
+
case null: return 'null';
|
213 |
+
case true: return 'true';
|
214 |
+
case false: return 'false';
|
215 |
+
}
|
216 |
+
|
217 |
+
type = typeof value;
|
218 |
+
switch (type) {
|
219 |
+
case 'string':
|
220 |
+
return value.inspect(true);
|
221 |
+
case 'number':
|
222 |
+
return isFinite(value) ? String(value) : 'null';
|
223 |
+
case 'object':
|
224 |
+
|
225 |
+
for (var i = 0, length = stack.length; i < length; i++) {
|
226 |
+
if (stack[i] === value) { throw new TypeError(); }
|
227 |
+
}
|
228 |
+
stack.push(value);
|
229 |
+
|
230 |
+
var partial = [];
|
231 |
+
if (_class === ARRAY_CLASS) {
|
232 |
+
for (var i = 0, length = value.length; i < length; i++) {
|
233 |
+
var str = Str(i, value, stack);
|
234 |
+
partial.push(typeof str === 'undefined' ? 'null' : str);
|
235 |
+
}
|
236 |
+
partial = '[' + partial.join(',') + ']';
|
237 |
+
} else {
|
238 |
+
var keys = Object.keys(value);
|
239 |
+
for (var i = 0, length = keys.length; i < length; i++) {
|
240 |
+
var key = keys[i], str = Str(key, value, stack);
|
241 |
+
if (typeof str !== "undefined") {
|
242 |
+
partial.push(key.inspect(true)+ ':' + str);
|
243 |
+
}
|
244 |
+
}
|
245 |
+
partial = '{' + partial.join(',') + '}';
|
246 |
+
}
|
247 |
+
stack.pop();
|
248 |
+
return partial;
|
249 |
+
}
|
250 |
+
}
|
251 |
+
|
252 |
+
function stringify(object) {
|
253 |
+
return JSON.stringify(object);
|
254 |
+
}
|
255 |
+
|
256 |
+
function toQueryString(object) {
|
257 |
+
return $H(object).toQueryString();
|
258 |
+
}
|
259 |
+
|
260 |
+
function toHTML(object) {
|
261 |
+
return object && object.toHTML ? object.toHTML() : String.interpret(object);
|
262 |
+
}
|
263 |
+
|
264 |
+
function keys(object) {
|
265 |
+
if (Type(object) !== OBJECT_TYPE) { throw new TypeError(); }
|
266 |
+
var results = [];
|
267 |
+
for (var property in object) {
|
268 |
+
if (object.hasOwnProperty(property)) {
|
269 |
+
results.push(property);
|
270 |
+
}
|
271 |
+
}
|
272 |
+
return results;
|
273 |
+
}
|
274 |
+
|
275 |
+
function values(object) {
|
276 |
+
var results = [];
|
277 |
+
for (var property in object)
|
278 |
+
results.push(object[property]);
|
279 |
+
return results;
|
280 |
+
}
|
281 |
+
|
282 |
+
function clone(object) {
|
283 |
+
return extend({ }, object);
|
284 |
+
}
|
285 |
+
|
286 |
+
function isElement(object) {
|
287 |
+
return !!(object && object.nodeType == 1);
|
288 |
+
}
|
289 |
+
|
290 |
+
function isArray(object) {
|
291 |
+
return _toString.call(object) === ARRAY_CLASS;
|
292 |
+
}
|
293 |
+
|
294 |
+
var hasNativeIsArray = (typeof Array.isArray == 'function')
|
295 |
+
&& Array.isArray([]) && !Array.isArray({});
|
296 |
+
|
297 |
+
if (hasNativeIsArray) {
|
298 |
+
isArray = Array.isArray;
|
299 |
+
}
|
300 |
+
|
301 |
+
function isHash(object) {
|
302 |
+
return object instanceof Hash;
|
303 |
+
}
|
304 |
+
|
305 |
+
function isFunction(object) {
|
306 |
+
return _toString.call(object) === FUNCTION_CLASS;
|
307 |
+
}
|
308 |
+
|
309 |
+
function isString(object) {
|
310 |
+
return _toString.call(object) === STRING_CLASS;
|
311 |
+
}
|
312 |
+
|
313 |
+
function isNumber(object) {
|
314 |
+
return _toString.call(object) === NUMBER_CLASS;
|
315 |
+
}
|
316 |
+
|
317 |
+
function isDate(object) {
|
318 |
+
return _toString.call(object) === DATE_CLASS;
|
319 |
+
}
|
320 |
+
|
321 |
+
function isUndefined(object) {
|
322 |
+
return typeof object === "undefined";
|
323 |
+
}
|
324 |
+
|
325 |
+
extend(Object, {
|
326 |
+
extend: extend,
|
327 |
+
inspect: inspect,
|
328 |
+
toJSON: NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON,
|
329 |
+
toQueryString: toQueryString,
|
330 |
+
toHTML: toHTML,
|
331 |
+
keys: Object.keys || keys,
|
332 |
+
values: values,
|
333 |
+
clone: clone,
|
334 |
+
isElement: isElement,
|
335 |
+
isArray: isArray,
|
336 |
+
isHash: isHash,
|
337 |
+
isFunction: isFunction,
|
338 |
+
isString: isString,
|
339 |
+
isNumber: isNumber,
|
340 |
+
isDate: isDate,
|
341 |
+
isUndefined: isUndefined
|
342 |
+
});
|
343 |
+
})();
|
344 |
+
Object.extend(Function.prototype, (function() {
|
345 |
+
var slice = Array.prototype.slice;
|
346 |
+
|
347 |
+
function update(array, args) {
|
348 |
+
var arrayLength = array.length, length = args.length;
|
349 |
+
while (length--) array[arrayLength + length] = args[length];
|
350 |
+
return array;
|
351 |
+
}
|
352 |
+
|
353 |
+
function merge(array, args) {
|
354 |
+
array = slice.call(array, 0);
|
355 |
+
return update(array, args);
|
356 |
+
}
|
357 |
+
|
358 |
+
function argumentNames() {
|
359 |
+
var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]
|
360 |
+
.replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '')
|
361 |
+
.replace(/\s+/g, '').split(',');
|
362 |
+
return names.length == 1 && !names[0] ? [] : names;
|
363 |
+
}
|
364 |
+
|
365 |
+
function bind(context) {
|
366 |
+
if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
|
367 |
+
var __method = this, args = slice.call(arguments, 1);
|
368 |
+
return function() {
|
369 |
+
var a = merge(args, arguments);
|
370 |
+
return __method.apply(context, a);
|
371 |
+
}
|
372 |
+
}
|
373 |
+
|
374 |
+
function bindAsEventListener(context) {
|
375 |
+
var __method = this, args = slice.call(arguments, 1);
|
376 |
+
return function(event) {
|
377 |
+
var a = update([event || window.event], args);
|
378 |
+
return __method.apply(context, a);
|
379 |
+
}
|
380 |
+
}
|
381 |
+
|
382 |
+
function curry() {
|
383 |
+
if (!arguments.length) return this;
|
384 |
+
var __method = this, args = slice.call(arguments, 0);
|
385 |
+
return function() {
|
386 |
+
var a = merge(args, arguments);
|
387 |
+
return __method.apply(this, a);
|
388 |
+
}
|
389 |
+
}
|
390 |
+
|
391 |
+
function delay(timeout) {
|
392 |
+
var __method = this, args = slice.call(arguments, 1);
|
393 |
+
timeout = timeout * 1000;
|
394 |
+
return window.setTimeout(function() {
|
395 |
+
return __method.apply(__method, args);
|
396 |
+
}, timeout);
|
397 |
+
}
|
398 |
+
|
399 |
+
function defer() {
|
400 |
+
var args = update([0.01], arguments);
|
401 |
+
return this.delay.apply(this, args);
|
402 |
+
}
|
403 |
+
|
404 |
+
function wrap(wrapper) {
|
405 |
+
var __method = this;
|
406 |
+
return function() {
|
407 |
+
var a = update([__method.bind(this)], arguments);
|
408 |
+
return wrapper.apply(this, a);
|
409 |
+
}
|
410 |
+
}
|
411 |
+
|
412 |
+
function methodize() {
|
413 |
+
if (this._methodized) return this._methodized;
|
414 |
+
var __method = this;
|
415 |
+
return this._methodized = function() {
|
416 |
+
var a = update([this], arguments);
|
417 |
+
return __method.apply(null, a);
|
418 |
+
};
|
419 |
+
}
|
420 |
+
|
421 |
+
return {
|
422 |
+
argumentNames: argumentNames,
|
423 |
+
bind: bind,
|
424 |
+
bindAsEventListener: bindAsEventListener,
|
425 |
+
curry: curry,
|
426 |
+
delay: delay,
|
427 |
+
defer: defer,
|
428 |
+
wrap: wrap,
|
429 |
+
methodize: methodize
|
430 |
+
}
|
431 |
+
})());
|
432 |
+
|
433 |
+
|
434 |
+
|
435 |
+
(function(proto) {
|
436 |
+
|
437 |
+
|
438 |
+
function toISOString() {
|
439 |
+
return this.getUTCFullYear() + '-' +
|
440 |
+
(this.getUTCMonth() + 1).toPaddedString(2) + '-' +
|
441 |
+
this.getUTCDate().toPaddedString(2) + 'T' +
|
442 |
+
this.getUTCHours().toPaddedString(2) + ':' +
|
443 |
+
this.getUTCMinutes().toPaddedString(2) + ':' +
|
444 |
+
this.getUTCSeconds().toPaddedString(2) + 'Z';
|
445 |
+
}
|
446 |
+
|
447 |
+
|
448 |
+
function toJSON() {
|
449 |
+
return this.toISOString();
|
450 |
+
}
|
451 |
+
|
452 |
+
if (!proto.toISOString) proto.toISOString = toISOString;
|
453 |
+
if (!proto.toJSON) proto.toJSON = toJSON;
|
454 |
+
|
455 |
+
})(Date.prototype);
|
456 |
+
|
457 |
+
|
458 |
+
RegExp.prototype.match = RegExp.prototype.test;
|
459 |
+
|
460 |
+
RegExp.escape = function(str) {
|
461 |
+
return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
|
462 |
+
};
|
463 |
+
var PeriodicalExecuter = Class.create({
|
464 |
+
initialize: function(callback, frequency) {
|
465 |
+
this.callback = callback;
|
466 |
+
this.frequency = frequency;
|
467 |
+
this.currentlyExecuting = false;
|
468 |
+
|
469 |
+
this.registerCallback();
|
470 |
+
},
|
471 |
+
|
472 |
+
registerCallback: function() {
|
473 |
+
this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
|
474 |
+
},
|
475 |
+
|
476 |
+
execute: function() {
|
477 |
+
this.callback(this);
|
478 |
+
},
|
479 |
+
|
480 |
+
stop: function() {
|
481 |
+
if (!this.timer) return;
|
482 |
+
clearInterval(this.timer);
|
483 |
+
this.timer = null;
|
484 |
+
},
|
485 |
+
|
486 |
+
onTimerEvent: function() {
|
487 |
+
if (!this.currentlyExecuting) {
|
488 |
+
try {
|
489 |
+
this.currentlyExecuting = true;
|
490 |
+
this.execute();
|
491 |
+
this.currentlyExecuting = false;
|
492 |
+
} catch(e) {
|
493 |
+
this.currentlyExecuting = false;
|
494 |
+
throw e;
|
495 |
+
}
|
496 |
+
}
|
497 |
+
}
|
498 |
+
});
|
499 |
+
Object.extend(String, {
|
500 |
+
interpret: function(value) {
|
501 |
+
return value == null ? '' : String(value);
|
502 |
+
},
|
503 |
+
specialChar: {
|
504 |
+
'\b': '\\b',
|
505 |
+
'\t': '\\t',
|
506 |
+
'\n': '\\n',
|
507 |
+
'\f': '\\f',
|
508 |
+
'\r': '\\r',
|
509 |
+
'\\': '\\\\'
|
510 |
+
}
|
511 |
+
});
|
512 |
+
|
513 |
+
Object.extend(String.prototype, (function() {
|
514 |
+
var NATIVE_JSON_PARSE_SUPPORT = window.JSON &&
|
515 |
+
typeof JSON.parse === 'function' &&
|
516 |
+
JSON.parse('{"test": true}').test;
|
517 |
+
|
518 |
+
function prepareReplacement(replacement) {
|
519 |
+
if (Object.isFunction(replacement)) return replacement;
|
520 |
+
var template = new Template(replacement);
|
521 |
+
return function(match) { return template.evaluate(match) };
|
522 |
+
}
|
523 |
+
|
524 |
+
function gsub(pattern, replacement) {
|
525 |
+
var result = '', source = this, match;
|
526 |
+
replacement = prepareReplacement(replacement);
|
527 |
+
|
528 |
+
if (Object.isString(pattern))
|
529 |
+
pattern = RegExp.escape(pattern);
|
530 |
+
|
531 |
+
if (!(pattern.length || pattern.source)) {
|
532 |
+
replacement = replacement('');
|
533 |
+
return replacement + source.split('').join(replacement) + replacement;
|
534 |
+
}
|
535 |
+
|
536 |
+
while (source.length > 0) {
|
537 |
+
if (match = source.match(pattern)) {
|
538 |
+
result += source.slice(0, match.index);
|
539 |
+
result += String.interpret(replacement(match));
|
540 |
+
source = source.slice(match.index + match[0].length);
|
541 |
+
} else {
|
542 |
+
result += source, source = '';
|
543 |
+
}
|
544 |
+
}
|
545 |
+
return result;
|
546 |
+
}
|
547 |
+
|
548 |
+
function sub(pattern, replacement, count) {
|
549 |
+
replacement = prepareReplacement(replacement);
|
550 |
+
count = Object.isUndefined(count) ? 1 : count;
|
551 |
+
|
552 |
+
return this.gsub(pattern, function(match) {
|
553 |
+
if (--count < 0) return match[0];
|
554 |
+
return replacement(match);
|
555 |
+
});
|
556 |
+
}
|
557 |
+
|
558 |
+
function scan(pattern, iterator) {
|
559 |
+
this.gsub(pattern, iterator);
|
560 |
+
return String(this);
|
561 |
+
}
|
562 |
+
|
563 |
+
function truncate(length, truncation) {
|
564 |
+
length = length || 30;
|
565 |
+
truncation = Object.isUndefined(truncation) ? '...' : truncation;
|
566 |
+
return this.length > length ?
|
567 |
+
this.slice(0, length - truncation.length) + truncation : String(this);
|
568 |
+
}
|
569 |
+
|
570 |
+
function strip() {
|
571 |
+
return this.replace(/^\s+/, '').replace(/\s+$/, '');
|
572 |
+
}
|
573 |
+
|
574 |
+
function stripTags() {
|
575 |
+
return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
|
576 |
+
}
|
577 |
+
|
578 |
+
function stripScripts() {
|
579 |
+
return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
|
580 |
+
}
|
581 |
+
|
582 |
+
function extractScripts() {
|
583 |
+
var matchAll = new RegExp(Prototype.ScriptFragment, 'img'),
|
584 |
+
matchOne = new RegExp(Prototype.ScriptFragment, 'im');
|
585 |
+
return (this.match(matchAll) || []).map(function(scriptTag) {
|
586 |
+
return (scriptTag.match(matchOne) || ['', ''])[1];
|
587 |
+
});
|
588 |
+
}
|
589 |
+
|
590 |
+
function evalScripts() {
|
591 |
+
return this.extractScripts().map(function(script) { return eval(script) });
|
592 |
+
}
|
593 |
+
|
594 |
+
function escapeHTML() {
|
595 |
+
return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
596 |
+
}
|
597 |
+
|
598 |
+
function unescapeHTML() {
|
599 |
+
return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&');
|
600 |
+
}
|
601 |
+
|
602 |
+
|
603 |
+
function toQueryParams(separator) {
|
604 |
+
var match = this.strip().match(/([^?#]*)(#.*)?$/);
|
605 |
+
if (!match) return { };
|
606 |
+
|
607 |
+
return match[1].split(separator || '&').inject({ }, function(hash, pair) {
|
608 |
+
if ((pair = pair.split('='))[0]) {
|
609 |
+
var key = decodeURIComponent(pair.shift()),
|
610 |
+
value = pair.length > 1 ? pair.join('=') : pair[0];
|
611 |
+
|
612 |
+
if (value != undefined) value = decodeURIComponent(value);
|
613 |
+
|
614 |
+
if (key in hash) {
|
615 |
+
if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
|
616 |
+
hash[key].push(value);
|
617 |
+
}
|
618 |
+
else hash[key] = value;
|
619 |
+
}
|
620 |
+
return hash;
|
621 |
+
});
|
622 |
+
}
|
623 |
+
|
624 |
+
function toArray() {
|
625 |
+
return this.split('');
|
626 |
+
}
|
627 |
+
|
628 |
+
function succ() {
|
629 |
+
return this.slice(0, this.length - 1) +
|
630 |
+
String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
|
631 |
+
}
|
632 |
+
|
633 |
+
function times(count) {
|
634 |
+
return count < 1 ? '' : new Array(count + 1).join(this);
|
635 |
+
}
|
636 |
+
|
637 |
+
function camelize() {
|
638 |
+
return this.replace(/-+(.)?/g, function(match, chr) {
|
639 |
+
return chr ? chr.toUpperCase() : '';
|
640 |
+
});
|
641 |
+
}
|
642 |
+
|
643 |
+
function capitalize() {
|
644 |
+
return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
|
645 |
+
}
|
646 |
+
|
647 |
+
function underscore() {
|
648 |
+
return this.replace(/::/g, '/')
|
649 |
+
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
|
650 |
+
.replace(/([a-z\d])([A-Z])/g, '$1_$2')
|
651 |
+
.replace(/-/g, '_')
|
652 |
+
.toLowerCase();
|
653 |
+
}
|
654 |
+
|
655 |
+
function dasherize() {
|
656 |
+
return this.replace(/_/g, '-');
|
657 |
+
}
|
658 |
+
|
659 |
+
function inspect(useDoubleQuotes) {
|
660 |
+
var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) {
|
661 |
+
if (character in String.specialChar) {
|
662 |
+
return String.specialChar[character];
|
663 |
+
}
|
664 |
+
return '\\u00' + character.charCodeAt().toPaddedString(2, 16);
|
665 |
+
});
|
666 |
+
if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
|
667 |
+
return "'" + escapedString.replace(/'/g, '\\\'') + "'";
|
668 |
+
}
|
669 |
+
|
670 |
+
function unfilterJSON(filter) {
|
671 |
+
return this.replace(filter || Prototype.JSONFilter, '$1');
|
672 |
+
}
|
673 |
+
|
674 |
+
function isJSON() {
|
675 |
+
var str = this;
|
676 |
+
if (str.blank()) return false;
|
677 |
+
str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@');
|
678 |
+
str = str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
|
679 |
+
str = str.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
|
680 |
+
return (/^[\],:{}\s]*$/).test(str);
|
681 |
+
}
|
682 |
+
|
683 |
+
function evalJSON(sanitize) {
|
684 |
+
var json = this.unfilterJSON(),
|
685 |
+
cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
686 |
+
if (cx.test(json)) {
|
687 |
+
json = json.replace(cx, function (a) {
|
688 |
+
return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
689 |
+
});
|
690 |
+
}
|
691 |
+
try {
|
692 |
+
if (!sanitize || json.isJSON()) return eval('(' + json + ')');
|
693 |
+
} catch (e) { }
|
694 |
+
throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
|
695 |
+
}
|
696 |
+
|
697 |
+
function parseJSON() {
|
698 |
+
var json = this.unfilterJSON();
|
699 |
+
return JSON.parse(json);
|
700 |
+
}
|
701 |
+
|
702 |
+
function include(pattern) {
|
703 |
+
return this.indexOf(pattern) > -1;
|
704 |
+
}
|
705 |
+
|
706 |
+
function startsWith(pattern) {
|
707 |
+
return this.lastIndexOf(pattern, 0) === 0;
|
708 |
+
}
|
709 |
+
|
710 |
+
function endsWith(pattern) {
|
711 |
+
var d = this.length - pattern.length;
|
712 |
+
return d >= 0 && this.indexOf(pattern, d) === d;
|
713 |
+
}
|
714 |
+
|
715 |
+
function empty() {
|
716 |
+
return this == '';
|
717 |
+
}
|
718 |
+
|
719 |
+
function blank() {
|
720 |
+
return /^\s*$/.test(this);
|
721 |
+
}
|
722 |
+
|
723 |
+
function interpolate(object, pattern) {
|
724 |
+
return new Template(this, pattern).evaluate(object);
|
725 |
+
}
|
726 |
+
|
727 |
+
return {
|
728 |
+
gsub: gsub,
|
729 |
+
sub: sub,
|
730 |
+
scan: scan,
|
731 |
+
truncate: truncate,
|
732 |
+
strip: String.prototype.trim || strip,
|
733 |
+
stripTags: stripTags,
|
734 |
+
stripScripts: stripScripts,
|
735 |
+
extractScripts: extractScripts,
|
736 |
+
evalScripts: evalScripts,
|
737 |
+
escapeHTML: escapeHTML,
|
738 |
+
unescapeHTML: unescapeHTML,
|
739 |
+
toQueryParams: toQueryParams,
|
740 |
+
parseQuery: toQueryParams,
|
741 |
+
toArray: toArray,
|
742 |
+
succ: succ,
|
743 |
+
times: times,
|
744 |
+
camelize: camelize,
|
745 |
+
capitalize: capitalize,
|
746 |
+
underscore: underscore,
|
747 |
+
dasherize: dasherize,
|
748 |
+
inspect: inspect,
|
749 |
+
unfilterJSON: unfilterJSON,
|
750 |
+
isJSON: isJSON,
|
751 |
+
evalJSON: NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON,
|
752 |
+
include: include,
|
753 |
+
startsWith: startsWith,
|
754 |
+
endsWith: endsWith,
|
755 |
+
empty: empty,
|
756 |
+
blank: blank,
|
757 |
+
interpolate: interpolate
|
758 |
+
};
|
759 |
+
})());
|
760 |
+
|
761 |
+
var Template = Class.create({
|
762 |
+
initialize: function(template, pattern) {
|
763 |
+
this.template = template.toString();
|
764 |
+
this.pattern = pattern || Template.Pattern;
|
765 |
+
},
|
766 |
+
|
767 |
+
evaluate: function(object) {
|
768 |
+
if (object && Object.isFunction(object.toTemplateReplacements))
|
769 |
+
object = object.toTemplateReplacements();
|
770 |
+
|
771 |
+
return this.template.gsub(this.pattern, function(match) {
|
772 |
+
if (object == null) return (match[1] + '');
|
773 |
+
|
774 |
+
var before = match[1] || '';
|
775 |
+
if (before == '\\') return match[2];
|
776 |
+
|
777 |
+
var ctx = object, expr = match[3],
|
778 |
+
pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
|
779 |
+
|
780 |
+
match = pattern.exec(expr);
|
781 |
+
if (match == null) return before;
|
782 |
+
|
783 |
+
while (match != null) {
|
784 |
+
var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1];
|
785 |
+
ctx = ctx[comp];
|
786 |
+
if (null == ctx || '' == match[3]) break;
|
787 |
+
expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
|
788 |
+
match = pattern.exec(expr);
|
789 |
+
}
|
790 |
+
|
791 |
+
return before + String.interpret(ctx);
|
792 |
+
});
|
793 |
+
}
|
794 |
+
});
|
795 |
+
Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
|
796 |
+
|
797 |
+
var $break = { };
|
798 |
+
|
799 |
+
var Enumerable = (function() {
|
800 |
+
function each(iterator, context) {
|
801 |
+
var index = 0;
|
802 |
+
try {
|
803 |
+
this._each(function(value) {
|
804 |
+
iterator.call(context, value, index++);
|
805 |
+
});
|
806 |
+
} catch (e) {
|
807 |
+
if (e != $break) throw e;
|
808 |
+
}
|
809 |
+
return this;
|
810 |
+
}
|
811 |
+
|
812 |
+
function eachSlice(number, iterator, context) {
|
813 |
+
var index = -number, slices = [], array = this.toArray();
|
814 |
+
if (number < 1) return array;
|
815 |
+
while ((index += number) < array.length)
|
816 |
+
slices.push(array.slice(index, index+number));
|
817 |
+
return slices.collect(iterator, context);
|
818 |
+
}
|
819 |
+
|
820 |
+
function all(iterator, context) {
|
821 |
+
iterator = iterator || Prototype.K;
|
822 |
+
var result = true;
|
823 |
+
this.each(function(value, index) {
|
824 |
+
result = result && !!iterator.call(context, value, index);
|
825 |
+
if (!result) throw $break;
|
826 |
+
});
|
827 |
+
return result;
|
828 |
+
}
|
829 |
+
|
830 |
+
function any(iterator, context) {
|
831 |
+
iterator = iterator || Prototype.K;
|
832 |
+
var result = false;
|
833 |
+
this.each(function(value, index) {
|
834 |
+
if (result = !!iterator.call(context, value, index))
|
835 |
+
throw $break;
|
836 |
+
});
|
837 |
+
return result;
|
838 |
+
}
|
839 |
+
|
840 |
+
function collect(iterator, context) {
|
841 |
+
iterator = iterator || Prototype.K;
|
842 |
+
var results = [];
|
843 |
+
this.each(function(value, index) {
|
844 |
+
results.push(iterator.call(context, value, index));
|
845 |
+
});
|
846 |
+
return results;
|
847 |
+
}
|
848 |
+
|
849 |
+
function detect(iterator, context) {
|
850 |
+
var result;
|
851 |
+
this.each(function(value, index) {
|
852 |
+
if (iterator.call(context, value, index)) {
|
853 |
+
result = value;
|
854 |
+
throw $break;
|
855 |
+
}
|
856 |
+
});
|
857 |
+
return result;
|
858 |
+
}
|
859 |
+
|
860 |
+
function findAll(iterator, context) {
|
861 |
+
var results = [];
|
862 |
+
this.each(function(value, index) {
|
863 |
+
if (iterator.call(context, value, index))
|
864 |
+
results.push(value);
|
865 |
+
});
|
866 |
+
return results;
|
867 |
+
}
|
868 |
+
|
869 |
+
function grep(filter, iterator, context) {
|
870 |
+
iterator = iterator || Prototype.K;
|
871 |
+
var results = [];
|
872 |
+
|
873 |
+
if (Object.isString(filter))
|
874 |
+
filter = new RegExp(RegExp.escape(filter));
|
875 |
+
|
876 |
+
this.each(function(value, index) {
|
877 |
+
if (filter.match(value))
|
878 |
+
results.push(iterator.call(context, value, index));
|
879 |
+
});
|
880 |
+
return results;
|
881 |
+
}
|
882 |
+
|
883 |
+
function include(object) {
|
884 |
+
if (Object.isFunction(this.indexOf))
|
885 |
+
if (this.indexOf(object) != -1) return true;
|
886 |
+
|
887 |
+
var found = false;
|
888 |
+
this.each(function(value) {
|
889 |
+
if (value == object) {
|
890 |
+
found = true;
|
891 |
+
throw $break;
|
892 |
+
}
|
893 |
+
});
|
894 |
+
return found;
|
895 |
+
}
|
896 |
+
|
897 |
+
function inGroupsOf(number, fillWith) {
|
898 |
+
fillWith = Object.isUndefined(fillWith) ? null : fillWith;
|
899 |
+
return this.eachSlice(number, function(slice) {
|
900 |
+
while(slice.length < number) slice.push(fillWith);
|
901 |
+
return slice;
|
902 |
+
});
|
903 |
+
}
|
904 |
+
|
905 |
+
function inject(memo, iterator, context) {
|
906 |
+
this.each(function(value, index) {
|
907 |
+
memo = iterator.call(context, memo, value, index);
|
908 |
+
});
|
909 |
+
return memo;
|
910 |
+
}
|
911 |
+
|
912 |
+
function invoke(method) {
|
913 |
+
var args = $A(arguments).slice(1);
|
914 |
+
return this.map(function(value) {
|
915 |
+
return value[method].apply(value, args);
|
916 |
+
});
|
917 |
+
}
|
918 |
+
|
919 |
+
function max(iterator, context) {
|
920 |
+
iterator = iterator || Prototype.K;
|
921 |
+
var result;
|
922 |
+
this.each(function(value, index) {
|
923 |
+
value = iterator.call(context, value, index);
|
924 |
+
if (result == null || value >= result)
|
925 |
+
result = value;
|
926 |
+
});
|
927 |
+
return result;
|
928 |
+
}
|
929 |
+
|
930 |
+
function min(iterator, context) {
|
931 |
+
iterator = iterator || Prototype.K;
|
932 |
+
var result;
|
933 |
+
this.each(function(value, index) {
|
934 |
+
value = iterator.call(context, value, index);
|
935 |
+
if (result == null || value < result)
|
936 |
+
result = value;
|
937 |
+
});
|
938 |
+
return result;
|
939 |
+
}
|
940 |
+
|
941 |
+
function partition(iterator, context) {
|
942 |
+
iterator = iterator || Prototype.K;
|
943 |
+
var trues = [], falses = [];
|
944 |
+
this.each(function(value, index) {
|
945 |
+
(iterator.call(context, value, index) ?
|
946 |
+
trues : falses).push(value);
|
947 |
+
});
|
948 |
+
return [trues, falses];
|
949 |
+
}
|
950 |
+
|
951 |
+
function pluck(property) {
|
952 |
+
var results = [];
|
953 |
+
this.each(function(value) {
|
954 |
+
results.push(value[property]);
|
955 |
+
});
|
956 |
+
return results;
|
957 |
+
}
|
958 |
+
|
959 |
+
function reject(iterator, context) {
|
960 |
+
var results = [];
|
961 |
+
this.each(function(value, index) {
|
962 |
+
if (!iterator.call(context, value, index))
|
963 |
+
results.push(value);
|
964 |
+
});
|
965 |
+
return results;
|
966 |
+
}
|
967 |
+
|
968 |
+
function sortBy(iterator, context) {
|
969 |
+
return this.map(function(value, index) {
|
970 |
+
return {
|
971 |
+
value: value,
|
972 |
+
criteria: iterator.call(context, value, index)
|
973 |
+
};
|
974 |
+
}).sort(function(left, right) {
|
975 |
+
var a = left.criteria, b = right.criteria;
|
976 |
+
return a < b ? -1 : a > b ? 1 : 0;
|
977 |
+
}).pluck('value');
|
978 |
+
}
|
979 |
+
|
980 |
+
function toArray() {
|
981 |
+
return this.map();
|
982 |
+
}
|
983 |
+
|
984 |
+
function zip() {
|
985 |
+
var iterator = Prototype.K, args = $A(arguments);
|
986 |
+
if (Object.isFunction(args.last()))
|
987 |
+
iterator = args.pop();
|
988 |
+
|
989 |
+
var collections = [this].concat(args).map($A);
|
990 |
+
return this.map(function(value, index) {
|
991 |
+
return iterator(collections.pluck(index));
|
992 |
+
});
|
993 |
+
}
|
994 |
+
|
995 |
+
function size() {
|
996 |
+
return this.toArray().length;
|
997 |
+
}
|
998 |
+
|
999 |
+
function inspect() {
|
1000 |
+
return '#<Enumerable:' + this.toArray().inspect() + '>';
|
1001 |
+
}
|
1002 |
+
|
1003 |
+
|
1004 |
+
|
1005 |
+
|
1006 |
+
|
1007 |
+
|
1008 |
+
|
1009 |
+
|
1010 |
+
|
1011 |
+
return {
|
1012 |
+
each: each,
|
1013 |
+
eachSlice: eachSlice,
|
1014 |
+
all: all,
|
1015 |
+
every: all,
|
1016 |
+
any: any,
|
1017 |
+
some: any,
|
1018 |
+
collect: collect,
|
1019 |
+
map: collect,
|
1020 |
+
detect: detect,
|
1021 |
+
findAll: findAll,
|
1022 |
+
select: findAll,
|
1023 |
+
filter: findAll,
|
1024 |
+
grep: grep,
|
1025 |
+
include: include,
|
1026 |
+
member: include,
|
1027 |
+
inGroupsOf: inGroupsOf,
|
1028 |
+
inject: inject,
|
1029 |
+
invoke: invoke,
|
1030 |
+
max: max,
|
1031 |
+
min: min,
|
1032 |
+
partition: partition,
|
1033 |
+
pluck: pluck,
|
1034 |
+
reject: reject,
|
1035 |
+
sortBy: sortBy,
|
1036 |
+
toArray: toArray,
|
1037 |
+
entries: toArray,
|
1038 |
+
zip: zip,
|
1039 |
+
size: size,
|
1040 |
+
inspect: inspect,
|
1041 |
+
find: detect
|
1042 |
+
};
|
1043 |
+
})();
|
1044 |
+
|
1045 |
+
function $A(iterable) {
|
1046 |
+
if (!iterable) return [];
|
1047 |
+
if ('toArray' in Object(iterable)) return iterable.toArray();
|
1048 |
+
var length = iterable.length || 0, results = new Array(length);
|
1049 |
+
while (length--) results[length] = iterable[length];
|
1050 |
+
return results;
|
1051 |
+
}
|
1052 |
+
|
1053 |
+
|
1054 |
+
function $w(string) {
|
1055 |
+
if (!Object.isString(string)) return [];
|
1056 |
+
string = string.strip();
|
1057 |
+
return string ? string.split(/\s+/) : [];
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
Array.from = $A;
|
1061 |
+
|
1062 |
+
|
1063 |
+
(function() {
|
1064 |
+
var arrayProto = Array.prototype,
|
1065 |
+
slice = arrayProto.slice,
|
1066 |
+
_each = arrayProto.forEach; // use native browser JS 1.6 implementation if available
|
1067 |
+
|
1068 |
+
function each(iterator, context) {
|
1069 |
+
for (var i = 0, length = this.length >>> 0; i < length; i++) {
|
1070 |
+
if (i in this) iterator.call(context, this[i], i, this);
|
1071 |
+
}
|
1072 |
+
}
|
1073 |
+
if (!_each) _each = each;
|
1074 |
+
|
1075 |
+
function clear() {
|
1076 |
+
this.length = 0;
|
1077 |
+
return this;
|
1078 |
+
}
|
1079 |
+
|
1080 |
+
function first() {
|
1081 |
+
return this[0];
|
1082 |
+
}
|
1083 |
+
|
1084 |
+
function last() {
|
1085 |
+
return this[this.length - 1];
|
1086 |
+
}
|
1087 |
+
|
1088 |
+
function compact() {
|
1089 |
+
return this.select(function(value) {
|
1090 |
+
return value != null;
|
1091 |
+
});
|
1092 |
+
}
|
1093 |
+
|
1094 |
+
function flatten() {
|
1095 |
+
return this.inject([], function(array, value) {
|
1096 |
+
if (Object.isArray(value))
|
1097 |
+
return array.concat(value.flatten());
|
1098 |
+
array.push(value);
|
1099 |
+
return array;
|
1100 |
+
});
|
1101 |
+
}
|
1102 |
+
|
1103 |
+
function without() {
|
1104 |
+
var values = slice.call(arguments, 0);
|
1105 |
+
return this.select(function(value) {
|
1106 |
+
return !values.include(value);
|
1107 |
+
});
|
1108 |
+
}
|
1109 |
+
|
1110 |
+
function reverse(inline) {
|
1111 |
+
return (inline === false ? this.toArray() : this)._reverse();
|
1112 |
+
}
|
1113 |
+
|
1114 |
+
function uniq(sorted) {
|
1115 |
+
return this.inject([], function(array, value, index) {
|
1116 |
+
if (0 == index || (sorted ? array.last() != value : !array.include(value)))
|
1117 |
+
array.push(value);
|
1118 |
+
return array;
|
1119 |
+
});
|
1120 |
+
}
|
1121 |
+
|
1122 |
+
function intersect(array) {
|
1123 |
+
return this.uniq().findAll(function(item) {
|
1124 |
+
return array.detect(function(value) { return item === value });
|
1125 |
+
});
|
1126 |
+
}
|
1127 |
+
|
1128 |
+
|
1129 |
+
function clone() {
|
1130 |
+
return slice.call(this, 0);
|
1131 |
+
}
|
1132 |
+
|
1133 |
+
function size() {
|
1134 |
+
return this.length;
|
1135 |
+
}
|
1136 |
+
|
1137 |
+
function inspect() {
|
1138 |
+
return '[' + this.map(Object.inspect).join(', ') + ']';
|
1139 |
+
}
|
1140 |
+
|
1141 |
+
function indexOf(item, i) {
|
1142 |
+
i || (i = 0);
|
1143 |
+
var length = this.length;
|
1144 |
+
if (i < 0) i = length + i;
|
1145 |
+
for (; i < length; i++)
|
1146 |
+
if (this[i] === item) return i;
|
1147 |
+
return -1;
|
1148 |
+
}
|
1149 |
+
|
1150 |
+
function lastIndexOf(item, i) {
|
1151 |
+
i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
|
1152 |
+
var n = this.slice(0, i).reverse().indexOf(item);
|
1153 |
+
return (n < 0) ? n : i - n - 1;
|
1154 |
+
}
|
1155 |
+
|
1156 |
+
function concat() {
|
1157 |
+
var array = slice.call(this, 0), item;
|
1158 |
+
for (var i = 0, length = arguments.length; i < length; i++) {
|
1159 |
+
item = arguments[i];
|
1160 |
+
if (Object.isArray(item) && !('callee' in item)) {
|
1161 |
+
for (var j = 0, arrayLength = item.length; j < arrayLength; j++)
|
1162 |
+
array.push(item[j]);
|
1163 |
+
} else {
|
1164 |
+
array.push(item);
|
1165 |
+
}
|
1166 |
+
}
|
1167 |
+
return array;
|
1168 |
+
}
|
1169 |
+
|
1170 |
+
Object.extend(arrayProto, Enumerable);
|
1171 |
+
|
1172 |
+
if (!arrayProto._reverse)
|
1173 |
+
arrayProto._reverse = arrayProto.reverse;
|
1174 |
+
|
1175 |
+
Object.extend(arrayProto, {
|
1176 |
+
_each: _each,
|
1177 |
+
clear: clear,
|
1178 |
+
first: first,
|
1179 |
+
last: last,
|
1180 |
+
compact: compact,
|
1181 |
+
flatten: flatten,
|
1182 |
+
without: without,
|
1183 |
+
reverse: reverse,
|
1184 |
+
uniq: uniq,
|
1185 |
+
intersect: intersect,
|
1186 |
+
clone: clone,
|
1187 |
+
toArray: clone,
|
1188 |
+
size: size,
|
1189 |
+
inspect: inspect
|
1190 |
+
});
|
1191 |
+
|
1192 |
+
var CONCAT_ARGUMENTS_BUGGY = (function() {
|
1193 |
+
return [].concat(arguments)[0][0] !== 1;
|
1194 |
+
})(1,2)
|
1195 |
+
|
1196 |
+
if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat;
|
1197 |
+
|
1198 |
+
if (!arrayProto.indexOf) arrayProto.indexOf = indexOf;
|
1199 |
+
if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf;
|
1200 |
+
})();
|
1201 |
+
function $H(object) {
|
1202 |
+
return new Hash(object);
|
1203 |
+
};
|
1204 |
+
|
1205 |
+
var Hash = Class.create(Enumerable, (function() {
|
1206 |
+
function initialize(object) {
|
1207 |
+
this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
|
1211 |
+
function _each(iterator) {
|
1212 |
+
for (var key in this._object) {
|
1213 |
+
var value = this._object[key], pair = [key, value];
|
1214 |
+
pair.key = key;
|
1215 |
+
pair.value = value;
|
1216 |
+
iterator(pair);
|
1217 |
+
}
|
1218 |
+
}
|
1219 |
+
|
1220 |
+
function set(key, value) {
|
1221 |
+
return this._object[key] = value;
|
1222 |
+
}
|
1223 |
+
|
1224 |
+
function get(key) {
|
1225 |
+
if (this._object[key] !== Object.prototype[key])
|
1226 |
+
return this._object[key];
|
1227 |
+
}
|
1228 |
+
|
1229 |
+
function unset(key) {
|
1230 |
+
var value = this._object[key];
|
1231 |
+
delete this._object[key];
|
1232 |
+
return value;
|
1233 |
+
}
|
1234 |
+
|
1235 |
+
function toObject() {
|
1236 |
+
return Object.clone(this._object);
|
1237 |
+
}
|
1238 |
+
|
1239 |
+
|
1240 |
+
|
1241 |
+
function keys() {
|
1242 |
+
return this.pluck('key');
|
1243 |
+
}
|
1244 |
+
|
1245 |
+
function values() {
|
1246 |
+
return this.pluck('value');
|
1247 |
+
}
|
1248 |
+
|
1249 |
+
function index(value) {
|
1250 |
+
var match = this.detect(function(pair) {
|
1251 |
+
return pair.value === value;
|
1252 |
+
});
|
1253 |
+
return match && match.key;
|
1254 |
+
}
|
1255 |
+
|
1256 |
+
function merge(object) {
|
1257 |
+
return this.clone().update(object);
|
1258 |
+
}
|
1259 |
+
|
1260 |
+
function update(object) {
|
1261 |
+
return new Hash(object).inject(this, function(result, pair) {
|
1262 |
+
result.set(pair.key, pair.value);
|
1263 |
+
return result;
|
1264 |
+
});
|
1265 |
+
}
|
1266 |
+
|
1267 |
+
function toQueryPair(key, value) {
|
1268 |
+
if (Object.isUndefined(value)) return key;
|
1269 |
+
return key + '=' + encodeURIComponent(String.interpret(value));
|
1270 |
+
}
|
1271 |
+
|
1272 |
+
function toQueryString() {
|
1273 |
+
return this.inject([], function(results, pair) {
|
1274 |
+
var key = encodeURIComponent(pair.key), values = pair.value;
|
1275 |
+
|
1276 |
+
if (values && typeof values == 'object') {
|
1277 |
+
if (Object.isArray(values)) {
|
1278 |
+
var queryValues = [];
|
1279 |
+
for (var i = 0, len = values.length, value; i < len; i++) {
|
1280 |
+
value = values[i];
|
1281 |
+
queryValues.push(toQueryPair(key, value));
|
1282 |
+
}
|
1283 |
+
return results.concat(queryValues);
|
1284 |
+
}
|
1285 |
+
} else results.push(toQueryPair(key, values));
|
1286 |
+
return results;
|
1287 |
+
}).join('&');
|
1288 |
+
}
|
1289 |
+
|
1290 |
+
function inspect() {
|
1291 |
+
return '#<Hash:{' + this.map(function(pair) {
|
1292 |
+
return pair.map(Object.inspect).join(': ');
|
1293 |
+
}).join(', ') + '}>';
|
1294 |
+
}
|
1295 |
+
|
1296 |
+
function clone() {
|
1297 |
+
return new Hash(this);
|
1298 |
+
}
|
1299 |
+
|
1300 |
+
return {
|
1301 |
+
initialize: initialize,
|
1302 |
+
_each: _each,
|
1303 |
+
set: set,
|
1304 |
+
get: get,
|
1305 |
+
unset: unset,
|
1306 |
+
toObject: toObject,
|
1307 |
+
toTemplateReplacements: toObject,
|
1308 |
+
keys: keys,
|
1309 |
+
values: values,
|
1310 |
+
index: index,
|
1311 |
+
merge: merge,
|
1312 |
+
update: update,
|
1313 |
+
toQueryString: toQueryString,
|
1314 |
+
inspect: inspect,
|
1315 |
+
toJSON: toObject,
|
1316 |
+
clone: clone
|
1317 |
+
};
|
1318 |
+
})());
|
1319 |
+
|
1320 |
+
Hash.from = $H;
|
1321 |
+
Object.extend(Number.prototype, (function() {
|
1322 |
+
function toColorPart() {
|
1323 |
+
return this.toPaddedString(2, 16);
|
1324 |
+
}
|
1325 |
+
|
1326 |
+
function succ() {
|
1327 |
+
return this + 1;
|
1328 |
+
}
|
1329 |
+
|
1330 |
+
function times(iterator, context) {
|
1331 |
+
$R(0, this, true).each(iterator, context);
|
1332 |
+
return this;
|
1333 |
+
}
|
1334 |
+
|
1335 |
+
function toPaddedString(length, radix) {
|
1336 |
+
var string = this.toString(radix || 10);
|
1337 |
+
return '0'.times(length - string.length) + string;
|
1338 |
+
}
|
1339 |
+
|
1340 |
+
function abs() {
|
1341 |
+
return Math.abs(this);
|
1342 |
+
}
|
1343 |
+
|
1344 |
+
function round() {
|
1345 |
+
return Math.round(this);
|
1346 |
+
}
|
1347 |
+
|
1348 |
+
function ceil() {
|
1349 |
+
return Math.ceil(this);
|
1350 |
+
}
|
1351 |
+
|
1352 |
+
function floor() {
|
1353 |
+
return Math.floor(this);
|
1354 |
+
}
|
1355 |
+
|
1356 |
+
return {
|
1357 |
+
toColorPart: toColorPart,
|
1358 |
+
succ: succ,
|
1359 |
+
times: times,
|
1360 |
+
toPaddedString: toPaddedString,
|
1361 |
+
abs: abs,
|
1362 |
+
round: round,
|
1363 |
+
ceil: ceil,
|
1364 |
+
floor: floor
|
1365 |
+
};
|
1366 |
+
})());
|
1367 |
+
|
1368 |
+
function $R(start, end, exclusive) {
|
1369 |
+
return new ObjectRange(start, end, exclusive);
|
1370 |
+
}
|
1371 |
+
|
1372 |
+
var ObjectRange = Class.create(Enumerable, (function() {
|
1373 |
+
function initialize(start, end, exclusive) {
|
1374 |
+
this.start = start;
|
1375 |
+
this.end = end;
|
1376 |
+
this.exclusive = exclusive;
|
1377 |
+
}
|
1378 |
+
|
1379 |
+
function _each(iterator) {
|
1380 |
+
var value = this.start;
|
1381 |
+
while (this.include(value)) {
|
1382 |
+
iterator(value);
|
1383 |
+
value = value.succ();
|
1384 |
+
}
|
1385 |
+
}
|
1386 |
+
|
1387 |
+
function include(value) {
|
1388 |
+
if (value < this.start)
|
1389 |
+
return false;
|
1390 |
+
if (this.exclusive)
|
1391 |
+
return value < this.end;
|
1392 |
+
return value <= this.end;
|
1393 |
+
}
|
1394 |
+
|
1395 |
+
return {
|
1396 |
+
initialize: initialize,
|
1397 |
+
_each: _each,
|
1398 |
+
include: include
|
1399 |
+
};
|
1400 |
+
})());
|
1401 |
+
|
1402 |
+
|
1403 |
+
|
1404 |
+
var Abstract = { };
|
1405 |
+
|
1406 |
+
|
1407 |
+
var Try = {
|
1408 |
+
these: function() {
|
1409 |
+
var returnValue;
|
1410 |
+
|
1411 |
+
for (var i = 0, length = arguments.length; i < length; i++) {
|
1412 |
+
var lambda = arguments[i];
|
1413 |
+
try {
|
1414 |
+
returnValue = lambda();
|
1415 |
+
break;
|
1416 |
+
} catch (e) { }
|
1417 |
+
}
|
1418 |
+
|
1419 |
+
return returnValue;
|
1420 |
+
}
|
1421 |
+
};
|
1422 |
+
|
1423 |
+
var Ajax = {
|
1424 |
+
getTransport: function() {
|
1425 |
+
return Try.these(
|
1426 |
+
function() {return new XMLHttpRequest()},
|
1427 |
+
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
|
1428 |
+
function() {return new ActiveXObject('Microsoft.XMLHTTP')}
|
1429 |
+
) || false;
|
1430 |
+
},
|
1431 |
+
|
1432 |
+
activeRequestCount: 0
|
1433 |
+
};
|
1434 |
+
|
1435 |
+
Ajax.Responders = {
|
1436 |
+
responders: [],
|
1437 |
+
|
1438 |
+
_each: function(iterator) {
|
1439 |
+
this.responders._each(iterator);
|
1440 |
+
},
|
1441 |
+
|
1442 |
+
register: function(responder) {
|
1443 |
+
if (!this.include(responder))
|
1444 |
+
this.responders.push(responder);
|
1445 |
+
},
|
1446 |
+
|
1447 |
+
unregister: function(responder) {
|
1448 |
+
this.responders = this.responders.without(responder);
|
1449 |
+
},
|
1450 |
+
|
1451 |
+
dispatch: function(callback, request, transport, json) {
|
1452 |
+
this.each(function(responder) {
|
1453 |
+
if (Object.isFunction(responder[callback])) {
|
1454 |
+
try {
|
1455 |
+
responder[callback].apply(responder, [request, transport, json]);
|
1456 |
+
} catch (e) { }
|
1457 |
+
}
|
1458 |
+
});
|
1459 |
+
}
|
1460 |
+
};
|
1461 |
+
|
1462 |
+
Object.extend(Ajax.Responders, Enumerable);
|
1463 |
+
|
1464 |
+
Ajax.Responders.register({
|
1465 |
+
onCreate: function() { Ajax.activeRequestCount++ },
|
1466 |
+
onComplete: function() { Ajax.activeRequestCount-- }
|
1467 |
+
});
|
1468 |
+
Ajax.Base = Class.create({
|
1469 |
+
initialize: function(options) {
|
1470 |
+
this.options = {
|
1471 |
+
method: 'post',
|
1472 |
+
asynchronous: true,
|
1473 |
+
contentType: 'application/x-www-form-urlencoded',
|
1474 |
+
encoding: 'UTF-8',
|
1475 |
+
parameters: '',
|
1476 |
+
evalJSON: true,
|
1477 |
+
evalJS: true
|
1478 |
+
};
|
1479 |
+
Object.extend(this.options, options || { });
|
1480 |
+
|
1481 |
+
this.options.method = this.options.method.toLowerCase();
|
1482 |
+
|
1483 |
+
if (Object.isHash(this.options.parameters))
|
1484 |
+
this.options.parameters = this.options.parameters.toObject();
|
1485 |
+
}
|
1486 |
+
});
|
1487 |
+
Ajax.Request = Class.create(Ajax.Base, {
|
1488 |
+
_complete: false,
|
1489 |
+
|
1490 |
+
initialize: function($super, url, options) {
|
1491 |
+
$super(options);
|
1492 |
+
this.transport = Ajax.getTransport();
|
1493 |
+
this.request(url);
|
1494 |
+
},
|
1495 |
+
|
1496 |
+
request: function(url) {
|
1497 |
+
this.url = url;
|
1498 |
+
this.method = this.options.method;
|
1499 |
+
var params = Object.isString(this.options.parameters) ?
|
1500 |
+
this.options.parameters :
|
1501 |
+
Object.toQueryString(this.options.parameters);
|
1502 |
+
|
1503 |
+
if (!['get', 'post'].include(this.method)) {
|
1504 |
+
params += (params ? '&' : '') + "_method=" + this.method;
|
1505 |
+
this.method = 'post';
|
1506 |
+
}
|
1507 |
+
|
1508 |
+
if (params && this.method === 'get') {
|
1509 |
+
this.url += (this.url.include('?') ? '&' : '?') + params;
|
1510 |
+
}
|
1511 |
+
|
1512 |
+
this.parameters = params.toQueryParams();
|
1513 |
+
|
1514 |
+
try {
|
1515 |
+
var response = new Ajax.Response(this);
|
1516 |
+
if (this.options.onCreate) this.options.onCreate(response);
|
1517 |
+
Ajax.Responders.dispatch('onCreate', this, response);
|
1518 |
+
|
1519 |
+
this.transport.open(this.method.toUpperCase(), this.url,
|
1520 |
+
this.options.asynchronous);
|
1521 |
+
|
1522 |
+
if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
|
1523 |
+
|
1524 |
+
this.transport.onreadystatechange = this.onStateChange.bind(this);
|
1525 |
+
this.setRequestHeaders();
|
1526 |
+
|
1527 |
+
this.body = this.method == 'post' ? (this.options.postBody || params) : null;
|
1528 |
+
this.transport.send(this.body);
|
1529 |
+
|
1530 |
+
/* Force Firefox to handle ready state 4 for synchronous requests */
|
1531 |
+
if (!this.options.asynchronous && this.transport.overrideMimeType)
|
1532 |
+
this.onStateChange();
|
1533 |
+
|
1534 |
+
}
|
1535 |
+
catch (e) {
|
1536 |
+
this.dispatchException(e);
|
1537 |
+
}
|
1538 |
+
},
|
1539 |
+
|
1540 |
+
onStateChange: function() {
|
1541 |
+
var readyState = this.transport.readyState;
|
1542 |
+
if (readyState > 1 && !((readyState == 4) && this._complete))
|
1543 |
+
this.respondToReadyState(this.transport.readyState);
|
1544 |
+
},
|
1545 |
+
|
1546 |
+
setRequestHeaders: function() {
|
1547 |
+
var headers = {
|
1548 |
+
'X-Requested-With': 'XMLHttpRequest',
|
1549 |
+
'X-Prototype-Version': Prototype.Version,
|
1550 |
+
'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
|
1551 |
+
};
|
1552 |
+
|
1553 |
+
if (this.method == 'post') {
|
1554 |
+
headers['Content-type'] = this.options.contentType +
|
1555 |
+
(this.options.encoding ? '; charset=' + this.options.encoding : '');
|
1556 |
+
|
1557 |
+
/* Force "Connection: close" for older Mozilla browsers to work
|
1558 |
+
* around a bug where XMLHttpRequest sends an incorrect
|
1559 |
+
* Content-length header. See Mozilla Bugzilla #246651.
|
1560 |
+
*/
|
1561 |
+
if (this.transport.overrideMimeType &&
|
1562 |
+
(navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
|
1563 |
+
headers['Connection'] = 'close';
|
1564 |
+
}
|
1565 |
+
|
1566 |
+
if (typeof this.options.requestHeaders == 'object') {
|
1567 |
+
var extras = this.options.requestHeaders;
|
1568 |
+
|
1569 |
+
if (Object.isFunction(extras.push))
|
1570 |
+
for (var i = 0, length = extras.length; i < length; i += 2)
|
1571 |
+
headers[extras[i]] = extras[i+1];
|
1572 |
+
else
|
1573 |
+
$H(extras).each(function(pair) { headers[pair.key] = pair.value });
|
1574 |
+
}
|
1575 |
+
|
1576 |
+
for (var name in headers)
|
1577 |
+
this.transport.setRequestHeader(name, headers[name]);
|
1578 |
+
},
|
1579 |
+
|
1580 |
+
success: function() {
|
1581 |
+
var status = this.getStatus();
|
1582 |
+
return !status || (status >= 200 && status < 300) || status == 304;
|
1583 |
+
},
|
1584 |
+
|
1585 |
+
getStatus: function() {
|
1586 |
+
try {
|
1587 |
+
if (this.transport.status === 1223) return 204;
|
1588 |
+
return this.transport.status || 0;
|
1589 |
+
} catch (e) { return 0 }
|
1590 |
+
},
|
1591 |
+
|
1592 |
+
respondToReadyState: function(readyState) {
|
1593 |
+
var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
|
1594 |
+
|
1595 |
+
if (state == 'Complete') {
|
1596 |
+
try {
|
1597 |
+
this._complete = true;
|
1598 |
+
(this.options['on' + response.status]
|
1599 |
+
|| this.options['on' + (this.success() ? 'Success' : 'Failure')]
|
1600 |
+
|| Prototype.emptyFunction)(response, response.headerJSON);
|
1601 |
+
} catch (e) {
|
1602 |
+
this.dispatchException(e);
|
1603 |
+
}
|
1604 |
+
|
1605 |
+
var contentType = response.getHeader('Content-type');
|
1606 |
+
if (this.options.evalJS == 'force'
|
1607 |
+
|| (this.options.evalJS && this.isSameOrigin() && contentType
|
1608 |
+
&& contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
|
1609 |
+
this.evalResponse();
|
1610 |
+
}
|
1611 |
+
|
1612 |
+
try {
|
1613 |
+
(this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
|
1614 |
+
Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
|
1615 |
+
} catch (e) {
|
1616 |
+
this.dispatchException(e);
|
1617 |
+
}
|
1618 |
+
|
1619 |
+
if (state == 'Complete') {
|
1620 |
+
this.transport.onreadystatechange = Prototype.emptyFunction;
|
1621 |
+
}
|
1622 |
+
},
|
1623 |
+
|
1624 |
+
isSameOrigin: function() {
|
1625 |
+
var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
|
1626 |
+
return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
|
1627 |
+
protocol: location.protocol,
|
1628 |
+
domain: document.domain,
|
1629 |
+
port: location.port ? ':' + location.port : ''
|
1630 |
+
}));
|
1631 |
+
},
|
1632 |
+
|
1633 |
+
getHeader: function(name) {
|
1634 |
+
try {
|
1635 |
+
return this.transport.getResponseHeader(name) || null;
|
1636 |
+
} catch (e) { return null; }
|
1637 |
+
},
|
1638 |
+
|
1639 |
+
evalResponse: function() {
|
1640 |
+
try {
|
1641 |
+
return eval((this.transport.responseText || '').unfilterJSON());
|
1642 |
+
} catch (e) {
|
1643 |
+
this.dispatchException(e);
|
1644 |
+
}
|
1645 |
+
},
|
1646 |
+
|
1647 |
+
dispatchException: function(exception) {
|
1648 |
+
(this.options.onException || Prototype.emptyFunction)(this, exception);
|
1649 |
+
Ajax.Responders.dispatch('onException', this, exception);
|
1650 |
+
}
|
1651 |
+
});
|
1652 |
+
|
1653 |
+
Ajax.Request.Events =
|
1654 |
+
['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
|
1655 |
+
|
1656 |
+
|
1657 |
+
|
1658 |
+
|
1659 |
+
|
1660 |
+
|
1661 |
+
|
1662 |
+
|
1663 |
+
Ajax.Response = Class.create({
|
1664 |
+
initialize: function(request){
|
1665 |
+
this.request = request;
|
1666 |
+
var transport = this.transport = request.transport,
|
1667 |
+
readyState = this.readyState = transport.readyState;
|
1668 |
+
|
1669 |
+
if ((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
|
1670 |
+
this.status = this.getStatus();
|
1671 |
+
this.statusText = this.getStatusText();
|
1672 |
+
this.responseText = String.interpret(transport.responseText);
|
1673 |
+
this.headerJSON = this._getHeaderJSON();
|
1674 |
+
}
|
1675 |
+
|
1676 |
+
if (readyState == 4) {
|
1677 |
+
var xml = transport.responseXML;
|
1678 |
+
this.responseXML = Object.isUndefined(xml) ? null : xml;
|
1679 |
+
this.responseJSON = this._getResponseJSON();
|
1680 |
+
}
|
1681 |
+
},
|
1682 |
+
|
1683 |
+
status: 0,
|
1684 |
+
|
1685 |
+
statusText: '',
|
1686 |
+
|
1687 |
+
getStatus: Ajax.Request.prototype.getStatus,
|
1688 |
+
|
1689 |
+
getStatusText: function() {
|
1690 |
+
try {
|
1691 |
+
return this.transport.statusText || '';
|
1692 |
+
} catch (e) { return '' }
|
1693 |
+
},
|
1694 |
+
|
1695 |
+
getHeader: Ajax.Request.prototype.getHeader,
|
1696 |
+
|
1697 |
+
getAllHeaders: function() {
|
1698 |
+
try {
|
1699 |
+
return this.getAllResponseHeaders();
|
1700 |
+
} catch (e) { return null }
|
1701 |
+
},
|
1702 |
+
|
1703 |
+
getResponseHeader: function(name) {
|
1704 |
+
return this.transport.getResponseHeader(name);
|
1705 |
+
},
|
1706 |
+
|
1707 |
+
getAllResponseHeaders: function() {
|
1708 |
+
return this.transport.getAllResponseHeaders();
|
1709 |
+
},
|
1710 |
+
|
1711 |
+
_getHeaderJSON: function() {
|
1712 |
+
var json = this.getHeader('X-JSON');
|
1713 |
+
if (!json) return null;
|
1714 |
+
json = decodeURIComponent(escape(json));
|
1715 |
+
try {
|
1716 |
+
return json.evalJSON(this.request.options.sanitizeJSON ||
|
1717 |
+
!this.request.isSameOrigin());
|
1718 |
+
} catch (e) {
|
1719 |
+
this.request.dispatchException(e);
|
1720 |
+
}
|
1721 |
+
},
|
1722 |
+
|
1723 |
+
_getResponseJSON: function() {
|
1724 |
+
var options = this.request.options;
|
1725 |
+
if (!options.evalJSON || (options.evalJSON != 'force' &&
|
1726 |
+
!(this.getHeader('Content-type') || '').include('application/json')) ||
|
1727 |
+
this.responseText.blank())
|
1728 |
+
return null;
|
1729 |
+
try {
|
1730 |
+
return this.responseText.evalJSON(options.sanitizeJSON ||
|
1731 |
+
!this.request.isSameOrigin());
|
1732 |
+
} catch (e) {
|
1733 |
+
this.request.dispatchException(e);
|
1734 |
+
}
|
1735 |
+
}
|
1736 |
+
});
|
1737 |
+
|
1738 |
+
Ajax.Updater = Class.create(Ajax.Request, {
|
1739 |
+
initialize: function($super, container, url, options) {
|
1740 |
+
this.container = {
|
1741 |
+
success: (container.success || container),
|
1742 |
+
failure: (container.failure || (container.success ? null : container))
|
1743 |
+
};
|
1744 |
+
|
1745 |
+
options = Object.clone(options);
|
1746 |
+
var onComplete = options.onComplete;
|
1747 |
+
options.onComplete = (function(response, json) {
|
1748 |
+
this.updateContent(response.responseText);
|
1749 |
+
if (Object.isFunction(onComplete)) onComplete(response, json);
|
1750 |
+
}).bind(this);
|
1751 |
+
|
1752 |
+
$super(url, options);
|
1753 |
+
},
|
1754 |
+
|
1755 |
+
updateContent: function(responseText) {
|
1756 |
+
var receiver = this.container[this.success() ? 'success' : 'failure'],
|
1757 |
+
options = this.options;
|
1758 |
+
|
1759 |
+
if (!options.evalScripts) responseText = responseText.stripScripts();
|
1760 |
+
|
1761 |
+
if (receiver = $(receiver)) {
|
1762 |
+
if (options.insertion) {
|
1763 |
+
if (Object.isString(options.insertion)) {
|
1764 |
+
var insertion = { }; insertion[options.insertion] = responseText;
|
1765 |
+
receiver.insert(insertion);
|
1766 |
+
}
|
1767 |
+
else options.insertion(receiver, responseText);
|
1768 |
+
}
|
1769 |
+
else receiver.update(responseText);
|
1770 |
+
}
|
1771 |
+
}
|
1772 |
+
});
|
1773 |
+
|
1774 |
+
Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
1775 |
+
initialize: function($super, container, url, options) {
|
1776 |
+
$super(options);
|
1777 |
+
this.onComplete = this.options.onComplete;
|
1778 |
+
|
1779 |
+
this.frequency = (this.options.frequency || 2);
|
1780 |
+
this.decay = (this.options.decay || 1);
|
1781 |
+
|
1782 |
+
this.updater = { };
|
1783 |
+
this.container = container;
|
1784 |
+
this.url = url;
|
1785 |
+
|
1786 |
+
this.start();
|
1787 |
+
},
|
1788 |
+
|
1789 |
+
start: function() {
|
1790 |
+
this.options.onComplete = this.updateComplete.bind(this);
|
1791 |
+
this.onTimerEvent();
|
1792 |
+
},
|
1793 |
+
|
1794 |
+
stop: function() {
|
1795 |
+
this.updater.options.onComplete = undefined;
|
1796 |
+
clearTimeout(this.timer);
|
1797 |
+
(this.onComplete || Prototype.emptyFunction).apply(this, arguments);
|
1798 |
+
},
|
1799 |
+
|
1800 |
+
updateComplete: function(response) {
|
1801 |
+
if (this.options.decay) {
|
1802 |
+
this.decay = (response.responseText == this.lastText ?
|
1803 |
+
this.decay * this.options.decay : 1);
|
1804 |
+
|
1805 |
+
this.lastText = response.responseText;
|
1806 |
+
}
|
1807 |
+
this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
|
1808 |
+
},
|
1809 |
+
|
1810 |
+
onTimerEvent: function() {
|
1811 |
+
this.updater = new Ajax.Updater(this.container, this.url, this.options);
|
1812 |
+
}
|
1813 |
+
});
|
1814 |
+
|
1815 |
+
|
1816 |
+
function $(element) {
|
1817 |
+
if (arguments.length > 1) {
|
1818 |
+
for (var i = 0, elements = [], length = arguments.length; i < length; i++)
|
1819 |
+
elements.push($(arguments[i]));
|
1820 |
+
return elements;
|
1821 |
+
}
|
1822 |
+
if (Object.isString(element))
|
1823 |
+
element = document.getElementById(element);
|
1824 |
+
return Element.extend(element);
|
1825 |
+
}
|
1826 |
+
|
1827 |
+
if (Prototype.BrowserFeatures.XPath) {
|
1828 |
+
document._getElementsByXPath = function(expression, parentElement) {
|
1829 |
+
var results = [];
|
1830 |
+
var query = document.evaluate(expression, $(parentElement) || document,
|
1831 |
+
null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
|
1832 |
+
for (var i = 0, length = query.snapshotLength; i < length; i++)
|
1833 |
+
results.push(Element.extend(query.snapshotItem(i)));
|
1834 |
+
return results;
|
1835 |
+
};
|
1836 |
+
}
|
1837 |
+
|
1838 |
+
/*--------------------------------------------------------------------------*/
|
1839 |
+
|
1840 |
+
if (!Node) var Node = { };
|
1841 |
+
|
1842 |
+
if (!Node.ELEMENT_NODE) {
|
1843 |
+
Object.extend(Node, {
|
1844 |
+
ELEMENT_NODE: 1,
|
1845 |
+
ATTRIBUTE_NODE: 2,
|
1846 |
+
TEXT_NODE: 3,
|
1847 |
+
CDATA_SECTION_NODE: 4,
|
1848 |
+
ENTITY_REFERENCE_NODE: 5,
|
1849 |
+
ENTITY_NODE: 6,
|
1850 |
+
PROCESSING_INSTRUCTION_NODE: 7,
|
1851 |
+
COMMENT_NODE: 8,
|
1852 |
+
DOCUMENT_NODE: 9,
|
1853 |
+
DOCUMENT_TYPE_NODE: 10,
|
1854 |
+
DOCUMENT_FRAGMENT_NODE: 11,
|
1855 |
+
NOTATION_NODE: 12
|
1856 |
+
});
|
1857 |
+
}
|
1858 |
+
|
1859 |
+
|
1860 |
+
|
1861 |
+
(function(global) {
|
1862 |
+
function shouldUseCache(tagName, attributes) {
|
1863 |
+
if (tagName === 'select') return false;
|
1864 |
+
if ('type' in attributes) return false;
|
1865 |
+
return true;
|
1866 |
+
}
|
1867 |
+
|
1868 |
+
var HAS_EXTENDED_CREATE_ELEMENT_SYNTAX = (function(){
|
1869 |
+
try {
|
1870 |
+
var el = document.createElement('<input name="x">');
|
1871 |
+
return el.tagName.toLowerCase() === 'input' && el.name === 'x';
|
1872 |
+
}
|
1873 |
+
catch(err) {
|
1874 |
+
return false;
|
1875 |
+
}
|
1876 |
+
})();
|
1877 |
+
|
1878 |
+
var element = global.Element;
|
1879 |
+
|
1880 |
+
global.Element = function(tagName, attributes) {
|
1881 |
+
attributes = attributes || { };
|
1882 |
+
tagName = tagName.toLowerCase();
|
1883 |
+
var cache = Element.cache;
|
1884 |
+
|
1885 |
+
if (HAS_EXTENDED_CREATE_ELEMENT_SYNTAX && attributes.name) {
|
1886 |
+
tagName = '<' + tagName + ' name="' + attributes.name + '">';
|
1887 |
+
delete attributes.name;
|
1888 |
+
return Element.writeAttribute(document.createElement(tagName), attributes);
|
1889 |
+
}
|
1890 |
+
|
1891 |
+
if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
|
1892 |
+
|
1893 |
+
var node = shouldUseCache(tagName, attributes) ?
|
1894 |
+
cache[tagName].cloneNode(false) : document.createElement(tagName);
|
1895 |
+
|
1896 |
+
return Element.writeAttribute(node, attributes);
|
1897 |
+
};
|
1898 |
+
|
1899 |
+
Object.extend(global.Element, element || { });
|
1900 |
+
if (element) global.Element.prototype = element.prototype;
|
1901 |
+
|
1902 |
+
})(this);
|
1903 |
+
|
1904 |
+
Element.idCounter = 1;
|
1905 |
+
Element.cache = { };
|
1906 |
+
|
1907 |
+
Element._purgeElement = function(element) {
|
1908 |
+
var uid = element._prototypeUID;
|
1909 |
+
if (uid) {
|
1910 |
+
Element.stopObserving(element);
|
1911 |
+
element._prototypeUID = void 0;
|
1912 |
+
delete Element.Storage[uid];
|
1913 |
+
}
|
1914 |
+
}
|
1915 |
+
|
1916 |
+
Element.Methods = {
|
1917 |
+
visible: function(element) {
|
1918 |
+
return $(element).style.display != 'none';
|
1919 |
+
},
|
1920 |
+
|
1921 |
+
toggle: function(element) {
|
1922 |
+
element = $(element);
|
1923 |
+
Element[Element.visible(element) ? 'hide' : 'show'](element);
|
1924 |
+
return element;
|
1925 |
+
},
|
1926 |
+
|
1927 |
+
hide: function(element) {
|
1928 |
+
element = $(element);
|
1929 |
+
element.style.display = 'none';
|
1930 |
+
return element;
|
1931 |
+
},
|
1932 |
+
|
1933 |
+
show: function(element) {
|
1934 |
+
element = $(element);
|
1935 |
+
element.style.display = '';
|
1936 |
+
return element;
|
1937 |
+
},
|
1938 |
+
|
1939 |
+
remove: function(element) {
|
1940 |
+
element = $(element);
|
1941 |
+
element.parentNode.removeChild(element);
|
1942 |
+
return element;
|
1943 |
+
},
|
1944 |
+
|
1945 |
+
update: (function(){
|
1946 |
+
|
1947 |
+
var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){
|
1948 |
+
var el = document.createElement("select"),
|
1949 |
+
isBuggy = true;
|
1950 |
+
el.innerHTML = "<option value=\"test\">test</option>";
|
1951 |
+
if (el.options && el.options[0]) {
|
1952 |
+
isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION";
|
1953 |
+
}
|
1954 |
+
el = null;
|
1955 |
+
return isBuggy;
|
1956 |
+
})();
|
1957 |
+
|
1958 |
+
var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){
|
1959 |
+
try {
|
1960 |
+
var el = document.createElement("table");
|
1961 |
+
if (el && el.tBodies) {
|
1962 |
+
el.innerHTML = "<tbody><tr><td>test</td></tr></tbody>";
|
1963 |
+
var isBuggy = typeof el.tBodies[0] == "undefined";
|
1964 |
+
el = null;
|
1965 |
+
return isBuggy;
|
1966 |
+
}
|
1967 |
+
} catch (e) {
|
1968 |
+
return true;
|
1969 |
+
}
|
1970 |
+
})();
|
1971 |
+
|
1972 |
+
var LINK_ELEMENT_INNERHTML_BUGGY = (function() {
|
1973 |
+
try {
|
1974 |
+
var el = document.createElement('div');
|
1975 |
+
el.innerHTML = "<link>";
|
1976 |
+
var isBuggy = (el.childNodes.length === 0);
|
1977 |
+
el = null;
|
1978 |
+
return isBuggy;
|
1979 |
+
} catch(e) {
|
1980 |
+
return true;
|
1981 |
+
}
|
1982 |
+
})();
|
1983 |
+
|
1984 |
+
var ANY_INNERHTML_BUGGY = SELECT_ELEMENT_INNERHTML_BUGGY ||
|
1985 |
+
TABLE_ELEMENT_INNERHTML_BUGGY || LINK_ELEMENT_INNERHTML_BUGGY;
|
1986 |
+
|
1987 |
+
var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () {
|
1988 |
+
var s = document.createElement("script"),
|
1989 |
+
isBuggy = false;
|
1990 |
+
try {
|
1991 |
+
s.appendChild(document.createTextNode(""));
|
1992 |
+
isBuggy = !s.firstChild ||
|
1993 |
+
s.firstChild && s.firstChild.nodeType !== 3;
|
1994 |
+
} catch (e) {
|
1995 |
+
isBuggy = true;
|
1996 |
+
}
|
1997 |
+
s = null;
|
1998 |
+
return isBuggy;
|
1999 |
+
})();
|
2000 |
+
|
2001 |
+
|
2002 |
+
function update(element, content) {
|
2003 |
+
element = $(element);
|
2004 |
+
var purgeElement = Element._purgeElement;
|
2005 |
+
|
2006 |
+
var descendants = element.getElementsByTagName('*'),
|
2007 |
+
i = descendants.length;
|
2008 |
+
while (i--) purgeElement(descendants[i]);
|
2009 |
+
|
2010 |
+
if (content && content.toElement)
|
2011 |
+
content = content.toElement();
|
2012 |
+
|
2013 |
+
if (Object.isElement(content))
|
2014 |
+
return element.update().insert(content);
|
2015 |
+
|
2016 |
+
content = Object.toHTML(content);
|
2017 |
+
|
2018 |
+
var tagName = element.tagName.toUpperCase();
|
2019 |
+
|
2020 |
+
if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) {
|
2021 |
+
element.text = content;
|
2022 |
+
return element;
|
2023 |
+
}
|
2024 |
+
|
2025 |
+
if (ANY_INNERHTML_BUGGY) {
|
2026 |
+
if (tagName in Element._insertionTranslations.tags) {
|
2027 |
+
while (element.firstChild) {
|
2028 |
+
element.removeChild(element.firstChild);
|
2029 |
+
}
|
2030 |
+
Element._getContentFromAnonymousElement(tagName, content.stripScripts())
|
2031 |
+
.each(function(node) {
|
2032 |
+
element.appendChild(node)
|
2033 |
+
});
|
2034 |
+
} else if (LINK_ELEMENT_INNERHTML_BUGGY && Object.isString(content) && content.indexOf('<link') > -1) {
|
2035 |
+
while (element.firstChild) {
|
2036 |
+
element.removeChild(element.firstChild);
|
2037 |
+
}
|
2038 |
+
var nodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts(), true);
|
2039 |
+
nodes.each(function(node) { element.appendChild(node) });
|
2040 |
+
}
|
2041 |
+
else {
|
2042 |
+
element.innerHTML = content.stripScripts();
|
2043 |
+
}
|
2044 |
+
}
|
2045 |
+
else {
|
2046 |
+
element.innerHTML = content.stripScripts();
|
2047 |
+
}
|
2048 |
+
|
2049 |
+
content.evalScripts.bind(content).defer();
|
2050 |
+
return element;
|
2051 |
+
}
|
2052 |
+
|
2053 |
+
return update;
|
2054 |
+
})(),
|
2055 |
+
|
2056 |
+
replace: function(element, content) {
|
2057 |
+
element = $(element);
|
2058 |
+
if (content && content.toElement) content = content.toElement();
|
2059 |
+
else if (!Object.isElement(content)) {
|
2060 |
+
content = Object.toHTML(content);
|
2061 |
+
var range = element.ownerDocument.createRange();
|
2062 |
+
range.selectNode(element);
|
2063 |
+
content.evalScripts.bind(content).defer();
|
2064 |
+
content = range.createContextualFragment(content.stripScripts());
|
2065 |
+
}
|
2066 |
+
element.parentNode.replaceChild(content, element);
|
2067 |
+
return element;
|
2068 |
+
},
|
2069 |
+
|
2070 |
+
insert: function(element, insertions) {
|
2071 |
+
element = $(element);
|
2072 |
+
|
2073 |
+
if (Object.isString(insertions) || Object.isNumber(insertions) ||
|
2074 |
+
Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
|
2075 |
+
insertions = {bottom:insertions};
|
2076 |
+
|
2077 |
+
var content, insert, tagName, childNodes;
|
2078 |
+
|
2079 |
+
for (var position in insertions) {
|
2080 |
+
content = insertions[position];
|
2081 |
+
position = position.toLowerCase();
|
2082 |
+
insert = Element._insertionTranslations[position];
|
2083 |
+
|
2084 |
+
if (content && content.toElement) content = content.toElement();
|
2085 |
+
if (Object.isElement(content)) {
|
2086 |
+
insert(element, content);
|
2087 |
+
continue;
|
2088 |
+
}
|
2089 |
+
|
2090 |
+
content = Object.toHTML(content);
|
2091 |
+
|
2092 |
+
tagName = ((position == 'before' || position == 'after')
|
2093 |
+
? element.parentNode : element).tagName.toUpperCase();
|
2094 |
+
|
2095 |
+
childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
|
2096 |
+
|
2097 |
+
if (position == 'top' || position == 'after') childNodes.reverse();
|
2098 |
+
childNodes.each(insert.curry(element));
|
2099 |
+
|
2100 |
+
content.evalScripts.bind(content).defer();
|
2101 |
+
}
|
2102 |
+
|
2103 |
+
return element;
|
2104 |
+
},
|
2105 |
+
|
2106 |
+
wrap: function(element, wrapper, attributes) {
|
2107 |
+
element = $(element);
|
2108 |
+
if (Object.isElement(wrapper))
|
2109 |
+
$(wrapper).writeAttribute(attributes || { });
|
2110 |
+
else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
|
2111 |
+
else wrapper = new Element('div', wrapper);
|
2112 |
+
if (element.parentNode)
|
2113 |
+
element.parentNode.replaceChild(wrapper, element);
|
2114 |
+
wrapper.appendChild(element);
|
2115 |
+
return wrapper;
|
2116 |
+
},
|
2117 |
+
|
2118 |
+
inspect: function(element) {
|
2119 |
+
element = $(element);
|
2120 |
+
var result = '<' + element.tagName.toLowerCase();
|
2121 |
+
$H({'id': 'id', 'className': 'class'}).each(function(pair) {
|
2122 |
+
var property = pair.first(),
|
2123 |
+
attribute = pair.last(),
|
2124 |
+
value = (element[property] || '').toString();
|
2125 |
+
if (value) result += ' ' + attribute + '=' + value.inspect(true);
|
2126 |
+
});
|
2127 |
+
return result + '>';
|
2128 |
+
},
|
2129 |
+
|
2130 |
+
recursivelyCollect: function(element, property, maximumLength) {
|
2131 |
+
element = $(element);
|
2132 |
+
maximumLength = maximumLength || -1;
|
2133 |
+
var elements = [];
|
2134 |
+
|
2135 |
+
while (element = element[property]) {
|
2136 |
+
if (element.nodeType == 1)
|
2137 |
+
elements.push(Element.extend(element));
|
2138 |
+
if (elements.length == maximumLength)
|
2139 |
+
break;
|
2140 |
+
}
|
2141 |
+
|
2142 |
+
return elements;
|
2143 |
+
},
|
2144 |
+
|
2145 |
+
ancestors: function(element) {
|
2146 |
+
return Element.recursivelyCollect(element, 'parentNode');
|
2147 |
+
},
|
2148 |
+
|
2149 |
+
descendants: function(element) {
|
2150 |
+
return Element.select(element, "*");
|
2151 |
+
},
|
2152 |
+
|
2153 |
+
firstDescendant: function(element) {
|
2154 |
+
element = $(element).firstChild;
|
2155 |
+
while (element && element.nodeType != 1) element = element.nextSibling;
|
2156 |
+
return $(element);
|
2157 |
+
},
|
2158 |
+
|
2159 |
+
immediateDescendants: function(element) {
|
2160 |
+
var results = [], child = $(element).firstChild;
|
2161 |
+
while (child) {
|
2162 |
+
if (child.nodeType === 1) {
|
2163 |
+
results.push(Element.extend(child));
|
2164 |
+
}
|
2165 |
+
child = child.nextSibling;
|
2166 |
+
}
|
2167 |
+
return results;
|
2168 |
+
},
|
2169 |
+
|
2170 |
+
previousSiblings: function(element, maximumLength) {
|
2171 |
+
return Element.recursivelyCollect(element, 'previousSibling');
|
2172 |
+
},
|
2173 |
+
|
2174 |
+
nextSiblings: function(element) {
|
2175 |
+
return Element.recursivelyCollect(element, 'nextSibling');
|
2176 |
+
},
|
2177 |
+
|
2178 |
+
siblings: function(element) {
|
2179 |
+
element = $(element);
|
2180 |
+
return Element.previousSiblings(element).reverse()
|
2181 |
+
.concat(Element.nextSiblings(element));
|
2182 |
+
},
|
2183 |
+
|
2184 |
+
match: function(element, selector) {
|
2185 |
+
element = $(element);
|
2186 |
+
if (Object.isString(selector))
|
2187 |
+
return Prototype.Selector.match(element, selector);
|
2188 |
+
return selector.match(element);
|
2189 |
+
},
|
2190 |
+
|
2191 |
+
up: function(element, expression, index) {
|
2192 |
+
element = $(element);
|
2193 |
+
if (arguments.length == 1) return $(element.parentNode);
|
2194 |
+
var ancestors = Element.ancestors(element);
|
2195 |
+
return Object.isNumber(expression) ? ancestors[expression] :
|
2196 |
+
Prototype.Selector.find(ancestors, expression, index);
|
2197 |
+
},
|
2198 |
+
|
2199 |
+
down: function(element, expression, index) {
|
2200 |
+
element = $(element);
|
2201 |
+
if (arguments.length == 1) return Element.firstDescendant(element);
|
2202 |
+
return Object.isNumber(expression) ? Element.descendants(element)[expression] :
|
2203 |
+
Element.select(element, expression)[index || 0];
|
2204 |
+
},
|
2205 |
+
|
2206 |
+
previous: function(element, expression, index) {
|
2207 |
+
element = $(element);
|
2208 |
+
if (Object.isNumber(expression)) index = expression, expression = false;
|
2209 |
+
if (!Object.isNumber(index)) index = 0;
|
2210 |
+
|
2211 |
+
if (expression) {
|
2212 |
+
return Prototype.Selector.find(element.previousSiblings(), expression, index);
|
2213 |
+
} else {
|
2214 |
+
return element.recursivelyCollect("previousSibling", index + 1)[index];
|
2215 |
+
}
|
2216 |
+
},
|
2217 |
+
|
2218 |
+
next: function(element, expression, index) {
|
2219 |
+
element = $(element);
|
2220 |
+
if (Object.isNumber(expression)) index = expression, expression = false;
|
2221 |
+
if (!Object.isNumber(index)) index = 0;
|
2222 |
+
|
2223 |
+
if (expression) {
|
2224 |
+
return Prototype.Selector.find(element.nextSiblings(), expression, index);
|
2225 |
+
} else {
|
2226 |
+
var maximumLength = Object.isNumber(index) ? index + 1 : 1;
|
2227 |
+
return element.recursivelyCollect("nextSibling", index + 1)[index];
|
2228 |
+
}
|
2229 |
+
},
|
2230 |
+
|
2231 |
+
|
2232 |
+
select: function(element) {
|
2233 |
+
element = $(element);
|
2234 |
+
var expressions = Array.prototype.slice.call(arguments, 1).join(', ');
|
2235 |
+
return Prototype.Selector.select(expressions, element);
|
2236 |
+
},
|
2237 |
+
|
2238 |
+
adjacent: function(element) {
|
2239 |
+
element = $(element);
|
2240 |
+
var expressions = Array.prototype.slice.call(arguments, 1).join(', ');
|
2241 |
+
return Prototype.Selector.select(expressions, element.parentNode).without(element);
|
2242 |
+
},
|
2243 |
+
|
2244 |
+
identify: function(element) {
|
2245 |
+
element = $(element);
|
2246 |
+
var id = Element.readAttribute(element, 'id');
|
2247 |
+
if (id) return id;
|
2248 |
+
do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id));
|
2249 |
+
Element.writeAttribute(element, 'id', id);
|
2250 |
+
return id;
|
2251 |
+
},
|
2252 |
+
|
2253 |
+
readAttribute: function(element, name) {
|
2254 |
+
element = $(element);
|
2255 |
+
if (Prototype.Browser.IE) {
|
2256 |
+
var t = Element._attributeTranslations.read;
|
2257 |
+
if (t.values[name]) return t.values[name](element, name);
|
2258 |
+
if (t.names[name]) name = t.names[name];
|
2259 |
+
if (name.include(':')) {
|
2260 |
+
return (!element.attributes || !element.attributes[name]) ? null :
|
2261 |
+
element.attributes[name].value;
|
2262 |
+
}
|
2263 |
+
}
|
2264 |
+
return element.getAttribute(name);
|
2265 |
+
},
|
2266 |
+
|
2267 |
+
writeAttribute: function(element, name, value) {
|
2268 |
+
element = $(element);
|
2269 |
+
var attributes = { }, t = Element._attributeTranslations.write;
|
2270 |
+
|
2271 |
+
if (typeof name == 'object') attributes = name;
|
2272 |
+
else attributes[name] = Object.isUndefined(value) ? true : value;
|
2273 |
+
|
2274 |
+
for (var attr in attributes) {
|
2275 |
+
name = t.names[attr] || attr;
|
2276 |
+
value = attributes[attr];
|
2277 |
+
if (t.values[attr]) name = t.values[attr](element, value);
|
2278 |
+
if (value === false || value === null)
|
2279 |
+
element.removeAttribute(name);
|
2280 |
+
else if (value === true)
|
2281 |
+
element.setAttribute(name, name);
|
2282 |
+
else element.setAttribute(name, value);
|
2283 |
+
}
|
2284 |
+
return element;
|
2285 |
+
},
|
2286 |
+
|
2287 |
+
getHeight: function(element) {
|
2288 |
+
return Element.getDimensions(element).height;
|
2289 |
+
},
|
2290 |
+
|
2291 |
+
getWidth: function(element) {
|
2292 |
+
return Element.getDimensions(element).width;
|
2293 |
+
},
|
2294 |
+
|
2295 |
+
classNames: function(element) {
|
2296 |
+
return new Element.ClassNames(element);
|
2297 |
+
},
|
2298 |
+
|
2299 |
+
hasClassName: function(element, className) {
|
2300 |
+
if (!(element = $(element))) return;
|
2301 |
+
var elementClassName = element.className;
|
2302 |
+
return (elementClassName.length > 0 && (elementClassName == className ||
|
2303 |
+
new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
|
2304 |
+
},
|
2305 |
+
|
2306 |
+
addClassName: function(element, className) {
|
2307 |
+
if (!(element = $(element))) return;
|
2308 |
+
if (!Element.hasClassName(element, className))
|
2309 |
+
element.className += (element.className ? ' ' : '') + className;
|
2310 |
+
return element;
|
2311 |
+
},
|
2312 |
+
|
2313 |
+
removeClassName: function(element, className) {
|
2314 |
+
if (!(element = $(element))) return;
|
2315 |
+
element.className = element.className.replace(
|
2316 |
+
new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
|
2317 |
+
return element;
|
2318 |
+
},
|
2319 |
+
|
2320 |
+
toggleClassName: function(element, className) {
|
2321 |
+
if (!(element = $(element))) return;
|
2322 |
+
return Element[Element.hasClassName(element, className) ?
|
2323 |
+
'removeClassName' : 'addClassName'](element, className);
|
2324 |
+
},
|
2325 |
+
|
2326 |
+
cleanWhitespace: function(element) {
|
2327 |
+
element = $(element);
|
2328 |
+
var node = element.firstChild;
|
2329 |
+
while (node) {
|
2330 |
+
var nextNode = node.nextSibling;
|
2331 |
+
if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
|
2332 |
+
element.removeChild(node);
|
2333 |
+
node = nextNode;
|
2334 |
+
}
|
2335 |
+
return element;
|
2336 |
+
},
|
2337 |
+
|
2338 |
+
empty: function(element) {
|
2339 |
+
return $(element).innerHTML.blank();
|
2340 |
+
},
|
2341 |
+
|
2342 |
+
descendantOf: function(element, ancestor) {
|
2343 |
+
element = $(element), ancestor = $(ancestor);
|
2344 |
+
|
2345 |
+
if (element.compareDocumentPosition)
|
2346 |
+
return (element.compareDocumentPosition(ancestor) & 8) === 8;
|
2347 |
+
|
2348 |
+
if (ancestor.contains)
|
2349 |
+
return ancestor.contains(element) && ancestor !== element;
|
2350 |
+
|
2351 |
+
while (element = element.parentNode)
|
2352 |
+
if (element == ancestor) return true;
|
2353 |
+
|
2354 |
+
return false;
|
2355 |
+
},
|
2356 |
+
|
2357 |
+
scrollTo: function(element) {
|
2358 |
+
element = $(element);
|
2359 |
+
var pos = Element.cumulativeOffset(element);
|
2360 |
+
window.scrollTo(pos[0], pos[1]);
|
2361 |
+
return element;
|
2362 |
+
},
|
2363 |
+
|
2364 |
+
getStyle: function(element, style) {
|
2365 |
+
element = $(element);
|
2366 |
+
style = style == 'float' ? 'cssFloat' : style.camelize();
|
2367 |
+
var value = element.style[style];
|
2368 |
+
if (!value || value == 'auto') {
|
2369 |
+
var css = document.defaultView.getComputedStyle(element, null);
|
2370 |
+
value = css ? css[style] : null;
|
2371 |
+
}
|
2372 |
+
if (style == 'opacity') return value ? parseFloat(value) : 1.0;
|
2373 |
+
return value == 'auto' ? null : value;
|
2374 |
+
},
|
2375 |
+
|
2376 |
+
getOpacity: function(element) {
|
2377 |
+
return $(element).getStyle('opacity');
|
2378 |
+
},
|
2379 |
+
|
2380 |
+
setStyle: function(element, styles) {
|
2381 |
+
element = $(element);
|
2382 |
+
var elementStyle = element.style, match;
|
2383 |
+
if (Object.isString(styles)) {
|
2384 |
+
element.style.cssText += ';' + styles;
|
2385 |
+
return styles.include('opacity') ?
|
2386 |
+
element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
|
2387 |
+
}
|
2388 |
+
for (var property in styles)
|
2389 |
+
if (property == 'opacity') element.setOpacity(styles[property]);
|
2390 |
+
else
|
2391 |
+
elementStyle[(property == 'float' || property == 'cssFloat') ?
|
2392 |
+
(Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
|
2393 |
+
property] = styles[property];
|
2394 |
+
|
2395 |
+
return element;
|
2396 |
+
},
|
2397 |
+
|
2398 |
+
setOpacity: function(element, value) {
|
2399 |
+
element = $(element);
|
2400 |
+
element.style.opacity = (value == 1 || value === '') ? '' :
|
2401 |
+
(value < 0.00001) ? 0 : value;
|
2402 |
+
return element;
|
2403 |
+
},
|
2404 |
+
|
2405 |
+
makePositioned: function(element) {
|
2406 |
+
element = $(element);
|
2407 |
+
var pos = Element.getStyle(element, 'position');
|
2408 |
+
if (pos == 'static' || !pos) {
|
2409 |
+
element._madePositioned = true;
|
2410 |
+
element.style.position = 'relative';
|
2411 |
+
if (Prototype.Browser.Opera) {
|
2412 |
+
element.style.top = 0;
|
2413 |
+
element.style.left = 0;
|
2414 |
+
}
|
2415 |
+
}
|
2416 |
+
return element;
|
2417 |
+
},
|
2418 |
+
|
2419 |
+
undoPositioned: function(element) {
|
2420 |
+
element = $(element);
|
2421 |
+
if (element._madePositioned) {
|
2422 |
+
element._madePositioned = undefined;
|
2423 |
+
element.style.position =
|
2424 |
+
element.style.top =
|
2425 |
+
element.style.left =
|
2426 |
+
element.style.bottom =
|
2427 |
+
element.style.right = '';
|
2428 |
+
}
|
2429 |
+
return element;
|
2430 |
+
},
|
2431 |
+
|
2432 |
+
makeClipping: function(element) {
|
2433 |
+
element = $(element);
|
2434 |
+
if (element._overflow) return element;
|
2435 |
+
element._overflow = Element.getStyle(element, 'overflow') || 'auto';
|
2436 |
+
if (element._overflow !== 'hidden')
|
2437 |
+
element.style.overflow = 'hidden';
|
2438 |
+
return element;
|
2439 |
+
},
|
2440 |
+
|
2441 |
+
undoClipping: function(element) {
|
2442 |
+
element = $(element);
|
2443 |
+
if (!element._overflow) return element;
|
2444 |
+
element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
|
2445 |
+
element._overflow = null;
|
2446 |
+
return element;
|
2447 |
+
},
|
2448 |
+
|
2449 |
+
clonePosition: function(element, source) {
|
2450 |
+
var options = Object.extend({
|
2451 |
+
setLeft: true,
|
2452 |
+
setTop: true,
|
2453 |
+
setWidth: true,
|
2454 |
+
setHeight: true,
|
2455 |
+
offsetTop: 0,
|
2456 |
+
offsetLeft: 0
|
2457 |
+
}, arguments[2] || { });
|
2458 |
+
|
2459 |
+
source = $(source);
|
2460 |
+
var p = Element.viewportOffset(source), delta = [0, 0], parent = null;
|
2461 |
+
|
2462 |
+
element = $(element);
|
2463 |
+
|
2464 |
+
if (Element.getStyle(element, 'position') == 'absolute') {
|
2465 |
+
parent = Element.getOffsetParent(element);
|
2466 |
+
delta = Element.viewportOffset(parent);
|
2467 |
+
}
|
2468 |
+
|
2469 |
+
if (parent == document.body) {
|
2470 |
+
delta[0] -= document.body.offsetLeft;
|
2471 |
+
delta[1] -= document.body.offsetTop;
|
2472 |
+
}
|
2473 |
+
|
2474 |
+
if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
|
2475 |
+
if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
|
2476 |
+
if (options.setWidth) element.style.width = source.offsetWidth + 'px';
|
2477 |
+
if (options.setHeight) element.style.height = source.offsetHeight + 'px';
|
2478 |
+
return element;
|
2479 |
+
}
|
2480 |
+
};
|
2481 |
+
|
2482 |
+
Object.extend(Element.Methods, {
|
2483 |
+
getElementsBySelector: Element.Methods.select,
|
2484 |
+
|
2485 |
+
childElements: Element.Methods.immediateDescendants
|
2486 |
+
});
|
2487 |
+
|
2488 |
+
Element._attributeTranslations = {
|
2489 |
+
write: {
|
2490 |
+
names: {
|
2491 |
+
className: 'class',
|
2492 |
+
htmlFor: 'for'
|
2493 |
+
},
|
2494 |
+
values: { }
|
2495 |
+
}
|
2496 |
+
};
|
2497 |
+
|
2498 |
+
if (Prototype.Browser.Opera) {
|
2499 |
+
Element.Methods.getStyle = Element.Methods.getStyle.wrap(
|
2500 |
+
function(proceed, element, style) {
|
2501 |
+
switch (style) {
|
2502 |
+
case 'height': case 'width':
|
2503 |
+
if (!Element.visible(element)) return null;
|
2504 |
+
|
2505 |
+
var dim = parseInt(proceed(element, style), 10);
|
2506 |
+
|
2507 |
+
if (dim !== element['offset' + style.capitalize()])
|
2508 |
+
return dim + 'px';
|
2509 |
+
|
2510 |
+
var properties;
|
2511 |
+
if (style === 'height') {
|
2512 |
+
properties = ['border-top-width', 'padding-top',
|
2513 |
+
'padding-bottom', 'border-bottom-width'];
|
2514 |
+
}
|
2515 |
+
else {
|
2516 |
+
properties = ['border-left-width', 'padding-left',
|
2517 |
+
'padding-right', 'border-right-width'];
|
2518 |
+
}
|
2519 |
+
return properties.inject(dim, function(memo, property) {
|
2520 |
+
var val = proceed(element, property);
|
2521 |
+
return val === null ? memo : memo - parseInt(val, 10);
|
2522 |
+
}) + 'px';
|
2523 |
+
default: return proceed(element, style);
|
2524 |
+
}
|
2525 |
+
}
|
2526 |
+
);
|
2527 |
+
|
2528 |
+
Element.Methods.readAttribute = Element.Methods.readAttribute.wrap(
|
2529 |
+
function(proceed, element, attribute) {
|
2530 |
+
if (attribute === 'title') return element.title;
|
2531 |
+
return proceed(element, attribute);
|
2532 |
+
}
|
2533 |
+
);
|
2534 |
+
}
|
2535 |
+
|
2536 |
+
else if (Prototype.Browser.IE) {
|
2537 |
+
Element.Methods.getStyle = function(element, style) {
|
2538 |
+
element = $(element);
|
2539 |
+
style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
|
2540 |
+
var value = element.style[style];
|
2541 |
+
if (!value && element.currentStyle) value = element.currentStyle[style];
|
2542 |
+
|
2543 |
+
if (style == 'opacity') {
|
2544 |
+
if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
|
2545 |
+
if (value[1]) return parseFloat(value[1]) / 100;
|
2546 |
+
return 1.0;
|
2547 |
+
}
|
2548 |
+
|
2549 |
+
if (value == 'auto') {
|
2550 |
+
if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
|
2551 |
+
return element['offset' + style.capitalize()] + 'px';
|
2552 |
+
return null;
|
2553 |
+
}
|
2554 |
+
return value;
|
2555 |
+
};
|
2556 |
+
|
2557 |
+
Element.Methods.setOpacity = function(element, value) {
|
2558 |
+
function stripAlpha(filter){
|
2559 |
+
return filter.replace(/alpha\([^\)]*\)/gi,'');
|
2560 |
+
}
|
2561 |
+
element = $(element);
|
2562 |
+
var currentStyle = element.currentStyle;
|
2563 |
+
if ((currentStyle && !currentStyle.hasLayout) ||
|
2564 |
+
(!currentStyle && element.style.zoom == 'normal'))
|
2565 |
+
element.style.zoom = 1;
|
2566 |
+
|
2567 |
+
var filter = element.getStyle('filter'), style = element.style;
|
2568 |
+
if (value == 1 || value === '') {
|
2569 |
+
(filter = stripAlpha(filter)) ?
|
2570 |
+
style.filter = filter : style.removeAttribute('filter');
|
2571 |
+
return element;
|
2572 |
+
} else if (value < 0.00001) value = 0;
|
2573 |
+
style.filter = stripAlpha(filter) +
|
2574 |
+
'alpha(opacity=' + (value * 100) + ')';
|
2575 |
+
return element;
|
2576 |
+
};
|
2577 |
+
|
2578 |
+
Element._attributeTranslations = (function(){
|
2579 |
+
|
2580 |
+
var classProp = 'className',
|
2581 |
+
forProp = 'for',
|
2582 |
+
el = document.createElement('div');
|
2583 |
+
|
2584 |
+
el.setAttribute(classProp, 'x');
|
2585 |
+
|
2586 |
+
if (el.className !== 'x') {
|
2587 |
+
el.setAttribute('class', 'x');
|
2588 |
+
if (el.className === 'x') {
|
2589 |
+
classProp = 'class';
|
2590 |
+
}
|
2591 |
+
}
|
2592 |
+
el = null;
|
2593 |
+
|
2594 |
+
el = document.createElement('label');
|
2595 |
+
el.setAttribute(forProp, 'x');
|
2596 |
+
if (el.htmlFor !== 'x') {
|
2597 |
+
el.setAttribute('htmlFor', 'x');
|
2598 |
+
if (el.htmlFor === 'x') {
|
2599 |
+
forProp = 'htmlFor';
|
2600 |
+
}
|
2601 |
+
}
|
2602 |
+
el = null;
|
2603 |
+
|
2604 |
+
return {
|
2605 |
+
read: {
|
2606 |
+
names: {
|
2607 |
+
'class': classProp,
|
2608 |
+
'className': classProp,
|
2609 |
+
'for': forProp,
|
2610 |
+
'htmlFor': forProp
|
2611 |
+
},
|
2612 |
+
values: {
|
2613 |
+
_getAttr: function(element, attribute) {
|
2614 |
+
return element.getAttribute(attribute);
|
2615 |
+
},
|
2616 |
+
_getAttr2: function(element, attribute) {
|
2617 |
+
return element.getAttribute(attribute, 2);
|
2618 |
+
},
|
2619 |
+
_getAttrNode: function(element, attribute) {
|
2620 |
+
var node = element.getAttributeNode(attribute);
|
2621 |
+
return node ? node.value : "";
|
2622 |
+
},
|
2623 |
+
_getEv: (function(){
|
2624 |
+
|
2625 |
+
var el = document.createElement('div'), f;
|
2626 |
+
el.onclick = Prototype.emptyFunction;
|
2627 |
+
var value = el.getAttribute('onclick');
|
2628 |
+
|
2629 |
+
if (String(value).indexOf('{') > -1) {
|
2630 |
+
f = function(element, attribute) {
|
2631 |
+
attribute = element.getAttribute(attribute);
|
2632 |
+
if (!attribute) return null;
|
2633 |
+
attribute = attribute.toString();
|
2634 |
+
attribute = attribute.split('{')[1];
|
2635 |
+
attribute = attribute.split('}')[0];
|
2636 |
+
return attribute.strip();
|
2637 |
+
};
|
2638 |
+
}
|
2639 |
+
else if (value === '') {
|
2640 |
+
f = function(element, attribute) {
|
2641 |
+
attribute = element.getAttribute(attribute);
|
2642 |
+
if (!attribute) return null;
|
2643 |
+
return attribute.strip();
|
2644 |
+
};
|
2645 |
+
}
|
2646 |
+
el = null;
|
2647 |
+
return f;
|
2648 |
+
})(),
|
2649 |
+
_flag: function(element, attribute) {
|
2650 |
+
return $(element).hasAttribute(attribute) ? attribute : null;
|
2651 |
+
},
|
2652 |
+
style: function(element) {
|
2653 |
+
return element.style.cssText.toLowerCase();
|
2654 |
+
},
|
2655 |
+
title: function(element) {
|
2656 |
+
return element.title;
|
2657 |
+
}
|
2658 |
+
}
|
2659 |
+
}
|
2660 |
+
}
|
2661 |
+
})();
|
2662 |
+
|
2663 |
+
Element._attributeTranslations.write = {
|
2664 |
+
names: Object.extend({
|
2665 |
+
cellpadding: 'cellPadding',
|
2666 |
+
cellspacing: 'cellSpacing'
|
2667 |
+
}, Element._attributeTranslations.read.names),
|
2668 |
+
values: {
|
2669 |
+
checked: function(element, value) {
|
2670 |
+
element.checked = !!value;
|
2671 |
+
},
|
2672 |
+
|
2673 |
+
style: function(element, value) {
|
2674 |
+
element.style.cssText = value ? value : '';
|
2675 |
+
}
|
2676 |
+
}
|
2677 |
+
};
|
2678 |
+
|
2679 |
+
Element._attributeTranslations.has = {};
|
2680 |
+
|
2681 |
+
$w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
|
2682 |
+
'encType maxLength readOnly longDesc frameBorder').each(function(attr) {
|
2683 |
+
Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
|
2684 |
+
Element._attributeTranslations.has[attr.toLowerCase()] = attr;
|
2685 |
+
});
|
2686 |
+
|
2687 |
+
(function(v) {
|
2688 |
+
Object.extend(v, {
|
2689 |
+
href: v._getAttr2,
|
2690 |
+
src: v._getAttr2,
|
2691 |
+
type: v._getAttr,
|
2692 |
+
action: v._getAttrNode,
|
2693 |
+
disabled: v._flag,
|
2694 |
+
checked: v._flag,
|
2695 |
+
readonly: v._flag,
|
2696 |
+
multiple: v._flag,
|
2697 |
+
onload: v._getEv,
|
2698 |
+
onunload: v._getEv,
|
2699 |
+
onclick: v._getEv,
|
2700 |
+
ondblclick: v._getEv,
|
2701 |
+
onmousedown: v._getEv,
|
2702 |
+
onmouseup: v._getEv,
|
2703 |
+
onmouseover: v._getEv,
|
2704 |
+
onmousemove: v._getEv,
|
2705 |
+
onmouseout: v._getEv,
|
2706 |
+
onfocus: v._getEv,
|
2707 |
+
onblur: v._getEv,
|
2708 |
+
onkeypress: v._getEv,
|
2709 |
+
onkeydown: v._getEv,
|
2710 |
+
onkeyup: v._getEv,
|
2711 |
+
onsubmit: v._getEv,
|
2712 |
+
onreset: v._getEv,
|
2713 |
+
onselect: v._getEv,
|
2714 |
+
onchange: v._getEv
|
2715 |
+
});
|
2716 |
+
})(Element._attributeTranslations.read.values);
|
2717 |
+
|
2718 |
+
if (Prototype.BrowserFeatures.ElementExtensions) {
|
2719 |
+
(function() {
|
2720 |
+
function _descendants(element) {
|
2721 |
+
var nodes = element.getElementsByTagName('*'), results = [];
|
2722 |
+
for (var i = 0, node; node = nodes[i]; i++)
|
2723 |
+
if (node.tagName !== "!") // Filter out comment nodes.
|
2724 |
+
results.push(node);
|
2725 |
+
return results;
|
2726 |
+
}
|
2727 |
+
|
2728 |
+
Element.Methods.down = function(element, expression, index) {
|
2729 |
+
element = $(element);
|
2730 |
+
if (arguments.length == 1) return element.firstDescendant();
|
2731 |
+
return Object.isNumber(expression) ? _descendants(element)[expression] :
|
2732 |
+
Element.select(element, expression)[index || 0];
|
2733 |
+
}
|
2734 |
+
})();
|
2735 |
+
}
|
2736 |
+
|
2737 |
+
}
|
2738 |
+
|
2739 |
+
else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
|
2740 |
+
Element.Methods.setOpacity = function(element, value) {
|
2741 |
+
element = $(element);
|
2742 |
+
element.style.opacity = (value == 1) ? 0.999999 :
|
2743 |
+
(value === '') ? '' : (value < 0.00001) ? 0 : value;
|
2744 |
+
return element;
|
2745 |
+
};
|
2746 |
+
}
|
2747 |
+
|
2748 |
+
else if (Prototype.Browser.WebKit) {
|
2749 |
+
Element.Methods.setOpacity = function(element, value) {
|
2750 |
+
element = $(element);
|
2751 |
+
element.style.opacity = (value == 1 || value === '') ? '' :
|
2752 |
+
(value < 0.00001) ? 0 : value;
|
2753 |
+
|
2754 |
+
if (value == 1)
|
2755 |
+
if (element.tagName.toUpperCase() == 'IMG' && element.width) {
|
2756 |
+
element.width++; element.width--;
|
2757 |
+
} else try {
|
2758 |
+
var n = document.createTextNode(' ');
|
2759 |
+
element.appendChild(n);
|
2760 |
+
element.removeChild(n);
|
2761 |
+
} catch (e) { }
|
2762 |
+
|
2763 |
+
return element;
|
2764 |
+
};
|
2765 |
+
}
|
2766 |
+
|
2767 |
+
if ('outerHTML' in document.documentElement) {
|
2768 |
+
Element.Methods.replace = function(element, content) {
|
2769 |
+
element = $(element);
|
2770 |
+
|
2771 |
+
if (content && content.toElement) content = content.toElement();
|
2772 |
+
if (Object.isElement(content)) {
|
2773 |
+
element.parentNode.replaceChild(content, element);
|
2774 |
+
return element;
|
2775 |
+
}
|
2776 |
+
|
2777 |
+
content = Object.toHTML(content);
|
2778 |
+
var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
|
2779 |
+
|
2780 |
+
if (Element._insertionTranslations.tags[tagName]) {
|
2781 |
+
var nextSibling = element.next(),
|
2782 |
+
fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
|
2783 |
+
parent.removeChild(element);
|
2784 |
+
if (nextSibling)
|
2785 |
+
fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
|
2786 |
+
else
|
2787 |
+
fragments.each(function(node) { parent.appendChild(node) });
|
2788 |
+
}
|
2789 |
+
else element.outerHTML = content.stripScripts();
|
2790 |
+
|
2791 |
+
content.evalScripts.bind(content).defer();
|
2792 |
+
return element;
|
2793 |
+
};
|
2794 |
+
}
|
2795 |
+
|
2796 |
+
Element._returnOffset = function(l, t) {
|
2797 |
+
var result = [l, t];
|
2798 |
+
result.left = l;
|
2799 |
+
result.top = t;
|
2800 |
+
return result;
|
2801 |
+
};
|
2802 |
+
|
2803 |
+
Element._getContentFromAnonymousElement = function(tagName, html, force) {
|
2804 |
+
var div = new Element('div'),
|
2805 |
+
t = Element._insertionTranslations.tags[tagName];
|
2806 |
+
|
2807 |
+
var workaround = false;
|
2808 |
+
if (t) workaround = true;
|
2809 |
+
else if (force) {
|
2810 |
+
workaround = true;
|
2811 |
+
t = ['', '', 0];
|
2812 |
+
}
|
2813 |
+
|
2814 |
+
if (workaround) {
|
2815 |
+
div.innerHTML = ' ' + t[0] + html + t[1];
|
2816 |
+
div.removeChild(div.firstChild);
|
2817 |
+
for (var i = t[2]; i--; ) {
|
2818 |
+
div = div.firstChild;
|
2819 |
+
}
|
2820 |
+
}
|
2821 |
+
else {
|
2822 |
+
div.innerHTML = html;
|
2823 |
+
}
|
2824 |
+
return $A(div.childNodes);
|
2825 |
+
};
|
2826 |
+
|
2827 |
+
Element._insertionTranslations = {
|
2828 |
+
before: function(element, node) {
|
2829 |
+
element.parentNode.insertBefore(node, element);
|
2830 |
+
},
|
2831 |
+
top: function(element, node) {
|
2832 |
+
element.insertBefore(node, element.firstChild);
|
2833 |
+
},
|
2834 |
+
bottom: function(element, node) {
|
2835 |
+
element.appendChild(node);
|
2836 |
+
},
|
2837 |
+
after: function(element, node) {
|
2838 |
+
element.parentNode.insertBefore(node, element.nextSibling);
|
2839 |
+
},
|
2840 |
+
tags: {
|
2841 |
+
TABLE: ['<table>', '</table>', 1],
|
2842 |
+
TBODY: ['<table><tbody>', '</tbody></table>', 2],
|
2843 |
+
TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3],
|
2844 |
+
TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
|
2845 |
+
SELECT: ['<select>', '</select>', 1]
|
2846 |
+
}
|
2847 |
+
};
|
2848 |
+
|
2849 |
+
(function() {
|
2850 |
+
var tags = Element._insertionTranslations.tags;
|
2851 |
+
Object.extend(tags, {
|
2852 |
+
THEAD: tags.TBODY,
|
2853 |
+
TFOOT: tags.TBODY,
|
2854 |
+
TH: tags.TD
|
2855 |
+
});
|
2856 |
+
})();
|
2857 |
+
|
2858 |
+
Element.Methods.Simulated = {
|
2859 |
+
hasAttribute: function(element, attribute) {
|
2860 |
+
attribute = Element._attributeTranslations.has[attribute] || attribute;
|
2861 |
+
var node = $(element).getAttributeNode(attribute);
|
2862 |
+
return !!(node && node.specified);
|
2863 |
+
}
|
2864 |
+
};
|
2865 |
+
|
2866 |
+
Element.Methods.ByTag = { };
|
2867 |
+
|
2868 |
+
Object.extend(Element, Element.Methods);
|
2869 |
+
|
2870 |
+
(function(div) {
|
2871 |
+
|
2872 |
+
if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) {
|
2873 |
+
window.HTMLElement = { };
|
2874 |
+
window.HTMLElement.prototype = div['__proto__'];
|
2875 |
+
Prototype.BrowserFeatures.ElementExtensions = true;
|
2876 |
+
}
|
2877 |
+
|
2878 |
+
div = null;
|
2879 |
+
|
2880 |
+
})(document.createElement('div'));
|
2881 |
+
|
2882 |
+
Element.extend = (function() {
|
2883 |
+
|
2884 |
+
function checkDeficiency(tagName) {
|
2885 |
+
if (typeof window.Element != 'undefined') {
|
2886 |
+
var proto = window.Element.prototype;
|
2887 |
+
if (proto) {
|
2888 |
+
var id = '_' + (Math.random()+'').slice(2),
|
2889 |
+
el = document.createElement(tagName);
|
2890 |
+
proto[id] = 'x';
|
2891 |
+
var isBuggy = (el[id] !== 'x');
|
2892 |
+
delete proto[id];
|
2893 |
+
el = null;
|
2894 |
+
return isBuggy;
|
2895 |
+
}
|
2896 |
+
}
|
2897 |
+
return false;
|
2898 |
+
}
|
2899 |
+
|
2900 |
+
function extendElementWith(element, methods) {
|
2901 |
+
for (var property in methods) {
|
2902 |
+
var value = methods[property];
|
2903 |
+
if (Object.isFunction(value) && !(property in element))
|
2904 |
+
element[property] = value.methodize();
|
2905 |
+
}
|
2906 |
+
}
|
2907 |
+
|
2908 |
+
var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object');
|
2909 |
+
|
2910 |
+
if (Prototype.BrowserFeatures.SpecificElementExtensions) {
|
2911 |
+
if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) {
|
2912 |
+
return function(element) {
|
2913 |
+
if (element && typeof element._extendedByPrototype == 'undefined') {
|
2914 |
+
var t = element.tagName;
|
2915 |
+
if (t && (/^(?:object|applet|embed)$/i.test(t))) {
|
2916 |
+
extendElementWith(element, Element.Methods);
|
2917 |
+
extendElementWith(element, Element.Methods.Simulated);
|
2918 |
+
extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]);
|
2919 |
+
}
|
2920 |
+
}
|
2921 |
+
return element;
|
2922 |
+
}
|
2923 |
+
}
|
2924 |
+
return Prototype.K;
|
2925 |
+
}
|
2926 |
+
|
2927 |
+
var Methods = { }, ByTag = Element.Methods.ByTag;
|
2928 |
+
|
2929 |
+
var extend = Object.extend(function(element) {
|
2930 |
+
if (!element || typeof element._extendedByPrototype != 'undefined' ||
|
2931 |
+
element.nodeType != 1 || element == window) return element;
|
2932 |
+
|
2933 |
+
var methods = Object.clone(Methods),
|
2934 |
+
tagName = element.tagName.toUpperCase();
|
2935 |
+
|
2936 |
+
if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
|
2937 |
+
|
2938 |
+
extendElementWith(element, methods);
|
2939 |
+
|
2940 |
+
element._extendedByPrototype = Prototype.emptyFunction;
|
2941 |
+
return element;
|
2942 |
+
|
2943 |
+
}, {
|
2944 |
+
refresh: function() {
|
2945 |
+
if (!Prototype.BrowserFeatures.ElementExtensions) {
|
2946 |
+
Object.extend(Methods, Element.Methods);
|
2947 |
+
Object.extend(Methods, Element.Methods.Simulated);
|
2948 |
+
}
|
2949 |
+
}
|
2950 |
+
});
|
2951 |
+
|
2952 |
+
extend.refresh();
|
2953 |
+
return extend;
|
2954 |
+
})();
|
2955 |
+
|
2956 |
+
if (document.documentElement.hasAttribute) {
|
2957 |
+
Element.hasAttribute = function(element, attribute) {
|
2958 |
+
return element.hasAttribute(attribute);
|
2959 |
+
};
|
2960 |
+
}
|
2961 |
+
else {
|
2962 |
+
Element.hasAttribute = Element.Methods.Simulated.hasAttribute;
|
2963 |
+
}
|
2964 |
+
|
2965 |
+
Element.addMethods = function(methods) {
|
2966 |
+
var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
|
2967 |
+
|
2968 |
+
if (!methods) {
|
2969 |
+
Object.extend(Form, Form.Methods);
|
2970 |
+
Object.extend(Form.Element, Form.Element.Methods);
|
2971 |
+
Object.extend(Element.Methods.ByTag, {
|
2972 |
+
"FORM": Object.clone(Form.Methods),
|
2973 |
+
"INPUT": Object.clone(Form.Element.Methods),
|
2974 |
+
"SELECT": Object.clone(Form.Element.Methods),
|
2975 |
+
"TEXTAREA": Object.clone(Form.Element.Methods),
|
2976 |
+
"BUTTON": Object.clone(Form.Element.Methods)
|
2977 |
+
});
|
2978 |
+
}
|
2979 |
+
|
2980 |
+
if (arguments.length == 2) {
|
2981 |
+
var tagName = methods;
|
2982 |
+
methods = arguments[1];
|
2983 |
+
}
|
2984 |
+
|
2985 |
+
if (!tagName) Object.extend(Element.Methods, methods || { });
|
2986 |
+
else {
|
2987 |
+
if (Object.isArray(tagName)) tagName.each(extend);
|
2988 |
+
else extend(tagName);
|
2989 |
+
}
|
2990 |
+
|
2991 |
+
function extend(tagName) {
|
2992 |
+
tagName = tagName.toUpperCase();
|
2993 |
+
if (!Element.Methods.ByTag[tagName])
|
2994 |
+
Element.Methods.ByTag[tagName] = { };
|
2995 |
+
Object.extend(Element.Methods.ByTag[tagName], methods);
|
2996 |
+
}
|
2997 |
+
|
2998 |
+
function copy(methods, destination, onlyIfAbsent) {
|
2999 |
+
onlyIfAbsent = onlyIfAbsent || false;
|
3000 |
+
for (var property in methods) {
|
3001 |
+
var value = methods[property];
|
3002 |
+
if (!Object.isFunction(value)) continue;
|
3003 |
+
if (!onlyIfAbsent || !(property in destination))
|
3004 |
+
destination[property] = value.methodize();
|
3005 |
+
}
|
3006 |
+
}
|
3007 |
+
|
3008 |
+
function findDOMClass(tagName) {
|
3009 |
+
var klass;
|
3010 |
+
var trans = {
|
3011 |
+
"OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
|
3012 |
+
"FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
|
3013 |
+
"DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
|
3014 |
+
"H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
|
3015 |
+
"INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
|
3016 |
+
"TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
|
3017 |
+
"TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
|
3018 |
+
"TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
|
3019 |
+
"FrameSet", "IFRAME": "IFrame"
|
3020 |
+
};
|
3021 |
+
if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
|
3022 |
+
if (window[klass]) return window[klass];
|
3023 |
+
klass = 'HTML' + tagName + 'Element';
|
3024 |
+
if (window[klass]) return window[klass];
|
3025 |
+
klass = 'HTML' + tagName.capitalize() + 'Element';
|
3026 |
+
if (window[klass]) return window[klass];
|
3027 |
+
|
3028 |
+
var element = document.createElement(tagName),
|
3029 |
+
proto = element['__proto__'] || element.constructor.prototype;
|
3030 |
+
|
3031 |
+
element = null;
|
3032 |
+
return proto;
|
3033 |
+
}
|
3034 |
+
|
3035 |
+
var elementPrototype = window.HTMLElement ? HTMLElement.prototype :
|
3036 |
+
Element.prototype;
|
3037 |
+
|
3038 |
+
if (F.ElementExtensions) {
|
3039 |
+
copy(Element.Methods, elementPrototype);
|
3040 |
+
copy(Element.Methods.Simulated, elementPrototype, true);
|
3041 |
+
}
|
3042 |
+
|
3043 |
+
if (F.SpecificElementExtensions) {
|
3044 |
+
for (var tag in Element.Methods.ByTag) {
|
3045 |
+
var klass = findDOMClass(tag);
|
3046 |
+
if (Object.isUndefined(klass)) continue;
|
3047 |
+
copy(T[tag], klass.prototype);
|
3048 |
+
}
|
3049 |
+
}
|
3050 |
+
|
3051 |
+
Object.extend(Element, Element.Methods);
|
3052 |
+
delete Element.ByTag;
|
3053 |
+
|
3054 |
+
if (Element.extend.refresh) Element.extend.refresh();
|
3055 |
+
Element.cache = { };
|
3056 |
+
};
|
3057 |
+
|
3058 |
+
|
3059 |
+
document.viewport = {
|
3060 |
+
|
3061 |
+
getDimensions: function() {
|
3062 |
+
return { width: this.getWidth(), height: this.getHeight() };
|
3063 |
+
},
|
3064 |
+
|
3065 |
+
getScrollOffsets: function() {
|
3066 |
+
return Element._returnOffset(
|
3067 |
+
window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
|
3068 |
+
window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
|
3069 |
+
}
|
3070 |
+
};
|
3071 |
+
|
3072 |
+
(function(viewport) {
|
3073 |
+
var B = Prototype.Browser, doc = document, element, property = {};
|
3074 |
+
|
3075 |
+
function getRootElement() {
|
3076 |
+
if (B.WebKit && !doc.evaluate)
|
3077 |
+
return document;
|
3078 |
+
|
3079 |
+
if (B.Opera && window.parseFloat(window.opera.version()) < 9.5)
|
3080 |
+
return document.body;
|
3081 |
+
|
3082 |
+
return document.documentElement;
|
3083 |
+
}
|
3084 |
+
|
3085 |
+
function define(D) {
|
3086 |
+
if (!element) element = getRootElement();
|
3087 |
+
|
3088 |
+
property[D] = 'client' + D;
|
3089 |
+
|
3090 |
+
viewport['get' + D] = function() { return element[property[D]] };
|
3091 |
+
return viewport['get' + D]();
|
3092 |
+
}
|
3093 |
+
|
3094 |
+
viewport.getWidth = define.curry('Width');
|
3095 |
+
|
3096 |
+
viewport.getHeight = define.curry('Height');
|
3097 |
+
})(document.viewport);
|
3098 |
+
|
3099 |
+
|
3100 |
+
Element.Storage = {
|
3101 |
+
UID: 1
|
3102 |
+
};
|
3103 |
+
|
3104 |
+
Element.addMethods({
|
3105 |
+
getStorage: function(element) {
|
3106 |
+
if (!(element = $(element))) return;
|
3107 |
+
|
3108 |
+
var uid;
|
3109 |
+
if (element === window) {
|
3110 |
+
uid = 0;
|
3111 |
+
} else {
|
3112 |
+
if (typeof element._prototypeUID === "undefined")
|
3113 |
+
element._prototypeUID = Element.Storage.UID++;
|
3114 |
+
uid = element._prototypeUID;
|
3115 |
+
}
|
3116 |
+
|
3117 |
+
if (!Element.Storage[uid])
|
3118 |
+
Element.Storage[uid] = $H();
|
3119 |
+
|
3120 |
+
return Element.Storage[uid];
|
3121 |
+
},
|
3122 |
+
|
3123 |
+
store: function(element, key, value) {
|
3124 |
+
if (!(element = $(element))) return;
|
3125 |
+
|
3126 |
+
if (arguments.length === 2) {
|
3127 |
+
Element.getStorage(element).update(key);
|
3128 |
+
} else {
|
3129 |
+
Element.getStorage(element).set(key, value);
|
3130 |
+
}
|
3131 |
+
|
3132 |
+
return element;
|
3133 |
+
},
|
3134 |
+
|
3135 |
+
retrieve: function(element, key, defaultValue) {
|
3136 |
+
if (!(element = $(element))) return;
|
3137 |
+
var hash = Element.getStorage(element), value = hash.get(key);
|
3138 |
+
|
3139 |
+
if (Object.isUndefined(value)) {
|
3140 |
+
hash.set(key, defaultValue);
|
3141 |
+
value = defaultValue;
|
3142 |
+
}
|
3143 |
+
|
3144 |
+
return value;
|
3145 |
+
},
|
3146 |
+
|
3147 |
+
clone: function(element, deep) {
|
3148 |
+
if (!(element = $(element))) return;
|
3149 |
+
var clone = element.cloneNode(deep);
|
3150 |
+
clone._prototypeUID = void 0;
|
3151 |
+
if (deep) {
|
3152 |
+
var descendants = Element.select(clone, '*'),
|
3153 |
+
i = descendants.length;
|
3154 |
+
while (i--) {
|
3155 |
+
descendants[i]._prototypeUID = void 0;
|
3156 |
+
}
|
3157 |
+
}
|
3158 |
+
return Element.extend(clone);
|
3159 |
+
},
|
3160 |
+
|
3161 |
+
purge: function(element) {
|
3162 |
+
if (!(element = $(element))) return;
|
3163 |
+
var purgeElement = Element._purgeElement;
|
3164 |
+
|
3165 |
+
purgeElement(element);
|
3166 |
+
|
3167 |
+
var descendants = element.getElementsByTagName('*'),
|
3168 |
+
i = descendants.length;
|
3169 |
+
|
3170 |
+
while (i--) purgeElement(descendants[i]);
|
3171 |
+
|
3172 |
+
return null;
|
3173 |
+
}
|
3174 |
+
});
|
3175 |
+
|
3176 |
+
(function() {
|
3177 |
+
|
3178 |
+
function toDecimal(pctString) {
|
3179 |
+
var match = pctString.match(/^(\d+)%?$/i);
|
3180 |
+
if (!match) return null;
|
3181 |
+
return (Number(match[1]) / 100);
|
3182 |
+
}
|
3183 |
+
|
3184 |
+
function getPixelValue(value, property, context) {
|
3185 |
+
var element = null;
|
3186 |
+
if (Object.isElement(value)) {
|
3187 |
+
element = value;
|
3188 |
+
value = element.getStyle(property);
|
3189 |
+
}
|
3190 |
+
|
3191 |
+
if (value === null) {
|
3192 |
+
return null;
|
3193 |
+
}
|
3194 |
+
|
3195 |
+
if ((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(value)) {
|
3196 |
+
return window.parseFloat(value);
|
3197 |
+
}
|
3198 |
+
|
3199 |
+
var isPercentage = value.include('%'), isViewport = (context === document.viewport);
|
3200 |
+
|
3201 |
+
if (/\d/.test(value) && element && element.runtimeStyle && !(isPercentage && isViewport)) {
|
3202 |
+
var style = element.style.left, rStyle = element.runtimeStyle.left;
|
3203 |
+
element.runtimeStyle.left = element.currentStyle.left;
|
3204 |
+
element.style.left = value || 0;
|
3205 |
+
value = element.style.pixelLeft;
|
3206 |
+
element.style.left = style;
|
3207 |
+
element.runtimeStyle.left = rStyle;
|
3208 |
+
|
3209 |
+
return value;
|
3210 |
+
}
|
3211 |
+
|
3212 |
+
if (element && isPercentage) {
|
3213 |
+
context = context || element.parentNode;
|
3214 |
+
var decimal = toDecimal(value);
|
3215 |
+
var whole = null;
|
3216 |
+
var position = element.getStyle('position');
|
3217 |
+
|
3218 |
+
var isHorizontal = property.include('left') || property.include('right') ||
|
3219 |
+
property.include('width');
|
3220 |
+
|
3221 |
+
var isVertical = property.include('top') || property.include('bottom') ||
|
3222 |
+
property.include('height');
|
3223 |
+
|
3224 |
+
if (context === document.viewport) {
|
3225 |
+
if (isHorizontal) {
|
3226 |
+
whole = document.viewport.getWidth();
|
3227 |
+
} else if (isVertical) {
|
3228 |
+
whole = document.viewport.getHeight();
|
3229 |
+
}
|
3230 |
+
} else {
|
3231 |
+
if (isHorizontal) {
|
3232 |
+
whole = $(context).measure('width');
|
3233 |
+
} else if (isVertical) {
|
3234 |
+
whole = $(context).measure('height');
|
3235 |
+
}
|
3236 |
+
}
|
3237 |
+
|
3238 |
+
return (whole === null) ? 0 : whole * decimal;
|
3239 |
+
}
|
3240 |
+
|
3241 |
+
return 0;
|
3242 |
+
}
|
3243 |
+
|
3244 |
+
function toCSSPixels(number) {
|
3245 |
+
if (Object.isString(number) && number.endsWith('px')) {
|
3246 |
+
return number;
|
3247 |
+
}
|
3248 |
+
return number + 'px';
|
3249 |
+
}
|
3250 |
+
|
3251 |
+
function isDisplayed(element) {
|
3252 |
+
var originalElement = element;
|
3253 |
+
while (element && element.parentNode) {
|
3254 |
+
var display = element.getStyle('display');
|
3255 |
+
if (display === 'none') {
|
3256 |
+
return false;
|
3257 |
+
}
|
3258 |
+
element = $(element.parentNode);
|
3259 |
+
}
|
3260 |
+
return true;
|
3261 |
+
}
|
3262 |
+
|
3263 |
+
var hasLayout = Prototype.K;
|
3264 |
+
if ('currentStyle' in document.documentElement) {
|
3265 |
+
hasLayout = function(element) {
|
3266 |
+
if (!element.currentStyle.hasLayout) {
|
3267 |
+
element.style.zoom = 1;
|
3268 |
+
}
|
3269 |
+
return element;
|
3270 |
+
};
|
3271 |
+
}
|
3272 |
+
|
3273 |
+
function cssNameFor(key) {
|
3274 |
+
if (key.include('border')) key = key + '-width';
|
3275 |
+
return key.camelize();
|
3276 |
+
}
|
3277 |
+
|
3278 |
+
Element.Layout = Class.create(Hash, {
|
3279 |
+
initialize: function($super, element, preCompute) {
|
3280 |
+
$super();
|
3281 |
+
this.element = $(element);
|
3282 |
+
|
3283 |
+
Element.Layout.PROPERTIES.each( function(property) {
|
3284 |
+
this._set(property, null);
|
3285 |
+
}, this);
|
3286 |
+
|
3287 |
+
if (preCompute) {
|
3288 |
+
this._preComputing = true;
|
3289 |
+
this._begin();
|
3290 |
+
Element.Layout.PROPERTIES.each( this._compute, this );
|
3291 |
+
this._end();
|
3292 |
+
this._preComputing = false;
|
3293 |
+
}
|
3294 |
+
},
|
3295 |
+
|
3296 |
+
_set: function(property, value) {
|
3297 |
+
return Hash.prototype.set.call(this, property, value);
|
3298 |
+
},
|
3299 |
+
|
3300 |
+
set: function(property, value) {
|
3301 |
+
throw "Properties of Element.Layout are read-only.";
|
3302 |
+
},
|
3303 |
+
|
3304 |
+
get: function($super, property) {
|
3305 |
+
var value = $super(property);
|
3306 |
+
return value === null ? this._compute(property) : value;
|
3307 |
+
},
|
3308 |
+
|
3309 |
+
_begin: function() {
|
3310 |
+
if (this._prepared) return;
|
3311 |
+
|
3312 |
+
var element = this.element;
|
3313 |
+
if (isDisplayed(element)) {
|
3314 |
+
this._prepared = true;
|
3315 |
+
return;
|
3316 |
+
}
|
3317 |
+
|
3318 |
+
var originalStyles = {
|
3319 |
+
position: element.style.position || '',
|
3320 |
+
width: element.style.width || '',
|
3321 |
+
visibility: element.style.visibility || '',
|
3322 |
+
display: element.style.display || ''
|
3323 |
+
};
|
3324 |
+
|
3325 |
+
element.store('prototype_original_styles', originalStyles);
|
3326 |
+
|
3327 |
+
var position = element.getStyle('position'),
|
3328 |
+
width = element.getStyle('width');
|
3329 |
+
|
3330 |
+
if (width === "0px" || width === null) {
|
3331 |
+
element.style.display = 'block';
|
3332 |
+
width = element.getStyle('width');
|
3333 |
+
}
|
3334 |
+
|
3335 |
+
var context = (position === 'fixed') ? document.viewport :
|
3336 |
+
element.parentNode;
|
3337 |
+
|
3338 |
+
element.setStyle({
|
3339 |
+
position: 'absolute',
|
3340 |
+
visibility: 'hidden',
|
3341 |
+
display: 'block'
|
3342 |
+
});
|
3343 |
+
|
3344 |
+
var positionedWidth = element.getStyle('width');
|
3345 |
+
|
3346 |
+
var newWidth;
|
3347 |
+
if (width && (positionedWidth === width)) {
|
3348 |
+
newWidth = getPixelValue(element, 'width', context);
|
3349 |
+
} else if (position === 'absolute' || position === 'fixed') {
|
3350 |
+
newWidth = getPixelValue(element, 'width', context);
|
3351 |
+
} else {
|
3352 |
+
var parent = element.parentNode, pLayout = $(parent).getLayout();
|
3353 |
+
|
3354 |
+
newWidth = pLayout.get('width') -
|
3355 |
+
this.get('margin-left') -
|
3356 |
+
this.get('border-left') -
|
3357 |
+
this.get('padding-left') -
|
3358 |
+
this.get('padding-right') -
|
3359 |
+
this.get('border-right') -
|
3360 |
+
this.get('margin-right');
|
3361 |
+
}
|
3362 |
+
|
3363 |
+
element.setStyle({ width: newWidth + 'px' });
|
3364 |
+
|
3365 |
+
this._prepared = true;
|
3366 |
+
},
|
3367 |
+
|
3368 |
+
_end: function() {
|
3369 |
+
var element = this.element;
|
3370 |
+
var originalStyles = element.retrieve('prototype_original_styles');
|
3371 |
+
element.store('prototype_original_styles', null);
|
3372 |
+
element.setStyle(originalStyles);
|
3373 |
+
this._prepared = false;
|
3374 |
+
},
|
3375 |
+
|
3376 |
+
_compute: function(property) {
|
3377 |
+
var COMPUTATIONS = Element.Layout.COMPUTATIONS;
|
3378 |
+
if (!(property in COMPUTATIONS)) {
|
3379 |
+
throw "Property not found.";
|
3380 |
+
}
|
3381 |
+
|
3382 |
+
return this._set(property, COMPUTATIONS[property].call(this, this.element));
|
3383 |
+
},
|
3384 |
+
|
3385 |
+
toObject: function() {
|
3386 |
+
var args = $A(arguments);
|
3387 |
+
var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
|
3388 |
+
args.join(' ').split(' ');
|
3389 |
+
var obj = {};
|
3390 |
+
keys.each( function(key) {
|
3391 |
+
if (!Element.Layout.PROPERTIES.include(key)) return;
|
3392 |
+
var value = this.get(key);
|
3393 |
+
if (value != null) obj[key] = value;
|
3394 |
+
}, this);
|
3395 |
+
return obj;
|
3396 |
+
},
|
3397 |
+
|
3398 |
+
toHash: function() {
|
3399 |
+
var obj = this.toObject.apply(this, arguments);
|
3400 |
+
return new Hash(obj);
|
3401 |
+
},
|
3402 |
+
|
3403 |
+
toCSS: function() {
|
3404 |
+
var args = $A(arguments);
|
3405 |
+
var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
|
3406 |
+
args.join(' ').split(' ');
|
3407 |
+
var css = {};
|
3408 |
+
|
3409 |
+
keys.each( function(key) {
|
3410 |
+
if (!Element.Layout.PROPERTIES.include(key)) return;
|
3411 |
+
if (Element.Layout.COMPOSITE_PROPERTIES.include(key)) return;
|
3412 |
+
|
3413 |
+
var value = this.get(key);
|
3414 |
+
if (value != null) css[cssNameFor(key)] = value + 'px';
|
3415 |
+
}, this);
|
3416 |
+
return css;
|
3417 |
+
},
|
3418 |
+
|
3419 |
+
inspect: function() {
|
3420 |
+
return "#<Element.Layout>";
|
3421 |
+
}
|
3422 |
+
});
|
3423 |
+
|
3424 |
+
Object.extend(Element.Layout, {
|
3425 |
+
PROPERTIES: $w('height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height'),
|
3426 |
+
|
3427 |
+
COMPOSITE_PROPERTIES: $w('padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height'),
|
3428 |
+
|
3429 |
+
COMPUTATIONS: {
|
3430 |
+
'height': function(element) {
|
3431 |
+
if (!this._preComputing) this._begin();
|
3432 |
+
|
3433 |
+
var bHeight = this.get('border-box-height');
|
3434 |
+
if (bHeight <= 0) {
|
3435 |
+
if (!this._preComputing) this._end();
|
3436 |
+
return 0;
|
3437 |
+
}
|
3438 |
+
|
3439 |
+
var bTop = this.get('border-top'),
|
3440 |
+
bBottom = this.get('border-bottom');
|
3441 |
+
|
3442 |
+
var pTop = this.get('padding-top'),
|
3443 |
+
pBottom = this.get('padding-bottom');
|
3444 |
+
|
3445 |
+
if (!this._preComputing) this._end();
|
3446 |
+
|
3447 |
+
return bHeight - bTop - bBottom - pTop - pBottom;
|
3448 |
+
},
|
3449 |
+
|
3450 |
+
'width': function(element) {
|
3451 |
+
if (!this._preComputing) this._begin();
|
3452 |
+
|
3453 |
+
var bWidth = this.get('border-box-width');
|
3454 |
+
if (bWidth <= 0) {
|
3455 |
+
if (!this._preComputing) this._end();
|
3456 |
+
return 0;
|
3457 |
+
}
|
3458 |
+
|
3459 |
+
var bLeft = this.get('border-left'),
|
3460 |
+
bRight = this.get('border-right');
|
3461 |
+
|
3462 |
+
var pLeft = this.get('padding-left'),
|
3463 |
+
pRight = this.get('padding-right');
|
3464 |
+
|
3465 |
+
if (!this._preComputing) this._end();
|
3466 |
+
|
3467 |
+
return bWidth - bLeft - bRight - pLeft - pRight;
|
3468 |
+
},
|
3469 |
+
|
3470 |
+
'padding-box-height': function(element) {
|
3471 |
+
var height = this.get('height'),
|
3472 |
+
pTop = this.get('padding-top'),
|
3473 |
+
pBottom = this.get('padding-bottom');
|
3474 |
+
|
3475 |
+
return height + pTop + pBottom;
|
3476 |
+
},
|
3477 |
+
|
3478 |
+
'padding-box-width': function(element) {
|
3479 |
+
var width = this.get('width'),
|
3480 |
+
pLeft = this.get('padding-left'),
|
3481 |
+
pRight = this.get('padding-right');
|
3482 |
+
|
3483 |
+
return width + pLeft + pRight;
|
3484 |
+
},
|
3485 |
+
|
3486 |
+
'border-box-height': function(element) {
|
3487 |
+
if (!this._preComputing) this._begin();
|
3488 |
+
var height = element.offsetHeight;
|
3489 |
+
if (!this._preComputing) this._end();
|
3490 |
+
return height;
|
3491 |
+
},
|
3492 |
+
|
3493 |
+
'border-box-width': function(element) {
|
3494 |
+
if (!this._preComputing) this._begin();
|
3495 |
+
var width = element.offsetWidth;
|
3496 |
+
if (!this._preComputing) this._end();
|
3497 |
+
return width;
|
3498 |
+
},
|
3499 |
+
|
3500 |
+
'margin-box-height': function(element) {
|
3501 |
+
var bHeight = this.get('border-box-height'),
|
3502 |
+
mTop = this.get('margin-top'),
|
3503 |
+
mBottom = this.get('margin-bottom');
|
3504 |
+
|
3505 |
+
if (bHeight <= 0) return 0;
|
3506 |
+
|
3507 |
+
return bHeight + mTop + mBottom;
|
3508 |
+
},
|
3509 |
+
|
3510 |
+
'margin-box-width': function(element) {
|
3511 |
+
var bWidth = this.get('border-box-width'),
|
3512 |
+
mLeft = this.get('margin-left'),
|
3513 |
+
mRight = this.get('margin-right');
|
3514 |
+
|
3515 |
+
if (bWidth <= 0) return 0;
|
3516 |
+
|
3517 |
+
return bWidth + mLeft + mRight;
|
3518 |
+
},
|
3519 |
+
|
3520 |
+
'top': function(element) {
|
3521 |
+
var offset = element.positionedOffset();
|
3522 |
+
return offset.top;
|
3523 |
+
},
|
3524 |
+
|
3525 |
+
'bottom': function(element) {
|
3526 |
+
var offset = element.positionedOffset(),
|
3527 |
+
parent = element.getOffsetParent(),
|
3528 |
+
pHeight = parent.measure('height');
|
3529 |
+
|
3530 |
+
var mHeight = this.get('border-box-height');
|
3531 |
+
|
3532 |
+
return pHeight - mHeight - offset.top;
|
3533 |
+
},
|
3534 |
+
|
3535 |
+
'left': function(element) {
|
3536 |
+
var offset = element.positionedOffset();
|
3537 |
+
return offset.left;
|
3538 |
+
},
|
3539 |
+
|
3540 |
+
'right': function(element) {
|
3541 |
+
var offset = element.positionedOffset(),
|
3542 |
+
parent = element.getOffsetParent(),
|
3543 |
+
pWidth = parent.measure('width');
|
3544 |
+
|
3545 |
+
var mWidth = this.get('border-box-width');
|
3546 |
+
|
3547 |
+
return pWidth - mWidth - offset.left;
|
3548 |
+
},
|
3549 |
+
|
3550 |
+
'padding-top': function(element) {
|
3551 |
+
return getPixelValue(element, 'paddingTop');
|
3552 |
+
},
|
3553 |
+
|
3554 |
+
'padding-bottom': function(element) {
|
3555 |
+
return getPixelValue(element, 'paddingBottom');
|
3556 |
+
},
|
3557 |
+
|
3558 |
+
'padding-left': function(element) {
|
3559 |
+
return getPixelValue(element, 'paddingLeft');
|
3560 |
+
},
|
3561 |
+
|
3562 |
+
'padding-right': function(element) {
|
3563 |
+
return getPixelValue(element, 'paddingRight');
|
3564 |
+
},
|
3565 |
+
|
3566 |
+
'border-top': function(element) {
|
3567 |
+
return getPixelValue(element, 'borderTopWidth');
|
3568 |
+
},
|
3569 |
+
|
3570 |
+
'border-bottom': function(element) {
|
3571 |
+
return getPixelValue(element, 'borderBottomWidth');
|
3572 |
+
},
|
3573 |
+
|
3574 |
+
'border-left': function(element) {
|
3575 |
+
return getPixelValue(element, 'borderLeftWidth');
|
3576 |
+
},
|
3577 |
+
|
3578 |
+
'border-right': function(element) {
|
3579 |
+
return getPixelValue(element, 'borderRightWidth');
|
3580 |
+
},
|
3581 |
+
|
3582 |
+
'margin-top': function(element) {
|
3583 |
+
return getPixelValue(element, 'marginTop');
|
3584 |
+
},
|
3585 |
+
|
3586 |
+
'margin-bottom': function(element) {
|
3587 |
+
return getPixelValue(element, 'marginBottom');
|
3588 |
+
},
|
3589 |
+
|
3590 |
+
'margin-left': function(element) {
|
3591 |
+
return getPixelValue(element, 'marginLeft');
|
3592 |
+
},
|
3593 |
+
|
3594 |
+
'margin-right': function(element) {
|
3595 |
+
return getPixelValue(element, 'marginRight');
|
3596 |
+
}
|
3597 |
+
}
|
3598 |
+
});
|
3599 |
+
|
3600 |
+
if ('getBoundingClientRect' in document.documentElement) {
|
3601 |
+
Object.extend(Element.Layout.COMPUTATIONS, {
|
3602 |
+
'right': function(element) {
|
3603 |
+
var parent = hasLayout(element.getOffsetParent());
|
3604 |
+
var rect = element.getBoundingClientRect(),
|
3605 |
+
pRect = parent.getBoundingClientRect();
|
3606 |
+
|
3607 |
+
return (pRect.right - rect.right).round();
|
3608 |
+
},
|
3609 |
+
|
3610 |
+
'bottom': function(element) {
|
3611 |
+
var parent = hasLayout(element.getOffsetParent());
|
3612 |
+
var rect = element.getBoundingClientRect(),
|
3613 |
+
pRect = parent.getBoundingClientRect();
|
3614 |
+
|
3615 |
+
return (pRect.bottom - rect.bottom).round();
|
3616 |
+
}
|
3617 |
+
});
|
3618 |
+
}
|
3619 |
+
|
3620 |
+
Element.Offset = Class.create({
|
3621 |
+
initialize: function(left, top) {
|
3622 |
+
this.left = left.round();
|
3623 |
+
this.top = top.round();
|
3624 |
+
|
3625 |
+
this[0] = this.left;
|
3626 |
+
this[1] = this.top;
|
3627 |
+
},
|
3628 |
+
|
3629 |
+
relativeTo: function(offset) {
|
3630 |
+
return new Element.Offset(
|
3631 |
+
this.left - offset.left,
|
3632 |
+
this.top - offset.top
|
3633 |
+
);
|
3634 |
+
},
|
3635 |
+
|
3636 |
+
inspect: function() {
|
3637 |
+
return "#<Element.Offset left: #{left} top: #{top}>".interpolate(this);
|
3638 |
+
},
|
3639 |
+
|
3640 |
+
toString: function() {
|
3641 |
+
return "[#{left}, #{top}]".interpolate(this);
|
3642 |
+
},
|
3643 |
+
|
3644 |
+
toArray: function() {
|
3645 |
+
return [this.left, this.top];
|
3646 |
+
}
|
3647 |
+
});
|
3648 |
+
|
3649 |
+
function getLayout(element, preCompute) {
|
3650 |
+
return new Element.Layout(element, preCompute);
|
3651 |
+
}
|
3652 |
+
|
3653 |
+
function measure(element, property) {
|
3654 |
+
return $(element).getLayout().get(property);
|
3655 |
+
}
|
3656 |
+
|
3657 |
+
function getDimensions(element) {
|
3658 |
+
element = $(element);
|
3659 |
+
var display = Element.getStyle(element, 'display');
|
3660 |
+
|
3661 |
+
if (display && display !== 'none') {
|
3662 |
+
return { width: element.offsetWidth, height: element.offsetHeight };
|
3663 |
+
}
|
3664 |
+
|
3665 |
+
var style = element.style;
|
3666 |
+
var originalStyles = {
|
3667 |
+
visibility: style.visibility,
|
3668 |
+
position: style.position,
|
3669 |
+
display: style.display
|
3670 |
+
};
|
3671 |
+
|
3672 |
+
var newStyles = {
|
3673 |
+
visibility: 'hidden',
|
3674 |
+
display: 'block'
|
3675 |
+
};
|
3676 |
+
|
3677 |
+
if (originalStyles.position !== 'fixed')
|
3678 |
+
newStyles.position = 'absolute';
|
3679 |
+
|
3680 |
+
Element.setStyle(element, newStyles);
|
3681 |
+
|
3682 |
+
var dimensions = {
|
3683 |
+
width: element.offsetWidth,
|
3684 |
+
height: element.offsetHeight
|
3685 |
+
};
|
3686 |
+
|
3687 |
+
Element.setStyle(element, originalStyles);
|
3688 |
+
|
3689 |
+
return dimensions;
|
3690 |
+
}
|
3691 |
+
|
3692 |
+
function getOffsetParent(element) {
|
3693 |
+
element = $(element);
|
3694 |
+
|
3695 |
+
if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
|
3696 |
+
return $(document.body);
|
3697 |
+
|
3698 |
+
var isInline = (Element.getStyle(element, 'display') === 'inline');
|
3699 |
+
if (!isInline && element.offsetParent) return $(element.offsetParent);
|
3700 |
+
|
3701 |
+
while ((element = element.parentNode) && element !== document.body) {
|
3702 |
+
if (Element.getStyle(element, 'position') !== 'static') {
|
3703 |
+
return isHtml(element) ? $(document.body) : $(element);
|
3704 |
+
}
|
3705 |
+
}
|
3706 |
+
|
3707 |
+
return $(document.body);
|
3708 |
+
}
|
3709 |
+
|
3710 |
+
|
3711 |
+
function cumulativeOffset(element) {
|
3712 |
+
element = $(element);
|
3713 |
+
var valueT = 0, valueL = 0;
|
3714 |
+
if (element.parentNode) {
|
3715 |
+
do {
|
3716 |
+
valueT += element.offsetTop || 0;
|
3717 |
+
valueL += element.offsetLeft || 0;
|
3718 |
+
element = element.offsetParent;
|
3719 |
+
} while (element);
|
3720 |
+
}
|
3721 |
+
return new Element.Offset(valueL, valueT);
|
3722 |
+
}
|
3723 |
+
|
3724 |
+
function positionedOffset(element) {
|
3725 |
+
element = $(element);
|
3726 |
+
|
3727 |
+
var layout = element.getLayout();
|
3728 |
+
|
3729 |
+
var valueT = 0, valueL = 0;
|
3730 |
+
do {
|
3731 |
+
valueT += element.offsetTop || 0;
|
3732 |
+
valueL += element.offsetLeft || 0;
|
3733 |
+
element = element.offsetParent;
|
3734 |
+
if (element) {
|
3735 |
+
if (isBody(element)) break;
|
3736 |
+
var p = Element.getStyle(element, 'position');
|
3737 |
+
if (p !== 'static') break;
|
3738 |
+
}
|
3739 |
+
} while (element);
|
3740 |
+
|
3741 |
+
valueL -= layout.get('margin-top');
|
3742 |
+
valueT -= layout.get('margin-left');
|
3743 |
+
|
3744 |
+
return new Element.Offset(valueL, valueT);
|
3745 |
+
}
|
3746 |
+
|
3747 |
+
function cumulativeScrollOffset(element) {
|
3748 |
+
var valueT = 0, valueL = 0;
|
3749 |
+
do {
|
3750 |
+
valueT += element.scrollTop || 0;
|
3751 |
+
valueL += element.scrollLeft || 0;
|
3752 |
+
element = element.parentNode;
|
3753 |
+
} while (element);
|
3754 |
+
return new Element.Offset(valueL, valueT);
|
3755 |
+
}
|
3756 |
+
|
3757 |
+
function viewportOffset(forElement) {
|
3758 |
+
element = $(element);
|
3759 |
+
var valueT = 0, valueL = 0, docBody = document.body;
|
3760 |
+
|
3761 |
+
var element = forElement;
|
3762 |
+
do {
|
3763 |
+
valueT += element.offsetTop || 0;
|
3764 |
+
valueL += element.offsetLeft || 0;
|
3765 |
+
if (element.offsetParent == docBody &&
|
3766 |
+
Element.getStyle(element, 'position') == 'absolute') break;
|
3767 |
+
} while (element = element.offsetParent);
|
3768 |
+
|
3769 |
+
element = forElement;
|
3770 |
+
do {
|
3771 |
+
if (element != docBody) {
|
3772 |
+
valueT -= element.scrollTop || 0;
|
3773 |
+
valueL -= element.scrollLeft || 0;
|
3774 |
+
}
|
3775 |
+
} while (element = element.parentNode);
|
3776 |
+
return new Element.Offset(valueL, valueT);
|
3777 |
+
}
|
3778 |
+
|
3779 |
+
function absolutize(element) {
|
3780 |
+
element = $(element);
|
3781 |
+
|
3782 |
+
if (Element.getStyle(element, 'position') === 'absolute') {
|
3783 |
+
return element;
|
3784 |
+
}
|
3785 |
+
|
3786 |
+
var offsetParent = getOffsetParent(element);
|
3787 |
+
var eOffset = element.viewportOffset(),
|
3788 |
+
pOffset = offsetParent.viewportOffset();
|
3789 |
+
|
3790 |
+
var offset = eOffset.relativeTo(pOffset);
|
3791 |
+
var layout = element.getLayout();
|
3792 |
+
|
3793 |
+
element.store('prototype_absolutize_original_styles', {
|
3794 |
+
left: element.getStyle('left'),
|
3795 |
+
top: element.getStyle('top'),
|
3796 |
+
width: element.getStyle('width'),
|
3797 |
+
height: element.getStyle('height')
|
3798 |
+
});
|
3799 |
+
|
3800 |
+
element.setStyle({
|
3801 |
+
position: 'absolute',
|
3802 |
+
top: offset.top + 'px',
|
3803 |
+
left: offset.left + 'px',
|
3804 |
+
width: layout.get('width') + 'px',
|
3805 |
+
height: layout.get('height') + 'px'
|
3806 |
+
});
|
3807 |
+
|
3808 |
+
return element;
|
3809 |
+
}
|
3810 |
+
|
3811 |
+
function relativize(element) {
|
3812 |
+
element = $(element);
|
3813 |
+
if (Element.getStyle(element, 'position') === 'relative') {
|
3814 |
+
return element;
|
3815 |
+
}
|
3816 |
+
|
3817 |
+
var originalStyles =
|
3818 |
+
element.retrieve('prototype_absolutize_original_styles');
|
3819 |
+
|
3820 |
+
if (originalStyles) element.setStyle(originalStyles);
|
3821 |
+
return element;
|
3822 |
+
}
|
3823 |
+
|
3824 |
+
if (Prototype.Browser.IE) {
|
3825 |
+
getOffsetParent = getOffsetParent.wrap(
|
3826 |
+
function(proceed, element) {
|
3827 |
+
element = $(element);
|
3828 |
+
|
3829 |
+
if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
|
3830 |
+
return $(document.body);
|
3831 |
+
|
3832 |
+
var position = element.getStyle('position');
|
3833 |
+
if (position !== 'static') return proceed(element);
|
3834 |
+
|
3835 |
+
element.setStyle({ position: 'relative' });
|
3836 |
+
var value = proceed(element);
|
3837 |
+
element.setStyle({ position: position });
|
3838 |
+
return value;
|
3839 |
+
}
|
3840 |
+
);
|
3841 |
+
|
3842 |
+
positionedOffset = positionedOffset.wrap(function(proceed, element) {
|
3843 |
+
element = $(element);
|
3844 |
+
if (!element.parentNode) return new Element.Offset(0, 0);
|
3845 |
+
var position = element.getStyle('position');
|
3846 |
+
if (position !== 'static') return proceed(element);
|
3847 |
+
|
3848 |
+
var offsetParent = element.getOffsetParent();
|
3849 |
+
if (offsetParent && offsetParent.getStyle('position') === 'fixed')
|
3850 |
+
hasLayout(offsetParent);
|
3851 |
+
|
3852 |
+
element.setStyle({ position: 'relative' });
|
3853 |
+
var value = proceed(element);
|
3854 |
+
element.setStyle({ position: position });
|
3855 |
+
return value;
|
3856 |
+
});
|
3857 |
+
} else if (Prototype.Browser.Webkit) {
|
3858 |
+
cumulativeOffset = function(element) {
|
3859 |
+
element = $(element);
|
3860 |
+
var valueT = 0, valueL = 0;
|
3861 |
+
do {
|
3862 |
+
valueT += element.offsetTop || 0;
|
3863 |
+
valueL += element.offsetLeft || 0;
|
3864 |
+
if (element.offsetParent == document.body)
|
3865 |
+
if (Element.getStyle(element, 'position') == 'absolute') break;
|
3866 |
+
|
3867 |
+
element = element.offsetParent;
|
3868 |
+
} while (element);
|
3869 |
+
|
3870 |
+
return new Element.Offset(valueL, valueT);
|
3871 |
+
};
|
3872 |
+
}
|
3873 |
+
|
3874 |
+
|
3875 |
+
Element.addMethods({
|
3876 |
+
getLayout: getLayout,
|
3877 |
+
measure: measure,
|
3878 |
+
getDimensions: getDimensions,
|
3879 |
+
getOffsetParent: getOffsetParent,
|
3880 |
+
cumulativeOffset: cumulativeOffset,
|
3881 |
+
positionedOffset: positionedOffset,
|
3882 |
+
cumulativeScrollOffset: cumulativeScrollOffset,
|
3883 |
+
viewportOffset: viewportOffset,
|
3884 |
+
absolutize: absolutize,
|
3885 |
+
relativize: relativize
|
3886 |
+
});
|
3887 |
+
|
3888 |
+
function isBody(element) {
|
3889 |
+
return element.nodeName.toUpperCase() === 'BODY';
|
3890 |
+
}
|
3891 |
+
|
3892 |
+
function isHtml(element) {
|
3893 |
+
return element.nodeName.toUpperCase() === 'HTML';
|
3894 |
+
}
|
3895 |
+
|
3896 |
+
function isDocument(element) {
|
3897 |
+
return element.nodeType === Node.DOCUMENT_NODE;
|
3898 |
+
}
|
3899 |
+
|
3900 |
+
function isDetached(element) {
|
3901 |
+
return element !== document.body &&
|
3902 |
+
!Element.descendantOf(element, document.body);
|
3903 |
+
}
|
3904 |
+
|
3905 |
+
if ('getBoundingClientRect' in document.documentElement) {
|
3906 |
+
Element.addMethods({
|
3907 |
+
viewportOffset: function(element) {
|
3908 |
+
element = $(element);
|
3909 |
+
if (isDetached(element)) return new Element.Offset(0, 0);
|
3910 |
+
|
3911 |
+
var rect = element.getBoundingClientRect(),
|
3912 |
+
docEl = document.documentElement;
|
3913 |
+
return new Element.Offset(rect.left - docEl.clientLeft,
|
3914 |
+
rect.top - docEl.clientTop);
|
3915 |
+
}
|
3916 |
+
});
|
3917 |
+
}
|
3918 |
+
})();
|
3919 |
+
window.$$ = function() {
|
3920 |
+
var expression = $A(arguments).join(', ');
|
3921 |
+
return Prototype.Selector.select(expression, document);
|
3922 |
+
};
|
3923 |
+
|
3924 |
+
Prototype.Selector = (function() {
|
3925 |
+
|
3926 |
+
function select() {
|
3927 |
+
throw new Error('Method "Prototype.Selector.select" must be defined.');
|
3928 |
+
}
|
3929 |
+
|
3930 |
+
function match() {
|
3931 |
+
throw new Error('Method "Prototype.Selector.match" must be defined.');
|
3932 |
+
}
|
3933 |
+
|
3934 |
+
function find(elements, expression, index) {
|
3935 |
+
index = index || 0;
|
3936 |
+
var match = Prototype.Selector.match, length = elements.length, matchIndex = 0, i;
|
3937 |
+
|
3938 |
+
for (i = 0; i < length; i++) {
|
3939 |
+
if (match(elements[i], expression) && index == matchIndex++) {
|
3940 |
+
return Element.extend(elements[i]);
|
3941 |
+
}
|
3942 |
+
}
|
3943 |
+
}
|
3944 |
+
|
3945 |
+
function extendElements(elements) {
|
3946 |
+
for (var i = 0, length = elements.length; i < length; i++) {
|
3947 |
+
Element.extend(elements[i]);
|
3948 |
+
}
|
3949 |
+
return elements;
|
3950 |
+
}
|
3951 |
+
|
3952 |
+
|
3953 |
+
var K = Prototype.K;
|
3954 |
+
|
3955 |
+
return {
|
3956 |
+
select: select,
|
3957 |
+
match: match,
|
3958 |
+
find: find,
|
3959 |
+
extendElements: (Element.extend === K) ? K : extendElements,
|
3960 |
+
extendElement: Element.extend
|
3961 |
+
};
|
3962 |
+
})();
|
3963 |
+
/*!
|
3964 |
+
* Sizzle CSS Selector Engine - v1.0
|
3965 |
+
* Copyright 2009, The Dojo Foundation
|
3966 |
+
* Released under the MIT, BSD, and GPL Licenses.
|
3967 |
+
* More information: http://sizzlejs.com/
|
3968 |
+
*/
|
3969 |
+
(function(){
|
3970 |
+
|
3971 |
+
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
|
3972 |
+
done = 0,
|
3973 |
+
toString = Object.prototype.toString,
|
3974 |
+
hasDuplicate = false,
|
3975 |
+
baseHasDuplicate = true;
|
3976 |
+
|
3977 |
+
[0, 0].sort(function(){
|
3978 |
+
baseHasDuplicate = false;
|
3979 |
+
return 0;
|
3980 |
+
});
|
3981 |
+
|
3982 |
+
var Sizzle = function(selector, context, results, seed) {
|
3983 |
+
results = results || [];
|
3984 |
+
var origContext = context = context || document;
|
3985 |
+
|
3986 |
+
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
|
3987 |
+
return [];
|
3988 |
+
}
|
3989 |
+
|
3990 |
+
if ( !selector || typeof selector !== "string" ) {
|
3991 |
+
return results;
|
3992 |
+
}
|
3993 |
+
|
3994 |
+
var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context),
|
3995 |
+
soFar = selector;
|
3996 |
+
|
3997 |
+
while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
|
3998 |
+
soFar = m[3];
|
3999 |
+
|
4000 |
+
parts.push( m[1] );
|
4001 |
+
|
4002 |
+
if ( m[2] ) {
|
4003 |
+
extra = m[3];
|
4004 |
+
break;
|
4005 |
+
}
|
4006 |
+
}
|
4007 |
+
|
4008 |
+
if ( parts.length > 1 && origPOS.exec( selector ) ) {
|
4009 |
+
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
|
4010 |
+
set = posProcess( parts[0] + parts[1], context );
|
4011 |
+
} else {
|
4012 |
+
set = Expr.relative[ parts[0] ] ?
|
4013 |
+
[ context ] :
|
4014 |
+
Sizzle( parts.shift(), context );
|
4015 |
+
|
4016 |
+
while ( parts.length ) {
|
4017 |
+
selector = parts.shift();
|
4018 |
+
|
4019 |
+
if ( Expr.relative[ selector ] )
|
4020 |
+
selector += parts.shift();
|
4021 |
+
|
4022 |
+
set = posProcess( selector, set );
|
4023 |
+
}
|
4024 |
+
}
|
4025 |
+
} else {
|
4026 |
+
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
|
4027 |
+
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
|
4028 |
+
var ret = Sizzle.find( parts.shift(), context, contextXML );
|
4029 |
+
context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
|
4030 |
+
}
|
4031 |
+
|
4032 |
+
if ( context ) {
|
4033 |
+
var ret = seed ?
|
4034 |
+
{ expr: parts.pop(), set: makeArray(seed) } :
|
4035 |
+
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
|
4036 |
+
set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
|
4037 |
+
|
4038 |
+
if ( parts.length > 0 ) {
|
4039 |
+
checkSet = makeArray(set);
|
4040 |
+
} else {
|
4041 |
+
prune = false;
|
4042 |
+
}
|
4043 |
+
|
4044 |
+
while ( parts.length ) {
|
4045 |
+
var cur = parts.pop(), pop = cur;
|
4046 |
+
|
4047 |
+
if ( !Expr.relative[ cur ] ) {
|
4048 |
+
cur = "";
|
4049 |
+
} else {
|
4050 |
+
pop = parts.pop();
|
4051 |
+
}
|
4052 |
+
|
4053 |
+
if ( pop == null ) {
|
4054 |
+
pop = context;
|
4055 |
+
}
|
4056 |
+
|
4057 |
+
Expr.relative[ cur ]( checkSet, pop, contextXML );
|
4058 |
+
}
|
4059 |
+
} else {
|
4060 |
+
checkSet = parts = [];
|
4061 |
+
}
|
4062 |
+
}
|
4063 |
+
|
4064 |
+
if ( !checkSet ) {
|
4065 |
+
checkSet = set;
|
4066 |
+
}
|
4067 |
+
|
4068 |
+
if ( !checkSet ) {
|
4069 |
+
throw "Syntax error, unrecognized expression: " + (cur || selector);
|
4070 |
+
}
|
4071 |
+
|
4072 |
+
if ( toString.call(checkSet) === "[object Array]" ) {
|
4073 |
+
if ( !prune ) {
|
4074 |
+
results.push.apply( results, checkSet );
|
4075 |
+
} else if ( context && context.nodeType === 1 ) {
|
4076 |
+
for ( var i = 0; checkSet[i] != null; i++ ) {
|
4077 |
+
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
|
4078 |
+
results.push( set[i] );
|
4079 |
+
}
|
4080 |
+
}
|
4081 |
+
} else {
|
4082 |
+
for ( var i = 0; checkSet[i] != null; i++ ) {
|
4083 |
+
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
|
4084 |
+
results.push( set[i] );
|
4085 |
+
}
|
4086 |
+
}
|
4087 |
+
}
|
4088 |
+
} else {
|
4089 |
+
makeArray( checkSet, results );
|
4090 |
+
}
|
4091 |
+
|
4092 |
+
if ( extra ) {
|
4093 |
+
Sizzle( extra, origContext, results, seed );
|
4094 |
+
Sizzle.uniqueSort( results );
|
4095 |
+
}
|
4096 |
+
|
4097 |
+
return results;
|
4098 |
+
};
|
4099 |
+
|
4100 |
+
Sizzle.uniqueSort = function(results){
|
4101 |
+
if ( sortOrder ) {
|
4102 |
+
hasDuplicate = baseHasDuplicate;
|
4103 |
+
results.sort(sortOrder);
|
4104 |
+
|
4105 |
+
if ( hasDuplicate ) {
|
4106 |
+
for ( var i = 1; i < results.length; i++ ) {
|
4107 |
+
if ( results[i] === results[i-1] ) {
|
4108 |
+
results.splice(i--, 1);
|
4109 |
+
}
|
4110 |
+
}
|
4111 |
+
}
|
4112 |
+
}
|
4113 |
+
|
4114 |
+
return results;
|
4115 |
+
};
|
4116 |
+
|
4117 |
+
Sizzle.matches = function(expr, set){
|
4118 |
+
return Sizzle(expr, null, null, set);
|
4119 |
+
};
|
4120 |
+
|
4121 |
+
Sizzle.find = function(expr, context, isXML){
|
4122 |
+
var set, match;
|
4123 |
+
|
4124 |
+
if ( !expr ) {
|
4125 |
+
return [];
|
4126 |
+
}
|
4127 |
+
|
4128 |
+
for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
|
4129 |
+
var type = Expr.order[i], match;
|
4130 |
+
|
4131 |
+
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
|
4132 |
+
var left = match[1];
|
4133 |
+
match.splice(1,1);
|
4134 |
+
|
4135 |
+
if ( left.substr( left.length - 1 ) !== "\\" ) {
|
4136 |
+
match[1] = (match[1] || "").replace(/\\/g, "");
|
4137 |
+
set = Expr.find[ type ]( match, context, isXML );
|
4138 |
+
if ( set != null ) {
|
4139 |
+
expr = expr.replace( Expr.match[ type ], "" );
|
4140 |
+
break;
|
4141 |
+
}
|
4142 |
+
}
|
4143 |
+
}
|
4144 |
+
}
|
4145 |
+
|
4146 |
+
if ( !set ) {
|
4147 |
+
set = context.getElementsByTagName("*");
|
4148 |
+
}
|
4149 |
+
|
4150 |
+
return {set: set, expr: expr};
|
4151 |
+
};
|
4152 |
+
|
4153 |
+
Sizzle.filter = function(expr, set, inplace, not){
|
4154 |
+
var old = expr, result = [], curLoop = set, match, anyFound,
|
4155 |
+
isXMLFilter = set && set[0] && isXML(set[0]);
|
4156 |
+
|
4157 |
+
while ( expr && set.length ) {
|
4158 |
+
for ( var type in Expr.filter ) {
|
4159 |
+
if ( (match = Expr.match[ type ].exec( expr )) != null ) {
|
4160 |
+
var filter = Expr.filter[ type ], found, item;
|
4161 |
+
anyFound = false;
|
4162 |
+
|
4163 |
+
if ( curLoop == result ) {
|
4164 |
+
result = [];
|
4165 |
+
}
|
4166 |
+
|
4167 |
+
if ( Expr.preFilter[ type ] ) {
|
4168 |
+
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
|
4169 |
+
|
4170 |
+
if ( !match ) {
|
4171 |
+
anyFound = found = true;
|
4172 |
+
} else if ( match === true ) {
|
4173 |
+
continue;
|
4174 |
+
}
|
4175 |
+
}
|
4176 |
+
|
4177 |
+
if ( match ) {
|
4178 |
+
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
|
4179 |
+
if ( item ) {
|
4180 |
+
found = filter( item, match, i, curLoop );
|
4181 |
+
var pass = not ^ !!found;
|
4182 |
+
|
4183 |
+
if ( inplace && found != null ) {
|
4184 |
+
if ( pass ) {
|
4185 |
+
anyFound = true;
|
4186 |
+
} else {
|
4187 |
+
curLoop[i] = false;
|
4188 |
+
}
|
4189 |
+
} else if ( pass ) {
|
4190 |
+
result.push( item );
|
4191 |
+
anyFound = true;
|
4192 |
+
}
|
4193 |
+
}
|
4194 |
+
}
|
4195 |
+
}
|
4196 |
+
|
4197 |
+
if ( found !== undefined ) {
|
4198 |
+
if ( !inplace ) {
|
4199 |
+
curLoop = result;
|
4200 |
+
}
|
4201 |
+
|
4202 |
+
expr = expr.replace( Expr.match[ type ], "" );
|
4203 |
+
|
4204 |
+
if ( !anyFound ) {
|
4205 |
+
return [];
|
4206 |
+
}
|
4207 |
+
|
4208 |
+
break;
|
4209 |
+
}
|
4210 |
+
}
|
4211 |
+
}
|
4212 |
+
|
4213 |
+
if ( expr == old ) {
|
4214 |
+
if ( anyFound == null ) {
|
4215 |
+
throw "Syntax error, unrecognized expression: " + expr;
|
4216 |
+
} else {
|
4217 |
+
break;
|
4218 |
+
}
|
4219 |
+
}
|
4220 |
+
|
4221 |
+
old = expr;
|
4222 |
+
}
|
4223 |
+
|
4224 |
+
return curLoop;
|
4225 |
+
};
|
4226 |
+
|
4227 |
+
var Expr = Sizzle.selectors = {
|
4228 |
+
order: [ "ID", "NAME", "TAG" ],
|
4229 |
+
match: {
|
4230 |
+
ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
|
4231 |
+
CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
|
4232 |
+
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
|
4233 |
+
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
|
4234 |
+
TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
|
4235 |
+
CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
|
4236 |
+
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
|
4237 |
+
PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
|
4238 |
+
},
|
4239 |
+
leftMatch: {},
|
4240 |
+
attrMap: {
|
4241 |
+
"class": "className",
|
4242 |
+
"for": "htmlFor"
|
4243 |
+
},
|
4244 |
+
attrHandle: {
|
4245 |
+
href: function(elem){
|
4246 |
+
return elem.getAttribute("href");
|
4247 |
+
}
|
4248 |
+
},
|
4249 |
+
relative: {
|
4250 |
+
"+": function(checkSet, part, isXML){
|
4251 |
+
var isPartStr = typeof part === "string",
|
4252 |
+
isTag = isPartStr && !/\W/.test(part),
|
4253 |
+
isPartStrNotTag = isPartStr && !isTag;
|
4254 |
+
|
4255 |
+
if ( isTag && !isXML ) {
|
4256 |
+
part = part.toUpperCase();
|
4257 |
+
}
|
4258 |
+
|
4259 |
+
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
|
4260 |
+
if ( (elem = checkSet[i]) ) {
|
4261 |
+
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
|
4262 |
+
|
4263 |
+
checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
|
4264 |
+
elem || false :
|
4265 |
+
elem === part;
|
4266 |
+
}
|
4267 |
+
}
|
4268 |
+
|
4269 |
+
if ( isPartStrNotTag ) {
|
4270 |
+
Sizzle.filter( part, checkSet, true );
|
4271 |
+
}
|
4272 |
+
},
|
4273 |
+
">": function(checkSet, part, isXML){
|
4274 |
+
var isPartStr = typeof part === "string";
|
4275 |
+
|
4276 |
+
if ( isPartStr && !/\W/.test(part) ) {
|
4277 |
+
part = isXML ? part : part.toUpperCase();
|
4278 |
+
|
4279 |
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
4280 |
+
var elem = checkSet[i];
|
4281 |
+
if ( elem ) {
|
4282 |
+
var parent = elem.parentNode;
|
4283 |
+
checkSet[i] = parent.nodeName === part ? parent : false;
|
4284 |
+
}
|
4285 |
+
}
|
4286 |
+
} else {
|
4287 |
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
4288 |
+
var elem = checkSet[i];
|
4289 |
+
if ( elem ) {
|
4290 |
+
checkSet[i] = isPartStr ?
|
4291 |
+
elem.parentNode :
|
4292 |
+
elem.parentNode === part;
|
4293 |
+
}
|
4294 |
+
}
|
4295 |
+
|
4296 |
+
if ( isPartStr ) {
|
4297 |
+
Sizzle.filter( part, checkSet, true );
|
4298 |
+
}
|
4299 |
+
}
|
4300 |
+
},
|
4301 |
+
"": function(checkSet, part, isXML){
|
4302 |
+
var doneName = done++, checkFn = dirCheck;
|
4303 |
+
|
4304 |
+
if ( !/\W/.test(part) ) {
|
4305 |
+
var nodeCheck = part = isXML ? part : part.toUpperCase();
|
4306 |
+
checkFn = dirNodeCheck;
|
4307 |
+
}
|
4308 |
+
|
4309 |
+
checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
|
4310 |
+
},
|
4311 |
+
"~": function(checkSet, part, isXML){
|
4312 |
+
var doneName = done++, checkFn = dirCheck;
|
4313 |
+
|
4314 |
+
if ( typeof part === "string" && !/\W/.test(part) ) {
|
4315 |
+
var nodeCheck = part = isXML ? part : part.toUpperCase();
|
4316 |
+
checkFn = dirNodeCheck;
|
4317 |
+
}
|
4318 |
+
|
4319 |
+
checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
|
4320 |
+
}
|
4321 |
+
},
|
4322 |
+
find: {
|
4323 |
+
ID: function(match, context, isXML){
|
4324 |
+
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
4325 |
+
var m = context.getElementById(match[1]);
|
4326 |
+
return m ? [m] : [];
|
4327 |
+
}
|
4328 |
+
},
|
4329 |
+
NAME: function(match, context, isXML){
|
4330 |
+
if ( typeof context.getElementsByName !== "undefined" ) {
|
4331 |
+
var ret = [], results = context.getElementsByName(match[1]);
|
4332 |
+
|
4333 |
+
for ( var i = 0, l = results.length; i < l; i++ ) {
|
4334 |
+
if ( results[i].getAttribute("name") === match[1] ) {
|
4335 |
+
ret.push( results[i] );
|
4336 |
+
}
|
4337 |
+
}
|
4338 |
+
|
4339 |
+
return ret.length === 0 ? null : ret;
|
4340 |
+
}
|
4341 |
+
},
|
4342 |
+
TAG: function(match, context){
|
4343 |
+
return context.getElementsByTagName(match[1]);
|
4344 |
+
}
|
4345 |
+
},
|
4346 |
+
preFilter: {
|
4347 |
+
CLASS: function(match, curLoop, inplace, result, not, isXML){
|
4348 |
+
match = " " + match[1].replace(/\\/g, "") + " ";
|
4349 |
+
|
4350 |
+
if ( isXML ) {
|
4351 |
+
return match;
|
4352 |
+
}
|
4353 |
+
|
4354 |
+
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
|
4355 |
+
if ( elem ) {
|
4356 |
+
if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
|
4357 |
+
if ( !inplace )
|
4358 |
+
result.push( elem );
|
4359 |
+
} else if ( inplace ) {
|
4360 |
+
curLoop[i] = false;
|
4361 |
+
}
|
4362 |
+
}
|
4363 |
+
}
|
4364 |
+
|
4365 |
+
return false;
|
4366 |
+
},
|
4367 |
+
ID: function(match){
|
4368 |
+
return match[1].replace(/\\/g, "");
|
4369 |
+
},
|
4370 |
+
TAG: function(match, curLoop){
|
4371 |
+
for ( var i = 0; curLoop[i] === false; i++ ){}
|
4372 |
+
return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
|
4373 |
+
},
|
4374 |
+
CHILD: function(match){
|
4375 |
+
if ( match[1] == "nth" ) {
|
4376 |
+
var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
|
4377 |
+
match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
|
4378 |
+
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
|
4379 |
+
|
4380 |
+
match[2] = (test[1] + (test[2] || 1)) - 0;
|
4381 |
+
match[3] = test[3] - 0;
|
4382 |
+
}
|
4383 |
+
|
4384 |
+
match[0] = done++;
|
4385 |
+
|
4386 |
+
return match;
|
4387 |
+
},
|
4388 |
+
ATTR: function(match, curLoop, inplace, result, not, isXML){
|
4389 |
+
var name = match[1].replace(/\\/g, "");
|
4390 |
+
|
4391 |
+
if ( !isXML && Expr.attrMap[name] ) {
|
4392 |
+
match[1] = Expr.attrMap[name];
|
4393 |
+
}
|
4394 |
+
|
4395 |
+
if ( match[2] === "~=" ) {
|
4396 |
+
match[4] = " " + match[4] + " ";
|
4397 |
+
}
|
4398 |
+
|
4399 |
+
return match;
|
4400 |
+
},
|
4401 |
+
PSEUDO: function(match, curLoop, inplace, result, not){
|
4402 |
+
if ( match[1] === "not" ) {
|
4403 |
+
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
|
4404 |
+
match[3] = Sizzle(match[3], null, null, curLoop);
|
4405 |
+
} else {
|
4406 |
+
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
|
4407 |
+
if ( !inplace ) {
|
4408 |
+
result.push.apply( result, ret );
|
4409 |
+
}
|
4410 |
+
return false;
|
4411 |
+
}
|
4412 |
+
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
|
4413 |
+
return true;
|
4414 |
+
}
|
4415 |
+
|
4416 |
+
return match;
|
4417 |
+
},
|
4418 |
+
POS: function(match){
|
4419 |
+
match.unshift( true );
|
4420 |
+
return match;
|
4421 |
+
}
|
4422 |
+
},
|
4423 |
+
filters: {
|
4424 |
+
enabled: function(elem){
|
4425 |
+
return elem.disabled === false && elem.type !== "hidden";
|
4426 |
+
},
|
4427 |
+
disabled: function(elem){
|
4428 |
+
return elem.disabled === true;
|
4429 |
+
},
|
4430 |
+
checked: function(elem){
|
4431 |
+
return elem.checked === true;
|
4432 |
+
},
|
4433 |
+
selected: function(elem){
|
4434 |
+
elem.parentNode.selectedIndex;
|
4435 |
+
return elem.selected === true;
|
4436 |
+
},
|
4437 |
+
parent: function(elem){
|
4438 |
+
return !!elem.firstChild;
|
4439 |
+
},
|
4440 |
+
empty: function(elem){
|
4441 |
+
return !elem.firstChild;
|
4442 |
+
},
|
4443 |
+
has: function(elem, i, match){
|
4444 |
+
return !!Sizzle( match[3], elem ).length;
|
4445 |
+
},
|
4446 |
+
header: function(elem){
|
4447 |
+
return /h\d/i.test( elem.nodeName );
|
4448 |
+
},
|
4449 |
+
text: function(elem){
|
4450 |
+
return "text" === elem.type;
|
4451 |
+
},
|
4452 |
+
radio: function(elem){
|
4453 |
+
return "radio" === elem.type;
|
4454 |
+
},
|
4455 |
+
checkbox: function(elem){
|
4456 |
+
return "checkbox" === elem.type;
|
4457 |
+
},
|
4458 |
+
file: function(elem){
|
4459 |
+
return "file" === elem.type;
|
4460 |
+
},
|
4461 |
+
password: function(elem){
|
4462 |
+
return "password" === elem.type;
|
4463 |
+
},
|
4464 |
+
submit: function(elem){
|
4465 |
+
return "submit" === elem.type;
|
4466 |
+
},
|
4467 |
+
image: function(elem){
|
4468 |
+
return "image" === elem.type;
|
4469 |
+
},
|
4470 |
+
reset: function(elem){
|
4471 |
+
return "reset" === elem.type;
|
4472 |
+
},
|
4473 |
+
button: function(elem){
|
4474 |
+
return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
|
4475 |
+
},
|
4476 |
+
input: function(elem){
|
4477 |
+
return /input|select|textarea|button/i.test(elem.nodeName);
|
4478 |
+
}
|
4479 |
+
},
|
4480 |
+
setFilters: {
|
4481 |
+
first: function(elem, i){
|
4482 |
+
return i === 0;
|
4483 |
+
},
|
4484 |
+
last: function(elem, i, match, array){
|
4485 |
+
return i === array.length - 1;
|
4486 |
+
},
|
4487 |
+
even: function(elem, i){
|
4488 |
+
return i % 2 === 0;
|
4489 |
+
},
|
4490 |
+
odd: function(elem, i){
|
4491 |
+
return i % 2 === 1;
|
4492 |
+
},
|
4493 |
+
lt: function(elem, i, match){
|
4494 |
+
return i < match[3] - 0;
|
4495 |
+
},
|
4496 |
+
gt: function(elem, i, match){
|
4497 |
+
return i > match[3] - 0;
|
4498 |
+
},
|
4499 |
+
nth: function(elem, i, match){
|
4500 |
+
return match[3] - 0 == i;
|
4501 |
+
},
|
4502 |
+
eq: function(elem, i, match){
|
4503 |
+
return match[3] - 0 == i;
|
4504 |
+
}
|
4505 |
+
},
|
4506 |
+
filter: {
|
4507 |
+
PSEUDO: function(elem, match, i, array){
|
4508 |
+
var name = match[1], filter = Expr.filters[ name ];
|
4509 |
+
|
4510 |
+
if ( filter ) {
|
4511 |
+
return filter( elem, i, match, array );
|
4512 |
+
} else if ( name === "contains" ) {
|
4513 |
+
return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
|
4514 |
+
} else if ( name === "not" ) {
|
4515 |
+
var not = match[3];
|
4516 |
+
|
4517 |
+
for ( var i = 0, l = not.length; i < l; i++ ) {
|
4518 |
+
if ( not[i] === elem ) {
|
4519 |
+
return false;
|
4520 |
+
}
|
4521 |
+
}
|
4522 |
+
|
4523 |
+
return true;
|
4524 |
+
}
|
4525 |
+
},
|
4526 |
+
CHILD: function(elem, match){
|
4527 |
+
var type = match[1], node = elem;
|
4528 |
+
switch (type) {
|
4529 |
+
case 'only':
|
4530 |
+
case 'first':
|
4531 |
+
while ( (node = node.previousSibling) ) {
|
4532 |
+
if ( node.nodeType === 1 ) return false;
|
4533 |
+
}
|
4534 |
+
if ( type == 'first') return true;
|
4535 |
+
node = elem;
|
4536 |
+
case 'last':
|
4537 |
+
while ( (node = node.nextSibling) ) {
|
4538 |
+
if ( node.nodeType === 1 ) return false;
|
4539 |
+
}
|
4540 |
+
return true;
|
4541 |
+
case 'nth':
|
4542 |
+
var first = match[2], last = match[3];
|
4543 |
+
|
4544 |
+
if ( first == 1 && last == 0 ) {
|
4545 |
+
return true;
|
4546 |
+
}
|
4547 |
+
|
4548 |
+
var doneName = match[0],
|
4549 |
+
parent = elem.parentNode;
|
4550 |
+
|
4551 |
+
if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
|
4552 |
+
var count = 0;
|
4553 |
+
for ( node = parent.firstChild; node; node = node.nextSibling ) {
|
4554 |
+
if ( node.nodeType === 1 ) {
|
4555 |
+
node.nodeIndex = ++count;
|
4556 |
+
}
|
4557 |
+
}
|
4558 |
+
parent.sizcache = doneName;
|
4559 |
+
}
|
4560 |
+
|
4561 |
+
var diff = elem.nodeIndex - last;
|
4562 |
+
if ( first == 0 ) {
|
4563 |
+
return diff == 0;
|
4564 |
+
} else {
|
4565 |
+
return ( diff % first == 0 && diff / first >= 0 );
|
4566 |
+
}
|
4567 |
+
}
|
4568 |
+
},
|
4569 |
+
ID: function(elem, match){
|
4570 |
+
return elem.nodeType === 1 && elem.getAttribute("id") === match;
|
4571 |
+
},
|
4572 |
+
TAG: function(elem, match){
|
4573 |
+
return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
|
4574 |
+
},
|
4575 |
+
CLASS: function(elem, match){
|
4576 |
+
return (" " + (elem.className || elem.getAttribute("class")) + " ")
|
4577 |
+
.indexOf( match ) > -1;
|
4578 |
+
},
|
4579 |
+
ATTR: function(elem, match){
|
4580 |
+
var name = match[1],
|
4581 |
+
result = Expr.attrHandle[ name ] ?
|
4582 |
+
Expr.attrHandle[ name ]( elem ) :
|
4583 |
+
elem[ name ] != null ?
|
4584 |
+
elem[ name ] :
|
4585 |
+
elem.getAttribute( name ),
|
4586 |
+
value = result + "",
|
4587 |
+
type = match[2],
|
4588 |
+
check = match[4];
|
4589 |
+
|
4590 |
+
return result == null ?
|
4591 |
+
type === "!=" :
|
4592 |
+
type === "=" ?
|
4593 |
+
value === check :
|
4594 |
+
type === "*=" ?
|
4595 |
+
value.indexOf(check) >= 0 :
|
4596 |
+
type === "~=" ?
|
4597 |
+
(" " + value + " ").indexOf(check) >= 0 :
|
4598 |
+
!check ?
|
4599 |
+
value && result !== false :
|
4600 |
+
type === "!=" ?
|
4601 |
+
value != check :
|
4602 |
+
type === "^=" ?
|
4603 |
+
value.indexOf(check) === 0 :
|
4604 |
+
type === "$=" ?
|
4605 |
+
value.substr(value.length - check.length) === check :
|
4606 |
+
type === "|=" ?
|
4607 |
+
value === check || value.substr(0, check.length + 1) === check + "-" :
|
4608 |
+
false;
|
4609 |
+
},
|
4610 |
+
POS: function(elem, match, i, array){
|
4611 |
+
var name = match[2], filter = Expr.setFilters[ name ];
|
4612 |
+
|
4613 |
+
if ( filter ) {
|
4614 |
+
return filter( elem, i, match, array );
|
4615 |
+
}
|
4616 |
+
}
|
4617 |
+
}
|
4618 |
+
};
|
4619 |
+
|
4620 |
+
var origPOS = Expr.match.POS;
|
4621 |
+
|
4622 |
+
for ( var type in Expr.match ) {
|
4623 |
+
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
|
4624 |
+
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source );
|
4625 |
+
}
|
4626 |
+
|
4627 |
+
var makeArray = function(array, results) {
|
4628 |
+
array = Array.prototype.slice.call( array, 0 );
|
4629 |
+
|
4630 |
+
if ( results ) {
|
4631 |
+
results.push.apply( results, array );
|
4632 |
+
return results;
|
4633 |
+
}
|
4634 |
+
|
4635 |
+
return array;
|
4636 |
+
};
|
4637 |
+
|
4638 |
+
try {
|
4639 |
+
Array.prototype.slice.call( document.documentElement.childNodes, 0 );
|
4640 |
+
|
4641 |
+
} catch(e){
|
4642 |
+
makeArray = function(array, results) {
|
4643 |
+
var ret = results || [];
|
4644 |
+
|
4645 |
+
if ( toString.call(array) === "[object Array]" ) {
|
4646 |
+
Array.prototype.push.apply( ret, array );
|
4647 |
+
} else {
|
4648 |
+
if ( typeof array.length === "number" ) {
|
4649 |
+
for ( var i = 0, l = array.length; i < l; i++ ) {
|
4650 |
+
ret.push( array[i] );
|
4651 |
+
}
|
4652 |
+
} else {
|
4653 |
+
for ( var i = 0; array[i]; i++ ) {
|
4654 |
+
ret.push( array[i] );
|
4655 |
+
}
|
4656 |
+
}
|
4657 |
+
}
|
4658 |
+
|
4659 |
+
return ret;
|
4660 |
+
};
|
4661 |
+
}
|
4662 |
+
|
4663 |
+
var sortOrder;
|
4664 |
+
|
4665 |
+
if ( document.documentElement.compareDocumentPosition ) {
|
4666 |
+
sortOrder = function( a, b ) {
|
4667 |
+
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
|
4668 |
+
if ( a == b ) {
|
4669 |
+
hasDuplicate = true;
|
4670 |
+
}
|
4671 |
+
return 0;
|
4672 |
+
}
|
4673 |
+
|
4674 |
+
var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
|
4675 |
+
if ( ret === 0 ) {
|
4676 |
+
hasDuplicate = true;
|
4677 |
+
}
|
4678 |
+
return ret;
|
4679 |
+
};
|
4680 |
+
} else if ( "sourceIndex" in document.documentElement ) {
|
4681 |
+
sortOrder = function( a, b ) {
|
4682 |
+
if ( !a.sourceIndex || !b.sourceIndex ) {
|
4683 |
+
if ( a == b ) {
|
4684 |
+
hasDuplicate = true;
|
4685 |
+
}
|
4686 |
+
return 0;
|
4687 |
+
}
|
4688 |
+
|
4689 |
+
var ret = a.sourceIndex - b.sourceIndex;
|
4690 |
+
if ( ret === 0 ) {
|
4691 |
+
hasDuplicate = true;
|
4692 |
+
}
|
4693 |
+
return ret;
|
4694 |
+
};
|
4695 |
+
} else if ( document.createRange ) {
|
4696 |
+
sortOrder = function( a, b ) {
|
4697 |
+
if ( !a.ownerDocument || !b.ownerDocument ) {
|
4698 |
+
if ( a == b ) {
|
4699 |
+
hasDuplicate = true;
|
4700 |
+
}
|
4701 |
+
return 0;
|
4702 |
+
}
|
4703 |
+
|
4704 |
+
var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
|
4705 |
+
aRange.setStart(a, 0);
|
4706 |
+
aRange.setEnd(a, 0);
|
4707 |
+
bRange.setStart(b, 0);
|
4708 |
+
bRange.setEnd(b, 0);
|
4709 |
+
var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
|
4710 |
+
if ( ret === 0 ) {
|
4711 |
+
hasDuplicate = true;
|
4712 |
+
}
|
4713 |
+
return ret;
|
4714 |
+
};
|
4715 |
+
}
|
4716 |
+
|
4717 |
+
(function(){
|
4718 |
+
var form = document.createElement("div"),
|
4719 |
+
id = "script" + (new Date).getTime();
|
4720 |
+
form.innerHTML = "<a name='" + id + "'/>";
|
4721 |
+
|
4722 |
+
var root = document.documentElement;
|
4723 |
+
root.insertBefore( form, root.firstChild );
|
4724 |
+
|
4725 |
+
if ( !!document.getElementById( id ) ) {
|
4726 |
+
Expr.find.ID = function(match, context, isXML){
|
4727 |
+
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
4728 |
+
var m = context.getElementById(match[1]);
|
4729 |
+
return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
|
4730 |
+
}
|
4731 |
+
};
|
4732 |
+
|
4733 |
+
Expr.filter.ID = function(elem, match){
|
4734 |
+
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
|
4735 |
+
return elem.nodeType === 1 && node && node.nodeValue === match;
|
4736 |
+
};
|
4737 |
+
}
|
4738 |
+
|
4739 |
+
root.removeChild( form );
|
4740 |
+
root = form = null; // release memory in IE
|
4741 |
+
})();
|
4742 |
+
|
4743 |
+
(function(){
|
4744 |
+
|
4745 |
+
var div = document.createElement("div");
|
4746 |
+
div.appendChild( document.createComment("") );
|
4747 |
+
|
4748 |
+
if ( div.getElementsByTagName("*").length > 0 ) {
|
4749 |
+
Expr.find.TAG = function(match, context){
|
4750 |
+
var results = context.getElementsByTagName(match[1]);
|
4751 |
+
|
4752 |
+
if ( match[1] === "*" ) {
|
4753 |
+
var tmp = [];
|
4754 |
+
|
4755 |
+
for ( var i = 0; results[i]; i++ ) {
|
4756 |
+
if ( results[i].nodeType === 1 ) {
|
4757 |
+
tmp.push( results[i] );
|
4758 |
+
}
|
4759 |
+
}
|
4760 |
+
|
4761 |
+
results = tmp;
|
4762 |
+
}
|
4763 |
+
|
4764 |
+
return results;
|
4765 |
+
};
|
4766 |
+
}
|
4767 |
+
|
4768 |
+
div.innerHTML = "<a href='#'></a>";
|
4769 |
+
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
|
4770 |
+
div.firstChild.getAttribute("href") !== "#" ) {
|
4771 |
+
Expr.attrHandle.href = function(elem){
|
4772 |
+
return elem.getAttribute("href", 2);
|
4773 |
+
};
|
4774 |
+
}
|
4775 |
+
|
4776 |
+
div = null; // release memory in IE
|
4777 |
+
})();
|
4778 |
+
|
4779 |
+
if ( document.querySelectorAll ) (function(){
|
4780 |
+
var oldSizzle = Sizzle, div = document.createElement("div");
|
4781 |
+
div.innerHTML = "<p class='TEST'></p>";
|
4782 |
+
|
4783 |
+
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
|
4784 |
+
return;
|
4785 |
+
}
|
4786 |
+
|
4787 |
+
Sizzle = function(query, context, extra, seed){
|
4788 |
+
context = context || document;
|
4789 |
+
|
4790 |
+
if ( !seed && context.nodeType === 9 && !isXML(context) ) {
|
4791 |
+
try {
|
4792 |
+
return makeArray( context.querySelectorAll(query), extra );
|
4793 |
+
} catch(e){}
|
4794 |
+
}
|
4795 |
+
|
4796 |
+
return oldSizzle(query, context, extra, seed);
|
4797 |
+
};
|
4798 |
+
|
4799 |
+
for ( var prop in oldSizzle ) {
|
4800 |
+
Sizzle[ prop ] = oldSizzle[ prop ];
|
4801 |
+
}
|
4802 |
+
|
4803 |
+
div = null; // release memory in IE
|
4804 |
+
})();
|
4805 |
+
|
4806 |
+
if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
|
4807 |
+
var div = document.createElement("div");
|
4808 |
+
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
|
4809 |
+
|
4810 |
+
if ( div.getElementsByClassName("e").length === 0 )
|
4811 |
+
return;
|
4812 |
+
|
4813 |
+
div.lastChild.className = "e";
|
4814 |
+
|
4815 |
+
if ( div.getElementsByClassName("e").length === 1 )
|
4816 |
+
return;
|
4817 |
+
|
4818 |
+
Expr.order.splice(1, 0, "CLASS");
|
4819 |
+
Expr.find.CLASS = function(match, context, isXML) {
|
4820 |
+
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
|
4821 |
+
return context.getElementsByClassName(match[1]);
|
4822 |
+
}
|
4823 |
+
};
|
4824 |
+
|
4825 |
+
div = null; // release memory in IE
|
4826 |
+
})();
|
4827 |
+
|
4828 |
+
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
4829 |
+
var sibDir = dir == "previousSibling" && !isXML;
|
4830 |
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
4831 |
+
var elem = checkSet[i];
|
4832 |
+
if ( elem ) {
|
4833 |
+
if ( sibDir && elem.nodeType === 1 ){
|
4834 |
+
elem.sizcache = doneName;
|
4835 |
+
elem.sizset = i;
|
4836 |
+
}
|
4837 |
+
elem = elem[dir];
|
4838 |
+
var match = false;
|
4839 |
+
|
4840 |
+
while ( elem ) {
|
4841 |
+
if ( elem.sizcache === doneName ) {
|
4842 |
+
match = checkSet[elem.sizset];
|
4843 |
+
break;
|
4844 |
+
}
|
4845 |
+
|
4846 |
+
if ( elem.nodeType === 1 && !isXML ){
|
4847 |
+
elem.sizcache = doneName;
|
4848 |
+
elem.sizset = i;
|
4849 |
+
}
|
4850 |
+
|
4851 |
+
if ( elem.nodeName === cur ) {
|
4852 |
+
match = elem;
|
4853 |
+
break;
|
4854 |
+
}
|
4855 |
+
|
4856 |
+
elem = elem[dir];
|
4857 |
+
}
|
4858 |
+
|
4859 |
+
checkSet[i] = match;
|
4860 |
+
}
|
4861 |
+
}
|
4862 |
+
}
|
4863 |
+
|
4864 |
+
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
4865 |
+
var sibDir = dir == "previousSibling" && !isXML;
|
4866 |
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
4867 |
+
var elem = checkSet[i];
|
4868 |
+
if ( elem ) {
|
4869 |
+
if ( sibDir && elem.nodeType === 1 ) {
|
4870 |
+
elem.sizcache = doneName;
|
4871 |
+
elem.sizset = i;
|
4872 |
+
}
|
4873 |
+
elem = elem[dir];
|
4874 |
+
var match = false;
|
4875 |
+
|
4876 |
+
while ( elem ) {
|
4877 |
+
if ( elem.sizcache === doneName ) {
|
4878 |
+
match = checkSet[elem.sizset];
|
4879 |
+
break;
|
4880 |
+
}
|
4881 |
+
|
4882 |
+
if ( elem.nodeType === 1 ) {
|
4883 |
+
if ( !isXML ) {
|
4884 |
+
elem.sizcache = doneName;
|
4885 |
+
elem.sizset = i;
|
4886 |
+
}
|
4887 |
+
if ( typeof cur !== "string" ) {
|
4888 |
+
if ( elem === cur ) {
|
4889 |
+
match = true;
|
4890 |
+
break;
|
4891 |
+
}
|
4892 |
+
|
4893 |
+
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
|
4894 |
+
match = elem;
|
4895 |
+
break;
|
4896 |
+
}
|
4897 |
+
}
|
4898 |
+
|
4899 |
+
elem = elem[dir];
|
4900 |
+
}
|
4901 |
+
|
4902 |
+
checkSet[i] = match;
|
4903 |
+
}
|
4904 |
+
}
|
4905 |
+
}
|
4906 |
+
|
4907 |
+
var contains = document.compareDocumentPosition ? function(a, b){
|
4908 |
+
return a.compareDocumentPosition(b) & 16;
|
4909 |
+
} : function(a, b){
|
4910 |
+
return a !== b && (a.contains ? a.contains(b) : true);
|
4911 |
+
};
|
4912 |
+
|
4913 |
+
var isXML = function(elem){
|
4914 |
+
return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
|
4915 |
+
!!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
|
4916 |
+
};
|
4917 |
+
|
4918 |
+
var posProcess = function(selector, context){
|
4919 |
+
var tmpSet = [], later = "", match,
|
4920 |
+
root = context.nodeType ? [context] : context;
|
4921 |
+
|
4922 |
+
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
|
4923 |
+
later += match[0];
|
4924 |
+
selector = selector.replace( Expr.match.PSEUDO, "" );
|
4925 |
+
}
|
4926 |
+
|
4927 |
+
selector = Expr.relative[selector] ? selector + "*" : selector;
|
4928 |
+
|
4929 |
+
for ( var i = 0, l = root.length; i < l; i++ ) {
|
4930 |
+
Sizzle( selector, root[i], tmpSet );
|
4931 |
+
}
|
4932 |
+
|
4933 |
+
return Sizzle.filter( later, tmpSet );
|
4934 |
+
};
|
4935 |
+
|
4936 |
+
|
4937 |
+
window.Sizzle = Sizzle;
|
4938 |
+
|
4939 |
+
})();
|
4940 |
+
|
4941 |
+
Prototype._original_property = window.Sizzle;
|
4942 |
+
|
4943 |
+
;(function(engine) {
|
4944 |
+
var extendElements = Prototype.Selector.extendElements;
|
4945 |
+
|
4946 |
+
function select(selector, scope) {
|
4947 |
+
return extendElements(engine(selector, scope || document));
|
4948 |
+
}
|
4949 |
+
|
4950 |
+
function match(element, selector) {
|
4951 |
+
return engine.matches(selector, [element]).length == 1;
|
4952 |
+
}
|
4953 |
+
|
4954 |
+
Prototype.Selector.engine = engine;
|
4955 |
+
Prototype.Selector.select = select;
|
4956 |
+
Prototype.Selector.match = match;
|
4957 |
+
})(Sizzle);
|
4958 |
+
|
4959 |
+
window.Sizzle = Prototype._original_property;
|
4960 |
+
delete Prototype._original_property;
|
4961 |
+
|
4962 |
+
var Form = {
|
4963 |
+
reset: function(form) {
|
4964 |
+
form = $(form);
|
4965 |
+
form.reset();
|
4966 |
+
return form;
|
4967 |
+
},
|
4968 |
+
|
4969 |
+
serializeElements: function(elements, options) {
|
4970 |
+
if (typeof options != 'object') options = { hash: !!options };
|
4971 |
+
else if (Object.isUndefined(options.hash)) options.hash = true;
|
4972 |
+
var key, value, submitted = false, submit = options.submit, accumulator, initial;
|
4973 |
+
|
4974 |
+
if (options.hash) {
|
4975 |
+
initial = {};
|
4976 |
+
accumulator = function(result, key, value) {
|
4977 |
+
if (key in result) {
|
4978 |
+
if (!Object.isArray(result[key])) result[key] = [result[key]];
|
4979 |
+
result[key].push(value);
|
4980 |
+
} else result[key] = value;
|
4981 |
+
return result;
|
4982 |
+
};
|
4983 |
+
} else {
|
4984 |
+
initial = '';
|
4985 |
+
accumulator = function(result, key, value) {
|
4986 |
+
return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + encodeURIComponent(value);
|
4987 |
+
}
|
4988 |
+
}
|
4989 |
+
|
4990 |
+
return elements.inject(initial, function(result, element) {
|
4991 |
+
if (!element.disabled && element.name) {
|
4992 |
+
key = element.name; value = $(element).getValue();
|
4993 |
+
if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
|
4994 |
+
submit !== false && (!submit || key == submit) && (submitted = true)))) {
|
4995 |
+
result = accumulator(result, key, value);
|
4996 |
+
}
|
4997 |
+
}
|
4998 |
+
return result;
|
4999 |
+
});
|
5000 |
+
}
|
5001 |
+
};
|
5002 |
+
|
5003 |
+
Form.Methods = {
|
5004 |
+
serialize: function(form, options) {
|
5005 |
+
return Form.serializeElements(Form.getElements(form), options);
|
5006 |
+
},
|
5007 |
+
|
5008 |
+
getElements: function(form) {
|
5009 |
+
var elements = $(form).getElementsByTagName('*'),
|
5010 |
+
element,
|
5011 |
+
arr = [ ],
|
5012 |
+
serializers = Form.Element.Serializers;
|
5013 |
+
for (var i = 0; element = elements[i]; i++) {
|
5014 |
+
arr.push(element);
|
5015 |
+
}
|
5016 |
+
return arr.inject([], function(elements, child) {
|
5017 |
+
if (serializers[child.tagName.toLowerCase()])
|
5018 |
+
elements.push(Element.extend(child));
|
5019 |
+
return elements;
|
5020 |
+
})
|
5021 |
+
},
|
5022 |
+
|
5023 |
+
getInputs: function(form, typeName, name) {
|
5024 |
+
form = $(form);
|
5025 |
+
var inputs = form.getElementsByTagName('input');
|
5026 |
+
|
5027 |
+
if (!typeName && !name) return $A(inputs).map(Element.extend);
|
5028 |
+
|
5029 |
+
for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
|
5030 |
+
var input = inputs[i];
|
5031 |
+
if ((typeName && input.type != typeName) || (name && input.name != name))
|
5032 |
+
continue;
|
5033 |
+
matchingInputs.push(Element.extend(input));
|
5034 |
+
}
|
5035 |
+
|
5036 |
+
return matchingInputs;
|
5037 |
+
},
|
5038 |
+
|
5039 |
+
disable: function(form) {
|
5040 |
+
form = $(form);
|
5041 |
+
Form.getElements(form).invoke('disable');
|
5042 |
+
return form;
|
5043 |
+
},
|
5044 |
+
|
5045 |
+
enable: function(form) {
|
5046 |
+
form = $(form);
|
5047 |
+
Form.getElements(form).invoke('enable');
|
5048 |
+
return form;
|
5049 |
+
},
|
5050 |
+
|
5051 |
+
findFirstElement: function(form) {
|
5052 |
+
var elements = $(form).getElements().findAll(function(element) {
|
5053 |
+
return 'hidden' != element.type && !element.disabled;
|
5054 |
+
});
|
5055 |
+
var firstByIndex = elements.findAll(function(element) {
|
5056 |
+
return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
|
5057 |
+
}).sortBy(function(element) { return element.tabIndex }).first();
|
5058 |
+
|
5059 |
+
return firstByIndex ? firstByIndex : elements.find(function(element) {
|
5060 |
+
return /^(?:input|select|textarea)$/i.test(element.tagName);
|
5061 |
+
});
|
5062 |
+
},
|
5063 |
+
|
5064 |
+
focusFirstElement: function(form) {
|
5065 |
+
form = $(form);
|
5066 |
+
var element = form.findFirstElement();
|
5067 |
+
if (element) element.activate();
|
5068 |
+
return form;
|
5069 |
+
},
|
5070 |
+
|
5071 |
+
request: function(form, options) {
|
5072 |
+
form = $(form), options = Object.clone(options || { });
|
5073 |
+
|
5074 |
+
var params = options.parameters, action = form.readAttribute('action') || '';
|
5075 |
+
if (action.blank()) action = window.location.href;
|
5076 |
+
options.parameters = form.serialize(true);
|
5077 |
+
|
5078 |
+
if (params) {
|
5079 |
+
if (Object.isString(params)) params = params.toQueryParams();
|
5080 |
+
Object.extend(options.parameters, params);
|
5081 |
+
}
|
5082 |
+
|
5083 |
+
if (form.hasAttribute('method') && !options.method)
|
5084 |
+
options.method = form.method;
|
5085 |
+
|
5086 |
+
return new Ajax.Request(action, options);
|
5087 |
+
}
|
5088 |
+
};
|
5089 |
+
|
5090 |
+
/*--------------------------------------------------------------------------*/
|
5091 |
+
|
5092 |
+
|
5093 |
+
Form.Element = {
|
5094 |
+
focus: function(element) {
|
5095 |
+
$(element).focus();
|
5096 |
+
return element;
|
5097 |
+
},
|
5098 |
+
|
5099 |
+
select: function(element) {
|
5100 |
+
$(element).select();
|
5101 |
+
return element;
|
5102 |
+
}
|
5103 |
+
};
|
5104 |
+
|
5105 |
+
Form.Element.Methods = {
|
5106 |
+
|
5107 |
+
serialize: function(element) {
|
5108 |
+
element = $(element);
|
5109 |
+
if (!element.disabled && element.name) {
|
5110 |
+
var value = element.getValue();
|
5111 |
+
if (value != undefined) {
|
5112 |
+
var pair = { };
|
5113 |
+
pair[element.name] = value;
|
5114 |
+
return Object.toQueryString(pair);
|
5115 |
+
}
|
5116 |
+
}
|
5117 |
+
return '';
|
5118 |
+
},
|
5119 |
+
|
5120 |
+
getValue: function(element) {
|
5121 |
+
element = $(element);
|
5122 |
+
var method = element.tagName.toLowerCase();
|
5123 |
+
return Form.Element.Serializers[method](element);
|
5124 |
+
},
|
5125 |
+
|
5126 |
+
setValue: function(element, value) {
|
5127 |
+
element = $(element);
|
5128 |
+
var method = element.tagName.toLowerCase();
|
5129 |
+
Form.Element.Serializers[method](element, value);
|
5130 |
+
return element;
|
5131 |
+
},
|
5132 |
+
|
5133 |
+
clear: function(element) {
|
5134 |
+
$(element).value = '';
|
5135 |
+
return element;
|
5136 |
+
},
|
5137 |
+
|
5138 |
+
present: function(element) {
|
5139 |
+
return $(element).value != '';
|
5140 |
+
},
|
5141 |
+
|
5142 |
+
activate: function(element) {
|
5143 |
+
element = $(element);
|
5144 |
+
try {
|
5145 |
+
element.focus();
|
5146 |
+
if (element.select && (element.tagName.toLowerCase() != 'input' ||
|
5147 |
+
!(/^(?:button|reset|submit)$/i.test(element.type))))
|
5148 |
+
element.select();
|
5149 |
+
} catch (e) { }
|
5150 |
+
return element;
|
5151 |
+
},
|
5152 |
+
|
5153 |
+
disable: function(element) {
|
5154 |
+
element = $(element);
|
5155 |
+
element.disabled = true;
|
5156 |
+
return element;
|
5157 |
+
},
|
5158 |
+
|
5159 |
+
enable: function(element) {
|
5160 |
+
element = $(element);
|
5161 |
+
element.disabled = false;
|
5162 |
+
return element;
|
5163 |
+
}
|
5164 |
+
};
|
5165 |
+
|
5166 |
+
/*--------------------------------------------------------------------------*/
|
5167 |
+
|
5168 |
+
var Field = Form.Element;
|
5169 |
+
|
5170 |
+
var $F = Form.Element.Methods.getValue;
|
5171 |
+
|
5172 |
+
/*--------------------------------------------------------------------------*/
|
5173 |
+
|
5174 |
+
Form.Element.Serializers = (function() {
|
5175 |
+
function input(element, value) {
|
5176 |
+
switch (element.type.toLowerCase()) {
|
5177 |
+
case 'checkbox':
|
5178 |
+
case 'radio':
|
5179 |
+
return inputSelector(element, value);
|
5180 |
+
default:
|
5181 |
+
return valueSelector(element, value);
|
5182 |
+
}
|
5183 |
+
}
|
5184 |
+
|
5185 |
+
function inputSelector(element, value) {
|
5186 |
+
if (Object.isUndefined(value))
|
5187 |
+
return element.checked ? element.value : null;
|
5188 |
+
else element.checked = !!value;
|
5189 |
+
}
|
5190 |
+
|
5191 |
+
function valueSelector(element, value) {
|
5192 |
+
if (Object.isUndefined(value)) return element.value;
|
5193 |
+
else element.value = value;
|
5194 |
+
}
|
5195 |
+
|
5196 |
+
function select(element, value) {
|
5197 |
+
if (Object.isUndefined(value))
|
5198 |
+
return (element.type === 'select-one' ? selectOne : selectMany)(element);
|
5199 |
+
|
5200 |
+
var opt, currentValue, single = !Object.isArray(value);
|
5201 |
+
for (var i = 0, length = element.length; i < length; i++) {
|
5202 |
+
opt = element.options[i];
|
5203 |
+
currentValue = this.optionValue(opt);
|
5204 |
+
if (single) {
|
5205 |
+
if (currentValue == value) {
|
5206 |
+
opt.selected = true;
|
5207 |
+
return;
|
5208 |
+
}
|
5209 |
+
}
|
5210 |
+
else opt.selected = value.include(currentValue);
|
5211 |
+
}
|
5212 |
+
}
|
5213 |
+
|
5214 |
+
function selectOne(element) {
|
5215 |
+
var index = element.selectedIndex;
|
5216 |
+
return index >= 0 ? optionValue(element.options[index]) : null;
|
5217 |
+
}
|
5218 |
+
|
5219 |
+
function selectMany(element) {
|
5220 |
+
var values, length = element.length;
|
5221 |
+
if (!length) return null;
|
5222 |
+
|
5223 |
+
for (var i = 0, values = []; i < length; i++) {
|
5224 |
+
var opt = element.options[i];
|
5225 |
+
if (opt.selected) values.push(optionValue(opt));
|
5226 |
+
}
|
5227 |
+
return values;
|
5228 |
+
}
|
5229 |
+
|
5230 |
+
function optionValue(opt) {
|
5231 |
+
return Element.hasAttribute(opt, 'value') ? opt.value : opt.text;
|
5232 |
+
}
|
5233 |
+
|
5234 |
+
return {
|
5235 |
+
input: input,
|
5236 |
+
inputSelector: inputSelector,
|
5237 |
+
textarea: valueSelector,
|
5238 |
+
select: select,
|
5239 |
+
selectOne: selectOne,
|
5240 |
+
selectMany: selectMany,
|
5241 |
+
optionValue: optionValue,
|
5242 |
+
button: valueSelector
|
5243 |
+
};
|
5244 |
+
})();
|
5245 |
+
|
5246 |
+
/*--------------------------------------------------------------------------*/
|
5247 |
+
|
5248 |
+
|
5249 |
+
Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
|
5250 |
+
initialize: function($super, element, frequency, callback) {
|
5251 |
+
$super(callback, frequency);
|
5252 |
+
this.element = $(element);
|
5253 |
+
this.lastValue = this.getValue();
|
5254 |
+
},
|
5255 |
+
|
5256 |
+
execute: function() {
|
5257 |
+
var value = this.getValue();
|
5258 |
+
if (Object.isString(this.lastValue) && Object.isString(value) ?
|
5259 |
+
this.lastValue != value : String(this.lastValue) != String(value)) {
|
5260 |
+
this.callback(this.element, value);
|
5261 |
+
this.lastValue = value;
|
5262 |
+
}
|
5263 |
+
}
|
5264 |
+
});
|
5265 |
+
|
5266 |
+
Form.Element.Observer = Class.create(Abstract.TimedObserver, {
|
5267 |
+
getValue: function() {
|
5268 |
+
return Form.Element.getValue(this.element);
|
5269 |
+
}
|
5270 |
+
});
|
5271 |
+
|
5272 |
+
Form.Observer = Class.create(Abstract.TimedObserver, {
|
5273 |
+
getValue: function() {
|
5274 |
+
return Form.serialize(this.element);
|
5275 |
+
}
|
5276 |
+
});
|
5277 |
+
|
5278 |
+
/*--------------------------------------------------------------------------*/
|
5279 |
+
|
5280 |
+
Abstract.EventObserver = Class.create({
|
5281 |
+
initialize: function(element, callback) {
|
5282 |
+
this.element = $(element);
|
5283 |
+
this.callback = callback;
|
5284 |
+
|
5285 |
+
this.lastValue = this.getValue();
|
5286 |
+
if (this.element.tagName.toLowerCase() == 'form')
|
5287 |
+
this.registerFormCallbacks();
|
5288 |
+
else
|
5289 |
+
this.registerCallback(this.element);
|
5290 |
+
},
|
5291 |
+
|
5292 |
+
onElementEvent: function() {
|
5293 |
+
var value = this.getValue();
|
5294 |
+
if (this.lastValue != value) {
|
5295 |
+
this.callback(this.element, value);
|
5296 |
+
this.lastValue = value;
|
5297 |
+
}
|
5298 |
+
},
|
5299 |
+
|
5300 |
+
registerFormCallbacks: function() {
|
5301 |
+
Form.getElements(this.element).each(this.registerCallback, this);
|
5302 |
+
},
|
5303 |
+
|
5304 |
+
registerCallback: function(element) {
|
5305 |
+
if (element.type) {
|
5306 |
+
switch (element.type.toLowerCase()) {
|
5307 |
+
case 'checkbox':
|
5308 |
+
case 'radio':
|
5309 |
+
Event.observe(element, 'click', this.onElementEvent.bind(this));
|
5310 |
+
break;
|
5311 |
+
default:
|
5312 |
+
Event.observe(element, 'change', this.onElementEvent.bind(this));
|
5313 |
+
break;
|
5314 |
+
}
|
5315 |
+
}
|
5316 |
+
}
|
5317 |
+
});
|
5318 |
+
|
5319 |
+
Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
|
5320 |
+
getValue: function() {
|
5321 |
+
return Form.Element.getValue(this.element);
|
5322 |
+
}
|
5323 |
+
});
|
5324 |
+
|
5325 |
+
Form.EventObserver = Class.create(Abstract.EventObserver, {
|
5326 |
+
getValue: function() {
|
5327 |
+
return Form.serialize(this.element);
|
5328 |
+
}
|
5329 |
+
});
|
5330 |
+
(function() {
|
5331 |
+
|
5332 |
+
var Event = {
|
5333 |
+
KEY_BACKSPACE: 8,
|
5334 |
+
KEY_TAB: 9,
|
5335 |
+
KEY_RETURN: 13,
|
5336 |
+
KEY_ESC: 27,
|
5337 |
+
KEY_LEFT: 37,
|
5338 |
+
KEY_UP: 38,
|
5339 |
+
KEY_RIGHT: 39,
|
5340 |
+
KEY_DOWN: 40,
|
5341 |
+
KEY_DELETE: 46,
|
5342 |
+
KEY_HOME: 36,
|
5343 |
+
KEY_END: 35,
|
5344 |
+
KEY_PAGEUP: 33,
|
5345 |
+
KEY_PAGEDOWN: 34,
|
5346 |
+
KEY_INSERT: 45,
|
5347 |
+
|
5348 |
+
cache: {}
|
5349 |
+
};
|
5350 |
+
|
5351 |
+
var docEl = document.documentElement;
|
5352 |
+
var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl
|
5353 |
+
&& 'onmouseleave' in docEl;
|
5354 |
+
|
5355 |
+
|
5356 |
+
|
5357 |
+
var isIELegacyEvent = function(event) { return false; };
|
5358 |
+
|
5359 |
+
if (window.attachEvent) {
|
5360 |
+
if (window.addEventListener) {
|
5361 |
+
isIELegacyEvent = function(event) {
|
5362 |
+
return !(event instanceof window.Event);
|
5363 |
+
};
|
5364 |
+
} else {
|
5365 |
+
isIELegacyEvent = function(event) { return true; };
|
5366 |
+
}
|
5367 |
+
}
|
5368 |
+
|
5369 |
+
var _isButton;
|
5370 |
+
|
5371 |
+
function _isButtonForDOMEvents(event, code) {
|
5372 |
+
return event.which ? (event.which === code + 1) : (event.button === code);
|
5373 |
+
}
|
5374 |
+
|
5375 |
+
var legacyButtonMap = { 0: 1, 1: 4, 2: 2 };
|
5376 |
+
function _isButtonForLegacyEvents(event, code) {
|
5377 |
+
return event.button === legacyButtonMap[code];
|
5378 |
+
}
|
5379 |
+
|
5380 |
+
function _isButtonForWebKit(event, code) {
|
5381 |
+
switch (code) {
|
5382 |
+
case 0: return event.which == 1 && !event.metaKey;
|
5383 |
+
case 1: return event.which == 2 || (event.which == 1 && event.metaKey);
|
5384 |
+
case 2: return event.which == 3;
|
5385 |
+
default: return false;
|
5386 |
+
}
|
5387 |
+
}
|
5388 |
+
|
5389 |
+
if (window.attachEvent) {
|
5390 |
+
if (!window.addEventListener) {
|
5391 |
+
_isButton = _isButtonForLegacyEvents;
|
5392 |
+
} else {
|
5393 |
+
_isButton = function(event, code) {
|
5394 |
+
return isIELegacyEvent(event) ? _isButtonForLegacyEvents(event, code) :
|
5395 |
+
_isButtonForDOMEvents(event, code);
|
5396 |
+
}
|
5397 |
+
}
|
5398 |
+
} else if (Prototype.Browser.WebKit) {
|
5399 |
+
_isButton = _isButtonForWebKit;
|
5400 |
+
} else {
|
5401 |
+
_isButton = _isButtonForDOMEvents;
|
5402 |
+
}
|
5403 |
+
|
5404 |
+
function isLeftClick(event) { return _isButton(event, 0) }
|
5405 |
+
|
5406 |
+
function isMiddleClick(event) { return _isButton(event, 1) }
|
5407 |
+
|
5408 |
+
function isRightClick(event) { return _isButton(event, 2) }
|
5409 |
+
|
5410 |
+
function element(event) {
|
5411 |
+
event = Event.extend(event);
|
5412 |
+
|
5413 |
+
var node = event.target, type = event.type,
|
5414 |
+
currentTarget = event.currentTarget;
|
5415 |
+
|
5416 |
+
if (currentTarget && currentTarget.tagName) {
|
5417 |
+
if (type === 'load' || type === 'error' ||
|
5418 |
+
(type === 'click' && currentTarget.tagName.toLowerCase() === 'input'
|
5419 |
+
&& currentTarget.type === 'radio'))
|
5420 |
+
node = currentTarget;
|
5421 |
+
}
|
5422 |
+
|
5423 |
+
if (node.nodeType == Node.TEXT_NODE)
|
5424 |
+
node = node.parentNode;
|
5425 |
+
|
5426 |
+
return Element.extend(node);
|
5427 |
+
}
|
5428 |
+
|
5429 |
+
function findElement(event, expression) {
|
5430 |
+
var element = Event.element(event);
|
5431 |
+
|
5432 |
+
if (!expression) return element;
|
5433 |
+
while (element) {
|
5434 |
+
if (Object.isElement(element) && Prototype.Selector.match(element, expression)) {
|
5435 |
+
return Element.extend(element);
|
5436 |
+
}
|
5437 |
+
element = element.parentNode;
|
5438 |
+
}
|
5439 |
+
}
|
5440 |
+
|
5441 |
+
function pointer(event) {
|
5442 |
+
return { x: pointerX(event), y: pointerY(event) };
|
5443 |
+
}
|
5444 |
+
|
5445 |
+
function pointerX(event) {
|
5446 |
+
var docElement = document.documentElement,
|
5447 |
+
body = document.body || { scrollLeft: 0 };
|
5448 |
+
|
5449 |
+
return event.pageX || (event.clientX +
|
5450 |
+
(docElement.scrollLeft || body.scrollLeft) -
|
5451 |
+
(docElement.clientLeft || 0));
|
5452 |
+
}
|
5453 |
+
|
5454 |
+
function pointerY(event) {
|
5455 |
+
var docElement = document.documentElement,
|
5456 |
+
body = document.body || { scrollTop: 0 };
|
5457 |
+
|
5458 |
+
return event.pageY || (event.clientY +
|
5459 |
+
(docElement.scrollTop || body.scrollTop) -
|
5460 |
+
(docElement.clientTop || 0));
|
5461 |
+
}
|
5462 |
+
|
5463 |
+
|
5464 |
+
function stop(event) {
|
5465 |
+
Event.extend(event);
|
5466 |
+
event.preventDefault();
|
5467 |
+
event.stopPropagation();
|
5468 |
+
|
5469 |
+
event.stopped = true;
|
5470 |
+
}
|
5471 |
+
|
5472 |
+
|
5473 |
+
Event.Methods = {
|
5474 |
+
isLeftClick: isLeftClick,
|
5475 |
+
isMiddleClick: isMiddleClick,
|
5476 |
+
isRightClick: isRightClick,
|
5477 |
+
|
5478 |
+
element: element,
|
5479 |
+
findElement: findElement,
|
5480 |
+
|
5481 |
+
pointer: pointer,
|
5482 |
+
pointerX: pointerX,
|
5483 |
+
pointerY: pointerY,
|
5484 |
+
|
5485 |
+
stop: stop
|
5486 |
+
};
|
5487 |
+
|
5488 |
+
var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
|
5489 |
+
m[name] = Event.Methods[name].methodize();
|
5490 |
+
return m;
|
5491 |
+
});
|
5492 |
+
|
5493 |
+
if (window.attachEvent) {
|
5494 |
+
function _relatedTarget(event) {
|
5495 |
+
var element;
|
5496 |
+
switch (event.type) {
|
5497 |
+
case 'mouseover':
|
5498 |
+
case 'mouseenter':
|
5499 |
+
element = event.fromElement;
|
5500 |
+
break;
|
5501 |
+
case 'mouseout':
|
5502 |
+
case 'mouseleave':
|
5503 |
+
element = event.toElement;
|
5504 |
+
break;
|
5505 |
+
default:
|
5506 |
+
return null;
|
5507 |
+
}
|
5508 |
+
return Element.extend(element);
|
5509 |
+
}
|
5510 |
+
|
5511 |
+
var additionalMethods = {
|
5512 |
+
stopPropagation: function() { this.cancelBubble = true },
|
5513 |
+
preventDefault: function() { this.returnValue = false },
|
5514 |
+
inspect: function() { return '[object Event]' }
|
5515 |
+
};
|
5516 |
+
|
5517 |
+
Event.extend = function(event, element) {
|
5518 |
+
if (!event) return false;
|
5519 |
+
|
5520 |
+
if (!isIELegacyEvent(event)) return event;
|
5521 |
+
|
5522 |
+
if (event._extendedByPrototype) return event;
|
5523 |
+
event._extendedByPrototype = Prototype.emptyFunction;
|
5524 |
+
|
5525 |
+
var pointer = Event.pointer(event);
|
5526 |
+
|
5527 |
+
Object.extend(event, {
|
5528 |
+
target: event.srcElement || element,
|
5529 |
+
relatedTarget: _relatedTarget(event),
|
5530 |
+
pageX: pointer.x,
|
5531 |
+
pageY: pointer.y
|
5532 |
+
});
|
5533 |
+
|
5534 |
+
Object.extend(event, methods);
|
5535 |
+
Object.extend(event, additionalMethods);
|
5536 |
+
|
5537 |
+
return event;
|
5538 |
+
};
|
5539 |
+
} else {
|
5540 |
+
Event.extend = Prototype.K;
|
5541 |
+
}
|
5542 |
+
|
5543 |
+
if (window.addEventListener) {
|
5544 |
+
Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__;
|
5545 |
+
Object.extend(Event.prototype, methods);
|
5546 |
+
}
|
5547 |
+
|
5548 |
+
function _createResponder(element, eventName, handler) {
|
5549 |
+
var registry = Element.retrieve(element, 'prototype_event_registry');
|
5550 |
+
|
5551 |
+
if (Object.isUndefined(registry)) {
|
5552 |
+
CACHE.push(element);
|
5553 |
+
registry = Element.retrieve(element, 'prototype_event_registry', $H());
|
5554 |
+
}
|
5555 |
+
|
5556 |
+
var respondersForEvent = registry.get(eventName);
|
5557 |
+
if (Object.isUndefined(respondersForEvent)) {
|
5558 |
+
respondersForEvent = [];
|
5559 |
+
registry.set(eventName, respondersForEvent);
|
5560 |
+
}
|
5561 |
+
|
5562 |
+
if (respondersForEvent.pluck('handler').include(handler)) return false;
|
5563 |
+
|
5564 |
+
var responder;
|
5565 |
+
if (eventName.include(":")) {
|
5566 |
+
responder = function(event) {
|
5567 |
+
if (Object.isUndefined(event.eventName))
|
5568 |
+
return false;
|
5569 |
+
|
5570 |
+
if (event.eventName !== eventName)
|
5571 |
+
return false;
|
5572 |
+
|
5573 |
+
Event.extend(event, element);
|
5574 |
+
handler.call(element, event);
|
5575 |
+
};
|
5576 |
+
} else {
|
5577 |
+
if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED &&
|
5578 |
+
(eventName === "mouseenter" || eventName === "mouseleave")) {
|
5579 |
+
if (eventName === "mouseenter" || eventName === "mouseleave") {
|
5580 |
+
responder = function(event) {
|
5581 |
+
Event.extend(event, element);
|
5582 |
+
|
5583 |
+
var parent = event.relatedTarget;
|
5584 |
+
while (parent && parent !== element) {
|
5585 |
+
try { parent = parent.parentNode; }
|
5586 |
+
catch(e) { parent = element; }
|
5587 |
+
}
|
5588 |
+
|
5589 |
+
if (parent === element) return;
|
5590 |
+
|
5591 |
+
handler.call(element, event);
|
5592 |
+
};
|
5593 |
+
}
|
5594 |
+
} else {
|
5595 |
+
responder = function(event) {
|
5596 |
+
Event.extend(event, element);
|
5597 |
+
handler.call(element, event);
|
5598 |
+
};
|
5599 |
+
}
|
5600 |
+
}
|
5601 |
+
|
5602 |
+
responder.handler = handler;
|
5603 |
+
respondersForEvent.push(responder);
|
5604 |
+
return responder;
|
5605 |
+
}
|
5606 |
+
|
5607 |
+
function _destroyCache() {
|
5608 |
+
for (var i = 0, length = CACHE.length; i < length; i++) {
|
5609 |
+
Event.stopObserving(CACHE[i]);
|
5610 |
+
CACHE[i] = null;
|
5611 |
+
}
|
5612 |
+
}
|
5613 |
+
|
5614 |
+
var CACHE = [];
|
5615 |
+
|
5616 |
+
if (Prototype.Browser.IE)
|
5617 |
+
window.attachEvent('onunload', _destroyCache);
|
5618 |
+
|
5619 |
+
if (Prototype.Browser.WebKit)
|
5620 |
+
window.addEventListener('unload', Prototype.emptyFunction, false);
|
5621 |
+
|
5622 |
+
|
5623 |
+
var _getDOMEventName = Prototype.K,
|
5624 |
+
translations = { mouseenter: "mouseover", mouseleave: "mouseout" };
|
5625 |
+
|
5626 |
+
if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) {
|
5627 |
+
_getDOMEventName = function(eventName) {
|
5628 |
+
return (translations[eventName] || eventName);
|
5629 |
+
};
|
5630 |
+
}
|
5631 |
+
|
5632 |
+
function observe(element, eventName, handler) {
|
5633 |
+
element = $(element);
|
5634 |
+
|
5635 |
+
var responder = _createResponder(element, eventName, handler);
|
5636 |
+
|
5637 |
+
if (!responder) return element;
|
5638 |
+
|
5639 |
+
if (eventName.include(':')) {
|
5640 |
+
if (element.addEventListener)
|
5641 |
+
element.addEventListener("dataavailable", responder, false);
|
5642 |
+
else {
|
5643 |
+
element.attachEvent("ondataavailable", responder);
|
5644 |
+
element.attachEvent("onlosecapture", responder);
|
5645 |
+
}
|
5646 |
+
} else {
|
5647 |
+
var actualEventName = _getDOMEventName(eventName);
|
5648 |
+
|
5649 |
+
if (element.addEventListener)
|
5650 |
+
element.addEventListener(actualEventName, responder, false);
|
5651 |
+
else
|
5652 |
+
element.attachEvent("on" + actualEventName, responder);
|
5653 |
+
}
|
5654 |
+
|
5655 |
+
return element;
|
5656 |
+
}
|
5657 |
+
|
5658 |
+
function stopObserving(element, eventName, handler) {
|
5659 |
+
element = $(element);
|
5660 |
+
|
5661 |
+
var registry = Element.retrieve(element, 'prototype_event_registry');
|
5662 |
+
if (!registry) return element;
|
5663 |
+
|
5664 |
+
if (!eventName) {
|
5665 |
+
registry.each( function(pair) {
|
5666 |
+
var eventName = pair.key;
|
5667 |
+
stopObserving(element, eventName);
|
5668 |
+
});
|
5669 |
+
return element;
|
5670 |
+
}
|
5671 |
+
|
5672 |
+
var responders = registry.get(eventName);
|
5673 |
+
if (!responders) return element;
|
5674 |
+
|
5675 |
+
if (!handler) {
|
5676 |
+
responders.each(function(r) {
|
5677 |
+
stopObserving(element, eventName, r.handler);
|
5678 |
+
});
|
5679 |
+
return element;
|
5680 |
+
}
|
5681 |
+
|
5682 |
+
var i = responders.length, responder;
|
5683 |
+
while (i--) {
|
5684 |
+
if (responders[i].handler === handler) {
|
5685 |
+
responder = responders[i];
|
5686 |
+
break;
|
5687 |
+
}
|
5688 |
+
}
|
5689 |
+
if (!responder) return element;
|
5690 |
+
|
5691 |
+
if (eventName.include(':')) {
|
5692 |
+
if (element.removeEventListener)
|
5693 |
+
element.removeEventListener("dataavailable", responder, false);
|
5694 |
+
else {
|
5695 |
+
element.detachEvent("ondataavailable", responder);
|
5696 |
+
element.detachEvent("onlosecapture", responder);
|
5697 |
+
}
|
5698 |
+
} else {
|
5699 |
+
var actualEventName = _getDOMEventName(eventName);
|
5700 |
+
if (element.removeEventListener)
|
5701 |
+
element.removeEventListener(actualEventName, responder, false);
|
5702 |
+
else
|
5703 |
+
element.detachEvent('on' + actualEventName, responder);
|
5704 |
+
}
|
5705 |
+
|
5706 |
+
registry.set(eventName, responders.without(responder));
|
5707 |
+
|
5708 |
+
return element;
|
5709 |
+
}
|
5710 |
+
|
5711 |
+
function fire(element, eventName, memo, bubble) {
|
5712 |
+
element = $(element);
|
5713 |
+
|
5714 |
+
if (Object.isUndefined(bubble))
|
5715 |
+
bubble = true;
|
5716 |
+
|
5717 |
+
if (element == document && document.createEvent && !element.dispatchEvent)
|
5718 |
+
element = document.documentElement;
|
5719 |
+
|
5720 |
+
var event;
|
5721 |
+
if (document.createEvent) {
|
5722 |
+
event = document.createEvent('HTMLEvents');
|
5723 |
+
event.initEvent('dataavailable', bubble, true);
|
5724 |
+
} else {
|
5725 |
+
event = document.createEventObject();
|
5726 |
+
event.eventType = bubble ? 'ondataavailable' : 'onlosecapture';
|
5727 |
+
}
|
5728 |
+
|
5729 |
+
event.eventName = eventName;
|
5730 |
+
event.memo = memo || { };
|
5731 |
+
|
5732 |
+
if (document.createEvent)
|
5733 |
+
element.dispatchEvent(event);
|
5734 |
+
else
|
5735 |
+
element.fireEvent(event.eventType, event);
|
5736 |
+
|
5737 |
+
return Event.extend(event);
|
5738 |
+
}
|
5739 |
+
|
5740 |
+
Event.Handler = Class.create({
|
5741 |
+
initialize: function(element, eventName, selector, callback) {
|
5742 |
+
this.element = $(element);
|
5743 |
+
this.eventName = eventName;
|
5744 |
+
this.selector = selector;
|
5745 |
+
this.callback = callback;
|
5746 |
+
this.handler = this.handleEvent.bind(this);
|
5747 |
+
},
|
5748 |
+
|
5749 |
+
start: function() {
|
5750 |
+
Event.observe(this.element, this.eventName, this.handler);
|
5751 |
+
return this;
|
5752 |
+
},
|
5753 |
+
|
5754 |
+
stop: function() {
|
5755 |
+
Event.stopObserving(this.element, this.eventName, this.handler);
|
5756 |
+
return this;
|
5757 |
+
},
|
5758 |
+
|
5759 |
+
handleEvent: function(event) {
|
5760 |
+
var element = Event.findElement(event, this.selector);
|
5761 |
+
if (element) this.callback.call(this.element, event, element);
|
5762 |
+
}
|
5763 |
+
});
|
5764 |
+
|
5765 |
+
function on(element, eventName, selector, callback) {
|
5766 |
+
element = $(element);
|
5767 |
+
if (Object.isFunction(selector) && Object.isUndefined(callback)) {
|
5768 |
+
callback = selector, selector = null;
|
5769 |
+
}
|
5770 |
+
|
5771 |
+
return new Event.Handler(element, eventName, selector, callback).start();
|
5772 |
+
}
|
5773 |
+
|
5774 |
+
Object.extend(Event, Event.Methods);
|
5775 |
+
|
5776 |
+
Object.extend(Event, {
|
5777 |
+
fire: fire,
|
5778 |
+
observe: observe,
|
5779 |
+
stopObserving: stopObserving,
|
5780 |
+
on: on
|
5781 |
+
});
|
5782 |
+
|
5783 |
+
Element.addMethods({
|
5784 |
+
fire: fire,
|
5785 |
+
|
5786 |
+
observe: observe,
|
5787 |
+
|
5788 |
+
stopObserving: stopObserving,
|
5789 |
+
|
5790 |
+
on: on
|
5791 |
+
});
|
5792 |
+
|
5793 |
+
Object.extend(document, {
|
5794 |
+
fire: fire.methodize(),
|
5795 |
+
|
5796 |
+
observe: observe.methodize(),
|
5797 |
+
|
5798 |
+
stopObserving: stopObserving.methodize(),
|
5799 |
+
|
5800 |
+
on: on.methodize(),
|
5801 |
+
|
5802 |
+
loaded: false
|
5803 |
+
});
|
5804 |
+
|
5805 |
+
if (window.Event) Object.extend(window.Event, Event);
|
5806 |
+
else window.Event = Event;
|
5807 |
+
})();
|
5808 |
+
|
5809 |
+
(function() {
|
5810 |
+
/* Support for the DOMContentLoaded event is based on work by Dan Webb,
|
5811 |
+
Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */
|
5812 |
+
|
5813 |
+
var timer;
|
5814 |
+
|
5815 |
+
function fireContentLoadedEvent() {
|
5816 |
+
if (document.loaded) return;
|
5817 |
+
if (timer) window.clearTimeout(timer);
|
5818 |
+
document.loaded = true;
|
5819 |
+
document.fire('dom:loaded');
|
5820 |
+
}
|
5821 |
+
|
5822 |
+
function checkReadyState() {
|
5823 |
+
if (document.readyState === 'complete') {
|
5824 |
+
document.stopObserving('readystatechange', checkReadyState);
|
5825 |
+
fireContentLoadedEvent();
|
5826 |
+
}
|
5827 |
+
}
|
5828 |
+
|
5829 |
+
function pollDoScroll() {
|
5830 |
+
try { document.documentElement.doScroll('left'); }
|
5831 |
+
catch(e) {
|
5832 |
+
timer = pollDoScroll.defer();
|
5833 |
+
return;
|
5834 |
+
}
|
5835 |
+
fireContentLoadedEvent();
|
5836 |
+
}
|
5837 |
+
|
5838 |
+
if (document.addEventListener) {
|
5839 |
+
document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false);
|
5840 |
+
} else {
|
5841 |
+
document.observe('readystatechange', checkReadyState);
|
5842 |
+
if (window == top)
|
5843 |
+
timer = pollDoScroll.defer();
|
5844 |
+
}
|
5845 |
+
|
5846 |
+
Event.observe(window, 'load', fireContentLoadedEvent);
|
5847 |
+
})();
|
5848 |
+
|
5849 |
+
|
5850 |
+
Element.addMethods();
|
5851 |
+
/*------------------------------- DEPRECATED -------------------------------*/
|
5852 |
+
|
5853 |
+
Hash.toQueryString = Object.toQueryString;
|
5854 |
+
|
5855 |
+
var Toggle = { display: Element.toggle };
|
5856 |
+
|
5857 |
+
Element.Methods.childOf = Element.Methods.descendantOf;
|
5858 |
+
|
5859 |
+
var Insertion = {
|
5860 |
+
Before: function(element, content) {
|
5861 |
+
return Element.insert(element, {before:content});
|
5862 |
+
},
|
5863 |
+
|
5864 |
+
Top: function(element, content) {
|
5865 |
+
return Element.insert(element, {top:content});
|
5866 |
+
},
|
5867 |
+
|
5868 |
+
Bottom: function(element, content) {
|
5869 |
+
return Element.insert(element, {bottom:content});
|
5870 |
+
},
|
5871 |
+
|
5872 |
+
After: function(element, content) {
|
5873 |
+
return Element.insert(element, {after:content});
|
5874 |
+
}
|
5875 |
+
};
|
5876 |
+
|
5877 |
+
var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
|
5878 |
+
|
5879 |
+
var Position = {
|
5880 |
+
includeScrollOffsets: false,
|
5881 |
+
|
5882 |
+
prepare: function() {
|
5883 |
+
this.deltaX = window.pageXOffset
|
5884 |
+
|| document.documentElement.scrollLeft
|
5885 |
+
|| document.body.scrollLeft
|
5886 |
+
|| 0;
|
5887 |
+
this.deltaY = window.pageYOffset
|
5888 |
+
|| document.documentElement.scrollTop
|
5889 |
+
|| document.body.scrollTop
|
5890 |
+
|| 0;
|
5891 |
+
},
|
5892 |
+
|
5893 |
+
within: function(element, x, y) {
|
5894 |
+
if (this.includeScrollOffsets)
|
5895 |
+
return this.withinIncludingScrolloffsets(element, x, y);
|
5896 |
+
this.xcomp = x;
|
5897 |
+
this.ycomp = y;
|
5898 |
+
this.offset = Element.cumulativeOffset(element);
|
5899 |
+
|
5900 |
+
return (y >= this.offset[1] &&
|
5901 |
+
y < this.offset[1] + element.offsetHeight &&
|
5902 |
+
x >= this.offset[0] &&
|
5903 |
+
x < this.offset[0] + element.offsetWidth);
|
5904 |
+
},
|
5905 |
+
|
5906 |
+
withinIncludingScrolloffsets: function(element, x, y) {
|
5907 |
+
var offsetcache = Element.cumulativeScrollOffset(element);
|
5908 |
+
|
5909 |
+
this.xcomp = x + offsetcache[0] - this.deltaX;
|
5910 |
+
this.ycomp = y + offsetcache[1] - this.deltaY;
|
5911 |
+
this.offset = Element.cumulativeOffset(element);
|
5912 |
+
|
5913 |
+
return (this.ycomp >= this.offset[1] &&
|
5914 |
+
this.ycomp < this.offset[1] + element.offsetHeight &&
|
5915 |
+
this.xcomp >= this.offset[0] &&
|
5916 |
+
this.xcomp < this.offset[0] + element.offsetWidth);
|
5917 |
+
},
|
5918 |
+
|
5919 |
+
overlap: function(mode, element) {
|
5920 |
+
if (!mode) return 0;
|
5921 |
+
if (mode == 'vertical')
|
5922 |
+
return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
|
5923 |
+
element.offsetHeight;
|
5924 |
+
if (mode == 'horizontal')
|
5925 |
+
return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
|
5926 |
+
element.offsetWidth;
|
5927 |
+
},
|
5928 |
+
|
5929 |
+
|
5930 |
+
cumulativeOffset: Element.Methods.cumulativeOffset,
|
5931 |
+
|
5932 |
+
positionedOffset: Element.Methods.positionedOffset,
|
5933 |
+
|
5934 |
+
absolutize: function(element) {
|
5935 |
+
Position.prepare();
|
5936 |
+
return Element.absolutize(element);
|
5937 |
+
},
|
5938 |
+
|
5939 |
+
relativize: function(element) {
|
5940 |
+
Position.prepare();
|
5941 |
+
return Element.relativize(element);
|
5942 |
+
},
|
5943 |
+
|
5944 |
+
realOffset: Element.Methods.cumulativeScrollOffset,
|
5945 |
+
|
5946 |
+
offsetParent: Element.Methods.getOffsetParent,
|
5947 |
+
|
5948 |
+
page: Element.Methods.viewportOffset,
|
5949 |
+
|
5950 |
+
clone: function(source, target, options) {
|
5951 |
+
options = options || { };
|
5952 |
+
return Element.clonePosition(target, source, options);
|
5953 |
+
}
|
5954 |
+
};
|
5955 |
+
|
5956 |
+
/*--------------------------------------------------------------------------*/
|
5957 |
+
|
5958 |
+
if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
|
5959 |
+
function iter(name) {
|
5960 |
+
return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
|
5961 |
+
}
|
5962 |
+
|
5963 |
+
instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
|
5964 |
+
function(element, className) {
|
5965 |
+
className = className.toString().strip();
|
5966 |
+
var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
|
5967 |
+
return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
|
5968 |
+
} : function(element, className) {
|
5969 |
+
className = className.toString().strip();
|
5970 |
+
var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
|
5971 |
+
if (!classNames && !className) return elements;
|
5972 |
+
|
5973 |
+
var nodes = $(element).getElementsByTagName('*');
|
5974 |
+
className = ' ' + className + ' ';
|
5975 |
+
|
5976 |
+
for (var i = 0, child, cn; child = nodes[i]; i++) {
|
5977 |
+
if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
|
5978 |
+
(classNames && classNames.all(function(name) {
|
5979 |
+
return !name.toString().blank() && cn.include(' ' + name + ' ');
|
5980 |
+
}))))
|
5981 |
+
elements.push(Element.extend(child));
|
5982 |
+
}
|
5983 |
+
return elements;
|
5984 |
+
};
|
5985 |
+
|
5986 |
+
return function(className, parentElement) {
|
5987 |
+
return $(parentElement || document.body).getElementsByClassName(className);
|
5988 |
+
};
|
5989 |
+
}(Element.Methods);
|
5990 |
+
|
5991 |
+
/*--------------------------------------------------------------------------*/
|
5992 |
+
|
5993 |
+
Element.ClassNames = Class.create();
|
5994 |
+
Element.ClassNames.prototype = {
|
5995 |
+
initialize: function(element) {
|
5996 |
+
this.element = $(element);
|
5997 |
+
},
|
5998 |
+
|
5999 |
+
_each: function(iterator) {
|
6000 |
+
this.element.className.split(/\s+/).select(function(name) {
|
6001 |
+
return name.length > 0;
|
6002 |
+
})._each(iterator);
|
6003 |
+
},
|
6004 |
+
|
6005 |
+
set: function(className) {
|
6006 |
+
this.element.className = className;
|
6007 |
+
},
|
6008 |
+
|
6009 |
+
add: function(classNameToAdd) {
|
6010 |
+
if (this.include(classNameToAdd)) return;
|
6011 |
+
this.set($A(this).concat(classNameToAdd).join(' '));
|
6012 |
+
},
|
6013 |
+
|
6014 |
+
remove: function(classNameToRemove) {
|
6015 |
+
if (!this.include(classNameToRemove)) return;
|
6016 |
+
this.set($A(this).without(classNameToRemove).join(' '));
|
6017 |
+
},
|
6018 |
+
|
6019 |
+
toString: function() {
|
6020 |
+
return $A(this).join(' ');
|
6021 |
+
}
|
6022 |
+
};
|
6023 |
+
|
6024 |
+
Object.extend(Element.ClassNames.prototype, Enumerable);
|
6025 |
+
|
6026 |
+
/*--------------------------------------------------------------------------*/
|
6027 |
+
|
6028 |
+
(function() {
|
6029 |
+
window.Selector = Class.create({
|
6030 |
+
initialize: function(expression) {
|
6031 |
+
this.expression = expression.strip();
|
6032 |
+
},
|
6033 |
+
|
6034 |
+
findElements: function(rootElement) {
|
6035 |
+
return Prototype.Selector.select(this.expression, rootElement);
|
6036 |
+
},
|
6037 |
+
|
6038 |
+
match: function(element) {
|
6039 |
+
return Prototype.Selector.match(element, this.expression);
|
6040 |
+
},
|
6041 |
+
|
6042 |
+
toString: function() {
|
6043 |
+
return this.expression;
|
6044 |
+
},
|
6045 |
+
|
6046 |
+
inspect: function() {
|
6047 |
+
return "#<Selector: " + this.expression + ">";
|
6048 |
+
}
|
6049 |
+
});
|
6050 |
+
|
6051 |
+
Object.extend(Selector, {
|
6052 |
+
matchElements: function(elements, expression) {
|
6053 |
+
var match = Prototype.Selector.match,
|
6054 |
+
results = [];
|
6055 |
+
|
6056 |
+
for (var i = 0, length = elements.length; i < length; i++) {
|
6057 |
+
var element = elements[i];
|
6058 |
+
if (match(element, expression)) {
|
6059 |
+
results.push(Element.extend(element));
|
6060 |
+
}
|
6061 |
+
}
|
6062 |
+
return results;
|
6063 |
+
},
|
6064 |
+
|
6065 |
+
findElement: function(elements, expression, index) {
|
6066 |
+
index = index || 0;
|
6067 |
+
var matchIndex = 0, element;
|
6068 |
+
for (var i = 0, length = elements.length; i < length; i++) {
|
6069 |
+
element = elements[i];
|
6070 |
+
if (Prototype.Selector.match(element, expression) && index === matchIndex++) {
|
6071 |
+
return Element.extend(element);
|
6072 |
+
}
|
6073 |
+
}
|
6074 |
+
},
|
6075 |
+
|
6076 |
+
findChildElements: function(element, expressions) {
|
6077 |
+
var selector = expressions.toArray().join(', ');
|
6078 |
+
return Prototype.Selector.select(selector, element || document);
|
6079 |
+
}
|
6080 |
+
});
|
6081 |
+
})();
|
skin/frontend/base/default/js/ajaxwishlist/lightview/scriptaculous.js
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// script.aculo.us scriptaculous.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
|
2 |
+
|
3 |
+
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
4 |
+
//
|
5 |
+
// Permission is hereby granted, free of charge, to any person obtaining
|
6 |
+
// a copy of this software and associated documentation files (the
|
7 |
+
// "Software"), to deal in the Software without restriction, including
|
8 |
+
// without limitation the rights to use, copy, modify, merge, publish,
|
9 |
+
// distribute, sublicense, and/or sell copies of the Software, and to
|
10 |
+
// permit persons to whom the Software is furnished to do so, subject to
|
11 |
+
// the following conditions:
|
12 |
+
//
|
13 |
+
// The above copyright notice and this permission notice shall be
|
14 |
+
// included in all copies or substantial portions of the Software.
|
15 |
+
//
|
16 |
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17 |
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18 |
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19 |
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20 |
+
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21 |
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22 |
+
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23 |
+
//
|
24 |
+
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
25 |
+
|
26 |
+
var Scriptaculous = {
|
27 |
+
Version: '1.9.0',
|
28 |
+
require: function(libraryName) {
|
29 |
+
try{
|
30 |
+
// inserting via DOM fails in Safari 2.0, so brute force approach
|
31 |
+
document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
|
32 |
+
} catch(e) {
|
33 |
+
// for xhtml+xml served content, fall back to DOM methods
|
34 |
+
var script = document.createElement('script');
|
35 |
+
script.type = 'text/javascript';
|
36 |
+
script.src = libraryName;
|
37 |
+
document.getElementsByTagName('head')[0].appendChild(script);
|
38 |
+
}
|
39 |
+
},
|
40 |
+
REQUIRED_PROTOTYPE: '1.6.0.3',
|
41 |
+
load: function() {
|
42 |
+
function convertVersionString(versionString) {
|
43 |
+
var v = versionString.replace(/_.*|\./g, '');
|
44 |
+
v = parseInt(v + '0'.times(4-v.length));
|
45 |
+
return versionString.indexOf('_') > -1 ? v-1 : v;
|
46 |
+
}
|
47 |
+
|
48 |
+
if((typeof Prototype=='undefined') ||
|
49 |
+
(typeof Element == 'undefined') ||
|
50 |
+
(typeof Element.Methods=='undefined') ||
|
51 |
+
(convertVersionString(Prototype.Version) <
|
52 |
+
convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
|
53 |
+
throw("script.aculo.us requires the Prototype JavaScript framework >= " +
|
54 |
+
Scriptaculous.REQUIRED_PROTOTYPE);
|
55 |
+
|
56 |
+
var js = /scriptaculous\.js(\?.*)?$/;
|
57 |
+
$$('script[src]').findAll(function(s) {
|
58 |
+
return s.src.match(js);
|
59 |
+
}).each(function(s) {
|
60 |
+
var path = s.src.replace(js, ''),
|
61 |
+
includes = s.src.match(/\?.*load=([a-z,]*)/);
|
62 |
+
(includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each(
|
63 |
+
function(include) { Scriptaculous.require(path+include+'.js') });
|
64 |
+
});
|
65 |
+
}
|
66 |
+
};
|
67 |
+
|
68 |
+
Scriptaculous.load();
|
skin/frontend/base/default/js/ajaxwishlist/lightview/slider.js
ADDED
@@ -0,0 +1,275 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// script.aculo.us slider.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
|
2 |
+
|
3 |
+
// Copyright (c) 2005-2010 Marty Haught, Thomas Fuchs
|
4 |
+
//
|
5 |
+
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
6 |
+
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
7 |
+
|
8 |
+
if (!Control) var Control = { };
|
9 |
+
|
10 |
+
// options:
|
11 |
+
// axis: 'vertical', or 'horizontal' (default)
|
12 |
+
//
|
13 |
+
// callbacks:
|
14 |
+
// onChange(value)
|
15 |
+
// onSlide(value)
|
16 |
+
Control.Slider = Class.create({
|
17 |
+
initialize: function(handle, track, options) {
|
18 |
+
var slider = this;
|
19 |
+
|
20 |
+
if (Object.isArray(handle)) {
|
21 |
+
this.handles = handle.collect( function(e) { return $(e) });
|
22 |
+
} else {
|
23 |
+
this.handles = [$(handle)];
|
24 |
+
}
|
25 |
+
|
26 |
+
this.track = $(track);
|
27 |
+
this.options = options || { };
|
28 |
+
|
29 |
+
this.axis = this.options.axis || 'horizontal';
|
30 |
+
this.increment = this.options.increment || 1;
|
31 |
+
this.step = parseInt(this.options.step || '1');
|
32 |
+
this.range = this.options.range || $R(0,1);
|
33 |
+
|
34 |
+
this.value = 0; // assure backwards compat
|
35 |
+
this.values = this.handles.map( function() { return 0 });
|
36 |
+
this.spans = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : false;
|
37 |
+
this.options.startSpan = $(this.options.startSpan || null);
|
38 |
+
this.options.endSpan = $(this.options.endSpan || null);
|
39 |
+
|
40 |
+
this.restricted = this.options.restricted || false;
|
41 |
+
|
42 |
+
this.maximum = this.options.maximum || this.range.end;
|
43 |
+
this.minimum = this.options.minimum || this.range.start;
|
44 |
+
|
45 |
+
// Will be used to align the handle onto the track, if necessary
|
46 |
+
this.alignX = parseInt(this.options.alignX || '0');
|
47 |
+
this.alignY = parseInt(this.options.alignY || '0');
|
48 |
+
|
49 |
+
this.trackLength = this.maximumOffset() - this.minimumOffset();
|
50 |
+
|
51 |
+
this.handleLength = this.isVertical() ?
|
52 |
+
(this.handles[0].offsetHeight != 0 ?
|
53 |
+
this.handles[0].offsetHeight : this.handles[0].style.height.replace(/px$/,"")) :
|
54 |
+
(this.handles[0].offsetWidth != 0 ? this.handles[0].offsetWidth :
|
55 |
+
this.handles[0].style.width.replace(/px$/,""));
|
56 |
+
|
57 |
+
this.active = false;
|
58 |
+
this.dragging = false;
|
59 |
+
this.disabled = false;
|
60 |
+
|
61 |
+
if (this.options.disabled) this.setDisabled();
|
62 |
+
|
63 |
+
// Allowed values array
|
64 |
+
this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false;
|
65 |
+
if (this.allowedValues) {
|
66 |
+
this.minimum = this.allowedValues.min();
|
67 |
+
this.maximum = this.allowedValues.max();
|
68 |
+
}
|
69 |
+
|
70 |
+
this.eventMouseDown = this.startDrag.bindAsEventListener(this);
|
71 |
+
this.eventMouseUp = this.endDrag.bindAsEventListener(this);
|
72 |
+
this.eventMouseMove = this.update.bindAsEventListener(this);
|
73 |
+
|
74 |
+
// Initialize handles in reverse (make sure first handle is active)
|
75 |
+
this.handles.each( function(h,i) {
|
76 |
+
i = slider.handles.length-1-i;
|
77 |
+
slider.setValue(parseFloat(
|
78 |
+
(Object.isArray(slider.options.sliderValue) ?
|
79 |
+
slider.options.sliderValue[i] : slider.options.sliderValue) ||
|
80 |
+
slider.range.start), i);
|
81 |
+
h.makePositioned().observe("mousedown", slider.eventMouseDown);
|
82 |
+
});
|
83 |
+
|
84 |
+
this.track.observe("mousedown", this.eventMouseDown);
|
85 |
+
document.observe("mouseup", this.eventMouseUp);
|
86 |
+
document.observe("mousemove", this.eventMouseMove);
|
87 |
+
|
88 |
+
this.initialized = true;
|
89 |
+
},
|
90 |
+
dispose: function() {
|
91 |
+
var slider = this;
|
92 |
+
Event.stopObserving(this.track, "mousedown", this.eventMouseDown);
|
93 |
+
Event.stopObserving(document, "mouseup", this.eventMouseUp);
|
94 |
+
Event.stopObserving(document, "mousemove", this.eventMouseMove);
|
95 |
+
this.handles.each( function(h) {
|
96 |
+
Event.stopObserving(h, "mousedown", slider.eventMouseDown);
|
97 |
+
});
|
98 |
+
},
|
99 |
+
setDisabled: function(){
|
100 |
+
this.disabled = true;
|
101 |
+
},
|
102 |
+
setEnabled: function(){
|
103 |
+
this.disabled = false;
|
104 |
+
},
|
105 |
+
getNearestValue: function(value){
|
106 |
+
if (this.allowedValues){
|
107 |
+
if (value >= this.allowedValues.max()) return(this.allowedValues.max());
|
108 |
+
if (value <= this.allowedValues.min()) return(this.allowedValues.min());
|
109 |
+
|
110 |
+
var offset = Math.abs(this.allowedValues[0] - value);
|
111 |
+
var newValue = this.allowedValues[0];
|
112 |
+
this.allowedValues.each( function(v) {
|
113 |
+
var currentOffset = Math.abs(v - value);
|
114 |
+
if (currentOffset <= offset){
|
115 |
+
newValue = v;
|
116 |
+
offset = currentOffset;
|
117 |
+
}
|
118 |
+
});
|
119 |
+
return newValue;
|
120 |
+
}
|
121 |
+
if (value > this.range.end) return this.range.end;
|
122 |
+
if (value < this.range.start) return this.range.start;
|
123 |
+
return value;
|
124 |
+
},
|
125 |
+
setValue: function(sliderValue, handleIdx){
|
126 |
+
if (!this.active) {
|
127 |
+
this.activeHandleIdx = handleIdx || 0;
|
128 |
+
this.activeHandle = this.handles[this.activeHandleIdx];
|
129 |
+
this.updateStyles();
|
130 |
+
}
|
131 |
+
handleIdx = handleIdx || this.activeHandleIdx || 0;
|
132 |
+
if (this.initialized && this.restricted) {
|
133 |
+
if ((handleIdx>0) && (sliderValue<this.values[handleIdx-1]))
|
134 |
+
sliderValue = this.values[handleIdx-1];
|
135 |
+
if ((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1]))
|
136 |
+
sliderValue = this.values[handleIdx+1];
|
137 |
+
}
|
138 |
+
sliderValue = this.getNearestValue(sliderValue);
|
139 |
+
this.values[handleIdx] = sliderValue;
|
140 |
+
this.value = this.values[0]; // assure backwards compat
|
141 |
+
|
142 |
+
this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] =
|
143 |
+
this.translateToPx(sliderValue);
|
144 |
+
|
145 |
+
this.drawSpans();
|
146 |
+
if (!this.dragging || !this.event) this.updateFinished();
|
147 |
+
},
|
148 |
+
setValueBy: function(delta, handleIdx) {
|
149 |
+
this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta,
|
150 |
+
handleIdx || this.activeHandleIdx || 0);
|
151 |
+
},
|
152 |
+
translateToPx: function(value) {
|
153 |
+
return Math.round(
|
154 |
+
((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) *
|
155 |
+
(value - this.range.start)) + "px";
|
156 |
+
},
|
157 |
+
translateToValue: function(offset) {
|
158 |
+
return ((offset/(this.trackLength-this.handleLength) *
|
159 |
+
(this.range.end-this.range.start)) + this.range.start);
|
160 |
+
},
|
161 |
+
getRange: function(range) {
|
162 |
+
var v = this.values.sortBy(Prototype.K);
|
163 |
+
range = range || 0;
|
164 |
+
return $R(v[range],v[range+1]);
|
165 |
+
},
|
166 |
+
minimumOffset: function(){
|
167 |
+
return(this.isVertical() ? this.alignY : this.alignX);
|
168 |
+
},
|
169 |
+
maximumOffset: function(){
|
170 |
+
return(this.isVertical() ?
|
171 |
+
(this.track.offsetHeight != 0 ? this.track.offsetHeight :
|
172 |
+
this.track.style.height.replace(/px$/,"")) - this.alignY :
|
173 |
+
(this.track.offsetWidth != 0 ? this.track.offsetWidth :
|
174 |
+
this.track.style.width.replace(/px$/,"")) - this.alignX);
|
175 |
+
},
|
176 |
+
isVertical: function(){
|
177 |
+
return (this.axis == 'vertical');
|
178 |
+
},
|
179 |
+
drawSpans: function() {
|
180 |
+
var slider = this;
|
181 |
+
if (this.spans)
|
182 |
+
$R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) });
|
183 |
+
if (this.options.startSpan)
|
184 |
+
this.setSpan(this.options.startSpan,
|
185 |
+
$R(0, this.values.length>1 ? this.getRange(0).min() : this.value ));
|
186 |
+
if (this.options.endSpan)
|
187 |
+
this.setSpan(this.options.endSpan,
|
188 |
+
$R(this.values.length>1 ? this.getRange(this.spans.length-1).max() : this.value, this.maximum));
|
189 |
+
},
|
190 |
+
setSpan: function(span, range) {
|
191 |
+
if (this.isVertical()) {
|
192 |
+
span.style.top = this.translateToPx(range.start);
|
193 |
+
span.style.height = this.translateToPx(range.end - range.start + this.range.start);
|
194 |
+
} else {
|
195 |
+
span.style.left = this.translateToPx(range.start);
|
196 |
+
span.style.width = this.translateToPx(range.end - range.start + this.range.start);
|
197 |
+
}
|
198 |
+
},
|
199 |
+
updateStyles: function() {
|
200 |
+
this.handles.each( function(h){ Element.removeClassName(h, 'selected') });
|
201 |
+
Element.addClassName(this.activeHandle, 'selected');
|
202 |
+
},
|
203 |
+
startDrag: function(event) {
|
204 |
+
if (Event.isLeftClick(event)) {
|
205 |
+
if (!this.disabled){
|
206 |
+
this.active = true;
|
207 |
+
|
208 |
+
var handle = Event.element(event);
|
209 |
+
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
210 |
+
var track = handle;
|
211 |
+
if (track==this.track) {
|
212 |
+
var offsets = this.track.cumulativeOffset();
|
213 |
+
this.event = event;
|
214 |
+
this.setValue(this.translateToValue(
|
215 |
+
(this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2)
|
216 |
+
));
|
217 |
+
var offsets = this.activeHandle.cumulativeOffset();
|
218 |
+
this.offsetX = (pointer[0] - offsets[0]);
|
219 |
+
this.offsetY = (pointer[1] - offsets[1]);
|
220 |
+
} else {
|
221 |
+
// find the handle (prevents issues with Safari)
|
222 |
+
while((this.handles.indexOf(handle) == -1) && handle.parentNode)
|
223 |
+
handle = handle.parentNode;
|
224 |
+
|
225 |
+
if (this.handles.indexOf(handle)!=-1) {
|
226 |
+
this.activeHandle = handle;
|
227 |
+
this.activeHandleIdx = this.handles.indexOf(this.activeHandle);
|
228 |
+
this.updateStyles();
|
229 |
+
|
230 |
+
var offsets = this.activeHandle.cumulativeOffset();
|
231 |
+
this.offsetX = (pointer[0] - offsets[0]);
|
232 |
+
this.offsetY = (pointer[1] - offsets[1]);
|
233 |
+
}
|
234 |
+
}
|
235 |
+
}
|
236 |
+
Event.stop(event);
|
237 |
+
}
|
238 |
+
},
|
239 |
+
update: function(event) {
|
240 |
+
if (this.active) {
|
241 |
+
if (!this.dragging) this.dragging = true;
|
242 |
+
this.draw(event);
|
243 |
+
if (Prototype.Browser.WebKit) window.scrollBy(0,0);
|
244 |
+
Event.stop(event);
|
245 |
+
}
|
246 |
+
},
|
247 |
+
draw: function(event) {
|
248 |
+
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
249 |
+
var offsets = this.track.cumulativeOffset();
|
250 |
+
pointer[0] -= this.offsetX + offsets[0];
|
251 |
+
pointer[1] -= this.offsetY + offsets[1];
|
252 |
+
this.event = event;
|
253 |
+
this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] ));
|
254 |
+
if (this.initialized && this.options.onSlide)
|
255 |
+
this.options.onSlide(this.values.length>1 ? this.values : this.value, this);
|
256 |
+
},
|
257 |
+
endDrag: function(event) {
|
258 |
+
if (this.active && this.dragging) {
|
259 |
+
this.finishDrag(event, true);
|
260 |
+
Event.stop(event);
|
261 |
+
}
|
262 |
+
this.active = false;
|
263 |
+
this.dragging = false;
|
264 |
+
},
|
265 |
+
finishDrag: function(event, success) {
|
266 |
+
this.active = false;
|
267 |
+
this.dragging = false;
|
268 |
+
this.updateFinished();
|
269 |
+
},
|
270 |
+
updateFinished: function() {
|
271 |
+
if (this.initialized && this.options.onChange)
|
272 |
+
this.options.onChange(this.values.length>1 ? this.values : this.value, this);
|
273 |
+
this.event = null;
|
274 |
+
}
|
275 |
+
});
|
skin/frontend/base/default/js/ajaxwishlist/lightview/sound.js
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// script.aculo.us sound.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
|
2 |
+
|
3 |
+
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
4 |
+
//
|
5 |
+
// Based on code created by Jules Gravinese (http://www.webveteran.com/)
|
6 |
+
//
|
7 |
+
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
8 |
+
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
9 |
+
|
10 |
+
Sound = {
|
11 |
+
tracks: {},
|
12 |
+
_enabled: true,
|
13 |
+
template:
|
14 |
+
new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'),
|
15 |
+
enable: function(){
|
16 |
+
Sound._enabled = true;
|
17 |
+
},
|
18 |
+
disable: function(){
|
19 |
+
Sound._enabled = false;
|
20 |
+
},
|
21 |
+
play: function(url){
|
22 |
+
if(!Sound._enabled) return;
|
23 |
+
var options = Object.extend({
|
24 |
+
track: 'global', url: url, replace: false
|
25 |
+
}, arguments[1] || {});
|
26 |
+
|
27 |
+
if(options.replace && this.tracks[options.track]) {
|
28 |
+
$R(0, this.tracks[options.track].id).each(function(id){
|
29 |
+
var sound = $('sound_'+options.track+'_'+id);
|
30 |
+
sound.Stop && sound.Stop();
|
31 |
+
sound.remove();
|
32 |
+
});
|
33 |
+
this.tracks[options.track] = null;
|
34 |
+
}
|
35 |
+
|
36 |
+
if(!this.tracks[options.track])
|
37 |
+
this.tracks[options.track] = { id: 0 };
|
38 |
+
else
|
39 |
+
this.tracks[options.track].id++;
|
40 |
+
|
41 |
+
options.id = this.tracks[options.track].id;
|
42 |
+
$$('body')[0].insert(
|
43 |
+
Prototype.Browser.IE ? new Element('bgsound',{
|
44 |
+
id: 'sound_'+options.track+'_'+options.id,
|
45 |
+
src: options.url, loop: 1, autostart: true
|
46 |
+
}) : Sound.template.evaluate(options));
|
47 |
+
}
|
48 |
+
};
|
49 |
+
|
50 |
+
if(Prototype.Browser.Gecko && navigator.userAgent.indexOf("Win") > 0){
|
51 |
+
if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('QuickTime') != -1 }))
|
52 |
+
Sound.template = new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>');
|
53 |
+
else if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('Windows Media') != -1 }))
|
54 |
+
Sound.template = new Template('<object id="sound_#{track}_#{id}" type="application/x-mplayer2" data="#{url}"></object>');
|
55 |
+
else if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('RealPlayer') != -1 }))
|
56 |
+
Sound.template = new Template('<embed type="audio/x-pn-realaudio-plugin" style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>');
|
57 |
+
else
|
58 |
+
Sound.play = function(){};
|
59 |
+
}
|
skin/frontend/base/default/js/ajaxwishlist/lightview/unittest.js
ADDED
@@ -0,0 +1,568 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// script.aculo.us unittest.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
|
2 |
+
|
3 |
+
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
4 |
+
// (c) 2005-2010 Jon Tirsen (http://www.tirsen.com)
|
5 |
+
// (c) 2005-2010 Michael Schuerig (http://www.schuerig.de/michael/)
|
6 |
+
//
|
7 |
+
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
8 |
+
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
9 |
+
|
10 |
+
// experimental, Firefox-only
|
11 |
+
Event.simulateMouse = function(element, eventName) {
|
12 |
+
var options = Object.extend({
|
13 |
+
pointerX: 0,
|
14 |
+
pointerY: 0,
|
15 |
+
buttons: 0,
|
16 |
+
ctrlKey: false,
|
17 |
+
altKey: false,
|
18 |
+
shiftKey: false,
|
19 |
+
metaKey: false
|
20 |
+
}, arguments[2] || {});
|
21 |
+
var oEvent = document.createEvent("MouseEvents");
|
22 |
+
oEvent.initMouseEvent(eventName, true, true, document.defaultView,
|
23 |
+
options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY,
|
24 |
+
options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, 0, $(element));
|
25 |
+
|
26 |
+
if(this.mark) Element.remove(this.mark);
|
27 |
+
this.mark = document.createElement('div');
|
28 |
+
this.mark.appendChild(document.createTextNode(" "));
|
29 |
+
document.body.appendChild(this.mark);
|
30 |
+
this.mark.style.position = 'absolute';
|
31 |
+
this.mark.style.top = options.pointerY + "px";
|
32 |
+
this.mark.style.left = options.pointerX + "px";
|
33 |
+
this.mark.style.width = "5px";
|
34 |
+
this.mark.style.height = "5px;";
|
35 |
+
this.mark.style.borderTop = "1px solid red;";
|
36 |
+
this.mark.style.borderLeft = "1px solid red;";
|
37 |
+
|
38 |
+
if(this.step)
|
39 |
+
alert('['+new Date().getTime().toString()+'] '+eventName+'/'+Test.Unit.inspect(options));
|
40 |
+
|
41 |
+
$(element).dispatchEvent(oEvent);
|
42 |
+
};
|
43 |
+
|
44 |
+
// Note: Due to a fix in Firefox 1.0.5/6 that probably fixed "too much", this doesn't work in 1.0.6 or DP2.
|
45 |
+
// You need to downgrade to 1.0.4 for now to get this working
|
46 |
+
// See https://bugzilla.mozilla.org/show_bug.cgi?id=289940 for the fix that fixed too much
|
47 |
+
Event.simulateKey = function(element, eventName) {
|
48 |
+
var options = Object.extend({
|
49 |
+
ctrlKey: false,
|
50 |
+
altKey: false,
|
51 |
+
shiftKey: false,
|
52 |
+
metaKey: false,
|
53 |
+
keyCode: 0,
|
54 |
+
charCode: 0
|
55 |
+
}, arguments[2] || {});
|
56 |
+
|
57 |
+
var oEvent = document.createEvent("KeyEvents");
|
58 |
+
oEvent.initKeyEvent(eventName, true, true, window,
|
59 |
+
options.ctrlKey, options.altKey, options.shiftKey, options.metaKey,
|
60 |
+
options.keyCode, options.charCode );
|
61 |
+
$(element).dispatchEvent(oEvent);
|
62 |
+
};
|
63 |
+
|
64 |
+
Event.simulateKeys = function(element, command) {
|
65 |
+
for(var i=0; i<command.length; i++) {
|
66 |
+
Event.simulateKey(element,'keypress',{charCode:command.charCodeAt(i)});
|
67 |
+
}
|
68 |
+
};
|
69 |
+
|
70 |
+
var Test = {};
|
71 |
+
Test.Unit = {};
|
72 |
+
|
73 |
+
// security exception workaround
|
74 |
+
Test.Unit.inspect = Object.inspect;
|
75 |
+
|
76 |
+
Test.Unit.Logger = Class.create();
|
77 |
+
Test.Unit.Logger.prototype = {
|
78 |
+
initialize: function(log) {
|
79 |
+
this.log = $(log);
|
80 |
+
if (this.log) {
|
81 |
+
this._createLogTable();
|
82 |
+
}
|
83 |
+
},
|
84 |
+
start: function(testName) {
|
85 |
+
if (!this.log) return;
|
86 |
+
this.testName = testName;
|
87 |
+
this.lastLogLine = document.createElement('tr');
|
88 |
+
this.statusCell = document.createElement('td');
|
89 |
+
this.nameCell = document.createElement('td');
|
90 |
+
this.nameCell.className = "nameCell";
|
91 |
+
this.nameCell.appendChild(document.createTextNode(testName));
|
92 |
+
this.messageCell = document.createElement('td');
|
93 |
+
this.lastLogLine.appendChild(this.statusCell);
|
94 |
+
this.lastLogLine.appendChild(this.nameCell);
|
95 |
+
this.lastLogLine.appendChild(this.messageCell);
|
96 |
+
this.loglines.appendChild(this.lastLogLine);
|
97 |
+
},
|
98 |
+
finish: function(status, summary) {
|
99 |
+
if (!this.log) return;
|
100 |
+
this.lastLogLine.className = status;
|
101 |
+
this.statusCell.innerHTML = status;
|
102 |
+
this.messageCell.innerHTML = this._toHTML(summary);
|
103 |
+
this.addLinksToResults();
|
104 |
+
},
|
105 |
+
message: function(message) {
|
106 |
+
if (!this.log) return;
|
107 |
+
this.messageCell.innerHTML = this._toHTML(message);
|
108 |
+
},
|
109 |
+
summary: function(summary) {
|
110 |
+
if (!this.log) return;
|
111 |
+
this.logsummary.innerHTML = this._toHTML(summary);
|
112 |
+
},
|
113 |
+
_createLogTable: function() {
|
114 |
+
this.log.innerHTML =
|
115 |
+
'<div id="logsummary"></div>' +
|
116 |
+
'<table id="logtable">' +
|
117 |
+
'<thead><tr><th>Status</th><th>Test</th><th>Message</th></tr></thead>' +
|
118 |
+
'<tbody id="loglines"></tbody>' +
|
119 |
+
'</table>';
|
120 |
+
this.logsummary = $('logsummary');
|
121 |
+
this.loglines = $('loglines');
|
122 |
+
},
|
123 |
+
_toHTML: function(txt) {
|
124 |
+
return txt.escapeHTML().replace(/\n/g,"<br/>");
|
125 |
+
},
|
126 |
+
addLinksToResults: function(){
|
127 |
+
$$("tr.failed .nameCell").each( function(td){ // todo: limit to children of this.log
|
128 |
+
td.title = "Run only this test";
|
129 |
+
Event.observe(td, 'click', function(){ window.location.search = "?tests=" + td.innerHTML;});
|
130 |
+
});
|
131 |
+
$$("tr.passed .nameCell").each( function(td){ // todo: limit to children of this.log
|
132 |
+
td.title = "Run all tests";
|
133 |
+
Event.observe(td, 'click', function(){ window.location.search = "";});
|
134 |
+
});
|
135 |
+
}
|
136 |
+
};
|
137 |
+
|
138 |
+
Test.Unit.Runner = Class.create();
|
139 |
+
Test.Unit.Runner.prototype = {
|
140 |
+
initialize: function(testcases) {
|
141 |
+
this.options = Object.extend({
|
142 |
+
testLog: 'testlog'
|
143 |
+
}, arguments[1] || {});
|
144 |
+
this.options.resultsURL = this.parseResultsURLQueryParameter();
|
145 |
+
this.options.tests = this.parseTestsQueryParameter();
|
146 |
+
if (this.options.testLog) {
|
147 |
+
this.options.testLog = $(this.options.testLog) || null;
|
148 |
+
}
|
149 |
+
if(this.options.tests) {
|
150 |
+
this.tests = [];
|
151 |
+
for(var i = 0; i < this.options.tests.length; i++) {
|
152 |
+
if(/^test/.test(this.options.tests[i])) {
|
153 |
+
this.tests.push(new Test.Unit.Testcase(this.options.tests[i], testcases[this.options.tests[i]], testcases["setup"], testcases["teardown"]));
|
154 |
+
}
|
155 |
+
}
|
156 |
+
} else {
|
157 |
+
if (this.options.test) {
|
158 |
+
this.tests = [new Test.Unit.Testcase(this.options.test, testcases[this.options.test], testcases["setup"], testcases["teardown"])];
|
159 |
+
} else {
|
160 |
+
this.tests = [];
|
161 |
+
for(var testcase in testcases) {
|
162 |
+
if(/^test/.test(testcase)) {
|
163 |
+
this.tests.push(
|
164 |
+
new Test.Unit.Testcase(
|
165 |
+
this.options.context ? ' -> ' + this.options.titles[testcase] : testcase,
|
166 |
+
testcases[testcase], testcases["setup"], testcases["teardown"]
|
167 |
+
));
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
}
|
172 |
+
this.currentTest = 0;
|
173 |
+
this.logger = new Test.Unit.Logger(this.options.testLog);
|
174 |
+
setTimeout(this.runTests.bind(this), 1000);
|
175 |
+
},
|
176 |
+
parseResultsURLQueryParameter: function() {
|
177 |
+
return window.location.search.parseQuery()["resultsURL"];
|
178 |
+
},
|
179 |
+
parseTestsQueryParameter: function(){
|
180 |
+
if (window.location.search.parseQuery()["tests"]){
|
181 |
+
return window.location.search.parseQuery()["tests"].split(',');
|
182 |
+
};
|
183 |
+
},
|
184 |
+
// Returns:
|
185 |
+
// "ERROR" if there was an error,
|
186 |
+
// "FAILURE" if there was a failure, or
|
187 |
+
// "SUCCESS" if there was neither
|
188 |
+
getResult: function() {
|
189 |
+
var hasFailure = false;
|
190 |
+
for(var i=0;i<this.tests.length;i++) {
|
191 |
+
if (this.tests[i].errors > 0) {
|
192 |
+
return "ERROR";
|
193 |
+
}
|
194 |
+
if (this.tests[i].failures > 0) {
|
195 |
+
hasFailure = true;
|
196 |
+
}
|
197 |
+
}
|
198 |
+
if (hasFailure) {
|
199 |
+
return "FAILURE";
|
200 |
+
} else {
|
201 |
+
return "SUCCESS";
|
202 |
+
}
|
203 |
+
},
|
204 |
+
postResults: function() {
|
205 |
+
if (this.options.resultsURL) {
|
206 |
+
new Ajax.Request(this.options.resultsURL,
|
207 |
+
{ method: 'get', parameters: 'result=' + this.getResult(), asynchronous: false });
|
208 |
+
}
|
209 |
+
},
|
210 |
+
runTests: function() {
|
211 |
+
var test = this.tests[this.currentTest];
|
212 |
+
if (!test) {
|
213 |
+
// finished!
|
214 |
+
this.postResults();
|
215 |
+
this.logger.summary(this.summary());
|
216 |
+
return;
|
217 |
+
}
|
218 |
+
if(!test.isWaiting) {
|
219 |
+
this.logger.start(test.name);
|
220 |
+
}
|
221 |
+
test.run();
|
222 |
+
if(test.isWaiting) {
|
223 |
+
this.logger.message("Waiting for " + test.timeToWait + "ms");
|
224 |
+
setTimeout(this.runTests.bind(this), test.timeToWait || 1000);
|
225 |
+
} else {
|
226 |
+
this.logger.finish(test.status(), test.summary());
|
227 |
+
this.currentTest++;
|
228 |
+
// tail recursive, hopefully the browser will skip the stackframe
|
229 |
+
this.runTests();
|
230 |
+
}
|
231 |
+
},
|
232 |
+
summary: function() {
|
233 |
+
var assertions = 0;
|
234 |
+
var failures = 0;
|
235 |
+
var errors = 0;
|
236 |
+
var messages = [];
|
237 |
+
for(var i=0;i<this.tests.length;i++) {
|
238 |
+
assertions += this.tests[i].assertions;
|
239 |
+
failures += this.tests[i].failures;
|
240 |
+
errors += this.tests[i].errors;
|
241 |
+
}
|
242 |
+
return (
|
243 |
+
(this.options.context ? this.options.context + ': ': '') +
|
244 |
+
this.tests.length + " tests, " +
|
245 |
+
assertions + " assertions, " +
|
246 |
+
failures + " failures, " +
|
247 |
+
errors + " errors");
|
248 |
+
}
|
249 |
+
};
|
250 |
+
|
251 |
+
Test.Unit.Assertions = Class.create();
|
252 |
+
Test.Unit.Assertions.prototype = {
|
253 |
+
initialize: function() {
|
254 |
+
this.assertions = 0;
|
255 |
+
this.failures = 0;
|
256 |
+
this.errors = 0;
|
257 |
+
this.messages = [];
|
258 |
+
},
|
259 |
+
summary: function() {
|
260 |
+
return (
|
261 |
+
this.assertions + " assertions, " +
|
262 |
+
this.failures + " failures, " +
|
263 |
+
this.errors + " errors" + "\n" +
|
264 |
+
this.messages.join("\n"));
|
265 |
+
},
|
266 |
+
pass: function() {
|
267 |
+
this.assertions++;
|
268 |
+
},
|
269 |
+
fail: function(message) {
|
270 |
+
this.failures++;
|
271 |
+
this.messages.push("Failure: " + message);
|
272 |
+
},
|
273 |
+
info: function(message) {
|
274 |
+
this.messages.push("Info: " + message);
|
275 |
+
},
|
276 |
+
error: function(error) {
|
277 |
+
this.errors++;
|
278 |
+
this.messages.push(error.name + ": "+ error.message + "(" + Test.Unit.inspect(error) +")");
|
279 |
+
},
|
280 |
+
status: function() {
|
281 |
+
if (this.failures > 0) return 'failed';
|
282 |
+
if (this.errors > 0) return 'error';
|
283 |
+
return 'passed';
|
284 |
+
},
|
285 |
+
assert: function(expression) {
|
286 |
+
var message = arguments[1] || 'assert: got "' + Test.Unit.inspect(expression) + '"';
|
287 |
+
try { expression ? this.pass() :
|
288 |
+
this.fail(message); }
|
289 |
+
catch(e) { this.error(e); }
|
290 |
+
},
|
291 |
+
assertEqual: function(expected, actual) {
|
292 |
+
var message = arguments[2] || "assertEqual";
|
293 |
+
try { (expected == actual) ? this.pass() :
|
294 |
+
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
295 |
+
'", actual "' + Test.Unit.inspect(actual) + '"'); }
|
296 |
+
catch(e) { this.error(e); }
|
297 |
+
},
|
298 |
+
assertInspect: function(expected, actual) {
|
299 |
+
var message = arguments[2] || "assertInspect";
|
300 |
+
try { (expected == actual.inspect()) ? this.pass() :
|
301 |
+
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
302 |
+
'", actual "' + Test.Unit.inspect(actual) + '"'); }
|
303 |
+
catch(e) { this.error(e); }
|
304 |
+
},
|
305 |
+
assertEnumEqual: function(expected, actual) {
|
306 |
+
var message = arguments[2] || "assertEnumEqual";
|
307 |
+
try { $A(expected).length == $A(actual).length &&
|
308 |
+
expected.zip(actual).all(function(pair) { return pair[0] == pair[1] }) ?
|
309 |
+
this.pass() : this.fail(message + ': expected ' + Test.Unit.inspect(expected) +
|
310 |
+
', actual ' + Test.Unit.inspect(actual)); }
|
311 |
+
catch(e) { this.error(e); }
|
312 |
+
},
|
313 |
+
assertNotEqual: function(expected, actual) {
|
314 |
+
var message = arguments[2] || "assertNotEqual";
|
315 |
+
try { (expected != actual) ? this.pass() :
|
316 |
+
this.fail(message + ': got "' + Test.Unit.inspect(actual) + '"'); }
|
317 |
+
catch(e) { this.error(e); }
|
318 |
+
},
|
319 |
+
assertIdentical: function(expected, actual) {
|
320 |
+
var message = arguments[2] || "assertIdentical";
|
321 |
+
try { (expected === actual) ? this.pass() :
|
322 |
+
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
323 |
+
'", actual "' + Test.Unit.inspect(actual) + '"'); }
|
324 |
+
catch(e) { this.error(e); }
|
325 |
+
},
|
326 |
+
assertNotIdentical: function(expected, actual) {
|
327 |
+
var message = arguments[2] || "assertNotIdentical";
|
328 |
+
try { !(expected === actual) ? this.pass() :
|
329 |
+
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
330 |
+
'", actual "' + Test.Unit.inspect(actual) + '"'); }
|
331 |
+
catch(e) { this.error(e); }
|
332 |
+
},
|
333 |
+
assertNull: function(obj) {
|
334 |
+
var message = arguments[1] || 'assertNull';
|
335 |
+
try { (obj==null) ? this.pass() :
|
336 |
+
this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); }
|
337 |
+
catch(e) { this.error(e); }
|
338 |
+
},
|
339 |
+
assertMatch: function(expected, actual) {
|
340 |
+
var message = arguments[2] || 'assertMatch';
|
341 |
+
var regex = new RegExp(expected);
|
342 |
+
try { (regex.exec(actual)) ? this.pass() :
|
343 |
+
this.fail(message + ' : regex: "' + Test.Unit.inspect(expected) + ' did not match: ' + Test.Unit.inspect(actual) + '"'); }
|
344 |
+
catch(e) { this.error(e); }
|
345 |
+
},
|
346 |
+
assertHidden: function(element) {
|
347 |
+
var message = arguments[1] || 'assertHidden';
|
348 |
+
this.assertEqual("none", element.style.display, message);
|
349 |
+
},
|
350 |
+
assertNotNull: function(object) {
|
351 |
+
var message = arguments[1] || 'assertNotNull';
|
352 |
+
this.assert(object != null, message);
|
353 |
+
},
|
354 |
+
assertType: function(expected, actual) {
|
355 |
+
var message = arguments[2] || 'assertType';
|
356 |
+
try {
|
357 |
+
(actual.constructor == expected) ? this.pass() :
|
358 |
+
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
359 |
+
'", actual "' + (actual.constructor) + '"'); }
|
360 |
+
catch(e) { this.error(e); }
|
361 |
+
},
|
362 |
+
assertNotOfType: function(expected, actual) {
|
363 |
+
var message = arguments[2] || 'assertNotOfType';
|
364 |
+
try {
|
365 |
+
(actual.constructor != expected) ? this.pass() :
|
366 |
+
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
367 |
+
'", actual "' + (actual.constructor) + '"'); }
|
368 |
+
catch(e) { this.error(e); }
|
369 |
+
},
|
370 |
+
assertInstanceOf: function(expected, actual) {
|
371 |
+
var message = arguments[2] || 'assertInstanceOf';
|
372 |
+
try {
|
373 |
+
(actual instanceof expected) ? this.pass() :
|
374 |
+
this.fail(message + ": object was not an instance of the expected type"); }
|
375 |
+
catch(e) { this.error(e); }
|
376 |
+
},
|
377 |
+
assertNotInstanceOf: function(expected, actual) {
|
378 |
+
var message = arguments[2] || 'assertNotInstanceOf';
|
379 |
+
try {
|
380 |
+
!(actual instanceof expected) ? this.pass() :
|
381 |
+
this.fail(message + ": object was an instance of the not expected type"); }
|
382 |
+
catch(e) { this.error(e); }
|
383 |
+
},
|
384 |
+
assertRespondsTo: function(method, obj) {
|
385 |
+
var message = arguments[2] || 'assertRespondsTo';
|
386 |
+
try {
|
387 |
+
(obj[method] && typeof obj[method] == 'function') ? this.pass() :
|
388 |
+
this.fail(message + ": object doesn't respond to [" + method + "]"); }
|
389 |
+
catch(e) { this.error(e); }
|
390 |
+
},
|
391 |
+
assertReturnsTrue: function(method, obj) {
|
392 |
+
var message = arguments[2] || 'assertReturnsTrue';
|
393 |
+
try {
|
394 |
+
var m = obj[method];
|
395 |
+
if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)];
|
396 |
+
m() ? this.pass() :
|
397 |
+
this.fail(message + ": method returned false"); }
|
398 |
+
catch(e) { this.error(e); }
|
399 |
+
},
|
400 |
+
assertReturnsFalse: function(method, obj) {
|
401 |
+
var message = arguments[2] || 'assertReturnsFalse';
|
402 |
+
try {
|
403 |
+
var m = obj[method];
|
404 |
+
if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)];
|
405 |
+
!m() ? this.pass() :
|
406 |
+
this.fail(message + ": method returned true"); }
|
407 |
+
catch(e) { this.error(e); }
|
408 |
+
},
|
409 |
+
assertRaise: function(exceptionName, method) {
|
410 |
+
var message = arguments[2] || 'assertRaise';
|
411 |
+
try {
|
412 |
+
method();
|
413 |
+
this.fail(message + ": exception expected but none was raised"); }
|
414 |
+
catch(e) {
|
415 |
+
((exceptionName == null) || (e.name==exceptionName)) ? this.pass() : this.error(e);
|
416 |
+
}
|
417 |
+
},
|
418 |
+
assertElementsMatch: function() {
|
419 |
+
var expressions = $A(arguments), elements = $A(expressions.shift());
|
420 |
+
if (elements.length != expressions.length) {
|
421 |
+
this.fail('assertElementsMatch: size mismatch: ' + elements.length + ' elements, ' + expressions.length + ' expressions');
|
422 |
+
return false;
|
423 |
+
}
|
424 |
+
elements.zip(expressions).all(function(pair, index) {
|
425 |
+
var element = $(pair.first()), expression = pair.last();
|
426 |
+
if (element.match(expression)) return true;
|
427 |
+
this.fail('assertElementsMatch: (in index ' + index + ') expected ' + expression.inspect() + ' but got ' + element.inspect());
|
428 |
+
}.bind(this)) && this.pass();
|
429 |
+
},
|
430 |
+
assertElementMatches: function(element, expression) {
|
431 |
+
this.assertElementsMatch([element], expression);
|
432 |
+
},
|
433 |
+
benchmark: function(operation, iterations) {
|
434 |
+
var startAt = new Date();
|
435 |
+
(iterations || 1).times(operation);
|
436 |
+
var timeTaken = ((new Date())-startAt);
|
437 |
+
this.info((arguments[2] || 'Operation') + ' finished ' +
|
438 |
+
iterations + ' iterations in ' + (timeTaken/1000)+'s' );
|
439 |
+
return timeTaken;
|
440 |
+
},
|
441 |
+
_isVisible: function(element) {
|
442 |
+
element = $(element);
|
443 |
+
if(!element.parentNode) return true;
|
444 |
+
this.assertNotNull(element);
|
445 |
+
if(element.style && Element.getStyle(element, 'display') == 'none')
|
446 |
+
return false;
|
447 |
+
|
448 |
+
return this._isVisible(element.parentNode);
|
449 |
+
},
|
450 |
+
assertNotVisible: function(element) {
|
451 |
+
this.assert(!this._isVisible(element), Test.Unit.inspect(element) + " was not hidden and didn't have a hidden parent either. " + ("" || arguments[1]));
|
452 |
+
},
|
453 |
+
assertVisible: function(element) {
|
454 |
+
this.assert(this._isVisible(element), Test.Unit.inspect(element) + " was not visible. " + ("" || arguments[1]));
|
455 |
+
},
|
456 |
+
benchmark: function(operation, iterations) {
|
457 |
+
var startAt = new Date();
|
458 |
+
(iterations || 1).times(operation);
|
459 |
+
var timeTaken = ((new Date())-startAt);
|
460 |
+
this.info((arguments[2] || 'Operation') + ' finished ' +
|
461 |
+
iterations + ' iterations in ' + (timeTaken/1000)+'s' );
|
462 |
+
return timeTaken;
|
463 |
+
}
|
464 |
+
};
|
465 |
+
|
466 |
+
Test.Unit.Testcase = Class.create();
|
467 |
+
Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.prototype), {
|
468 |
+
initialize: function(name, test, setup, teardown) {
|
469 |
+
Test.Unit.Assertions.prototype.initialize.bind(this)();
|
470 |
+
this.name = name;
|
471 |
+
|
472 |
+
if(typeof test == 'string') {
|
473 |
+
test = test.gsub(/(\.should[^\(]+\()/,'#{0}this,');
|
474 |
+
test = test.gsub(/(\.should[^\(]+)\(this,\)/,'#{1}(this)');
|
475 |
+
this.test = function() {
|
476 |
+
eval('with(this){'+test+'}');
|
477 |
+
}
|
478 |
+
} else {
|
479 |
+
this.test = test || function() {};
|
480 |
+
}
|
481 |
+
|
482 |
+
this.setup = setup || function() {};
|
483 |
+
this.teardown = teardown || function() {};
|
484 |
+
this.isWaiting = false;
|
485 |
+
this.timeToWait = 1000;
|
486 |
+
},
|
487 |
+
wait: function(time, nextPart) {
|
488 |
+
this.isWaiting = true;
|
489 |
+
this.test = nextPart;
|
490 |
+
this.timeToWait = time;
|
491 |
+
},
|
492 |
+
run: function() {
|
493 |
+
try {
|
494 |
+
try {
|
495 |
+
if (!this.isWaiting) this.setup.bind(this)();
|
496 |
+
this.isWaiting = false;
|
497 |
+
this.test.bind(this)();
|
498 |
+
} finally {
|
499 |
+
if(!this.isWaiting) {
|
500 |
+
this.teardown.bind(this)();
|
501 |
+
}
|
502 |
+
}
|
503 |
+
}
|
504 |
+
catch(e) { this.error(e); }
|
505 |
+
}
|
506 |
+
});
|
507 |
+
|
508 |
+
// *EXPERIMENTAL* BDD-style testing to please non-technical folk
|
509 |
+
// This draws many ideas from RSpec http://rspec.rubyforge.org/
|
510 |
+
|
511 |
+
Test.setupBDDExtensionMethods = function(){
|
512 |
+
var METHODMAP = {
|
513 |
+
shouldEqual: 'assertEqual',
|
514 |
+
shouldNotEqual: 'assertNotEqual',
|
515 |
+
shouldEqualEnum: 'assertEnumEqual',
|
516 |
+
shouldBeA: 'assertType',
|
517 |
+
shouldNotBeA: 'assertNotOfType',
|
518 |
+
shouldBeAn: 'assertType',
|
519 |
+
shouldNotBeAn: 'assertNotOfType',
|
520 |
+
shouldBeNull: 'assertNull',
|
521 |
+
shouldNotBeNull: 'assertNotNull',
|
522 |
+
|
523 |
+
shouldBe: 'assertReturnsTrue',
|
524 |
+
shouldNotBe: 'assertReturnsFalse',
|
525 |
+
shouldRespondTo: 'assertRespondsTo'
|
526 |
+
};
|
527 |
+
var makeAssertion = function(assertion, args, object) {
|
528 |
+
this[assertion].apply(this,(args || []).concat([object]));
|
529 |
+
};
|
530 |
+
|
531 |
+
Test.BDDMethods = {};
|
532 |
+
$H(METHODMAP).each(function(pair) {
|
533 |
+
Test.BDDMethods[pair.key] = function() {
|
534 |
+
var args = $A(arguments);
|
535 |
+
var scope = args.shift();
|
536 |
+
makeAssertion.apply(scope, [pair.value, args, this]); };
|
537 |
+
});
|
538 |
+
|
539 |
+
[Array.prototype, String.prototype, Number.prototype, Boolean.prototype].each(
|
540 |
+
function(p){ Object.extend(p, Test.BDDMethods) }
|
541 |
+
);
|
542 |
+
};
|
543 |
+
|
544 |
+
Test.context = function(name, spec, log){
|
545 |
+
Test.setupBDDExtensionMethods();
|
546 |
+
|
547 |
+
var compiledSpec = {};
|
548 |
+
var titles = {};
|
549 |
+
for(specName in spec) {
|
550 |
+
switch(specName){
|
551 |
+
case "setup":
|
552 |
+
case "teardown":
|
553 |
+
compiledSpec[specName] = spec[specName];
|
554 |
+
break;
|
555 |
+
default:
|
556 |
+
var testName = 'test'+specName.gsub(/\s+/,'-').camelize();
|
557 |
+
var body = spec[specName].toString().split('\n').slice(1);
|
558 |
+
if(/^\{/.test(body[0])) body = body.slice(1);
|
559 |
+
body.pop();
|
560 |
+
body = body.map(function(statement){
|
561 |
+
return statement.strip()
|
562 |
+
});
|
563 |
+
compiledSpec[testName] = body.join('\n');
|
564 |
+
titles[testName] = specName;
|
565 |
+
}
|
566 |
+
}
|
567 |
+
new Test.Unit.Runner(compiledSpec, { titles: titles, testLog: log || 'testlog', context: name });
|
568 |
+
};
|
skin/frontend/default/default/js/fancybox/blank.gif
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_close.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_loading.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_nav_left.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_nav_right.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_shadow_e.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_shadow_n.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_shadow_ne.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_shadow_nw.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_shadow_s.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_shadow_se.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_shadow_sw.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_shadow_w.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_title_left.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_title_main.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_title_over.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancy_title_right.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancybox-x.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancybox-y.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/fancybox.png
DELETED
Binary file
|
skin/frontend/default/default/js/fancybox/jquery.easing-1.3.pack.js
DELETED
@@ -1,72 +0,0 @@
|
|
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 |
-
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))
|
40 |
-
|
41 |
-
/*
|
42 |
-
*
|
43 |
-
* TERMS OF USE - EASING EQUATIONS
|
44 |
-
*
|
45 |
-
* Open source under the BSD License.
|
46 |
-
*
|
47 |
-
* Copyright © 2001 Robert Penner
|
48 |
-
* All rights reserved.
|
49 |
-
*
|
50 |
-
* Redistribution and use in source and binary forms, with or without modification,
|
51 |
-
* are permitted provided that the following conditions are met:
|
52 |
-
*
|
53 |
-
* Redistributions of source code must retain the above copyright notice, this list of
|
54 |
-
* conditions and the following disclaimer.
|
55 |
-
* Redistributions in binary form must reproduce the above copyright notice, this list
|
56 |
-
* of conditions and the following disclaimer in the documentation and/or other materials
|
57 |
-
* provided with the distribution.
|
58 |
-
*
|
59 |
-
* Neither the name of the author nor the names of contributors may be used to endorse
|
60 |
-
* or promote products derived from this software without specific prior written permission.
|
61 |
-
*
|
62 |
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
63 |
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
64 |
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
65 |
-
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
66 |
-
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
67 |
-
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
68 |
-
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
69 |
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
70 |
-
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
71 |
-
*
|
72 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skin/frontend/default/default/js/fancybox/jquery.fancybox-1.3.4.css
DELETED
@@ -1,358 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* FancyBox - jQuery Plugin
|
3 |
-
* Simple and fancy lightbox alternative
|
4 |
-
*
|
5 |
-
* Examples and documentation at: http://fancybox.net
|
6 |
-
*
|
7 |
-
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
8 |
-
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
9 |
-
*
|
10 |
-
* Version: 1.3.4 (11/11/2010)
|
11 |
-
* Requires: jQuery v1.3+
|
12 |
-
*
|
13 |
-
* Dual licensed under the MIT and GPL licenses:
|
14 |
-
* http://www.opensource.org/licenses/mit-license.php
|
15 |
-
* http://www.gnu.org/licenses/gpl.html
|
16 |
-
*/
|
17 |
-
#fancybox-loading {
|
18 |
-
position: fixed;
|
19 |
-
top: 50%;
|
20 |
-
left: 50%;
|
21 |
-
width: 40px;
|
22 |
-
height: 40px;
|
23 |
-
margin-top: -20px;
|
24 |
-
margin-left: -20px;
|
25 |
-
cursor: pointer;
|
26 |
-
overflow: hidden;
|
27 |
-
z-index: 1104;
|
28 |
-
display: none;
|
29 |
-
}
|
30 |
-
|
31 |
-
#fancybox-loading div {
|
32 |
-
position: absolute;
|
33 |
-
top: 0;
|
34 |
-
left: 0;
|
35 |
-
width: 40px;
|
36 |
-
height: 480px;
|
37 |
-
background-image: url('fancybox.png');
|
38 |
-
}
|
39 |
-
|
40 |
-
#fancybox-overlay {
|
41 |
-
position: absolute;
|
42 |
-
top: 0;
|
43 |
-
left: 0;
|
44 |
-
width: 100%;
|
45 |
-
z-index: 1100;
|
46 |
-
display: none;
|
47 |
-
}
|
48 |
-
|
49 |
-
#fancybox-tmp {
|
50 |
-
padding: 0;
|
51 |
-
margin: 0;
|
52 |
-
border: 0;
|
53 |
-
overflow: auto;
|
54 |
-
display: none;
|
55 |
-
}
|
56 |
-
|
57 |
-
#fancybox-wrap {
|
58 |
-
position: absolute;
|
59 |
-
top: 0;
|
60 |
-
left: 0;
|
61 |
-
padding: 20px;
|
62 |
-
z-index: 1101;
|
63 |
-
outline: none;
|
64 |
-
display: none;
|
65 |
-
}
|
66 |
-
|
67 |
-
#fancybox-outer {
|
68 |
-
position: relative;
|
69 |
-
width: 100%;
|
70 |
-
height: 100%;
|
71 |
-
background: #fff;
|
72 |
-
}
|
73 |
-
|
74 |
-
#fancybox-content {
|
75 |
-
width: 0;
|
76 |
-
height: 0;
|
77 |
-
padding: 0;
|
78 |
-
outline: none;
|
79 |
-
position: relative;
|
80 |
-
overflow: hidden;
|
81 |
-
z-index: 1102;
|
82 |
-
border: 0px solid #fff;
|
83 |
-
}
|
84 |
-
|
85 |
-
#fancybox-hide-sel-frame {
|
86 |
-
position: absolute;
|
87 |
-
top: 0;
|
88 |
-
left: 0;
|
89 |
-
width: 100%;
|
90 |
-
height: 100%;
|
91 |
-
background: transparent;
|
92 |
-
z-index: 1101;
|
93 |
-
}
|
94 |
-
|
95 |
-
#fancybox-close {
|
96 |
-
position: absolute;
|
97 |
-
top: -15px;
|
98 |
-
right: -15px;
|
99 |
-
width: 30px;
|
100 |
-
height: 30px;
|
101 |
-
background: transparent url('fancybox.png') -40px 0px;
|
102 |
-
cursor: pointer;
|
103 |
-
z-index: 1103;
|
104 |
-
display: none;
|
105 |
-
}
|
106 |
-
|
107 |
-
#fancybox-error {
|
108 |
-
color: #444;
|
109 |
-
font: normal 12px/20px Arial;
|
110 |
-
padding: 14px;
|
111 |
-
margin: 0;
|
112 |
-
}
|
113 |
-
|
114 |
-
#fancybox-img {
|
115 |
-
width: 100%;
|
116 |
-
height: 100%;
|
117 |
-
padding: 0;
|
118 |
-
margin: 0;
|
119 |
-
border: none;
|
120 |
-
outline: none;
|
121 |
-
line-height: 0;
|
122 |
-
vertical-align: top;
|
123 |
-
}
|
124 |
-
|
125 |
-
#fancybox-frame {
|
126 |
-
width: 100%;
|
127 |
-
height: 100%;
|
128 |
-
border: none;
|
129 |
-
display: block;
|
130 |
-
}
|
131 |
-
|
132 |
-
#fancybox-left, #fancybox-right {
|
133 |
-
position: absolute;
|
134 |
-
bottom: 0px;
|
135 |
-
height: 100%;
|
136 |
-
width: 35%;
|
137 |
-
cursor: pointer;
|
138 |
-
outline: none;
|
139 |
-
background: transparent url('blank.gif');
|
140 |
-
z-index: 1102;
|
141 |
-
display: none;
|
142 |
-
}
|
143 |
-
|
144 |
-
#fancybox-left {
|
145 |
-
left: 0px;
|
146 |
-
}
|
147 |
-
|
148 |
-
#fancybox-right {
|
149 |
-
right: 0px;
|
150 |
-
}
|
151 |
-
|
152 |
-
#fancybox-left-ico, #fancybox-right-ico {
|
153 |
-
position: absolute;
|
154 |
-
top: 50%;
|
155 |
-
left: -9999px;
|
156 |
-
width: 30px;
|
157 |
-
height: 30px;
|
158 |
-
margin-top: -15px;
|
159 |
-
cursor: pointer;
|
160 |
-
z-index: 1102;
|
161 |
-
display: block;
|
162 |
-
}
|
163 |
-
|
164 |
-
#fancybox-left-ico {
|
165 |
-
background-image: url('fancybox.png');
|
166 |
-
background-position: -40px -30px;
|
167 |
-
}
|
168 |
-
|
169 |
-
#fancybox-right-ico {
|
170 |
-
background-image: url('fancybox.png');
|
171 |
-
background-position: -40px -60px;
|
172 |
-
}
|
173 |
-
|
174 |
-
#fancybox-left:hover, #fancybox-right:hover {
|
175 |
-
visibility: visible; /* IE6 */
|
176 |
-
}
|
177 |
-
|
178 |
-
#fancybox-left:hover span {
|
179 |
-
left: 20px;
|
180 |
-
}
|
181 |
-
|
182 |
-
#fancybox-right:hover span {
|
183 |
-
left: auto;
|
184 |
-
right: 20px;
|
185 |
-
}
|
186 |
-
|
187 |
-
.fancybox-bg {
|
188 |
-
position: absolute;
|
189 |
-
padding: 0;
|
190 |
-
margin: 0;
|
191 |
-
border: 0;
|
192 |
-
width: 20px;
|
193 |
-
height: 20px;
|
194 |
-
z-index: 1001;
|
195 |
-
}
|
196 |
-
|
197 |
-
#fancybox-bg-n {
|
198 |
-
top: -20px;
|
199 |
-
left: 0;
|
200 |
-
width: 100%;
|
201 |
-
background-image: url('fancybox-x.png');
|
202 |
-
}
|
203 |
-
|
204 |
-
#fancybox-bg-ne {
|
205 |
-
top: -20px;
|
206 |
-
right: -20px;
|
207 |
-
background-image: url('fancybox.png');
|
208 |
-
background-position: -40px -162px;
|
209 |
-
}
|
210 |
-
|
211 |
-
#fancybox-bg-e {
|
212 |
-
top: 0;
|
213 |
-
right: -20px;
|
214 |
-
height: 100%;
|
215 |
-
background-image: url('fancybox-y.png');
|
216 |
-
background-position: -20px 0px;
|
217 |
-
}
|
218 |
-
|
219 |
-
#fancybox-bg-se {
|
220 |
-
bottom: -20px;
|
221 |
-
right: -20px;
|
222 |
-
background-image: url('fancybox.png');
|
223 |
-
background-position: -40px -182px;
|
224 |
-
}
|
225 |
-
|
226 |
-
#fancybox-bg-s {
|
227 |
-
bottom: -20px;
|
228 |
-
left: 0;
|
229 |
-
width: 100%;
|
230 |
-
background-image: url('fancybox-x.png');
|
231 |
-
background-position: 0px -20px;
|
232 |
-
}
|
233 |
-
|
234 |
-
#fancybox-bg-sw {
|
235 |
-
bottom: -20px;
|
236 |
-
left: -20px;
|
237 |
-
background-image: url('fancybox.png');
|
238 |
-
background-position: -40px -142px;
|
239 |
-
}
|
240 |
-
|
241 |
-
#fancybox-bg-w {
|
242 |
-
top: 0;
|
243 |
-
left: -20px;
|
244 |
-
height: 100%;
|
245 |
-
background-image: url('fancybox-y.png');
|
246 |
-
}
|
247 |
-
|
248 |
-
#fancybox-bg-nw {
|
249 |
-
top: -20px;
|
250 |
-
left: -20px;
|
251 |
-
background-image: url('fancybox.png');
|
252 |
-
background-position: -40px -122px;
|
253 |
-
}
|
254 |
-
|
255 |
-
#fancybox-title {
|
256 |
-
font-family: Helvetica;
|
257 |
-
font-size: 12px;
|
258 |
-
z-index: 1102;
|
259 |
-
}
|
260 |
-
|
261 |
-
.fancybox-title-inside {
|
262 |
-
padding-bottom: 10px;
|
263 |
-
text-align: center;
|
264 |
-
color: #333;
|
265 |
-
background: #fff;
|
266 |
-
position: relative;
|
267 |
-
}
|
268 |
-
|
269 |
-
.fancybox-title-outside {
|
270 |
-
padding-top: 10px;
|
271 |
-
color: #fff;
|
272 |
-
}
|
273 |
-
|
274 |
-
.fancybox-title-over {
|
275 |
-
position: absolute;
|
276 |
-
bottom: 0;
|
277 |
-
left: 0;
|
278 |
-
color: #FFF;
|
279 |
-
text-align: left;
|
280 |
-
}
|
281 |
-
|
282 |
-
#fancybox-title-over {
|
283 |
-
padding: 10px;
|
284 |
-
background-image: url('fancy_title_over.png');
|
285 |
-
display: block;
|
286 |
-
}
|
287 |
-
|
288 |
-
.fancybox-title-float {
|
289 |
-
position: absolute;
|
290 |
-
left: 0;
|
291 |
-
bottom: -20px;
|
292 |
-
height: 32px;
|
293 |
-
}
|
294 |
-
|
295 |
-
#fancybox-title-float-wrap {
|
296 |
-
border: none;
|
297 |
-
border-collapse: collapse;
|
298 |
-
width: auto;
|
299 |
-
}
|
300 |
-
|
301 |
-
#fancybox-title-float-wrap td {
|
302 |
-
border: none;
|
303 |
-
white-space: nowrap;
|
304 |
-
}
|
305 |
-
|
306 |
-
#fancybox-title-float-left {
|
307 |
-
padding: 0 0 0 15px;
|
308 |
-
background: url('fancybox.png') -40px -90px no-repeat;
|
309 |
-
}
|
310 |
-
|
311 |
-
#fancybox-title-float-main {
|
312 |
-
color: #FFF;
|
313 |
-
line-height: 29px;
|
314 |
-
font-weight: bold;
|
315 |
-
padding: 0 0 3px 0;
|
316 |
-
background: url('fancybox-x.png') 0px -40px;
|
317 |
-
}
|
318 |
-
|
319 |
-
#fancybox-title-float-right {
|
320 |
-
padding: 0 0 0 15px;
|
321 |
-
background: url('fancybox.png') -55px -90px no-repeat;
|
322 |
-
}
|
323 |
-
|
324 |
-
/* IE6 */
|
325 |
-
|
326 |
-
.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
|
327 |
-
|
328 |
-
.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
|
329 |
-
.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
|
330 |
-
|
331 |
-
.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
|
332 |
-
.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
|
333 |
-
.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
|
334 |
-
.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
|
335 |
-
|
336 |
-
.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
|
337 |
-
height: expression(this.parentNode.clientHeight + "px");
|
338 |
-
}
|
339 |
-
|
340 |
-
#fancybox-loading.fancybox-ie6 {
|
341 |
-
position: absolute; margin-top: 0;
|
342 |
-
top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
|
343 |
-
}
|
344 |
-
|
345 |
-
#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
|
346 |
-
|
347 |
-
/* IE6, IE7, IE8 */
|
348 |
-
|
349 |
-
.fancybox-ie .fancybox-bg { background: transparent !important; }
|
350 |
-
|
351 |
-
.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
|
352 |
-
.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
|
353 |
-
.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
|
354 |
-
.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
|
355 |
-
.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
|
356 |
-
.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
|
357 |
-
.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
|
358 |
-
.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skin/frontend/default/default/js/fancybox/jquery.fancybox-1.3.4.js
DELETED
@@ -1,1156 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* FancyBox - jQuery Plugin
|
3 |
-
* Simple and fancy lightbox alternative
|
4 |
-
*
|
5 |
-
* Examples and documentation at: http://fancybox.net
|
6 |
-
*
|
7 |
-
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
8 |
-
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
9 |
-
*
|
10 |
-
* Version: 1.3.4 (11/11/2010)
|
11 |
-
* Requires: jQuery v1.3+
|
12 |
-
*
|
13 |
-
* Dual licensed under the MIT and GPL licenses:
|
14 |
-
* http://www.opensource.org/licenses/mit-license.php
|
15 |
-
* http://www.gnu.org/licenses/gpl.html
|
16 |
-
*/
|
17 |
-
|
18 |
-
;(function($) {
|
19 |
-
var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
|
20 |
-
|
21 |
-
selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
|
22 |
-
|
23 |
-
ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,
|
24 |
-
|
25 |
-
loadingTimer, loadingFrame = 1,
|
26 |
-
|
27 |
-
titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
|
28 |
-
|
29 |
-
isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
|
30 |
-
|
31 |
-
/*
|
32 |
-
* Private methods
|
33 |
-
*/
|
34 |
-
|
35 |
-
_abort = function() {
|
36 |
-
loading.hide();
|
37 |
-
|
38 |
-
imgPreloader.onerror = imgPreloader.onload = null;
|
39 |
-
|
40 |
-
if (ajaxLoader) {
|
41 |
-
ajaxLoader.abort();
|
42 |
-
}
|
43 |
-
|
44 |
-
tmp.empty();
|
45 |
-
},
|
46 |
-
|
47 |
-
_error = function() {
|
48 |
-
if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
|
49 |
-
loading.hide();
|
50 |
-
busy = false;
|
51 |
-
return;
|
52 |
-
}
|
53 |
-
|
54 |
-
selectedOpts.titleShow = false;
|
55 |
-
|
56 |
-
selectedOpts.width = 'auto';
|
57 |
-
selectedOpts.height = 'auto';
|
58 |
-
|
59 |
-
tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );
|
60 |
-
|
61 |
-
_process_inline();
|
62 |
-
},
|
63 |
-
|
64 |
-
_start = function() {
|
65 |
-
var obj = selectedArray[ selectedIndex ],
|
66 |
-
href,
|
67 |
-
type,
|
68 |
-
title,
|
69 |
-
str,
|
70 |
-
emb,
|
71 |
-
ret;
|
72 |
-
|
73 |
-
_abort();
|
74 |
-
|
75 |
-
selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
|
76 |
-
|
77 |
-
ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
|
78 |
-
|
79 |
-
if (ret === false) {
|
80 |
-
busy = false;
|
81 |
-
return;
|
82 |
-
} else if (typeof ret == 'object') {
|
83 |
-
selectedOpts = $.extend(selectedOpts, ret);
|
84 |
-
}
|
85 |
-
|
86 |
-
title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
|
87 |
-
|
88 |
-
if (obj.nodeName && !selectedOpts.orig) {
|
89 |
-
selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
|
90 |
-
}
|
91 |
-
|
92 |
-
if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
|
93 |
-
title = selectedOpts.orig.attr('alt');
|
94 |
-
}
|
95 |
-
|
96 |
-
href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
|
97 |
-
|
98 |
-
if ((/^(?:javascript)/i).test(href) || href == '#') {
|
99 |
-
href = null;
|
100 |
-
}
|
101 |
-
|
102 |
-
if (selectedOpts.type) {
|
103 |
-
type = selectedOpts.type;
|
104 |
-
|
105 |
-
if (!href) {
|
106 |
-
href = selectedOpts.content;
|
107 |
-
}
|
108 |
-
|
109 |
-
} else if (selectedOpts.content) {
|
110 |
-
type = 'html';
|
111 |
-
|
112 |
-
} else if (href) {
|
113 |
-
if (href.match(imgRegExp)) {
|
114 |
-
type = 'image';
|
115 |
-
|
116 |
-
} else if (href.match(swfRegExp)) {
|
117 |
-
type = 'swf';
|
118 |
-
|
119 |
-
} else if ($(obj).hasClass("iframe")) {
|
120 |
-
type = 'iframe';
|
121 |
-
|
122 |
-
} else if (href.indexOf("#") === 0) {
|
123 |
-
type = 'inline';
|
124 |
-
|
125 |
-
} else {
|
126 |
-
type = 'ajax';
|
127 |
-
}
|
128 |
-
}
|
129 |
-
|
130 |
-
if (!type) {
|
131 |
-
_error();
|
132 |
-
return;
|
133 |
-
}
|
134 |
-
|
135 |
-
if (type == 'inline') {
|
136 |
-
obj = href.substr(href.indexOf("#"));
|
137 |
-
type = $(obj).length > 0 ? 'inline' : 'ajax';
|
138 |
-
}
|
139 |
-
|
140 |
-
selectedOpts.type = type;
|
141 |
-
selectedOpts.href = href;
|
142 |
-
selectedOpts.title = title;
|
143 |
-
|
144 |
-
if (selectedOpts.autoDimensions) {
|
145 |
-
if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
|
146 |
-
selectedOpts.width = 'auto';
|
147 |
-
selectedOpts.height = 'auto';
|
148 |
-
} else {
|
149 |
-
selectedOpts.autoDimensions = false;
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
if (selectedOpts.modal) {
|
154 |
-
selectedOpts.overlayShow = true;
|
155 |
-
selectedOpts.hideOnOverlayClick = false;
|
156 |
-
selectedOpts.hideOnContentClick = false;
|
157 |
-
selectedOpts.enableEscapeButton = false;
|
158 |
-
selectedOpts.showCloseButton = false;
|
159 |
-
}
|
160 |
-
|
161 |
-
selectedOpts.padding = parseInt(selectedOpts.padding, 10);
|
162 |
-
selectedOpts.margin = parseInt(selectedOpts.margin, 10);
|
163 |
-
|
164 |
-
tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
|
165 |
-
|
166 |
-
$('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
|
167 |
-
$(this).replaceWith(content.children());
|
168 |
-
});
|
169 |
-
|
170 |
-
switch (type) {
|
171 |
-
case 'html' :
|
172 |
-
tmp.html( selectedOpts.content );
|
173 |
-
_process_inline();
|
174 |
-
break;
|
175 |
-
|
176 |
-
case 'inline' :
|
177 |
-
if ( $(obj).parent().is('#fancybox-content') === true) {
|
178 |
-
busy = false;
|
179 |
-
return;
|
180 |
-
}
|
181 |
-
|
182 |
-
$('<div class="fancybox-inline-tmp" />')
|
183 |
-
.hide()
|
184 |
-
.insertBefore( $(obj) )
|
185 |
-
.bind('fancybox-cleanup', function() {
|
186 |
-
$(this).replaceWith(content.children());
|
187 |
-
}).bind('fancybox-cancel', function() {
|
188 |
-
$(this).replaceWith(tmp.children());
|
189 |
-
});
|
190 |
-
|
191 |
-
$(obj).appendTo(tmp);
|
192 |
-
|
193 |
-
_process_inline();
|
194 |
-
break;
|
195 |
-
|
196 |
-
case 'image':
|
197 |
-
busy = false;
|
198 |
-
|
199 |
-
$.fancybox.showActivity();
|
200 |
-
|
201 |
-
imgPreloader = new Image();
|
202 |
-
|
203 |
-
imgPreloader.onerror = function() {
|
204 |
-
_error();
|
205 |
-
};
|
206 |
-
|
207 |
-
imgPreloader.onload = function() {
|
208 |
-
busy = true;
|
209 |
-
|
210 |
-
imgPreloader.onerror = imgPreloader.onload = null;
|
211 |
-
|
212 |
-
_process_image();
|
213 |
-
};
|
214 |
-
|
215 |
-
imgPreloader.src = href;
|
216 |
-
break;
|
217 |
-
|
218 |
-
case 'swf':
|
219 |
-
selectedOpts.scrolling = 'no';
|
220 |
-
|
221 |
-
str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
|
222 |
-
emb = '';
|
223 |
-
|
224 |
-
$.each(selectedOpts.swf, function(name, val) {
|
225 |
-
str += '<param name="' + name + '" value="' + val + '"></param>';
|
226 |
-
emb += ' ' + name + '="' + val + '"';
|
227 |
-
});
|
228 |
-
|
229 |
-
str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';
|
230 |
-
|
231 |
-
tmp.html(str);
|
232 |
-
|
233 |
-
_process_inline();
|
234 |
-
break;
|
235 |
-
|
236 |
-
case 'ajax':
|
237 |
-
busy = false;
|
238 |
-
|
239 |
-
$.fancybox.showActivity();
|
240 |
-
|
241 |
-
selectedOpts.ajax.win = selectedOpts.ajax.success;
|
242 |
-
|
243 |
-
ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
|
244 |
-
url : href,
|
245 |
-
data : selectedOpts.ajax.data || {},
|
246 |
-
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
247 |
-
if ( XMLHttpRequest.status > 0 ) {
|
248 |
-
_error();
|
249 |
-
}
|
250 |
-
},
|
251 |
-
success : function(data, textStatus, XMLHttpRequest) {
|
252 |
-
var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
|
253 |
-
if (o.status == 200) {
|
254 |
-
if ( typeof selectedOpts.ajax.win == 'function' ) {
|
255 |
-
ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
|
256 |
-
|
257 |
-
if (ret === false) {
|
258 |
-
loading.hide();
|
259 |
-
return;
|
260 |
-
} else if (typeof ret == 'string' || typeof ret == 'object') {
|
261 |
-
data = ret;
|
262 |
-
}
|
263 |
-
}
|
264 |
-
|
265 |
-
tmp.html( data );
|
266 |
-
_process_inline();
|
267 |
-
}
|
268 |
-
}
|
269 |
-
}));
|
270 |
-
|
271 |
-
break;
|
272 |
-
|
273 |
-
case 'iframe':
|
274 |
-
_show();
|
275 |
-
break;
|
276 |
-
}
|
277 |
-
},
|
278 |
-
|
279 |
-
_process_inline = function() {
|
280 |
-
var
|
281 |
-
w = selectedOpts.width,
|
282 |
-
h = selectedOpts.height;
|
283 |
-
|
284 |
-
if (w.toString().indexOf('%') > -1) {
|
285 |
-
w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
|
286 |
-
|
287 |
-
} else {
|
288 |
-
w = w == 'auto' ? 'auto' : w + 'px';
|
289 |
-
}
|
290 |
-
|
291 |
-
if (h.toString().indexOf('%') > -1) {
|
292 |
-
h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
|
293 |
-
|
294 |
-
} else {
|
295 |
-
h = h == 'auto' ? 'auto' : h + 'px';
|
296 |
-
}
|
297 |
-
|
298 |
-
tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
|
299 |
-
|
300 |
-
selectedOpts.width = tmp.width();
|
301 |
-
selectedOpts.height = tmp.height();
|
302 |
-
|
303 |
-
_show();
|
304 |
-
},
|
305 |
-
|
306 |
-
_process_image = function() {
|
307 |
-
selectedOpts.width = imgPreloader.width;
|
308 |
-
selectedOpts.height = imgPreloader.height;
|
309 |
-
|
310 |
-
$("<img />").attr({
|
311 |
-
'id' : 'fancybox-img',
|
312 |
-
'src' : imgPreloader.src,
|
313 |
-
'alt' : selectedOpts.title
|
314 |
-
}).appendTo( tmp );
|
315 |
-
|
316 |
-
_show();
|
317 |
-
},
|
318 |
-
|
319 |
-
_show = function() {
|
320 |
-
var pos, equal;
|
321 |
-
|
322 |
-
loading.hide();
|
323 |
-
|
324 |
-
if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
|
325 |
-
$.event.trigger('fancybox-cancel');
|
326 |
-
|
327 |
-
busy = false;
|
328 |
-
return;
|
329 |
-
}
|
330 |
-
|
331 |
-
busy = true;
|
332 |
-
|
333 |
-
$(content.add( overlay )).unbind();
|
334 |
-
|
335 |
-
$(window).unbind("resize.fb scroll.fb");
|
336 |
-
$(document).unbind('keydown.fb');
|
337 |
-
|
338 |
-
if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
|
339 |
-
wrap.css('height', wrap.height());
|
340 |
-
}
|
341 |
-
|
342 |
-
currentArray = selectedArray;
|
343 |
-
currentIndex = selectedIndex;
|
344 |
-
currentOpts = selectedOpts;
|
345 |
-
|
346 |
-
if (currentOpts.overlayShow) {
|
347 |
-
overlay.css({
|
348 |
-
'background-color' : currentOpts.overlayColor,
|
349 |
-
'opacity' : currentOpts.overlayOpacity,
|
350 |
-
'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
|
351 |
-
'height' : $(document).height()
|
352 |
-
});
|
353 |
-
|
354 |
-
if (!overlay.is(':visible')) {
|
355 |
-
if (isIE6) {
|
356 |
-
$('select:not(#fancybox-tmp select)').filter(function() {
|
357 |
-
return this.style.visibility !== 'hidden';
|
358 |
-
}).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
|
359 |
-
this.style.visibility = 'inherit';
|
360 |
-
});
|
361 |
-
}
|
362 |
-
|
363 |
-
overlay.show();
|
364 |
-
}
|
365 |
-
} else {
|
366 |
-
overlay.hide();
|
367 |
-
}
|
368 |
-
|
369 |
-
final_pos = _get_zoom_to();
|
370 |
-
|
371 |
-
_process_title();
|
372 |
-
|
373 |
-
if (wrap.is(":visible")) {
|
374 |
-
$( close.add( nav_left ).add( nav_right ) ).hide();
|
375 |
-
|
376 |
-
pos = wrap.position(),
|
377 |
-
|
378 |
-
start_pos = {
|
379 |
-
top : pos.top,
|
380 |
-
left : pos.left,
|
381 |
-
width : wrap.width(),
|
382 |
-
height : wrap.height()
|
383 |
-
};
|
384 |
-
|
385 |
-
equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
|
386 |
-
|
387 |
-
content.fadeTo(currentOpts.changeFade, 0.3, function() {
|
388 |
-
var finish_resizing = function() {
|
389 |
-
content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
|
390 |
-
};
|
391 |
-
|
392 |
-
$.event.trigger('fancybox-change');
|
393 |
-
|
394 |
-
content
|
395 |
-
.empty()
|
396 |
-
.removeAttr('filter')
|
397 |
-
.css({
|
398 |
-
'border-width' : currentOpts.padding,
|
399 |
-
'width' : final_pos.width - currentOpts.padding * 2,
|
400 |
-
'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
|
401 |
-
});
|
402 |
-
|
403 |
-
if (equal) {
|
404 |
-
finish_resizing();
|
405 |
-
|
406 |
-
} else {
|
407 |
-
fx.prop = 0;
|
408 |
-
|
409 |
-
$(fx).animate({prop: 1}, {
|
410 |
-
duration : currentOpts.changeSpeed,
|
411 |
-
easing : currentOpts.easingChange,
|
412 |
-
step : _draw,
|
413 |
-
complete : finish_resizing
|
414 |
-
});
|
415 |
-
}
|
416 |
-
});
|
417 |
-
|
418 |
-
return;
|
419 |
-
}
|
420 |
-
|
421 |
-
wrap.removeAttr("style");
|
422 |
-
|
423 |
-
content.css('border-width', currentOpts.padding);
|
424 |
-
|
425 |
-
if (currentOpts.transitionIn == 'elastic') {
|
426 |
-
start_pos = _get_zoom_from();
|
427 |
-
|
428 |
-
content.html( tmp.contents() );
|
429 |
-
|
430 |
-
wrap.show();
|
431 |
-
|
432 |
-
if (currentOpts.opacity) {
|
433 |
-
final_pos.opacity = 0;
|
434 |
-
}
|
435 |
-
|
436 |
-
fx.prop = 0;
|
437 |
-
|
438 |
-
$(fx).animate({prop: 1}, {
|
439 |
-
duration : currentOpts.speedIn,
|
440 |
-
easing : currentOpts.easingIn,
|
441 |
-
step : _draw,
|
442 |
-
complete : _finish
|
443 |
-
});
|
444 |
-
|
445 |
-
return;
|
446 |
-
}
|
447 |
-
|
448 |
-
if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
|
449 |
-
title.show();
|
450 |
-
}
|
451 |
-
|
452 |
-
content
|
453 |
-
.css({
|
454 |
-
'width' : final_pos.width - currentOpts.padding * 2,
|
455 |
-
'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
|
456 |
-
})
|
457 |
-
.html( tmp.contents() );
|
458 |
-
|
459 |
-
wrap
|
460 |
-
.css(final_pos)
|
461 |
-
.fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
|
462 |
-
},
|
463 |
-
|
464 |
-
_format_title = function(title) {
|
465 |
-
if (title && title.length) {
|
466 |
-
if (currentOpts.titlePosition == 'float') {
|
467 |
-
return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
|
468 |
-
}
|
469 |
-
|
470 |
-
return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
|
471 |
-
}
|
472 |
-
|
473 |
-
return false;
|
474 |
-
},
|
475 |
-
|
476 |
-
_process_title = function() {
|
477 |
-
titleStr = currentOpts.title || '';
|
478 |
-
titleHeight = 0;
|
479 |
-
|
480 |
-
title
|
481 |
-
.empty()
|
482 |
-
.removeAttr('style')
|
483 |
-
.removeClass();
|
484 |
-
|
485 |
-
if (currentOpts.titleShow === false) {
|
486 |
-
title.hide();
|
487 |
-
return;
|
488 |
-
}
|
489 |
-
|
490 |
-
titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
|
491 |
-
|
492 |
-
if (!titleStr || titleStr === '') {
|
493 |
-
title.hide();
|
494 |
-
return;
|
495 |
-
}
|
496 |
-
|
497 |
-
title
|
498 |
-
.addClass('fancybox-title-' + currentOpts.titlePosition)
|
499 |
-
.html( titleStr )
|
500 |
-
.appendTo( 'body' )
|
501 |
-
.show();
|
502 |
-
|
503 |
-
switch (currentOpts.titlePosition) {
|
504 |
-
case 'inside':
|
505 |
-
title
|
506 |
-
.css({
|
507 |
-
'width' : final_pos.width - (currentOpts.padding * 2),
|
508 |
-
'marginLeft' : currentOpts.padding,
|
509 |
-
'marginRight' : currentOpts.padding
|
510 |
-
});
|
511 |
-
|
512 |
-
titleHeight = title.outerHeight(true);
|
513 |
-
|
514 |
-
title.appendTo( outer );
|
515 |
-
|
516 |
-
final_pos.height += titleHeight;
|
517 |
-
break;
|
518 |
-
|
519 |
-
case 'over':
|
520 |
-
title
|
521 |
-
.css({
|
522 |
-
'marginLeft' : currentOpts.padding,
|
523 |
-
'width' : final_pos.width - (currentOpts.padding * 2),
|
524 |
-
'bottom' : currentOpts.padding
|
525 |
-
})
|
526 |
-
.appendTo( outer );
|
527 |
-
break;
|
528 |
-
|
529 |
-
case 'float':
|
530 |
-
title
|
531 |
-
.css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
|
532 |
-
.appendTo( wrap );
|
533 |
-
break;
|
534 |
-
|
535 |
-
default:
|
536 |
-
title
|
537 |
-
.css({
|
538 |
-
'width' : final_pos.width - (currentOpts.padding * 2),
|
539 |
-
'paddingLeft' : currentOpts.padding,
|
540 |
-
'paddingRight' : currentOpts.padding
|
541 |
-
})
|
542 |
-
.appendTo( wrap );
|
543 |
-
break;
|
544 |
-
}
|
545 |
-
|
546 |
-
title.hide();
|
547 |
-
},
|
548 |
-
|
549 |
-
_set_navigation = function() {
|
550 |
-
if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
|
551 |
-
$(document).bind('keydown.fb', function(e) {
|
552 |
-
if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
|
553 |
-
e.preventDefault();
|
554 |
-
$.fancybox.close();
|
555 |
-
|
556 |
-
} else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
|
557 |
-
e.preventDefault();
|
558 |
-
$.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
|
559 |
-
}
|
560 |
-
});
|
561 |
-
}
|
562 |
-
|
563 |
-
if (!currentOpts.showNavArrows) {
|
564 |
-
nav_left.hide();
|
565 |
-
nav_right.hide();
|
566 |
-
return;
|
567 |
-
}
|
568 |
-
|
569 |
-
if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
|
570 |
-
nav_left.show();
|
571 |
-
}
|
572 |
-
|
573 |
-
if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
|
574 |
-
nav_right.show();
|
575 |
-
}
|
576 |
-
},
|
577 |
-
|
578 |
-
_finish = function () {
|
579 |
-
if (!$.support.opacity) {
|
580 |
-
content.get(0).style.removeAttribute('filter');
|
581 |
-
wrap.get(0).style.removeAttribute('filter');
|
582 |
-
}
|
583 |
-
|
584 |
-
if (selectedOpts.autoDimensions) {
|
585 |
-
content.css('height', 'auto');
|
586 |
-
}
|
587 |
-
|
588 |
-
wrap.css('height', 'auto');
|
589 |
-
|
590 |
-
if (titleStr && titleStr.length) {
|
591 |
-
title.show();
|
592 |
-
}
|
593 |
-
|
594 |
-
if (currentOpts.showCloseButton) {
|
595 |
-
close.show();
|
596 |
-
}
|
597 |
-
|
598 |
-
_set_navigation();
|
599 |
-
|
600 |
-
if (currentOpts.hideOnContentClick) {
|
601 |
-
content.bind('click', $.fancybox.close);
|
602 |
-
}
|
603 |
-
|
604 |
-
if (currentOpts.hideOnOverlayClick) {
|
605 |
-
overlay.bind('click', $.fancybox.close);
|
606 |
-
}
|
607 |
-
|
608 |
-
$(window).bind("resize.fb", $.fancybox.resize);
|
609 |
-
|
610 |
-
if (currentOpts.centerOnScroll) {
|
611 |
-
$(window).bind("scroll.fb", $.fancybox.center);
|
612 |
-
}
|
613 |
-
|
614 |
-
if (currentOpts.type == 'iframe') {
|
615 |
-
$('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content);
|
616 |
-
}
|
617 |
-
|
618 |
-
wrap.show();
|
619 |
-
|
620 |
-
busy = false;
|
621 |
-
|
622 |
-
$.fancybox.center();
|
623 |
-
|
624 |
-
currentOpts.onComplete(currentArray, currentIndex, currentOpts);
|
625 |
-
|
626 |
-
_preload_images();
|
627 |
-
},
|
628 |
-
|
629 |
-
_preload_images = function() {
|
630 |
-
var href,
|
631 |
-
objNext;
|
632 |
-
|
633 |
-
if ((currentArray.length -1) > currentIndex) {
|
634 |
-
href = currentArray[ currentIndex + 1 ].href;
|
635 |
-
|
636 |
-
if (typeof href !== 'undefined' && href.match(imgRegExp)) {
|
637 |
-
objNext = new Image();
|
638 |
-
objNext.src = href;
|
639 |
-
}
|
640 |
-
}
|
641 |
-
|
642 |
-
if (currentIndex > 0) {
|
643 |
-
href = currentArray[ currentIndex - 1 ].href;
|
644 |
-
|
645 |
-
if (typeof href !== 'undefined' && href.match(imgRegExp)) {
|
646 |
-
objNext = new Image();
|
647 |
-
objNext.src = href;
|
648 |
-
}
|
649 |
-
}
|
650 |
-
},
|
651 |
-
|
652 |
-
_draw = function(pos) {
|
653 |
-
var dim = {
|
654 |
-
width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
|
655 |
-
height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
|
656 |
-
|
657 |
-
top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
|
658 |
-
left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
|
659 |
-
};
|
660 |
-
|
661 |
-
if (typeof final_pos.opacity !== 'undefined') {
|
662 |
-
dim.opacity = pos < 0.5 ? 0.5 : pos;
|
663 |
-
}
|
664 |
-
|
665 |
-
wrap.css(dim);
|
666 |
-
|
667 |
-
content.css({
|
668 |
-
'width' : dim.width - currentOpts.padding * 2,
|
669 |
-
'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
|
670 |
-
});
|
671 |
-
},
|
672 |
-
|
673 |
-
_get_viewport = function() {
|
674 |
-
return [
|
675 |
-
$(window).width() - (currentOpts.margin * 2),
|
676 |
-
$(window).height() - (currentOpts.margin * 2),
|
677 |
-
$(document).scrollLeft() + currentOpts.margin,
|
678 |
-
$(document).scrollTop() + currentOpts.margin
|
679 |
-
];
|
680 |
-
},
|
681 |
-
|
682 |
-
_get_zoom_to = function () {
|
683 |
-
var view = _get_viewport(),
|
684 |
-
to = {},
|
685 |
-
resize = currentOpts.autoScale,
|
686 |
-
double_padding = currentOpts.padding * 2,
|
687 |
-
ratio;
|
688 |
-
|
689 |
-
if (currentOpts.width.toString().indexOf('%') > -1) {
|
690 |
-
to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
|
691 |
-
} else {
|
692 |
-
to.width = currentOpts.width + double_padding;
|
693 |
-
}
|
694 |
-
|
695 |
-
if (currentOpts.height.toString().indexOf('%') > -1) {
|
696 |
-
to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
|
697 |
-
} else {
|
698 |
-
to.height = currentOpts.height + double_padding;
|
699 |
-
}
|
700 |
-
|
701 |
-
if (resize && (to.width > view[0] || to.height > view[1])) {
|
702 |
-
if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
|
703 |
-
ratio = (currentOpts.width ) / (currentOpts.height );
|
704 |
-
|
705 |
-
if ((to.width ) > view[0]) {
|
706 |
-
to.width = view[0];
|
707 |
-
to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
|
708 |
-
}
|
709 |
-
|
710 |
-
if ((to.height) > view[1]) {
|
711 |
-
to.height = view[1];
|
712 |
-
to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
|
713 |
-
}
|
714 |
-
|
715 |
-
} else {
|
716 |
-
to.width = Math.min(to.width, view[0]);
|
717 |
-
to.height = Math.min(to.height, view[1]);
|
718 |
-
}
|
719 |
-
}
|
720 |
-
|
721 |
-
to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
|
722 |
-
to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
|
723 |
-
|
724 |
-
return to;
|
725 |
-
},
|
726 |
-
|
727 |
-
_get_obj_pos = function(obj) {
|
728 |
-
var pos = obj.offset();
|
729 |
-
|
730 |
-
pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
|
731 |
-
pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
|
732 |
-
|
733 |
-
pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
|
734 |
-
pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
|
735 |
-
|
736 |
-
pos.width = obj.width();
|
737 |
-
pos.height = obj.height();
|
738 |
-
|
739 |
-
return pos;
|
740 |
-
},
|
741 |
-
|
742 |
-
_get_zoom_from = function() {
|
743 |
-
var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
|
744 |
-
from = {},
|
745 |
-
pos,
|
746 |
-
view;
|
747 |
-
|
748 |
-
if (orig && orig.length) {
|
749 |
-
pos = _get_obj_pos(orig);
|
750 |
-
|
751 |
-
from = {
|
752 |
-
width : pos.width + (currentOpts.padding * 2),
|
753 |
-
height : pos.height + (currentOpts.padding * 2),
|
754 |
-
top : pos.top - currentOpts.padding - 20,
|
755 |
-
left : pos.left - currentOpts.padding - 20
|
756 |
-
};
|
757 |
-
|
758 |
-
} else {
|
759 |
-
view = _get_viewport();
|
760 |
-
|
761 |
-
from = {
|
762 |
-
width : currentOpts.padding * 2,
|
763 |
-
height : currentOpts.padding * 2,
|
764 |
-
top : parseInt(view[3] + view[1] * 0.5, 10),
|
765 |
-
left : parseInt(view[2] + view[0] * 0.5, 10)
|
766 |
-
};
|
767 |
-
}
|
768 |
-
|
769 |
-
return from;
|
770 |
-
},
|
771 |
-
|
772 |
-
_animate_loading = function() {
|
773 |
-
if (!loading.is(':visible')){
|
774 |
-
clearInterval(loadingTimer);
|
775 |
-
return;
|
776 |
-
}
|
777 |
-
|
778 |
-
$('div', loading).css('top', (loadingFrame * -40) + 'px');
|
779 |
-
|
780 |
-
loadingFrame = (loadingFrame + 1) % 12;
|
781 |
-
};
|
782 |
-
|
783 |
-
/*
|
784 |
-
* Public methods
|
785 |
-
*/
|
786 |
-
|
787 |
-
$.fn.fancybox = function(options) {
|
788 |
-
if (!$(this).length) {
|
789 |
-
return this;
|
790 |
-
}
|
791 |
-
|
792 |
-
$(this)
|
793 |
-
.data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
|
794 |
-
.unbind('click.fb')
|
795 |
-
.bind('click.fb', function(e) {
|
796 |
-
e.preventDefault();
|
797 |
-
|
798 |
-
if (busy) {
|
799 |
-
return;
|
800 |
-
}
|
801 |
-
|
802 |
-
busy = true;
|
803 |
-
|
804 |
-
$(this).blur();
|
805 |
-
|
806 |
-
selectedArray = [];
|
807 |
-
selectedIndex = 0;
|
808 |
-
|
809 |
-
var rel = $(this).attr('rel') || '';
|
810 |
-
|
811 |
-
if (!rel || rel == '' || rel === 'nofollow') {
|
812 |
-
selectedArray.push(this);
|
813 |
-
|
814 |
-
} else {
|
815 |
-
selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
|
816 |
-
selectedIndex = selectedArray.index( this );
|
817 |
-
}
|
818 |
-
|
819 |
-
_start();
|
820 |
-
|
821 |
-
return;
|
822 |
-
});
|
823 |
-
|
824 |
-
return this;
|
825 |
-
};
|
826 |
-
|
827 |
-
$.fancybox = function(obj) {
|
828 |
-
var opts;
|
829 |
-
|
830 |
-
if (busy) {
|
831 |
-
return;
|
832 |
-
}
|
833 |
-
|
834 |
-
busy = true;
|
835 |
-
opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
|
836 |
-
|
837 |
-
selectedArray = [];
|
838 |
-
selectedIndex = parseInt(opts.index, 10) || 0;
|
839 |
-
|
840 |
-
if ($.isArray(obj)) {
|
841 |
-
for (var i = 0, j = obj.length; i < j; i++) {
|
842 |
-
if (typeof obj[i] == 'object') {
|
843 |
-
$(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
|
844 |
-
} else {
|
845 |
-
obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
|
846 |
-
}
|
847 |
-
}
|
848 |
-
|
849 |
-
selectedArray = jQuery.merge(selectedArray, obj);
|
850 |
-
|
851 |
-
} else {
|
852 |
-
if (typeof obj == 'object') {
|
853 |
-
$(obj).data('fancybox', $.extend({}, opts, obj));
|
854 |
-
} else {
|
855 |
-
obj = $({}).data('fancybox', $.extend({content : obj}, opts));
|
856 |
-
}
|
857 |
-
|
858 |
-
selectedArray.push(obj);
|
859 |
-
}
|
860 |
-
|
861 |
-
if (selectedIndex > selectedArray.length || selectedIndex < 0) {
|
862 |
-
selectedIndex = 0;
|
863 |
-
}
|
864 |
-
|
865 |
-
_start();
|
866 |
-
};
|
867 |
-
|
868 |
-
$.fancybox.showActivity = function() {
|
869 |
-
clearInterval(loadingTimer);
|
870 |
-
|
871 |
-
loading.show();
|
872 |
-
loadingTimer = setInterval(_animate_loading, 66);
|
873 |
-
};
|
874 |
-
|
875 |
-
$.fancybox.hideActivity = function() {
|
876 |
-
loading.hide();
|
877 |
-
};
|
878 |
-
|
879 |
-
$.fancybox.next = function() {
|
880 |
-
return $.fancybox.pos( currentIndex + 1);
|
881 |
-
};
|
882 |
-
|
883 |
-
$.fancybox.prev = function() {
|
884 |
-
return $.fancybox.pos( currentIndex - 1);
|
885 |
-
};
|
886 |
-
|
887 |
-
$.fancybox.pos = function(pos) {
|
888 |
-
if (busy) {
|
889 |
-
return;
|
890 |
-
}
|
891 |
-
|
892 |
-
pos = parseInt(pos);
|
893 |
-
|
894 |
-
selectedArray = currentArray;
|
895 |
-
|
896 |
-
if (pos > -1 && pos < currentArray.length) {
|
897 |
-
selectedIndex = pos;
|
898 |
-
_start();
|
899 |
-
|
900 |
-
} else if (currentOpts.cyclic && currentArray.length > 1) {
|
901 |
-
selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
|
902 |
-
_start();
|
903 |
-
}
|
904 |
-
|
905 |
-
return;
|
906 |
-
};
|
907 |
-
|
908 |
-
$.fancybox.cancel = function() {
|
909 |
-
if (busy) {
|
910 |
-
return;
|
911 |
-
}
|
912 |
-
|
913 |
-
busy = true;
|
914 |
-
|
915 |
-
$.event.trigger('fancybox-cancel');
|
916 |
-
|
917 |
-
_abort();
|
918 |
-
|
919 |
-
selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
|
920 |
-
|
921 |
-
busy = false;
|
922 |
-
};
|
923 |
-
|
924 |
-
// Note: within an iframe use - parent.$.fancybox.close();
|
925 |
-
$.fancybox.close = function() {
|
926 |
-
if (busy || wrap.is(':hidden')) {
|
927 |
-
return;
|
928 |
-
}
|
929 |
-
|
930 |
-
busy = true;
|
931 |
-
|
932 |
-
if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
|
933 |
-
busy = false;
|
934 |
-
return;
|
935 |
-
}
|
936 |
-
|
937 |
-
_abort();
|
938 |
-
|
939 |
-
$(close.add( nav_left ).add( nav_right )).hide();
|
940 |
-
|
941 |
-
$(content.add( overlay )).unbind();
|
942 |
-
|
943 |
-
$(window).unbind("resize.fb scroll.fb");
|
944 |
-
$(document).unbind('keydown.fb');
|
945 |
-
|
946 |
-
content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
|
947 |
-
|
948 |
-
if (currentOpts.titlePosition !== 'inside') {
|
949 |
-
title.empty();
|
950 |
-
}
|
951 |
-
|
952 |
-
wrap.stop();
|
953 |
-
|
954 |
-
function _cleanup() {
|
955 |
-
overlay.fadeOut('fast');
|
956 |
-
|
957 |
-
title.empty().hide();
|
958 |
-
wrap.hide();
|
959 |
-
|
960 |
-
$.event.trigger('fancybox-cleanup');
|
961 |
-
|
962 |
-
content.empty();
|
963 |
-
|
964 |
-
currentOpts.onClosed(currentArray, currentIndex, currentOpts);
|
965 |
-
|
966 |
-
currentArray = selectedOpts = [];
|
967 |
-
currentIndex = selectedIndex = 0;
|
968 |
-
currentOpts = selectedOpts = {};
|
969 |
-
|
970 |
-
busy = false;
|
971 |
-
}
|
972 |
-
|
973 |
-
if (currentOpts.transitionOut == 'elastic') {
|
974 |
-
start_pos = _get_zoom_from();
|
975 |
-
|
976 |
-
var pos = wrap.position();
|
977 |
-
|
978 |
-
final_pos = {
|
979 |
-
top : pos.top ,
|
980 |
-
left : pos.left,
|
981 |
-
width : wrap.width(),
|
982 |
-
height : wrap.height()
|
983 |
-
};
|
984 |
-
|
985 |
-
if (currentOpts.opacity) {
|
986 |
-
final_pos.opacity = 1;
|
987 |
-
}
|
988 |
-
|
989 |
-
title.empty().hide();
|
990 |
-
|
991 |
-
fx.prop = 1;
|
992 |
-
|
993 |
-
$(fx).animate({ prop: 0 }, {
|
994 |
-
duration : currentOpts.speedOut,
|
995 |
-
easing : currentOpts.easingOut,
|
996 |
-
step : _draw,
|
997 |
-
complete : _cleanup
|
998 |
-
});
|
999 |
-
|
1000 |
-
} else {
|
1001 |
-
wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
|
1002 |
-
}
|
1003 |
-
};
|
1004 |
-
|
1005 |
-
$.fancybox.resize = function() {
|
1006 |
-
if (overlay.is(':visible')) {
|
1007 |
-
overlay.css('height', $(document).height());
|
1008 |
-
}
|
1009 |
-
|
1010 |
-
$.fancybox.center(true);
|
1011 |
-
};
|
1012 |
-
|
1013 |
-
$.fancybox.center = function() {
|
1014 |
-
var view, align;
|
1015 |
-
|
1016 |
-
if (busy) {
|
1017 |
-
return;
|
1018 |
-
}
|
1019 |
-
|
1020 |
-
align = arguments[0] === true ? 1 : 0;
|
1021 |
-
view = _get_viewport();
|
1022 |
-
|
1023 |
-
if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
|
1024 |
-
return;
|
1025 |
-
}
|
1026 |
-
|
1027 |
-
wrap
|
1028 |
-
.stop()
|
1029 |
-
.animate({
|
1030 |
-
'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
|
1031 |
-
'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
|
1032 |
-
}, typeof arguments[0] == 'number' ? arguments[0] : 200);
|
1033 |
-
};
|
1034 |
-
|
1035 |
-
$.fancybox.init = function() {
|
1036 |
-
if ($("#fancybox-wrap").length) {
|
1037 |
-
return;
|
1038 |
-
}
|
1039 |
-
|
1040 |
-
$('body').append(
|
1041 |
-
tmp = $('<div id="fancybox-tmp"></div>'),
|
1042 |
-
loading = $('<div id="fancybox-loading"><div></div></div>'),
|
1043 |
-
overlay = $('<div id="fancybox-overlay"></div>'),
|
1044 |
-
wrap = $('<div id="fancybox-wrap"></div>')
|
1045 |
-
);
|
1046 |
-
|
1047 |
-
outer = $('<div id="fancybox-outer"></div>')
|
1048 |
-
.append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
|
1049 |
-
.appendTo( wrap );
|
1050 |
-
|
1051 |
-
outer.append(
|
1052 |
-
content = $('<div id="fancybox-content"></div>'),
|
1053 |
-
close = $('<a id="fancybox-close"></a>'),
|
1054 |
-
title = $('<div id="fancybox-title"></div>'),
|
1055 |
-
|
1056 |
-
nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
|
1057 |
-
nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
|
1058 |
-
);
|
1059 |
-
|
1060 |
-
close.click($.fancybox.close);
|
1061 |
-
loading.click($.fancybox.cancel);
|
1062 |
-
|
1063 |
-
nav_left.click(function(e) {
|
1064 |
-
e.preventDefault();
|
1065 |
-
$.fancybox.prev();
|
1066 |
-
});
|
1067 |
-
|
1068 |
-
nav_right.click(function(e) {
|
1069 |
-
e.preventDefault();
|
1070 |
-
$.fancybox.next();
|
1071 |
-
});
|
1072 |
-
|
1073 |
-
if ($.fn.mousewheel) {
|
1074 |
-
wrap.bind('mousewheel.fb', function(e, delta) {
|
1075 |
-
if (busy) {
|
1076 |
-
e.preventDefault();
|
1077 |
-
|
1078 |
-
} else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
|
1079 |
-
e.preventDefault();
|
1080 |
-
$.fancybox[ delta > 0 ? 'prev' : 'next']();
|
1081 |
-
}
|
1082 |
-
});
|
1083 |
-
}
|
1084 |
-
|
1085 |
-
if (!$.support.opacity) {
|
1086 |
-
wrap.addClass('fancybox-ie');
|
1087 |
-
}
|
1088 |
-
|
1089 |
-
if (isIE6) {
|
1090 |
-
loading.addClass('fancybox-ie6');
|
1091 |
-
wrap.addClass('fancybox-ie6');
|
1092 |
-
|
1093 |
-
$('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
|
1094 |
-
}
|
1095 |
-
};
|
1096 |
-
|
1097 |
-
$.fn.fancybox.defaults = {
|
1098 |
-
padding : 10,
|
1099 |
-
margin : 40,
|
1100 |
-
opacity : false,
|
1101 |
-
modal : false,
|
1102 |
-
cyclic : false,
|
1103 |
-
scrolling : 'auto', // 'auto', 'yes' or 'no'
|
1104 |
-
|
1105 |
-
width : 560,
|
1106 |
-
height : 340,
|
1107 |
-
|
1108 |
-
autoScale : true,
|
1109 |
-
autoDimensions : true,
|
1110 |
-
centerOnScroll : false,
|
1111 |
-
|
1112 |
-
ajax : {},
|
1113 |
-
swf : { wmode: 'transparent' },
|
1114 |
-
|
1115 |
-
hideOnOverlayClick : true,
|
1116 |
-
hideOnContentClick : false,
|
1117 |
-
|
1118 |
-
overlayShow : true,
|
1119 |
-
overlayOpacity : 0.7,
|
1120 |
-
overlayColor : '#777',
|
1121 |
-
|
1122 |
-
titleShow : true,
|
1123 |
-
titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
|
1124 |
-
titleFormat : null,
|
1125 |
-
titleFromAlt : false,
|
1126 |
-
|
1127 |
-
transitionIn : 'fade', // 'elastic', 'fade' or 'none'
|
1128 |
-
transitionOut : 'fade', // 'elastic', 'fade' or 'none'
|
1129 |
-
|
1130 |
-
speedIn : 300,
|
1131 |
-
speedOut : 300,
|
1132 |
-
|
1133 |
-
changeSpeed : 300,
|
1134 |
-
changeFade : 'fast',
|
1135 |
-
|
1136 |
-
easingIn : 'swing',
|
1137 |
-
easingOut : 'swing',
|
1138 |
-
|
1139 |
-
showCloseButton : true,
|
1140 |
-
showNavArrows : true,
|
1141 |
-
enableEscapeButton : true,
|
1142 |
-
enableKeyboardNav : true,
|
1143 |
-
|
1144 |
-
onStart : function(){},
|
1145 |
-
onCancel : function(){},
|
1146 |
-
onComplete : function(){},
|
1147 |
-
onCleanup : function(){},
|
1148 |
-
onClosed : function(){},
|
1149 |
-
onError : function(){}
|
1150 |
-
};
|
1151 |
-
|
1152 |
-
$(document).ready(function() {
|
1153 |
-
$.fancybox.init();
|
1154 |
-
});
|
1155 |
-
|
1156 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skin/frontend/default/default/js/fancybox/jquery.fancybox-1.3.4.pack.js
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* FancyBox - jQuery Plugin
|
3 |
-
* Simple and fancy lightbox alternative
|
4 |
-
*
|
5 |
-
* Examples and documentation at: http://fancybox.net
|
6 |
-
*
|
7 |
-
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
8 |
-
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
9 |
-
*
|
10 |
-
* Version: 1.3.4 (11/11/2010)
|
11 |
-
* Requires: jQuery v1.3+
|
12 |
-
*
|
13 |
-
* Dual licensed under the MIT and GPL licenses:
|
14 |
-
* http://www.opensource.org/licenses/mit-license.php
|
15 |
-
* http://www.gnu.org/licenses/gpl.html
|
16 |
-
*/
|
17 |
-
|
18 |
-
;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
|
19 |
-
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
|
20 |
-
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
|
21 |
-
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
|
22 |
-
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
|
23 |
-
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
|
24 |
-
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
|
25 |
-
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
|
26 |
-
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
|
27 |
-
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
|
28 |
-
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
|
29 |
-
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
|
30 |
-
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
|
31 |
-
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
|
32 |
-
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
|
33 |
-
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
|
34 |
-
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
|
35 |
-
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
|
36 |
-
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
|
37 |
-
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
|
38 |
-
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
|
39 |
-
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
|
40 |
-
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
|
41 |
-
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
|
42 |
-
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
|
43 |
-
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
|
44 |
-
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
|
45 |
-
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
|
46 |
-
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skin/frontend/default/default/js/fancybox/jquery.mousewheel-3.0.4.pack.js
DELETED
@@ -1,14 +0,0 @@
|
|
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(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
|
14 |
-
f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|