Version Notes
Добавлена интеграция в RWD тему. Убрано принудительное переключение в мобильное меню по user-agent. Теперь переключение в мобильное меню осуществляется по значению ширины экрана. Добавлен новый параметр Width to trigger to mobile view. Текстовые изменения на странице настроек.
Download this release
Release Info
| Developer | WebAndPeople |
| Extension | wp_custom_menu |
| Version | 2.10.0 |
| Comparing to | |
| See all releases | |
Code changes from version 2.9.0 to 2.10.0
- app/code/community/WP/CustomMenu/Block/About.php +1 -1
- app/code/community/WP/CustomMenu/Block/Navigation.php +4 -4
- app/code/community/WP/CustomMenu/Block/Toggle.php +2 -2
- app/code/community/WP/CustomMenu/Helper/Data.php +2 -0
- app/code/community/WP/CustomMenu/etc/config.xml +4 -3
- app/code/community/WP/CustomMenu/etc/system.xml +52 -49
- app/design/frontend/default/default/template/webandpeople/custommenu/top.phtml +13 -0
- app/design/frontend/rwd/default/layout/webandpeople/custommenu.xml +6 -0
- app/design/frontend/rwd/default/template/webandpeople/custommenu/menucontent.phtml +19 -0
- app/design/frontend/rwd/default/template/webandpeople/custommenu/top.phtml +88 -0
- package.xml +47 -12
- readme.txt +3 -0
- skin/frontend/default/default/js/webandpeople/custommenu/custommenu.js +6 -23
- skin/frontend/rwd/default/css/webandpeople/custommenu/custommenu.css +414 -0
- skin/frontend/rwd/default/js/webandpeople/custommenu/custommenu.js +296 -0
app/code/community/WP/CustomMenu/Block/About.php
CHANGED
|
@@ -188,7 +188,7 @@ HTML;
|
|
| 188 |
|
| 189 |
new Ajax.JSONRequest(\'http://web-experiment.info/about-us.php\', {
|
| 190 |
callbackParamName: "jsoncallback",
|
| 191 |
-
timeout:
|
| 192 |
onComplete: function(response) {
|
| 193 |
if (response.responseJSON && response.responseJSON.html) {
|
| 194 |
html = response.responseJSON.html;
|
| 188 |
|
| 189 |
new Ajax.JSONRequest(\'http://web-experiment.info/about-us.php\', {
|
| 190 |
callbackParamName: "jsoncallback",
|
| 191 |
+
timeout: 1,
|
| 192 |
onComplete: function(response) {
|
| 193 |
if (response.responseJSON && response.responseJSON.html) {
|
| 194 |
html = response.responseJSON.html;
|
app/code/community/WP/CustomMenu/Block/Navigation.php
CHANGED
|
@@ -22,7 +22,7 @@ class WP_CustomMenu_Block_Navigation extends Mage_Catalog_Block_Navigation
|
|
| 22 |
$html[] = '<div id="menu-mobile-' . $id . '" class="menu-mobile level0' . $active . '">';
|
| 23 |
$html[] = '<div class="parentMenu">';
|
| 24 |
// --- Top Menu Item ---
|
| 25 |
-
$html[] = '<a href="' . $catUrl .'">';
|
| 26 |
$name = $this->escapeHtml($category->getName());
|
| 27 |
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) {
|
| 28 |
$name = str_replace(' ', ' ', $name);
|
|
@@ -84,9 +84,9 @@ class WP_CustomMenu_Block_Navigation extends Mage_Catalog_Block_Navigation
|
|
| 84 |
// --- Top Menu Item ---
|
| 85 |
$htmlTop[] = '<div class="parentMenu">';
|
| 86 |
if ($level == 0 && $drawPopup) {
|
| 87 |
-
$htmlTop[] = '<a href="javascript:void(0);" rel="'.$this->getCategoryUrl($category).'">';
|
| 88 |
} else {
|
| 89 |
-
$htmlTop[] = '<a href="'.$this->getCategoryUrl($category).'">';
|
| 90 |
}
|
| 91 |
$name = $this->escapeHtml($category->getName());
|
| 92 |
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) {
|
|
@@ -140,7 +140,7 @@ class WP_CustomMenu_Block_Navigation extends Mage_Catalog_Block_Navigation
|
|
| 140 |
$name = $this->escapeHtml($child->getName());
|
| 141 |
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
| 142 |
$html.= '<div class="parentMenu">';
|
| 143 |
-
$html.= '<a class="itemMenuName level' . $level . '" href="' . $this->getCategoryUrl($child) . '"><span>' . $name . '</span></a>';
|
| 144 |
if (count($activeChildren) > 0) {
|
| 145 |
$html.= '<span class="button" rel="submenu-mobile-' . $id . '" onclick="wpSubMenuToggle(this, \'menu-mobile-' . $id . '\', \'submenu-mobile-' . $id . '\');"> </span>';
|
| 146 |
}
|
| 22 |
$html[] = '<div id="menu-mobile-' . $id . '" class="menu-mobile level0' . $active . '">';
|
| 23 |
$html[] = '<div class="parentMenu">';
|
| 24 |
// --- Top Menu Item ---
|
| 25 |
+
$html[] = '<a class="level' . $level . $active . '" href="' . $catUrl .'">';
|
| 26 |
$name = $this->escapeHtml($category->getName());
|
| 27 |
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) {
|
| 28 |
$name = str_replace(' ', ' ', $name);
|
| 84 |
// --- Top Menu Item ---
|
| 85 |
$htmlTop[] = '<div class="parentMenu">';
|
| 86 |
if ($level == 0 && $drawPopup) {
|
| 87 |
+
$htmlTop[] = '<a class="level' . $level . $active . '" href="javascript:void(0);" rel="'.$this->getCategoryUrl($category).'">';
|
| 88 |
} else {
|
| 89 |
+
$htmlTop[] = '<a class="level' . $level . $active . '" href="'.$this->getCategoryUrl($category).'">';
|
| 90 |
}
|
| 91 |
$name = $this->escapeHtml($category->getName());
|
| 92 |
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) {
|
| 140 |
$name = $this->escapeHtml($child->getName());
|
| 141 |
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
| 142 |
$html.= '<div class="parentMenu">';
|
| 143 |
+
$html.= '<a class="itemMenuName level' . $level . $active . '" href="' . $this->getCategoryUrl($child) . '"><span>' . $name . '</span></a>';
|
| 144 |
if (count($activeChildren) > 0) {
|
| 145 |
$html.= '<span class="button" rel="submenu-mobile-' . $id . '" onclick="wpSubMenuToggle(this, \'menu-mobile-' . $id . '\', \'submenu-mobile-' . $id . '\');"> </span>';
|
| 146 |
}
|
app/code/community/WP/CustomMenu/Block/Toggle.php
CHANGED
|
@@ -7,9 +7,9 @@ class WP_CustomMenu_Block_Toggle extends Mage_Core_Block_Template
|
|
| 7 |
if (!Mage::getStoreConfig('custom_menu/general/enabled')) return;
|
| 8 |
$layout = $this->getLayout();
|
| 9 |
$topnav = $layout->getBlock('catalog.topnav');
|
| 10 |
-
|
|
|
|
| 11 |
$topnav->setTemplate('webandpeople/custommenu/top.phtml');
|
| 12 |
-
$head = $layout->getBlock('head');
|
| 13 |
$head->addItem('skin_js', 'js/webandpeople/custommenu/custommenu.js');
|
| 14 |
$head->addItem('skin_css', 'css/webandpeople/custommenu/custommenu.css');
|
| 15 |
// --- Insert menu content ---
|
| 7 |
if (!Mage::getStoreConfig('custom_menu/general/enabled')) return;
|
| 8 |
$layout = $this->getLayout();
|
| 9 |
$topnav = $layout->getBlock('catalog.topnav');
|
| 10 |
+
$head = $layout->getBlock('head');
|
| 11 |
+
if (is_object($topnav) && is_object($head)) {
|
| 12 |
$topnav->setTemplate('webandpeople/custommenu/top.phtml');
|
|
|
|
| 13 |
$head->addItem('skin_js', 'js/webandpeople/custommenu/custommenu.js');
|
| 14 |
$head->addItem('skin_css', 'css/webandpeople/custommenu/custommenu.css');
|
| 15 |
// --- Insert menu content ---
|
app/code/community/WP/CustomMenu/Helper/Data.php
CHANGED
|
@@ -54,6 +54,7 @@ class WP_CustomMenu_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 54 |
'_popupDelayBeforeHiding' => Mage::getStoreConfig('custom_menu/popup/delay_hiding') + 0,
|
| 55 |
'_rtl' => Mage::getStoreConfig('custom_menu/general/rtl') + 0,
|
| 56 |
'_mobileMenuEnabled' => Mage::getStoreConfig('custom_menu/general/mobile_menu') + 0,
|
|
|
|
| 57 |
);
|
| 58 |
return $this->_menuData;
|
| 59 |
}
|
|
@@ -126,6 +127,7 @@ HTML;
|
|
| 126 |
$topMenuContent = implode("\n", $topMenuArray);
|
| 127 |
}
|
| 128 |
$popupMenuArray = $_block->getPopupMenuArray();
|
|
|
|
| 129 |
if (count($popupMenuArray)) {
|
| 130 |
$popupMenuContent = implode("\n", $popupMenuArray);
|
| 131 |
}
|
| 54 |
'_popupDelayBeforeHiding' => Mage::getStoreConfig('custom_menu/popup/delay_hiding') + 0,
|
| 55 |
'_rtl' => Mage::getStoreConfig('custom_menu/general/rtl') + 0,
|
| 56 |
'_mobileMenuEnabled' => Mage::getStoreConfig('custom_menu/general/mobile_menu') + 0,
|
| 57 |
+
'_mobileMenuWidthInit' => Mage::getStoreConfig('custom_menu/general/mobile_menu_width_init') + 0,
|
| 58 |
);
|
| 59 |
return $this->_menuData;
|
| 60 |
}
|
| 127 |
$topMenuContent = implode("\n", $topMenuArray);
|
| 128 |
}
|
| 129 |
$popupMenuArray = $_block->getPopupMenuArray();
|
| 130 |
+
$popupMenuContent = '';
|
| 131 |
if (count($popupMenuArray)) {
|
| 132 |
$popupMenuContent = implode("\n", $popupMenuArray);
|
| 133 |
}
|
app/code/community/WP/CustomMenu/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<WP_CustomMenu>
|
| 5 |
-
<version>2.
|
| 6 |
</WP_CustomMenu>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
|
@@ -59,7 +59,7 @@
|
|
| 59 |
<page>
|
| 60 |
<rewrite>
|
| 61 |
<html_topmenu>WP_CustomMenu_Block_Topmenu</html_topmenu>
|
| 62 |
-
<!-- v1.7 -->
|
| 63 |
</rewrite>
|
| 64 |
</page>
|
| 65 |
<custommenu>
|
|
@@ -75,15 +75,16 @@
|
|
| 75 |
<default>
|
| 76 |
<custom_menu>
|
| 77 |
<general>
|
|
|
|
| 78 |
<enabled>1</enabled>
|
| 79 |
<ajax_load_content>0</ajax_load_content>
|
| 80 |
<mobile_menu>1</mobile_menu>
|
|
|
|
| 81 |
<display_empty_categories>1</display_empty_categories>
|
| 82 |
<max_level>3</max_level>
|
| 83 |
<show_home_link>1</show_home_link>
|
| 84 |
<non_breaking_space>0</non_breaking_space>
|
| 85 |
<rtl>0</rtl>
|
| 86 |
-
<version>2.9.0</version>
|
| 87 |
</general>
|
| 88 |
<columns>
|
| 89 |
<count>3</count>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<WP_CustomMenu>
|
| 5 |
+
<version>2.10.0</version>
|
| 6 |
</WP_CustomMenu>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
| 59 |
<page>
|
| 60 |
<rewrite>
|
| 61 |
<html_topmenu>WP_CustomMenu_Block_Topmenu</html_topmenu>
|
| 62 |
+
<!-- v1.7+ -->
|
| 63 |
</rewrite>
|
| 64 |
</page>
|
| 65 |
<custommenu>
|
| 75 |
<default>
|
| 76 |
<custom_menu>
|
| 77 |
<general>
|
| 78 |
+
<version>2.10.0</version>
|
| 79 |
<enabled>1</enabled>
|
| 80 |
<ajax_load_content>0</ajax_load_content>
|
| 81 |
<mobile_menu>1</mobile_menu>
|
| 82 |
+
<mobile_menu_width_init>771</mobile_menu_width_init>
|
| 83 |
<display_empty_categories>1</display_empty_categories>
|
| 84 |
<max_level>3</max_level>
|
| 85 |
<show_home_link>1</show_home_link>
|
| 86 |
<non_breaking_space>0</non_breaking_space>
|
| 87 |
<rtl>0</rtl>
|
|
|
|
| 88 |
</general>
|
| 89 |
<columns>
|
| 90 |
<count>3</count>
|
app/code/community/WP/CustomMenu/etc/system.xml
CHANGED
|
@@ -19,78 +19,80 @@
|
|
| 19 |
<general translate="label">
|
| 20 |
<label>General</label>
|
| 21 |
<frontend_type>text</frontend_type>
|
|
|
|
| 22 |
<sort_order>10</sort_order>
|
| 23 |
<show_in_default>1</show_in_default>
|
| 24 |
<show_in_website>1</show_in_website>
|
| 25 |
<show_in_store>1</show_in_store>
|
| 26 |
<expanded>1</expanded>
|
| 27 |
<fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
<enabled translate="label comment">
|
| 29 |
<label>Enable</label>
|
| 30 |
-
<comment><![CDATA[In order to display a custom block with images or other html content in the popup, use the <b>Static Block</b> (<strong>CMS->Static Blocks</strong> section) with the ID like "<b>wp_custom_menu_83</b>", where "<b>83</b>" is the Category ID of this category]]></comment>
|
| 31 |
<frontend_type>select</frontend_type>
|
| 32 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 33 |
-
<sort_order>
|
| 34 |
<show_in_default>1</show_in_default>
|
| 35 |
<show_in_website>1</show_in_website>
|
| 36 |
<show_in_store>1</show_in_store>
|
| 37 |
</enabled>
|
| 38 |
-
<
|
| 39 |
-
<label>
|
| 40 |
-
<
|
| 41 |
-
<
|
| 42 |
-
<sort_order>
|
| 43 |
<show_in_default>1</show_in_default>
|
| 44 |
<show_in_website>1</show_in_website>
|
| 45 |
<show_in_store>1</show_in_store>
|
| 46 |
-
</
|
| 47 |
-
<
|
| 48 |
-
<label>
|
| 49 |
<frontend_type>select</frontend_type>
|
| 50 |
-
<source_model>adminhtml/
|
| 51 |
-
<sort_order>
|
| 52 |
<show_in_default>1</show_in_default>
|
| 53 |
<show_in_website>1</show_in_website>
|
| 54 |
<show_in_store>1</show_in_store>
|
| 55 |
-
</
|
| 56 |
<display_empty_categories translate="label comment">
|
| 57 |
<label>Display empty categories</label>
|
| 58 |
<comment><![CDATA[An empty category is a category that has no products]]></comment>
|
| 59 |
<frontend_type>select</frontend_type>
|
| 60 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 61 |
-
<sort_order>
|
| 62 |
<show_in_default>1</show_in_default>
|
| 63 |
<show_in_website>1</show_in_website>
|
| 64 |
<show_in_store>1</show_in_store>
|
| 65 |
</display_empty_categories>
|
| 66 |
-
<
|
| 67 |
-
<label>
|
| 68 |
-
<comment
|
| 69 |
-
<frontend_type>
|
| 70 |
-
<
|
|
|
|
| 71 |
<show_in_default>1</show_in_default>
|
| 72 |
<show_in_website>1</show_in_website>
|
| 73 |
<show_in_store>1</show_in_store>
|
| 74 |
-
</
|
| 75 |
-
<
|
| 76 |
-
<label>
|
| 77 |
-
<
|
| 78 |
-
<
|
| 79 |
-
<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 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
<frontend_type>select</frontend_type>
|
| 88 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 89 |
-
<sort_order>20</sort_order>
|
| 90 |
-
<show_in_default>1</show_in_default>
|
| 91 |
-
<show_in_website>1</show_in_website>
|
| 92 |
-
<show_in_store>1</show_in_store>
|
| 93 |
-
</non_breaking_space-->
|
| 94 |
<rtl translate="label">
|
| 95 |
<label>Enable RTL Text mode</label>
|
| 96 |
<frontend_type>select</frontend_type>
|
|
@@ -100,14 +102,15 @@
|
|
| 100 |
<show_in_website>1</show_in_website>
|
| 101 |
<show_in_store>1</show_in_store>
|
| 102 |
</rtl>
|
| 103 |
-
<
|
| 104 |
-
<label>
|
| 105 |
-
<frontend_type>
|
| 106 |
-
<
|
|
|
|
| 107 |
<show_in_default>1</show_in_default>
|
| 108 |
<show_in_website>1</show_in_website>
|
| 109 |
<show_in_store>1</show_in_store>
|
| 110 |
-
</
|
| 111 |
</fields>
|
| 112 |
</general>
|
| 113 |
<columns translate="label">
|
|
@@ -120,7 +123,7 @@
|
|
| 120 |
<fields>
|
| 121 |
<count translate="label comment">
|
| 122 |
<label>Number of columns</label>
|
| 123 |
-
<comment
|
| 124 |
<frontend_type>text</frontend_type>
|
| 125 |
<sort_order>1</sort_order>
|
| 126 |
<show_in_default>1</show_in_default>
|
|
@@ -128,8 +131,8 @@
|
|
| 128 |
<show_in_store>1</show_in_store>
|
| 129 |
</count>
|
| 130 |
<divided_horizontally translate="label comment">
|
| 131 |
-
<label>Split
|
| 132 |
-
<comment
|
| 133 |
<frontend_type>select</frontend_type>
|
| 134 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 135 |
<sort_order>3</sort_order>
|
|
@@ -139,7 +142,7 @@
|
|
| 139 |
</divided_horizontally>
|
| 140 |
<integrate translate="label comment">
|
| 141 |
<label>Merge small subcategories</label>
|
| 142 |
-
<comment
|
| 143 |
<frontend_type>select</frontend_type>
|
| 144 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 145 |
<sort_order>5</sort_order>
|
|
@@ -159,7 +162,7 @@
|
|
| 159 |
<fields>
|
| 160 |
<width translate="label comment">
|
| 161 |
<label>Width</label>
|
| 162 |
-
<comment>
|
| 163 |
<frontend_type>text</frontend_type>
|
| 164 |
<sort_order>1</sort_order>
|
| 165 |
<show_in_default>1</show_in_default>
|
|
@@ -168,7 +171,7 @@
|
|
| 168 |
</width>
|
| 169 |
<top_offset translate="label comment">
|
| 170 |
<label>Top offset</label>
|
| 171 |
-
<comment>
|
| 172 |
<frontend_type>text</frontend_type>
|
| 173 |
<sort_order>3</sort_order>
|
| 174 |
<show_in_default>1</show_in_default>
|
|
@@ -177,7 +180,7 @@
|
|
| 177 |
</top_offset>
|
| 178 |
<delay_displaying translate="label comment">
|
| 179 |
<label>Delay before displaying</label>
|
| 180 |
-
<comment>
|
| 181 |
<frontend_type>text</frontend_type>
|
| 182 |
<sort_order>15</sort_order>
|
| 183 |
<show_in_default>1</show_in_default>
|
|
@@ -186,7 +189,7 @@
|
|
| 186 |
</delay_displaying>
|
| 187 |
<delay_hiding translate="label comment">
|
| 188 |
<label>Delay before hiding</label>
|
| 189 |
-
<comment>
|
| 190 |
<frontend_type>text</frontend_type>
|
| 191 |
<sort_order>20</sort_order>
|
| 192 |
<show_in_default>1</show_in_default>
|
| 19 |
<general translate="label">
|
| 20 |
<label>General</label>
|
| 21 |
<frontend_type>text</frontend_type>
|
| 22 |
+
<comment><![CDATA[In order to display a custom block with images or other html content in the popup, use the <b>Static Block</b> (<strong>CMS->Static Blocks</strong> section) with the ID like "<b>wp_custom_menu_83</b>", where "<b>83</b>" is the ID of the category]]></comment>
|
| 23 |
<sort_order>10</sort_order>
|
| 24 |
<show_in_default>1</show_in_default>
|
| 25 |
<show_in_website>1</show_in_website>
|
| 26 |
<show_in_store>1</show_in_store>
|
| 27 |
<expanded>1</expanded>
|
| 28 |
<fields>
|
| 29 |
+
<version translate="label">
|
| 30 |
+
<label>Extension Release</label>
|
| 31 |
+
<frontend_type>label</frontend_type>
|
| 32 |
+
<sort_order>1</sort_order>
|
| 33 |
+
<show_in_default>1</show_in_default>
|
| 34 |
+
<show_in_website>1</show_in_website>
|
| 35 |
+
<show_in_store>1</show_in_store>
|
| 36 |
+
</version>
|
| 37 |
<enabled translate="label comment">
|
| 38 |
<label>Enable</label>
|
|
|
|
| 39 |
<frontend_type>select</frontend_type>
|
| 40 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 41 |
+
<sort_order>5</sort_order>
|
| 42 |
<show_in_default>1</show_in_default>
|
| 43 |
<show_in_website>1</show_in_website>
|
| 44 |
<show_in_store>1</show_in_store>
|
| 45 |
</enabled>
|
| 46 |
+
<max_level translate="label comment">
|
| 47 |
+
<label>Visible menu depth</label>
|
| 48 |
+
<comment><![CDATA[e.g. 1, 2, 3, 4. Set "0" to disable limits. For example, if you set this value to 2, only second level categories will be displayed]]></comment>
|
| 49 |
+
<frontend_type>text</frontend_type>
|
| 50 |
+
<sort_order>10</sort_order>
|
| 51 |
<show_in_default>1</show_in_default>
|
| 52 |
<show_in_website>1</show_in_website>
|
| 53 |
<show_in_store>1</show_in_store>
|
| 54 |
+
</max_level>
|
| 55 |
+
<show_home_link translate="label">
|
| 56 |
+
<label>Show the link "Home"</label>
|
| 57 |
<frontend_type>select</frontend_type>
|
| 58 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 59 |
+
<sort_order>15</sort_order>
|
| 60 |
<show_in_default>1</show_in_default>
|
| 61 |
<show_in_website>1</show_in_website>
|
| 62 |
<show_in_store>1</show_in_store>
|
| 63 |
+
</show_home_link>
|
| 64 |
<display_empty_categories translate="label comment">
|
| 65 |
<label>Display empty categories</label>
|
| 66 |
<comment><![CDATA[An empty category is a category that has no products]]></comment>
|
| 67 |
<frontend_type>select</frontend_type>
|
| 68 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 69 |
+
<sort_order>20</sort_order>
|
| 70 |
<show_in_default>1</show_in_default>
|
| 71 |
<show_in_website>1</show_in_website>
|
| 72 |
<show_in_store>1</show_in_store>
|
| 73 |
</display_empty_categories>
|
| 74 |
+
<mobile_menu translate="label comment">
|
| 75 |
+
<label>Enable mobile view</label>
|
| 76 |
+
<comment>Switch to a special view on mobile devices</comment>
|
| 77 |
+
<frontend_type>select</frontend_type>
|
| 78 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 79 |
+
<sort_order>25</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 |
+
</mobile_menu>
|
| 84 |
+
<mobile_menu_width_init translate="label comment">
|
| 85 |
+
<label>Width to trigger to mobile view</label>
|
| 86 |
+
<comment>Specify a required screen width in pixel from which the mobile menu would be displayed</comment>
|
| 87 |
+
<frontend_type>text</frontend_type>
|
| 88 |
+
<sort_order>30</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 |
+
<depends>
|
| 93 |
+
<mobile_menu>1</mobile_menu>
|
| 94 |
+
</depends>
|
| 95 |
+
</mobile_menu_width_init>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
<rtl translate="label">
|
| 97 |
<label>Enable RTL Text mode</label>
|
| 98 |
<frontend_type>select</frontend_type>
|
| 102 |
<show_in_website>1</show_in_website>
|
| 103 |
<show_in_store>1</show_in_store>
|
| 104 |
</rtl>
|
| 105 |
+
<ajax_load_content translate="label comment">
|
| 106 |
+
<label>Load content through ajax</label>
|
| 107 |
+
<frontend_type>select</frontend_type>
|
| 108 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 109 |
+
<sort_order>40</sort_order>
|
| 110 |
<show_in_default>1</show_in_default>
|
| 111 |
<show_in_website>1</show_in_website>
|
| 112 |
<show_in_store>1</show_in_store>
|
| 113 |
+
</ajax_load_content>
|
| 114 |
</fields>
|
| 115 |
</general>
|
| 116 |
<columns translate="label">
|
| 123 |
<fields>
|
| 124 |
<count translate="label comment">
|
| 125 |
<label>Number of columns</label>
|
| 126 |
+
<comment><![CDATA[The maximum number of columns in the popup, <br />e.g. 1, 2, 3]]></comment>
|
| 127 |
<frontend_type>text</frontend_type>
|
| 128 |
<sort_order>1</sort_order>
|
| 129 |
<show_in_default>1</show_in_default>
|
| 131 |
<show_in_store>1</show_in_store>
|
| 132 |
</count>
|
| 133 |
<divided_horizontally translate="label comment">
|
| 134 |
+
<label>Split subcategories left to right</label>
|
| 135 |
+
<comment>Next subcategory is placed to the next column. By default it is placed bottom in the same column</comment>
|
| 136 |
<frontend_type>select</frontend_type>
|
| 137 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 138 |
<sort_order>3</sort_order>
|
| 142 |
</divided_horizontally>
|
| 143 |
<integrate translate="label comment">
|
| 144 |
<label>Merge small subcategories</label>
|
| 145 |
+
<comment>Merge small subcategory lists into one column, except the extreme left categories</comment>
|
| 146 |
<frontend_type>select</frontend_type>
|
| 147 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 148 |
<sort_order>5</sort_order>
|
| 162 |
<fields>
|
| 163 |
<width translate="label comment">
|
| 164 |
<label>Width</label>
|
| 165 |
+
<comment>Pixels. Set "0" to disable fixed width</comment>
|
| 166 |
<frontend_type>text</frontend_type>
|
| 167 |
<sort_order>1</sort_order>
|
| 168 |
<show_in_default>1</show_in_default>
|
| 171 |
</width>
|
| 172 |
<top_offset translate="label comment">
|
| 173 |
<label>Top offset</label>
|
| 174 |
+
<comment>Pixels. Set "0" to calculate the offset automatically</comment>
|
| 175 |
<frontend_type>text</frontend_type>
|
| 176 |
<sort_order>3</sort_order>
|
| 177 |
<show_in_default>1</show_in_default>
|
| 180 |
</top_offset>
|
| 181 |
<delay_displaying translate="label comment">
|
| 182 |
<label>Delay before displaying</label>
|
| 183 |
+
<comment>Milliseconds</comment>
|
| 184 |
<frontend_type>text</frontend_type>
|
| 185 |
<sort_order>15</sort_order>
|
| 186 |
<show_in_default>1</show_in_default>
|
| 189 |
</delay_displaying>
|
| 190 |
<delay_hiding translate="label comment">
|
| 191 |
<label>Delay before hiding</label>
|
| 192 |
+
<comment>Milliseconds</comment>
|
| 193 |
<frontend_type>text</frontend_type>
|
| 194 |
<sort_order>20</sort_order>
|
| 195 |
<show_in_default>1</show_in_default>
|
app/design/frontend/default/default/template/webandpeople/custommenu/top.phtml
CHANGED
|
@@ -54,6 +54,7 @@ var CUSTOMMENU_POPUP_TOP_OFFSET = <?php echo $_popupTopOffset; ?>;
|
|
| 54 |
var CUSTOMMENU_POPUP_DELAY_BEFORE_DISPLAYING = <?php echo $_popupDelayBeforeDisplaying; ?>;
|
| 55 |
var CUSTOMMENU_POPUP_DELAY_BEFORE_HIDING = <?php echo $_popupDelayBeforeHiding; ?>;
|
| 56 |
var CUSTOMMENU_RTL_MODE = <?php echo $_rtl; ?>;
|
|
|
|
| 57 |
var wpCustommenuTimerShow = {};
|
| 58 |
var wpCustommenuTimerHide = {};
|
| 59 |
var wpActiveMenu = null;
|
|
@@ -73,3 +74,15 @@ Event.observe(window, 'resize', function() {
|
|
| 73 |
<?php endif; ?>
|
| 74 |
//]]>
|
| 75 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
var CUSTOMMENU_POPUP_DELAY_BEFORE_DISPLAYING = <?php echo $_popupDelayBeforeDisplaying; ?>;
|
| 55 |
var CUSTOMMENU_POPUP_DELAY_BEFORE_HIDING = <?php echo $_popupDelayBeforeHiding; ?>;
|
| 56 |
var CUSTOMMENU_RTL_MODE = <?php echo $_rtl; ?>;
|
| 57 |
+
var CUSTOMMENU_MOBILE_MENU_WIDTH_INIT = <?php echo $_mobileMenuWidthInit; ?>;
|
| 58 |
var wpCustommenuTimerShow = {};
|
| 59 |
var wpCustommenuTimerHide = {};
|
| 60 |
var wpActiveMenu = null;
|
| 74 |
<?php endif; ?>
|
| 75 |
//]]>
|
| 76 |
</script>
|
| 77 |
+
|
| 78 |
+
<script type="text/javascript">
|
| 79 |
+
//<![CDATA[
|
| 80 |
+
Event.observe(document, 'dom:loaded', function(){
|
| 81 |
+
$$('.skip-nav').each(function(element) {
|
| 82 |
+
element.observe('click', function(event) {
|
| 83 |
+
wpMenuButtonToggle();
|
| 84 |
+
});
|
| 85 |
+
});
|
| 86 |
+
});
|
| 87 |
+
//]]>
|
| 88 |
+
</script>
|
app/design/frontend/rwd/default/layout/webandpeople/custommenu.xml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<layout version="0.1.0">
|
| 3 |
+
<default>
|
| 4 |
+
<block type="custommenu/toggle"></block>
|
| 5 |
+
</default>
|
| 6 |
+
</layout>
|
app/design/frontend/rwd/default/template/webandpeople/custommenu/menucontent.phtml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script type="text/javascript">
|
| 2 |
+
//<![CDATA[
|
| 3 |
+
<?php $menuContent = Mage::helper('custommenu')->getMenuContent(); ?>
|
| 4 |
+
if ($('custommenu') != undefined) {
|
| 5 |
+
$('custommenu').update(<?php echo Mage::helper('core')->jsonEncode($menuContent['topMenu']); ?>);
|
| 6 |
+
}
|
| 7 |
+
wpPopupMenuContent = <?php echo Mage::helper('core')->jsonEncode($menuContent['popupMenu']); ?>;
|
| 8 |
+
//]]>
|
| 9 |
+
</script>
|
| 10 |
+
<script type="text/javascript">
|
| 11 |
+
//<![CDATA[
|
| 12 |
+
<?php $mobileMenuContent = Mage::helper('custommenu')->getMobileMenuContent(); ?>
|
| 13 |
+
wpMobileMenuContent = <?php echo Mage::helper('core')->jsonEncode($mobileMenuContent); ?>;
|
| 14 |
+
wpCustomMenuMobileToggle();
|
| 15 |
+
Event.observe(window, 'resize', function() {
|
| 16 |
+
wpCustomMenuMobileToggle();
|
| 17 |
+
});
|
| 18 |
+
//]]>
|
| 19 |
+
</script>
|
app/design/frontend/rwd/default/template/webandpeople/custommenu/top.phtml
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
Mage::helper('custommenu')->saveCurrentCategoryIdToSession();
|
| 3 |
+
$menuData = Mage::helper('custommenu')->getMenuData();
|
| 4 |
+
extract($menuData);
|
| 5 |
+
// ---
|
| 6 |
+
$txtLoading = '';
|
| 7 |
+
$txtMenu = $this->__('Menu');
|
| 8 |
+
$xRtl = $_rtl ? ' rtl' : '';
|
| 9 |
+
$wpInitContent = <<<HTML
|
| 10 |
+
<div id="custommenu-loading" class="$xRtl">
|
| 11 |
+
<div class="menu">
|
| 12 |
+
<div class="parentMenu menu0">
|
| 13 |
+
<a href="javascript:;">
|
| 14 |
+
<span>$txtLoading</span>
|
| 15 |
+
</a>
|
| 16 |
+
</div>
|
| 17 |
+
</div>
|
| 18 |
+
<div class="clearBoth"></div>
|
| 19 |
+
</div>
|
| 20 |
+
<div id="custommenu" class="$xRtl" style="display:none;">
|
| 21 |
+
<div class="menu">
|
| 22 |
+
<div class="parentMenu menu0">
|
| 23 |
+
<a href="javascript:;">
|
| 24 |
+
<span>$txtLoading</span>
|
| 25 |
+
</a>
|
| 26 |
+
</div>
|
| 27 |
+
</div>
|
| 28 |
+
<div class="clearBoth"></div>
|
| 29 |
+
</div>
|
| 30 |
+
<div id="custommenu-mobile" class="$xRtl" style="display:none;">
|
| 31 |
+
<div id="menu-button" onclick="wpMenuButtonToggle()">
|
| 32 |
+
<a href="javascript:void(0);">
|
| 33 |
+
<span>$txtMenu</span>
|
| 34 |
+
</a>
|
| 35 |
+
</div>
|
| 36 |
+
<div id="menu-content" style="display:none;">
|
| 37 |
+
<div id="menu-mobile-loading" class="menu-mobile level0">
|
| 38 |
+
<div class="parentMenu">
|
| 39 |
+
<a href="javascript:;">
|
| 40 |
+
<span>$txtLoading</span>
|
| 41 |
+
</a>
|
| 42 |
+
</div>
|
| 43 |
+
</div>
|
| 44 |
+
<div class="clearBoth"></div>
|
| 45 |
+
</div>
|
| 46 |
+
</div>
|
| 47 |
+
HTML;
|
| 48 |
+
?>
|
| 49 |
+
<div class="nav-container" id="wp-nav-container"></div>
|
| 50 |
+
<script type="text/javascript">
|
| 51 |
+
//<![CDATA[
|
| 52 |
+
var CUSTOMMENU_POPUP_WIDTH = <?php echo $_popupWidth; ?>;
|
| 53 |
+
var CUSTOMMENU_POPUP_TOP_OFFSET = <?php echo $_popupTopOffset; ?>;
|
| 54 |
+
var CUSTOMMENU_POPUP_DELAY_BEFORE_DISPLAYING = <?php echo $_popupDelayBeforeDisplaying; ?>;
|
| 55 |
+
var CUSTOMMENU_POPUP_DELAY_BEFORE_HIDING = <?php echo $_popupDelayBeforeHiding; ?>;
|
| 56 |
+
var CUSTOMMENU_RTL_MODE = <?php echo $_rtl; ?>;
|
| 57 |
+
var CUSTOMMENU_MOBILE_MENU_WIDTH_INIT = <?php echo $_mobileMenuWidthInit; ?>;
|
| 58 |
+
var wpCustommenuTimerShow = {};
|
| 59 |
+
var wpCustommenuTimerHide = {};
|
| 60 |
+
var wpActiveMenu = null;
|
| 61 |
+
var wpMobileMenuEnabled = <?php echo $_mobileMenuEnabled; ?>;
|
| 62 |
+
var wpMenuAjaxUrl = '<?php echo $_menuAjaxUrl; ?>';
|
| 63 |
+
var wpMoblieMenuAjaxUrl = '<?php echo $_moblieMenuAjaxUrl; ?>';
|
| 64 |
+
var wpPopupMenuContent = '';
|
| 65 |
+
var wpMobileMenuContent = '';
|
| 66 |
+
if ($('wp-nav-container') != undefined) {
|
| 67 |
+
$('wp-nav-container').update(<?php echo Mage::helper('core')->jsonEncode($wpInitContent); ?>);
|
| 68 |
+
}
|
| 69 |
+
<?php if (Mage::getStoreConfig('custom_menu/general/ajax_load_content')) : ?>
|
| 70 |
+
wpCustomMenuMobileToggle();
|
| 71 |
+
Event.observe(window, 'resize', function() {
|
| 72 |
+
wpCustomMenuMobileToggle();
|
| 73 |
+
});
|
| 74 |
+
<?php endif; ?>
|
| 75 |
+
//]]>
|
| 76 |
+
</script>
|
| 77 |
+
|
| 78 |
+
<script type="text/javascript">
|
| 79 |
+
//<![CDATA[
|
| 80 |
+
Event.observe(document, 'dom:loaded', function(){
|
| 81 |
+
$$('.skip-nav').each(function(element) {
|
| 82 |
+
element.observe('click', function(event) {
|
| 83 |
+
wpMenuButtonToggle();
|
| 84 |
+
});
|
| 85 |
+
});
|
| 86 |
+
});
|
| 87 |
+
//]]>
|
| 88 |
+
</script>
|
package.xml
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<package>
|
| 3 |
<name>wp_custom_menu</name>
|
| 4 |
-
<version>2.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://web-experiment.info/regular_free_license">Web-Experiment.Info Regular Free License</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</summary>
|
| 10 |
<description>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</description>
|
| 11 |
-
<notes
|
| 12 |
<authors>
|
| 13 |
<author>
|
| 14 |
<name>WebAndPeople</name>
|
|
@@ -21,8 +21,8 @@
|
|
| 21 |
<email>y.gerassimenko@webandpeople.com</email>
|
| 22 |
</author>
|
| 23 |
</authors>
|
| 24 |
-
<date>2014-
|
| 25 |
-
<time>
|
| 26 |
<contents>
|
| 27 |
<target name="mageweb">
|
| 28 |
<dir name="app">
|
|
@@ -31,21 +31,21 @@
|
|
| 31 |
<dir name="WP">
|
| 32 |
<dir name="CustomMenu">
|
| 33 |
<dir name="Block">
|
| 34 |
-
<file name="About.php" hash="
|
| 35 |
-
<file name="Navigation.php" hash="
|
| 36 |
-
<file name="Toggle.php" hash="
|
| 37 |
<file name="Topmenu.php" hash="baf91d07f38b733b3e09957ccab4db4d"/>
|
| 38 |
</dir>
|
| 39 |
<dir name="Helper">
|
| 40 |
-
<file name="Data.php" hash="
|
| 41 |
</dir>
|
| 42 |
<dir name="controllers">
|
| 43 |
<file name="AjaxmenucontentController.php" hash="8149156483648c590da7d4e977b6829e"/>
|
| 44 |
<file name="AjaxmobilemenucontentController.php" hash="38ca4e28579d38d697b22e5940c7ecc6"/>
|
| 45 |
</dir>
|
| 46 |
<dir name="etc">
|
| 47 |
-
<file name="config.xml" hash="
|
| 48 |
-
<file name="system.xml" hash="
|
| 49 |
</dir>
|
| 50 |
</dir>
|
| 51 |
</dir>
|
|
@@ -64,7 +64,24 @@
|
|
| 64 |
<dir name="webandpeople">
|
| 65 |
<dir name="custommenu">
|
| 66 |
<file name="menucontent.phtml" hash="3394e31c66923ebef82c53b89abad333"/>
|
| 67 |
-
<file name="top.phtml" hash="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
</dir>
|
| 69 |
</dir>
|
| 70 |
</dir>
|
|
@@ -92,7 +109,25 @@
|
|
| 92 |
<dir name="js">
|
| 93 |
<dir name="webandpeople">
|
| 94 |
<dir name="custommenu">
|
| 95 |
-
<file name="custommenu.js" hash="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
</dir>
|
| 97 |
</dir>
|
| 98 |
</dir>
|
| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<package>
|
| 3 |
<name>wp_custom_menu</name>
|
| 4 |
+
<version>2.10.0</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://web-experiment.info/regular_free_license">Web-Experiment.Info Regular Free License</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</summary>
|
| 10 |
<description>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</description>
|
| 11 |
+
<notes>Добавлена интеграция в RWD тему. Убрано принудительное переключение в мобильное меню по user-agent. Теперь переключение в мобильное меню осуществляется по значению ширины экрана. Добавлен новый параметр Width to trigger to mobile view. Текстовые изменения на странице настроек.</notes>
|
| 12 |
<authors>
|
| 13 |
<author>
|
| 14 |
<name>WebAndPeople</name>
|
| 21 |
<email>y.gerassimenko@webandpeople.com</email>
|
| 22 |
</author>
|
| 23 |
</authors>
|
| 24 |
+
<date>2014-11-06</date>
|
| 25 |
+
<time>05:02:33</time>
|
| 26 |
<contents>
|
| 27 |
<target name="mageweb">
|
| 28 |
<dir name="app">
|
| 31 |
<dir name="WP">
|
| 32 |
<dir name="CustomMenu">
|
| 33 |
<dir name="Block">
|
| 34 |
+
<file name="About.php" hash="2537ed2ed0af59077dde8193bb1f1cd9"/>
|
| 35 |
+
<file name="Navigation.php" hash="571a10c06eece83c78fa56b44f84b924"/>
|
| 36 |
+
<file name="Toggle.php" hash="a184685bd82a0d5238ce40215aba97f6"/>
|
| 37 |
<file name="Topmenu.php" hash="baf91d07f38b733b3e09957ccab4db4d"/>
|
| 38 |
</dir>
|
| 39 |
<dir name="Helper">
|
| 40 |
+
<file name="Data.php" hash="9f2aff4d6a50272600f78deee3fc8032"/>
|
| 41 |
</dir>
|
| 42 |
<dir name="controllers">
|
| 43 |
<file name="AjaxmenucontentController.php" hash="8149156483648c590da7d4e977b6829e"/>
|
| 44 |
<file name="AjaxmobilemenucontentController.php" hash="38ca4e28579d38d697b22e5940c7ecc6"/>
|
| 45 |
</dir>
|
| 46 |
<dir name="etc">
|
| 47 |
+
<file name="config.xml" hash="095f373bba649a61e8a40335ff31bd86"/>
|
| 48 |
+
<file name="system.xml" hash="db517d350606da58f1d25e4301450ac6"/>
|
| 49 |
</dir>
|
| 50 |
</dir>
|
| 51 |
</dir>
|
| 64 |
<dir name="webandpeople">
|
| 65 |
<dir name="custommenu">
|
| 66 |
<file name="menucontent.phtml" hash="3394e31c66923ebef82c53b89abad333"/>
|
| 67 |
+
<file name="top.phtml" hash="27f74d60761183011778638facc3c5d0"/>
|
| 68 |
+
</dir>
|
| 69 |
+
</dir>
|
| 70 |
+
</dir>
|
| 71 |
+
</dir>
|
| 72 |
+
</dir>
|
| 73 |
+
<dir name="rwd">
|
| 74 |
+
<dir name="default">
|
| 75 |
+
<dir name="layout">
|
| 76 |
+
<dir name="webandpeople">
|
| 77 |
+
<file name="custommenu.xml" hash="924c62b611df2b20ef35fccab8c87a86"/>
|
| 78 |
+
</dir>
|
| 79 |
+
</dir>
|
| 80 |
+
<dir name="template">
|
| 81 |
+
<dir name="webandpeople">
|
| 82 |
+
<dir name="custommenu">
|
| 83 |
+
<file name="menucontent.phtml" hash="3394e31c66923ebef82c53b89abad333"/>
|
| 84 |
+
<file name="top.phtml" hash="27f74d60761183011778638facc3c5d0"/>
|
| 85 |
</dir>
|
| 86 |
</dir>
|
| 87 |
</dir>
|
| 109 |
<dir name="js">
|
| 110 |
<dir name="webandpeople">
|
| 111 |
<dir name="custommenu">
|
| 112 |
+
<file name="custommenu.js" hash="4e0ebcb63638c6d9cedb9e1a314ed9f8"/>
|
| 113 |
+
</dir>
|
| 114 |
+
</dir>
|
| 115 |
+
</dir>
|
| 116 |
+
</dir>
|
| 117 |
+
</dir>
|
| 118 |
+
<dir name="rwd">
|
| 119 |
+
<dir name="default">
|
| 120 |
+
<dir name="css">
|
| 121 |
+
<dir name="webandpeople">
|
| 122 |
+
<dir name="custommenu">
|
| 123 |
+
<file name="custommenu.css" hash="1a7b49f1047b7738c73acae90bd168b4"/>
|
| 124 |
+
</dir>
|
| 125 |
+
</dir>
|
| 126 |
+
</dir>
|
| 127 |
+
<dir name="js">
|
| 128 |
+
<dir name="webandpeople">
|
| 129 |
+
<dir name="custommenu">
|
| 130 |
+
<file name="custommenu.js" hash="4e0ebcb63638c6d9cedb9e1a314ed9f8"/>
|
| 131 |
</dir>
|
| 132 |
</dir>
|
| 133 |
</dir>
|
readme.txt
CHANGED
|
@@ -5,6 +5,9 @@ Thank you for choosing the Web-Experiment Magento extension.
|
|
| 5 |
|
| 6 |
INSTALLATION GUIDE
|
| 7 |
Please find the installation guide here:
|
|
|
|
|
|
|
|
|
|
| 8 |
http://web-experiment.info/articles/cat/custom_menu/
|
| 9 |
|
| 10 |
SUPPORT
|
| 5 |
|
| 6 |
INSTALLATION GUIDE
|
| 7 |
Please find the installation guide here:
|
| 8 |
+
http://web-experiment.info/articles/cat/custom_menu/post/wp_custom_menu/
|
| 9 |
+
|
| 10 |
+
General guides page for the extension:
|
| 11 |
http://web-experiment.info/articles/cat/custom_menu/
|
| 12 |
|
| 13 |
SUPPORT
|
skin/frontend/default/default/js/webandpeople/custommenu/custommenu.js
CHANGED
|
@@ -126,7 +126,7 @@ function wpChangeTopMenuHref(wpMenuAnchor, state)
|
|
| 126 |
{
|
| 127 |
if (state) {
|
| 128 |
wpMenuAnchor.href = wpMenuAnchor.rel;
|
| 129 |
-
} else
|
| 130 |
wpMenuAnchor.href = 'javascript:void(0);';
|
| 131 |
}
|
| 132 |
}
|
|
@@ -235,7 +235,8 @@ function wpCustomMenuMobileToggle()
|
|
| 235 |
x = w.innerWidth || e.clientWidth || g.clientWidth,
|
| 236 |
y = w.innerHeight|| e.clientHeight|| g.clientHeight;
|
| 237 |
|
| 238 |
-
if (
|
|
|
|
| 239 |
wpInitMobileMenuContent();
|
| 240 |
if ($('custommenu') != undefined) $('custommenu').hide();
|
| 241 |
if ($('custommenu-mobile') != undefined) $('custommenu-mobile').show();
|
|
@@ -261,7 +262,9 @@ function wpCustomMenuMobileToggle()
|
|
| 261 |
);
|
| 262 |
wpMoblieMenuAjaxUrl = null;
|
| 263 |
}
|
|
|
|
| 264 |
} else {
|
|
|
|
| 265 |
if ($('custommenu-mobile') != undefined) $('custommenu-mobile').hide();
|
| 266 |
wpResetMobileMenuState();
|
| 267 |
if ($('custommenu') != undefined) $('custommenu').show();
|
|
@@ -286,28 +289,8 @@ function wpCustomMenuMobileToggle()
|
|
| 286 |
);
|
| 287 |
wpMenuAjaxUrl = null;
|
| 288 |
}
|
|
|
|
| 289 |
}
|
| 290 |
|
| 291 |
if ($('custommenu-loading') != undefined) $('custommenu-loading').remove();
|
| 292 |
}
|
| 293 |
-
|
| 294 |
-
var wpIsMobile = {
|
| 295 |
-
Android: function() {
|
| 296 |
-
return navigator.userAgent.match(/Android/i);
|
| 297 |
-
},
|
| 298 |
-
BlackBerry: function() {
|
| 299 |
-
return navigator.userAgent.match(/BlackBerry/i);
|
| 300 |
-
},
|
| 301 |
-
iOS: function() {
|
| 302 |
-
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
|
| 303 |
-
},
|
| 304 |
-
Opera: function() {
|
| 305 |
-
return navigator.userAgent.match(/Opera Mini/i);
|
| 306 |
-
},
|
| 307 |
-
Windows: function() {
|
| 308 |
-
return navigator.userAgent.match(/IEMobile/i);
|
| 309 |
-
},
|
| 310 |
-
any: function() {
|
| 311 |
-
return (wpIsMobile.Android() || wpIsMobile.BlackBerry() || wpIsMobile.iOS() || wpIsMobile.Opera() || wpIsMobile.Windows());
|
| 312 |
-
}
|
| 313 |
-
};
|
| 126 |
{
|
| 127 |
if (state) {
|
| 128 |
wpMenuAnchor.href = wpMenuAnchor.rel;
|
| 129 |
+
} else {
|
| 130 |
wpMenuAnchor.href = 'javascript:void(0);';
|
| 131 |
}
|
| 132 |
}
|
| 235 |
x = w.innerWidth || e.clientWidth || g.clientWidth,
|
| 236 |
y = w.innerHeight|| e.clientHeight|| g.clientHeight;
|
| 237 |
|
| 238 |
+
if (wpMobileMenuEnabled && CUSTOMMENU_MOBILE_MENU_WIDTH_INIT > x) {
|
| 239 |
+
|
| 240 |
wpInitMobileMenuContent();
|
| 241 |
if ($('custommenu') != undefined) $('custommenu').hide();
|
| 242 |
if ($('custommenu-mobile') != undefined) $('custommenu-mobile').show();
|
| 262 |
);
|
| 263 |
wpMoblieMenuAjaxUrl = null;
|
| 264 |
}
|
| 265 |
+
|
| 266 |
} else {
|
| 267 |
+
|
| 268 |
if ($('custommenu-mobile') != undefined) $('custommenu-mobile').hide();
|
| 269 |
wpResetMobileMenuState();
|
| 270 |
if ($('custommenu') != undefined) $('custommenu').show();
|
| 289 |
);
|
| 290 |
wpMenuAjaxUrl = null;
|
| 291 |
}
|
| 292 |
+
|
| 293 |
}
|
| 294 |
|
| 295 |
if ($('custommenu-loading') != undefined) $('custommenu-loading').remove();
|
| 296 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skin/frontend/rwd/default/css/webandpeople/custommenu/custommenu.css
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#custommenu {
|
| 2 |
+
position: relative;
|
| 3 |
+
font-size: 14px;
|
| 4 |
+
padding: 0px 0px 0px 0px;
|
| 5 |
+
width: 100%;
|
| 6 |
+
border-radius: 2px;
|
| 7 |
+
height: auto;
|
| 8 |
+
margin: 15px 0 0 0;
|
| 9 |
+
}
|
| 10 |
+
/*IE7 fix*/
|
| 11 |
+
*:first-child+html #custommenu {
|
| 12 |
+
z-index: 998;
|
| 13 |
+
}
|
| 14 |
+
div.menu {
|
| 15 |
+
float: left;
|
| 16 |
+
padding: 0px 0px 0px 0px;
|
| 17 |
+
margin: 0px 0px 0px 0px;
|
| 18 |
+
}
|
| 19 |
+
div.menu a:link, div.menu a:visited {
|
| 20 |
+
display: block;
|
| 21 |
+
height: 40px;
|
| 22 |
+
padding-left: 15px;
|
| 23 |
+
padding-right: 15px;
|
| 24 |
+
padding-top: 0;
|
| 25 |
+
padding-bottom: 0;
|
| 26 |
+
}
|
| 27 |
+
div.menu a span {
|
| 28 |
+
display: block;
|
| 29 |
+
height: 28px;
|
| 30 |
+
padding-right: 0px;
|
| 31 |
+
padding-top: 12px;
|
| 32 |
+
}
|
| 33 |
+
div.menu a span:hover {
|
| 34 |
+
cursor: pointer;
|
| 35 |
+
}
|
| 36 |
+
div.wp-custom-menu-popup {
|
| 37 |
+
position: absolute;
|
| 38 |
+
z-index: 1000;
|
| 39 |
+
display: none;
|
| 40 |
+
text-align: left;
|
| 41 |
+
padding: 0px 0px 10px 0px;
|
| 42 |
+
border-top: 0;
|
| 43 |
+
width: 100%;
|
| 44 |
+
margin-top: -1px;
|
| 45 |
+
}
|
| 46 |
+
div.menu a, div.wp-custom-menu-popup a {
|
| 47 |
+
text-decoration: none;
|
| 48 |
+
display:block;
|
| 49 |
+
cursor: pointer;
|
| 50 |
+
_height: 0;
|
| 51 |
+
height: auto;
|
| 52 |
+
line-height:13px;
|
| 53 |
+
}
|
| 54 |
+
div.level1 {
|
| 55 |
+
margin-bottom: 5px;
|
| 56 |
+
}
|
| 57 |
+
div.level2 {
|
| 58 |
+
margin-bottom: 5px;
|
| 59 |
+
}
|
| 60 |
+
div.block2 {
|
| 61 |
+
padding-top: 0px;
|
| 62 |
+
padding-left: 10px;
|
| 63 |
+
padding-right: 10px;
|
| 64 |
+
display: block;
|
| 65 |
+
}
|
| 66 |
+
a.level1:link, a.level1:visited {
|
| 67 |
+
margin-top: 10px;
|
| 68 |
+
margin-bottom: 10px;
|
| 69 |
+
padding: 5px 10px;
|
| 70 |
+
border-radius: 2px;
|
| 71 |
+
}
|
| 72 |
+
a.level2:link, a.level2:visited {
|
| 73 |
+
padding: 3px 10px;
|
| 74 |
+
border-radius: 2px;
|
| 75 |
+
}
|
| 76 |
+
/* Clearfix */
|
| 77 |
+
div.block2:after {
|
| 78 |
+
content: ".";
|
| 79 |
+
display: block;
|
| 80 |
+
clear: both;
|
| 81 |
+
visibility: hidden;
|
| 82 |
+
line-height: 0;
|
| 83 |
+
height: 0;
|
| 84 |
+
}
|
| 85 |
+
html[xmlns] div.block2 {
|
| 86 |
+
display: block;
|
| 87 |
+
}
|
| 88 |
+
* html div.block2 {
|
| 89 |
+
height: 1%;
|
| 90 |
+
}
|
| 91 |
+
div.block2 p {
|
| 92 |
+
margin-bottom: 3px;
|
| 93 |
+
line-height: 120%;
|
| 94 |
+
color: #000;
|
| 95 |
+
font-size: 11px;
|
| 96 |
+
}
|
| 97 |
+
div.block2 p a {
|
| 98 |
+
display: inline;
|
| 99 |
+
}
|
| 100 |
+
div.block2 a img {
|
| 101 |
+
opacity: .9;
|
| 102 |
+
filter: alpha(opacity=90);
|
| 103 |
+
}
|
| 104 |
+
div.block2 a:hover img {
|
| 105 |
+
opacity: 1;
|
| 106 |
+
filter: alpha(opacity=100);
|
| 107 |
+
-webkit-transition: all .2s ease-in-out;
|
| 108 |
+
-moz-transition: all .2s ease-in-out;
|
| 109 |
+
-ms-transition: all .2s ease-in-out;
|
| 110 |
+
transition: all .2s ease-in-out;
|
| 111 |
+
}
|
| 112 |
+
div.block2 .brand a:hover img {
|
| 113 |
+
-webkit-transition: all 0;
|
| 114 |
+
-moz-transition: all 0;
|
| 115 |
+
-ms-transition: all 0;
|
| 116 |
+
transition: all 0;
|
| 117 |
+
}
|
| 118 |
+
div.wp-custom-menu-popup hr {
|
| 119 |
+
margin: 0px 0px 10px 0px;
|
| 120 |
+
}
|
| 121 |
+
/******************************************* COLUMN WIDTH ***************************** */
|
| 122 |
+
div.column {
|
| 123 |
+
float: left;
|
| 124 |
+
width: 31%; /* for 3 columns*/
|
| 125 |
+
padding: 0px 1%;
|
| 126 |
+
margin: 0px 0px 0px 0px;
|
| 127 |
+
}
|
| 128 |
+
/*end COLUMN WIDTH */
|
| 129 |
+
|
| 130 |
+
div.itemSubMenu {
|
| 131 |
+
margin-left: 0px;
|
| 132 |
+
}
|
| 133 |
+
.clearBoth {
|
| 134 |
+
clear:both;
|
| 135 |
+
height: 0;
|
| 136 |
+
overflow: hidden;
|
| 137 |
+
}
|
| 138 |
+
div.level1 {
|
| 139 |
+
margin-bottom: 0px;
|
| 140 |
+
}
|
| 141 |
+
/*BG*/
|
| 142 |
+
#custommenu {
|
| 143 |
+
}
|
| 144 |
+
div.wp-custom-menu-popup {
|
| 145 |
+
background-color: #fbfbfb;
|
| 146 |
+
border: solid 1px #cccccc;
|
| 147 |
+
}
|
| 148 |
+
div.menu a:link, div.menu a:visited {
|
| 149 |
+
}
|
| 150 |
+
div.menu a:hover {
|
| 151 |
+
background: #f1f1f1;
|
| 152 |
+
}
|
| 153 |
+
div.menu a, div.wp-custom-menu-popup a {
|
| 154 |
+
-webkit-transition: all .1s linear;
|
| 155 |
+
-moz-transition: all .1s linear;
|
| 156 |
+
-ms-transition: all .1s linear;
|
| 157 |
+
transition: all .1s linear;
|
| 158 |
+
}
|
| 159 |
+
div.menu .brand a, div.wp-custom-menu-popup .brand a {
|
| 160 |
+
-webkit-transition: all 0s linear;
|
| 161 |
+
-moz-transition: all 0s linear;
|
| 162 |
+
-ms-transition: all 0s linear;
|
| 163 |
+
transition: all 0s linear;
|
| 164 |
+
}
|
| 165 |
+
/*FONTS*/
|
| 166 |
+
div.menu {
|
| 167 |
+
font-weight: normal;
|
| 168 |
+
font-size: 14px;
|
| 169 |
+
text-transform: uppercase;
|
| 170 |
+
font-family: "Raleway", "Helvetica Neue", Verdana, Arial, sans-serif;
|
| 171 |
+
line-height: 0;
|
| 172 |
+
}
|
| 173 |
+
a.level1:link, a.level1:visited {
|
| 174 |
+
text-transform: none;
|
| 175 |
+
font-weight: normal;
|
| 176 |
+
}
|
| 177 |
+
a.level2:link, a.level2:visited {
|
| 178 |
+
font-weight: normal;
|
| 179 |
+
font-size: 12px;
|
| 180 |
+
line-height: 12px;
|
| 181 |
+
margin-left: 20px;
|
| 182 |
+
}
|
| 183 |
+
/*COLOR*/
|
| 184 |
+
#custommenu {
|
| 185 |
+
background-color: #fff;
|
| 186 |
+
}
|
| 187 |
+
div.menu a:link, div.menu a:visited {
|
| 188 |
+
background-color: #fff;
|
| 189 |
+
color: #636363;
|
| 190 |
+
text-transform: uppercase;
|
| 191 |
+
}
|
| 192 |
+
a.level1:link, a.level1:visited {
|
| 193 |
+
color: #636363;
|
| 194 |
+
}
|
| 195 |
+
a.level2:link, a.level2:visited {
|
| 196 |
+
color: #636363;
|
| 197 |
+
}
|
| 198 |
+
div.menu a:hover,
|
| 199 |
+
div.menu.act a,
|
| 200 |
+
div.menu.active a {
|
| 201 |
+
color: #3399cc;
|
| 202 |
+
}
|
| 203 |
+
a.level1:hover, a.level1.act, a.level1.actParent {
|
| 204 |
+
color: #3399cc;
|
| 205 |
+
}
|
| 206 |
+
a.level2:hover, a.level2.act, a.level2.actParent {
|
| 207 |
+
color: #3399cc;
|
| 208 |
+
}
|
| 209 |
+
.block2 table.brand {
|
| 210 |
+
float: left;
|
| 211 |
+
}
|
| 212 |
+
.block2 .single_menu_product {
|
| 213 |
+
float: left;
|
| 214 |
+
position: relative;
|
| 215 |
+
max-width: 150px;
|
| 216 |
+
overflow: hidden;
|
| 217 |
+
margin-right: 20px;
|
| 218 |
+
margin-left: 0px;
|
| 219 |
+
}
|
| 220 |
+
/*MOBILE MENU STYLES*/
|
| 221 |
+
#menu-button, .parentMenu {
|
| 222 |
+
display: inline-block;
|
| 223 |
+
}
|
| 224 |
+
html[xmlns] #menu-button, html[xmlns] .parentMenu {
|
| 225 |
+
display: block;
|
| 226 |
+
}
|
| 227 |
+
* html #menu-button, * html .parentMenu {
|
| 228 |
+
height: 1%;
|
| 229 |
+
}
|
| 230 |
+
#menu-button:after, .parentMenu:after {
|
| 231 |
+
content: ".";
|
| 232 |
+
display: block;
|
| 233 |
+
clear: both;
|
| 234 |
+
visibility: hidden;
|
| 235 |
+
line-height: 0;
|
| 236 |
+
height: 0;
|
| 237 |
+
}
|
| 238 |
+
#custommenu-mobile {
|
| 239 |
+
position:relative;
|
| 240 |
+
margin: 0 auto;
|
| 241 |
+
padding: 0;
|
| 242 |
+
z-index: 999;
|
| 243 |
+
}
|
| 244 |
+
#menu-button {
|
| 245 |
+
float: none;
|
| 246 |
+
padding: 10px 0px 10px 0px;
|
| 247 |
+
margin: 0px 0px 0px 0px;
|
| 248 |
+
width: 100%;
|
| 249 |
+
border-bottom: 1px solid #fff;
|
| 250 |
+
text-transform: uppercase;
|
| 251 |
+
display: none;
|
| 252 |
+
}
|
| 253 |
+
#menu-button a:link, #menu-button a:visited {
|
| 254 |
+
color: #fff;
|
| 255 |
+
display: block;
|
| 256 |
+
float: left;
|
| 257 |
+
margin-left: 45%;
|
| 258 |
+
position: relative;
|
| 259 |
+
padding: 0px 10px;
|
| 260 |
+
}
|
| 261 |
+
#menu-button a span:after {
|
| 262 |
+
display: block;
|
| 263 |
+
position: relative;
|
| 264 |
+
content: "";
|
| 265 |
+
width: 0;
|
| 266 |
+
height: 0;
|
| 267 |
+
border-left: 5px solid transparent;
|
| 268 |
+
border-right: 5px solid transparent;
|
| 269 |
+
border-top: 4px solid #dadada;
|
| 270 |
+
margin: 8px 0px 0px 5px;
|
| 271 |
+
float: right;
|
| 272 |
+
opacity: 0.7;
|
| 273 |
+
}
|
| 274 |
+
#menu-button:hover {
|
| 275 |
+
cursor: pointer;
|
| 276 |
+
}
|
| 277 |
+
#menu-button:hover a:after {
|
| 278 |
+
opacity: 1;
|
| 279 |
+
}
|
| 280 |
+
.menu-mobile div.column {
|
| 281 |
+
float:none;
|
| 282 |
+
padding:5px;
|
| 283 |
+
background: #fff;
|
| 284 |
+
}
|
| 285 |
+
.menu-mobile a.itemMenuName {
|
| 286 |
+
display: block;
|
| 287 |
+
text-align: left;
|
| 288 |
+
}
|
| 289 |
+
.menu-mobile div.menu-button, .menu-mobile div.menu-mobile {
|
| 290 |
+
float: none;
|
| 291 |
+
padding: 0px 0px 0px 0px;
|
| 292 |
+
margin: 0px 0px 0px 0px;
|
| 293 |
+
width: 100%;
|
| 294 |
+
border-bottom: 1px solid #fff;
|
| 295 |
+
}
|
| 296 |
+
.menu-mobile div.column {
|
| 297 |
+
float: none;
|
| 298 |
+
width: 100%;
|
| 299 |
+
padding: 0px 0;
|
| 300 |
+
margin: 0px 0px 0px 0px;
|
| 301 |
+
}
|
| 302 |
+
.menu-mobile a.level1:link, .menu-mobile a.level1:visited {
|
| 303 |
+
margin-top: 0px;
|
| 304 |
+
margin-bottom: 0;
|
| 305 |
+
padding: 10px 10px;
|
| 306 |
+
border-radius: 2px;
|
| 307 |
+
color: #000;
|
| 308 |
+
}
|
| 309 |
+
.menu-mobile a.level2:link, .menu-mobile a.level2:visited {
|
| 310 |
+
padding: 10px 10px;
|
| 311 |
+
border-radius: 2px;
|
| 312 |
+
}
|
| 313 |
+
.menu-mobile a.level1:link, .menu-mobile a.level1:visited {
|
| 314 |
+
color: #555;
|
| 315 |
+
}
|
| 316 |
+
.menu-mobile a.level1:hover {
|
| 317 |
+
background-color: #f1f1f1;
|
| 318 |
+
}
|
| 319 |
+
.menu-mobile .parent {
|
| 320 |
+
background-color: #fff;
|
| 321 |
+
}
|
| 322 |
+
/*buttons level 01*/
|
| 323 |
+
.menu-mobile .parentMenu {
|
| 324 |
+
padding: 0px 0px;
|
| 325 |
+
display: block;
|
| 326 |
+
text-align: left;
|
| 327 |
+
border-bottom: 1px solid #dadada;
|
| 328 |
+
}
|
| 329 |
+
.menu-mobile .parentMenu a:link,
|
| 330 |
+
.menu-mobile .parentMenu a:visited {
|
| 331 |
+
padding: 10px 0px 10px 10px;
|
| 332 |
+
margin-right: 80px;
|
| 333 |
+
color: #636363;
|
| 334 |
+
display: block;
|
| 335 |
+
}
|
| 336 |
+
.menu-mobile .parentMenu:hover {
|
| 337 |
+
cursor: pointer;
|
| 338 |
+
}
|
| 339 |
+
.parentMenu {
|
| 340 |
+
position: relative;
|
| 341 |
+
}
|
| 342 |
+
.parentMenu a {
|
| 343 |
+
display: block;
|
| 344 |
+
}
|
| 345 |
+
#menu-button {
|
| 346 |
+
cursor: pointer;
|
| 347 |
+
}
|
| 348 |
+
.menu-mobile div.level2 {
|
| 349 |
+
margin-bottom: 0;
|
| 350 |
+
}
|
| 351 |
+
.menu-mobile a:hover {
|
| 352 |
+
text-decoration: none;
|
| 353 |
+
}
|
| 354 |
+
.menu-mobile.level0 .parentMenu a:link,
|
| 355 |
+
.menu-mobile.level0 .parentMenu a:visited {
|
| 356 |
+
text-transform: uppercase;
|
| 357 |
+
}
|
| 358 |
+
.menu-mobile .parentMenu a.level1:link,
|
| 359 |
+
.menu-mobile .parentMenu a.level1:visited,
|
| 360 |
+
.menu-mobile .parentMenu a.level2:link,
|
| 361 |
+
.menu-mobile .parentMenu a.level2:visited {
|
| 362 |
+
text-transform: none;
|
| 363 |
+
}
|
| 364 |
+
.menu-mobile .parentMenu a.level1:link,
|
| 365 |
+
.menu-mobile .parentMenu a.level1:visited {
|
| 366 |
+
margin-left: 20px;
|
| 367 |
+
}
|
| 368 |
+
.menu-mobile .parentMenu a.level2:link,
|
| 369 |
+
.menu-mobile .parentMenu a.level2:visited {
|
| 370 |
+
margin-left: 40px;
|
| 371 |
+
}
|
| 372 |
+
.menu-mobile .parentMenu a:hover,
|
| 373 |
+
.menu-mobile .parentMenu a.act,
|
| 374 |
+
.menu-mobile .parentMenu a.actParent {
|
| 375 |
+
color: #3399cc;
|
| 376 |
+
}
|
| 377 |
+
#custommenu-mobile .button {
|
| 378 |
+
cursor: pointer;
|
| 379 |
+
position: absolute;
|
| 380 |
+
right: 1%;
|
| 381 |
+
top: 0px;
|
| 382 |
+
display: block;
|
| 383 |
+
width: 80px;
|
| 384 |
+
height: 38px;
|
| 385 |
+
background-color: transparent;
|
| 386 |
+
background-repeat: no-repeat;
|
| 387 |
+
background-position: 90% 50%;
|
| 388 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJxJREFUeNpi/P//PwM66O3tBVF1UNwEwsXFxRjqmBhwg3wgZobSWAE+zcxoNEmaCQKKNDP29PTgkvsAxPxA/BGIBXDZ3A7Ef4D4Pxrmh6rhxyL3E4gbQZqL8AUKDsAG0gfS3AfEf0nU/AuIJ4I0VwIxC8j/aPgjVOFHLHLsQFzDiCeFoQQYqSmMtvGMT/NfNJokzQug9HRcCgACDAC34CnSSWx3zwAAAABJRU5ErkJggg==);
|
| 389 |
+
}
|
| 390 |
+
#custommenu-mobile .button.open {
|
| 391 |
+
background-color: transparent;
|
| 392 |
+
background-repeat: no-repeat;
|
| 393 |
+
background-position: 90% 50%;
|
| 394 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAE5JREFUeNpi/P//PwO5gImBAjBENbP09vZSZHM7EP8B4v8k4J9A3AjSXATEzCRaygbSB9LcB8R/SdT8C4gnsgCJSigmGTCOpjDSAECAAQBI6RqpQRaDFgAAAABJRU5ErkJggg==);
|
| 395 |
+
}
|
| 396 |
+
#custommenu-mobile .level1 .button {
|
| 397 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIxJREFUeNpi/P//PwO5gAWbYG9vL4ZYcXExhhgTAwUAn+YJQAzyUxcuBYwwP2Nx6k8gZgPid0AsjM0L+Gxmg9LMxDob5lTkKOBHEuvCpzmZQBgl4NNcD8SvcWgEiTfhi+c+KGZAcvpHIBbAG9pYEglKaJOaSCqB+BrUK8QnTyxeYCDa2dRIngQBQIABAGG6KfxEmzSnAAAAAElFTkSuQmCC);
|
| 398 |
+
}
|
| 399 |
+
#custommenu-mobile .level1 .button.open {
|
| 400 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAE1JREFUeNpi/P//PwO5gImBAjBwmllgjN7eXqI1FRcXU9/ZE4D4Px7chU9zMgHLEvBprgfi1zg0gsSbsAYYFPRBMVGAcQSmMIo0AwQYAIYUFeQ3G04OAAAAAElFTkSuQmCC);
|
| 401 |
+
}
|
| 402 |
+
/*BG*/
|
| 403 |
+
#custommenu-mobile .parentMenu:hover a:link, #custommenu-mobile .parentMenu:hover a:visited, #custommenu-mobile .parentMenu:hover {
|
| 404 |
+
background-color: #fff;
|
| 405 |
+
}
|
| 406 |
+
#custommenu-mobile .level0 {
|
| 407 |
+
background-color: #ededed;
|
| 408 |
+
}
|
| 409 |
+
#custommenu-mobile .level1 {
|
| 410 |
+
background-color: #e4e4e4;
|
| 411 |
+
}
|
| 412 |
+
#custommenu-mobile .level2 {
|
| 413 |
+
background-color: #f1f1f1;
|
| 414 |
+
}
|
skin/frontend/rwd/default/js/webandpeople/custommenu/custommenu.js
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var wpMenuLoaded = false;
|
| 2 |
+
var wpMobileMenuLoaded = false;
|
| 3 |
+
|
| 4 |
+
function wpInitPopupContent()
|
| 5 |
+
{
|
| 6 |
+
if (wpMenuLoaded) return;
|
| 7 |
+
var xMenu = $('custommenu');
|
| 8 |
+
if (typeof wpPopupMenuContent != 'undefined') xMenu.innerHTML = wpPopupMenuContent + xMenu.innerHTML;
|
| 9 |
+
wpMenuLoaded = true;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
function wpInitMobileMenuContent()
|
| 13 |
+
{
|
| 14 |
+
if (wpMobileMenuLoaded) return;
|
| 15 |
+
var xMenu = $('menu-content');
|
| 16 |
+
if (typeof wpMobileMenuContent != 'undefined') xMenu.innerHTML = wpMobileMenuContent;
|
| 17 |
+
wpMobileMenuLoaded = true;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
function wpShowMenuPopup(objMenu, event, popupId)
|
| 21 |
+
{
|
| 22 |
+
wpInitPopupContent();
|
| 23 |
+
if (typeof wpCustommenuTimerHide[popupId] != 'undefined') clearTimeout(wpCustommenuTimerHide[popupId]);
|
| 24 |
+
objMenu = $(objMenu.id); var popup = $(popupId); if (!popup) return;
|
| 25 |
+
if (!!wpActiveMenu) {
|
| 26 |
+
wpHideMenuPopup(objMenu, event, wpActiveMenu.popupId, wpActiveMenu.menuId);
|
| 27 |
+
}
|
| 28 |
+
wpActiveMenu = {menuId: objMenu.id, popupId: popupId};
|
| 29 |
+
if (!objMenu.hasClassName('active')) {
|
| 30 |
+
wpCustommenuTimerShow[popupId] = setTimeout(function() {
|
| 31 |
+
objMenu.addClassName('active');
|
| 32 |
+
var popupWidth = CUSTOMMENU_POPUP_WIDTH;
|
| 33 |
+
if (!popupWidth) popupWidth = popup.getWidth();
|
| 34 |
+
var pos = wpPopupPos(objMenu, popupWidth);
|
| 35 |
+
popup.style.top = pos.top + 'px';
|
| 36 |
+
popup.style.left = pos.left + 'px';
|
| 37 |
+
wpSetPopupZIndex(popup);
|
| 38 |
+
if (CUSTOMMENU_POPUP_WIDTH)
|
| 39 |
+
popup.style.width = CUSTOMMENU_POPUP_WIDTH + 'px';
|
| 40 |
+
// --- Static Block width ---
|
| 41 |
+
var block2 = $(popupId).select('div.block2');
|
| 42 |
+
if (typeof block2[0] != 'undefined') {
|
| 43 |
+
var wStart = block2[0].id.indexOf('_w');
|
| 44 |
+
if (wStart > -1) {
|
| 45 |
+
var w = block2[0].id.substr(wStart+2);
|
| 46 |
+
} else {
|
| 47 |
+
var w = 0;
|
| 48 |
+
$(popupId).select('div.block1 div.column').each(function(item) {
|
| 49 |
+
w += $(item).getWidth();
|
| 50 |
+
});
|
| 51 |
+
}
|
| 52 |
+
if (w) block2[0].style.width = w + 'px';
|
| 53 |
+
}
|
| 54 |
+
// --- change href ---
|
| 55 |
+
var wpMenuAnchor = $(objMenu.select('a')[0]);
|
| 56 |
+
wpChangeTopMenuHref(wpMenuAnchor, true);
|
| 57 |
+
// --- show popup ---
|
| 58 |
+
if (typeof jQuery == 'undefined') {
|
| 59 |
+
popup.style.display = 'block';
|
| 60 |
+
} else {
|
| 61 |
+
jQuery('#' + popupId).stop(true, true).fadeIn();
|
| 62 |
+
}
|
| 63 |
+
}, CUSTOMMENU_POPUP_DELAY_BEFORE_DISPLAYING);
|
| 64 |
+
}
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
function wpHideMenuPopup(element, event, popupId, menuId)
|
| 68 |
+
{
|
| 69 |
+
if (typeof wpCustommenuTimerShow[popupId] != 'undefined') clearTimeout(wpCustommenuTimerShow[popupId]);
|
| 70 |
+
var element = $(element); var objMenu = $(menuId) ;var popup = $(popupId); if (!popup) return;
|
| 71 |
+
var wpCurrentMouseTarget = getCurrentMouseTarget(event);
|
| 72 |
+
if (!!wpCurrentMouseTarget) {
|
| 73 |
+
if (!wpIsChildOf(element, wpCurrentMouseTarget) && element != wpCurrentMouseTarget) {
|
| 74 |
+
if (!wpIsChildOf(popup, wpCurrentMouseTarget) && popup != wpCurrentMouseTarget) {
|
| 75 |
+
if (objMenu.hasClassName('active')) {
|
| 76 |
+
wpCustommenuTimerHide[popupId] = setTimeout(function() {
|
| 77 |
+
objMenu.removeClassName('active');
|
| 78 |
+
// --- change href ---
|
| 79 |
+
var wpMenuAnchor = $(objMenu.select('a')[0]);
|
| 80 |
+
wpChangeTopMenuHref(wpMenuAnchor, false);
|
| 81 |
+
// --- hide popup ---
|
| 82 |
+
if (typeof jQuery == 'undefined') {
|
| 83 |
+
popup.style.display = 'none';
|
| 84 |
+
} else {
|
| 85 |
+
jQuery('#' + popupId).stop(true, true).fadeOut();
|
| 86 |
+
}
|
| 87 |
+
}, CUSTOMMENU_POPUP_DELAY_BEFORE_HIDING);
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
function wpPopupOver(element, event, popupId, menuId)
|
| 95 |
+
{
|
| 96 |
+
if (typeof wpCustommenuTimerHide[popupId] != 'undefined') clearTimeout(wpCustommenuTimerHide[popupId]);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
function wpPopupPos(objMenu, w)
|
| 100 |
+
{
|
| 101 |
+
var pos = objMenu.cumulativeOffset();
|
| 102 |
+
var wraper = $('custommenu');
|
| 103 |
+
var posWraper = wraper.cumulativeOffset();
|
| 104 |
+
var xTop = pos.top - posWraper.top
|
| 105 |
+
if (CUSTOMMENU_POPUP_TOP_OFFSET) {
|
| 106 |
+
xTop += CUSTOMMENU_POPUP_TOP_OFFSET;
|
| 107 |
+
} else {
|
| 108 |
+
xTop += objMenu.getHeight();
|
| 109 |
+
}
|
| 110 |
+
var res = {'top': xTop};
|
| 111 |
+
if (CUSTOMMENU_RTL_MODE) {
|
| 112 |
+
var xLeft = pos.left - posWraper.left - w + objMenu.getWidth();
|
| 113 |
+
if (xLeft < 0) xLeft = 0;
|
| 114 |
+
res.left = xLeft;
|
| 115 |
+
} else {
|
| 116 |
+
var wWraper = wraper.getWidth();
|
| 117 |
+
var xLeft = pos.left - posWraper.left;
|
| 118 |
+
if ((xLeft + w) > wWraper) xLeft = wWraper - w;
|
| 119 |
+
if (xLeft < 0) xLeft = 0;
|
| 120 |
+
res.left = xLeft;
|
| 121 |
+
}
|
| 122 |
+
return res;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
function wpChangeTopMenuHref(wpMenuAnchor, state)
|
| 126 |
+
{
|
| 127 |
+
if (state) {
|
| 128 |
+
wpMenuAnchor.href = wpMenuAnchor.rel;
|
| 129 |
+
} else {
|
| 130 |
+
wpMenuAnchor.href = 'javascript:void(0);';
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
function wpIsChildOf(parent, child)
|
| 135 |
+
{
|
| 136 |
+
if (child != null) {
|
| 137 |
+
while (child.parentNode) {
|
| 138 |
+
if ((child = child.parentNode) == parent) {
|
| 139 |
+
return true;
|
| 140 |
+
}
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
return false;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
function wpSetPopupZIndex(popup)
|
| 147 |
+
{
|
| 148 |
+
$$('.wp-custom-menu-popup').each(function(item){
|
| 149 |
+
item.style.zIndex = '9999';
|
| 150 |
+
});
|
| 151 |
+
popup.style.zIndex = '10000';
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
function getCurrentMouseTarget(xEvent)
|
| 155 |
+
{
|
| 156 |
+
var wpCurrentMouseTarget = null;
|
| 157 |
+
if (xEvent.toElement) {
|
| 158 |
+
wpCurrentMouseTarget = xEvent.toElement;
|
| 159 |
+
} else if (xEvent.relatedTarget) {
|
| 160 |
+
wpCurrentMouseTarget = xEvent.relatedTarget;
|
| 161 |
+
}
|
| 162 |
+
return wpCurrentMouseTarget;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
function getCurrentMouseTargetMobile(xEvent)
|
| 166 |
+
{
|
| 167 |
+
if (!xEvent) var xEvent = window.event;
|
| 168 |
+
var wpCurrentMouseTarget = null;
|
| 169 |
+
if (xEvent.target) wpCurrentMouseTarget = xEvent.target;
|
| 170 |
+
else if (xEvent.srcElement) wpCurrentMouseTarget = xEvent.srcElement;
|
| 171 |
+
if (wpCurrentMouseTarget.nodeType == 3) // defeat Safari bug
|
| 172 |
+
wpCurrentMouseTarget = wpCurrentMouseTarget.parentNode;
|
| 173 |
+
return wpCurrentMouseTarget;
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
/* Mobile */
|
| 177 |
+
function wpMenuButtonToggle()
|
| 178 |
+
{
|
| 179 |
+
$('menu-content').toggle();
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
function wpGetMobileSubMenuLevel(id)
|
| 183 |
+
{
|
| 184 |
+
var rel = $(id).readAttribute('rel');
|
| 185 |
+
return parseInt(rel.replace('level', ''));
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
function wpSubMenuToggle(obj, activeMenuId, activeSubMenuId)
|
| 189 |
+
{
|
| 190 |
+
var currLevel = wpGetMobileSubMenuLevel(activeSubMenuId);
|
| 191 |
+
// --- hide submenus ---
|
| 192 |
+
$$('.wp-custom-menu-submenu').each(function(item) {
|
| 193 |
+
if (item.id == activeSubMenuId) return;
|
| 194 |
+
var xLevel = wpGetMobileSubMenuLevel(item.id);
|
| 195 |
+
if (xLevel >= currLevel) {
|
| 196 |
+
$(item).hide();
|
| 197 |
+
}
|
| 198 |
+
});
|
| 199 |
+
// --- reset button state ---
|
| 200 |
+
$('custommenu-mobile').select('span.button').each(function(xItem) {
|
| 201 |
+
var subMenuId = $(xItem).readAttribute('rel');
|
| 202 |
+
if (!$(subMenuId).visible()) {
|
| 203 |
+
$(xItem).removeClassName('open');
|
| 204 |
+
}
|
| 205 |
+
});
|
| 206 |
+
// ---
|
| 207 |
+
if ($(activeSubMenuId).getStyle('display') == 'none') {
|
| 208 |
+
$(activeSubMenuId).show();
|
| 209 |
+
$(obj).addClassName('open');
|
| 210 |
+
} else {
|
| 211 |
+
$(activeSubMenuId).hide();
|
| 212 |
+
$(obj).removeClassName('open');
|
| 213 |
+
}
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
function wpResetMobileMenuState()
|
| 217 |
+
{
|
| 218 |
+
if ($('menu-content') != undefined) $('menu-content').hide();
|
| 219 |
+
$$('.wp-custom-menu-submenu').each(function(item) {
|
| 220 |
+
$(item).hide();
|
| 221 |
+
});
|
| 222 |
+
if ($('custommenu-mobile') != undefined) {
|
| 223 |
+
$('custommenu-mobile').select('span.button').each(function(item) {
|
| 224 |
+
$(item).removeClassName('open');
|
| 225 |
+
});
|
| 226 |
+
}
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
function wpCustomMenuMobileToggle()
|
| 230 |
+
{
|
| 231 |
+
var w = window,
|
| 232 |
+
d = document,
|
| 233 |
+
e = d.documentElement,
|
| 234 |
+
g = d.getElementsByTagName('body')[0],
|
| 235 |
+
x = w.innerWidth || e.clientWidth || g.clientWidth,
|
| 236 |
+
y = w.innerHeight|| e.clientHeight|| g.clientHeight;
|
| 237 |
+
|
| 238 |
+
if (wpMobileMenuEnabled && CUSTOMMENU_MOBILE_MENU_WIDTH_INIT > x) {
|
| 239 |
+
|
| 240 |
+
wpInitMobileMenuContent();
|
| 241 |
+
if ($('custommenu') != undefined) $('custommenu').hide();
|
| 242 |
+
if ($('custommenu-mobile') != undefined) $('custommenu-mobile').show();
|
| 243 |
+
// --- ajax load ---
|
| 244 |
+
if (wpMoblieMenuAjaxUrl) {
|
| 245 |
+
new Ajax.Request(
|
| 246 |
+
wpMoblieMenuAjaxUrl, {
|
| 247 |
+
asynchronous: true,
|
| 248 |
+
method: 'post',
|
| 249 |
+
onSuccess: function(transport) {
|
| 250 |
+
if (transport && transport.responseText) {
|
| 251 |
+
try {
|
| 252 |
+
response = eval('(' + transport.responseText + ')');
|
| 253 |
+
} catch (e) {
|
| 254 |
+
response = {};
|
| 255 |
+
}
|
| 256 |
+
}
|
| 257 |
+
wpMobileMenuContent = response;
|
| 258 |
+
wpMobileMenuLoaded = false;
|
| 259 |
+
wpInitMobileMenuContent();
|
| 260 |
+
}
|
| 261 |
+
}
|
| 262 |
+
);
|
| 263 |
+
wpMoblieMenuAjaxUrl = null;
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
} else {
|
| 267 |
+
|
| 268 |
+
if ($('custommenu-mobile') != undefined) $('custommenu-mobile').hide();
|
| 269 |
+
wpResetMobileMenuState();
|
| 270 |
+
if ($('custommenu') != undefined) $('custommenu').show();
|
| 271 |
+
// --- ajax load ---
|
| 272 |
+
if (wpMenuAjaxUrl) {
|
| 273 |
+
new Ajax.Request(
|
| 274 |
+
wpMenuAjaxUrl, {
|
| 275 |
+
asynchronous: true,
|
| 276 |
+
method: 'post',
|
| 277 |
+
onSuccess: function(transport) {
|
| 278 |
+
if (transport && transport.responseText) {
|
| 279 |
+
try {
|
| 280 |
+
response = eval('(' + transport.responseText + ')');
|
| 281 |
+
} catch (e) {
|
| 282 |
+
response = {};
|
| 283 |
+
}
|
| 284 |
+
}
|
| 285 |
+
if ($('custommenu') != undefined) $('custommenu').update(response.topMenu);
|
| 286 |
+
wpPopupMenuContent = response.popupMenu;
|
| 287 |
+
}
|
| 288 |
+
}
|
| 289 |
+
);
|
| 290 |
+
wpMenuAjaxUrl = null;
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
}
|
| 294 |
+
|
| 295 |
+
if ($('custommenu-loading') != undefined) $('custommenu-loading').remove();
|
| 296 |
+
}
|
