Changeset 2608529
- Timestamp:
- 10/03/2021 04:52:42 PM (4 years ago)
- Location:
- mean-menu-refueled
- Files:
-
- 4 edited
- 9 copied
-
tags/1.3 (copied) (copied from mean-menu-refueled/trunk)
-
tags/1.3/plugin.php (copied) (copied from mean-menu-refueled/trunk/plugin.php) (2 diffs)
-
tags/1.3/readme.txt (copied) (copied from mean-menu-refueled/trunk/readme.txt) (4 diffs)
-
tags/1.3/scripts.js (copied) (copied from mean-menu-refueled/trunk/scripts.js)
-
tags/1.3/vendor (copied) (copied from mean-menu-refueled/trunk/vendor)
-
tags/1.3/vendor/meanMenu/README.md (copied) (copied from mean-menu-refueled/trunk/vendor/meanMenu/README.md)
-
tags/1.3/vendor/meanMenu/demo.html (copied) (copied from mean-menu-refueled/trunk/vendor/meanMenu/demo.html)
-
tags/1.3/vendor/meanMenu/meanmenu.js (copied) (copied from mean-menu-refueled/trunk/vendor/meanMenu/meanmenu.js) (1 diff)
-
tags/1.3/vendor/meanMenu/meanmenu.min.js (copied) (copied from mean-menu-refueled/trunk/vendor/meanMenu/meanmenu.min.js) (1 diff)
-
trunk/plugin.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/vendor/meanMenu/meanmenu.js (modified) (1 diff)
-
trunk/vendor/meanMenu/meanmenu.min.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mean-menu-refueled/tags/1.3/plugin.php
r2608272 r2608529 5 5 Plugin URI: https://planetjon.ca/projects/mean-menu-refueled/ 6 6 Description: Make any menu suitable for mobile 7 Version: 1. 27 Version: 1.3 8 8 Requires at least: 5.0.0 9 9 Tested up to: 5.8 … … 20 20 'target' => [ 'type' => 'text', 'label' => 'Menu target', 'description' => 'Where is target menu contained? Leave blank for auto-detection of parent of first ul.menu element', 'input_attrs' => [] ], 21 21 'container' => [ 'type' => 'text', 'label' => 'Menu container', 'description' => 'Where should mean menu be anchored?', 'input_attrs' => [ 'placeholder' => 'body' ] ], 22 'barColour' => [ 'type' => 'color', 'label' => 'Bar colour', 'description' => ' Colour of the mean bar', 'default' => '#0c1923' ],23 'navColour' => [ 'type' => 'color', 'label' => 'Menu colour', 'description' => ' Colour of the expanded menu', 'default' => '#0c1923' ],22 'barColour' => [ 'type' => 'color', 'label' => 'Bar colour', 'description' => 'Background colour of the mean bar', 'default' => '#0c1923' ], 23 'navColour' => [ 'type' => 'color', 'label' => 'Menu colour', 'description' => 'Background colour of the expanded menu', 'default' => '#0c1923' ], 24 24 'menuClose' => [ 'type' => 'text', 'label' => 'Menu close', 'description' => 'Symbol shown to close the menu', 'input_attrs' => [ 'placeholder' => 'x' ] ], 25 25 'menuOpen' => [ 'type' => 'text', 'label' => 'Menu open', 'description' => 'Symbol shown to open the menu', 'input_attrs' => [ 'placeholder' => '≡' ] ], 26 26 'revealPosition' => [ 'type' => 'select', 'label' => 'Reveal position', 'description' => 'Position of the reveal', 'choices' => [ 'right' => 'right', 'center' => 'center', 'left' => 'left' ], 'default' => 'right' ], 27 27 'revealPositionDistance' => [ 'type' => 'text', 'label' => 'Reveal position offset', 'description' => 'Offset of the reveal', 'input_attrs' => [ 'placeholder' => '0' ] ], 28 'revealColour' => [ 'type' => 'color', 'label' => 'Reveal colour', 'description' => ' Colour of the reveal', 'default' => 'none' ],29 'screenWidth' => [ 'type' => 'number', 'label' => 'Responsive threshold', 'description' => 'Threshold when menu is activated (pixels)', 'input_attrs' => [ 'placeholder' => ' 960' ] ],28 'revealColour' => [ 'type' => 'color', 'label' => 'Reveal colour', 'description' => 'Background colour of the reveal', 'default' => 'none' ], 29 'screenWidth' => [ 'type' => 'number', 'label' => 'Responsive threshold', 'description' => 'Threshold when menu is activated (pixels)', 'input_attrs' => [ 'placeholder' => '640' ] ], 30 30 'navPush' => [ 'type' => 'text', 'label' => 'Nav push', 'description' => 'Vertical push when mobile menu is shown', 'input_attrs' => [ 'placeholder' => '0' ] ], 31 31 'showChildren' => [ 'type' => 'checkbox', 'label' => 'Show children', 'description' => 'Include submenus', 'default' => true ], -
mean-menu-refueled/tags/1.3/readme.txt
r2608272 r2608529 6 6 Tested up to: 5.8 7 7 Requires PHP: 5.4 8 Stable tag: 1. 28 Stable tag: 1.3 9 9 License: GPL2 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 21 21 - **Menu target** A CSS selector to the closest container where the menu resides. Leave blank for an attempt at auto-detection with ul.menu (The WP default). 22 22 - **Menu anchor** A CSS selector to the container where the mean menu will reside. If you're unsure, try `body`. 23 - **Bar colour** The b ckground colour of the mean menu bar.23 - **Bar colour** The background colour of the mean menu bar. 24 24 - **Menu colour** The background colour of the expanded mean menu. 25 25 - **Menu close** The symbol that will be used when the menu is expanded. This can be any unicode character or HTML entity. … … 27 27 - **Reveal position** The justification of the mean menu state symbol. 28 28 - **Reveal position offset** Horizontal offset applied to the mean menu state symbol. This is intelligently applied depending on the justification, and has no effect when centered. 29 - **Reveal colour** The fontcolour of the mean menu state symbol.29 - **Reveal colour** The background colour of the mean menu state symbol. 30 30 - **Responsive threshold** The viewport threshold of when the mean menu replaced the standard menu. 31 31 - **Nav push** Vertical offset applied to the expanded component of the mean menu. … … 61 61 == Changelog == 62 62 63 = 1.3 = 64 * Mean Menu now adapts to window resize 65 * Corrected some configuration text labels 66 63 67 = 1.2 = 64 68 * Automatic menu detection as a feature -
mean-menu-refueled/tags/1.3/vendor/meanMenu/meanmenu.js
r2608272 r2608529 208 208 } ) 209 209 210 window.addEventListener( "resize", function(e) { 211 applyMean() 212 } ) 213 210 214 applyMean() 211 215 } -
mean-menu-refueled/tags/1.3/vendor/meanMenu/meanmenu.min.js
r2608272 r2608529 1 function MeanMenu(e,n={}){ var a;const c=Object.assign({},{meanMenuContainer:"body",meanBarColour:"#0c1923",meanNavColour:"inherit",meanMenuClose:"x",meanMenuOpen:"≡",meanRevealPosition:"right",meanRevealPositionDistance:"0",meanRevealColour:"none",meanScreenWidth:640,meanNavPush:!1,meanShowChildren:!0,meanExpandableChildren:!0,meanExpand:"+",meanContract:"-",meanRemoveAttrs:!1,onePage:!1,removeElements:null,meanDisplay:"block"},n),u=e instanceof Element?e:document.querySelector(e),d=document.querySelector(c.meanMenuContainer),v={menuOn:!1,menuOpen:!1};function t(){var e=d.querySelector(".mean-reveal"),n=e.classList.contains("mean-close")?c.meanMenuClose:c.meanMenuOpen;e.innerHTML=n}function l(){v.menuOn=!0;var e,n,a,t={backgroundColor:c.meanBarColour},l={backgroundColor:c.meanNavColour},o=Object.assign({},function(e){let n;switch(e){case"right":n={right:c.meanRevealPositionDistance,left:"auto"};break;case"left":n={left:c.meanRevealPositionDistance,right:"auto"};break;case"center":n={left:0,right:0,marginLeft:"auto",marginRight:"auto"}}return n}(c.meanRevealPosition),{backgroundColor:c.meanRevealColour});d.classList.add("mean-container");const r=document.createElement("div");for(e in r.classList.add("mean-bar"),t)r.style[e]=t[e];const i=document.createElement("a");for(n in i.setAttribute("href","#nav"),i.setAttribute("title","Toggle navigation"),i.className="mean-reveal",o)i.style[n]=o[n];const s=document.createElement("nav");for(a in s.className="mean-nav",l)s.style[a]=l[a];if(s.innerHTML=u.innerHTML,r.append(i,s),d.prepend(r),c.removeElements&&document.querySelectorAll(c.removeElements).forEach(function(e){e.classList.add("mean-remove")}),c.meanRemoveAttrs&&d.querySelectorAll("nav.mean-nav ul, nav.mean-nav ul *").each(function(e){e.removeAttribute("id"),e.className=""}),c.meanNavPush){const m=document.createElement("div");m.className="nav-push",m.style="height:"+c.meanNavPush,u.parentNode.insertBefore(m,u)}u.style.display="none",d.querySelectorAll(".mean-nav ul").forEach(function(e){e.style.display="none"}),d.querySelectorAll(".mean-nav ul ul").forEach(function(e){if(c.meanShowChildren&&c.meanExpandableChildren){if(e.hasChildNodes()){const n=document.createElement("a");n.setAttribute("href","#nav"),n.setAttribute("title","Toggle submenu"),n.className="mean-expand",n.innerHTML=c.meanExpand,e.parentNode.append(n)}}else e.style.display=c.meanShowChildren?"inline":"none"})}function o(){v.menuOpen=!1,d.querySelector(".mean-nav ul").style.display="none",d.querySelector(".mean-reveal").classList.toggle("mean-close"),t()}c.onePage&&d.querySelectorAll(".mean-nav ul > li > a:first-child").forEach(function(e){e.addEventListener("click",o)}),d.addEventListener("click",function(e){if(e.target.matches(".mean-reveal")){e.preventDefault(),v.menuOpen=!v.menuOpen;const n=d.querySelector(".mean-nav ul");e="block"===n.style.display?"none":"block";n.style.display=e,d.querySelector(".mean-reveal").classList.toggle("mean-close"),t()}}),d.addEventListener("click",function(e){var n,a;e.target.matches(".mean-expand")&&(e.preventDefault(),n=e.target.classList.contains("mean-clicked"),a=e.target.previousElementSibling.style.display,e.target.classList.toggle("mean-clicked"),e.target.innerHTML=n?c.meanExpand:c.meanContract,e.target.previousElementSibling.style.display="block"===a?"none":"block")}),(a=window.innerWidth||document.documentElement.clientWidth)<=c.meanScreenWidth&&!v.menuOn?(l(),t()):a>c.meanScreenWidth&&v.menuOn&&(v.menuOn=!1,u.style.display=c.meanDisplay,d.classList.remove("mean-container"),d.querySelectorAll(".mean-bar, .mean-push").forEach(function(e){e.parentNode.removeChild(e)}),c.removeElements&&document.querySelectorAll(c.removeElements).forEach(function(e){e.classList.remove("mean-remove")}))}1 function MeanMenu(e,n={}){const m=Object.assign({},{meanMenuContainer:"body",meanBarColour:"#0c1923",meanNavColour:"inherit",meanMenuClose:"x",meanMenuOpen:"≡",meanRevealPosition:"right",meanRevealPositionDistance:"0",meanRevealColour:"none",meanScreenWidth:640,meanNavPush:!1,meanShowChildren:!0,meanExpandableChildren:!0,meanExpand:"+",meanContract:"-",meanRemoveAttrs:!1,onePage:!1,removeElements:null,meanDisplay:"block"},n),u=e instanceof Element?e:document.querySelector(e),d=document.querySelector(m.meanMenuContainer),v={menuOn:!1,menuOpen:!1};function a(){var e=d.querySelector(".mean-reveal"),n=e.classList.contains("mean-close")?m.meanMenuClose:m.meanMenuOpen;e.innerHTML=n}function t(){v.menuOn=!0;var e,n,a,t={backgroundColor:m.meanBarColour},l={backgroundColor:m.meanNavColour},o=Object.assign({},function(e){let n;switch(e){case"right":n={right:m.meanRevealPositionDistance,left:"auto"};break;case"left":n={left:m.meanRevealPositionDistance,right:"auto"};break;case"center":n={left:0,right:0,marginLeft:"auto",marginRight:"auto"}}return n}(m.meanRevealPosition),{backgroundColor:m.meanRevealColour});d.classList.add("mean-container");const r=document.createElement("div");for(e in r.classList.add("mean-bar"),t)r.style[e]=t[e];const i=document.createElement("a");for(n in i.setAttribute("href","#nav"),i.setAttribute("title","Toggle navigation"),i.className="mean-reveal",o)i.style[n]=o[n];const s=document.createElement("nav");for(a in s.className="mean-nav",l)s.style[a]=l[a];if(s.innerHTML=u.innerHTML,r.append(i,s),d.prepend(r),m.removeElements&&document.querySelectorAll(m.removeElements).forEach(function(e){e.classList.add("mean-remove")}),m.meanRemoveAttrs&&d.querySelectorAll("nav.mean-nav ul, nav.mean-nav ul *").each(function(e){e.removeAttribute("id"),e.className=""}),m.meanNavPush){const c=document.createElement("div");c.className="nav-push",c.style="height:"+m.meanNavPush,u.parentNode.insertBefore(c,u)}u.style.display="none",d.querySelectorAll(".mean-nav ul").forEach(function(e){e.style.display="none"}),d.querySelectorAll(".mean-nav ul ul").forEach(function(e){if(m.meanShowChildren&&m.meanExpandableChildren){if(e.hasChildNodes()){const n=document.createElement("a");n.setAttribute("href","#nav"),n.setAttribute("title","Toggle submenu"),n.className="mean-expand",n.innerHTML=m.meanExpand,e.parentNode.append(n)}}else e.style.display=m.meanShowChildren?"inline":"none"})}function l(){var e=window.innerWidth||document.documentElement.clientWidth;e<=m.meanScreenWidth&&!v.menuOn?(t(),a()):e>m.meanScreenWidth&&v.menuOn&&(v.menuOn=!1,u.style.display=m.meanDisplay,d.classList.remove("mean-container"),d.querySelectorAll(".mean-bar, .mean-push").forEach(function(e){e.parentNode.removeChild(e)}),m.removeElements&&document.querySelectorAll(m.removeElements).forEach(function(e){e.classList.remove("mean-remove")}))}function o(){v.menuOpen=!1,d.querySelector(".mean-nav ul").style.display="none",d.querySelector(".mean-reveal").classList.toggle("mean-close"),a()}m.onePage&&d.querySelectorAll(".mean-nav ul > li > a:first-child").forEach(function(e){e.addEventListener("click",o)}),d.addEventListener("click",function(e){if(e.target.matches(".mean-reveal")){e.preventDefault(),v.menuOpen=!v.menuOpen;const n=d.querySelector(".mean-nav ul");e="block"===n.style.display?"none":"block";n.style.display=e,d.querySelector(".mean-reveal").classList.toggle("mean-close"),a()}}),d.addEventListener("click",function(e){var n,a;e.target.matches(".mean-expand")&&(e.preventDefault(),n=e.target.classList.contains("mean-clicked"),a=e.target.previousElementSibling.style.display,e.target.classList.toggle("mean-clicked"),e.target.innerHTML=n?m.meanExpand:m.meanContract,e.target.previousElementSibling.style.display="block"===a?"none":"block")}),window.addEventListener("resize",function(e){l()}),l()} -
mean-menu-refueled/trunk/plugin.php
r2608272 r2608529 5 5 Plugin URI: https://planetjon.ca/projects/mean-menu-refueled/ 6 6 Description: Make any menu suitable for mobile 7 Version: 1. 27 Version: 1.3 8 8 Requires at least: 5.0.0 9 9 Tested up to: 5.8 … … 20 20 'target' => [ 'type' => 'text', 'label' => 'Menu target', 'description' => 'Where is target menu contained? Leave blank for auto-detection of parent of first ul.menu element', 'input_attrs' => [] ], 21 21 'container' => [ 'type' => 'text', 'label' => 'Menu container', 'description' => 'Where should mean menu be anchored?', 'input_attrs' => [ 'placeholder' => 'body' ] ], 22 'barColour' => [ 'type' => 'color', 'label' => 'Bar colour', 'description' => ' Colour of the mean bar', 'default' => '#0c1923' ],23 'navColour' => [ 'type' => 'color', 'label' => 'Menu colour', 'description' => ' Colour of the expanded menu', 'default' => '#0c1923' ],22 'barColour' => [ 'type' => 'color', 'label' => 'Bar colour', 'description' => 'Background colour of the mean bar', 'default' => '#0c1923' ], 23 'navColour' => [ 'type' => 'color', 'label' => 'Menu colour', 'description' => 'Background colour of the expanded menu', 'default' => '#0c1923' ], 24 24 'menuClose' => [ 'type' => 'text', 'label' => 'Menu close', 'description' => 'Symbol shown to close the menu', 'input_attrs' => [ 'placeholder' => 'x' ] ], 25 25 'menuOpen' => [ 'type' => 'text', 'label' => 'Menu open', 'description' => 'Symbol shown to open the menu', 'input_attrs' => [ 'placeholder' => '≡' ] ], 26 26 'revealPosition' => [ 'type' => 'select', 'label' => 'Reveal position', 'description' => 'Position of the reveal', 'choices' => [ 'right' => 'right', 'center' => 'center', 'left' => 'left' ], 'default' => 'right' ], 27 27 'revealPositionDistance' => [ 'type' => 'text', 'label' => 'Reveal position offset', 'description' => 'Offset of the reveal', 'input_attrs' => [ 'placeholder' => '0' ] ], 28 'revealColour' => [ 'type' => 'color', 'label' => 'Reveal colour', 'description' => ' Colour of the reveal', 'default' => 'none' ],29 'screenWidth' => [ 'type' => 'number', 'label' => 'Responsive threshold', 'description' => 'Threshold when menu is activated (pixels)', 'input_attrs' => [ 'placeholder' => ' 960' ] ],28 'revealColour' => [ 'type' => 'color', 'label' => 'Reveal colour', 'description' => 'Background colour of the reveal', 'default' => 'none' ], 29 'screenWidth' => [ 'type' => 'number', 'label' => 'Responsive threshold', 'description' => 'Threshold when menu is activated (pixels)', 'input_attrs' => [ 'placeholder' => '640' ] ], 30 30 'navPush' => [ 'type' => 'text', 'label' => 'Nav push', 'description' => 'Vertical push when mobile menu is shown', 'input_attrs' => [ 'placeholder' => '0' ] ], 31 31 'showChildren' => [ 'type' => 'checkbox', 'label' => 'Show children', 'description' => 'Include submenus', 'default' => true ], -
mean-menu-refueled/trunk/readme.txt
r2608272 r2608529 6 6 Tested up to: 5.8 7 7 Requires PHP: 5.4 8 Stable tag: 1. 28 Stable tag: 1.3 9 9 License: GPL2 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 21 21 - **Menu target** A CSS selector to the closest container where the menu resides. Leave blank for an attempt at auto-detection with ul.menu (The WP default). 22 22 - **Menu anchor** A CSS selector to the container where the mean menu will reside. If you're unsure, try `body`. 23 - **Bar colour** The b ckground colour of the mean menu bar.23 - **Bar colour** The background colour of the mean menu bar. 24 24 - **Menu colour** The background colour of the expanded mean menu. 25 25 - **Menu close** The symbol that will be used when the menu is expanded. This can be any unicode character or HTML entity. … … 27 27 - **Reveal position** The justification of the mean menu state symbol. 28 28 - **Reveal position offset** Horizontal offset applied to the mean menu state symbol. This is intelligently applied depending on the justification, and has no effect when centered. 29 - **Reveal colour** The fontcolour of the mean menu state symbol.29 - **Reveal colour** The background colour of the mean menu state symbol. 30 30 - **Responsive threshold** The viewport threshold of when the mean menu replaced the standard menu. 31 31 - **Nav push** Vertical offset applied to the expanded component of the mean menu. … … 61 61 == Changelog == 62 62 63 = 1.3 = 64 * Mean Menu now adapts to window resize 65 * Corrected some configuration text labels 66 63 67 = 1.2 = 64 68 * Automatic menu detection as a feature -
mean-menu-refueled/trunk/vendor/meanMenu/meanmenu.js
r2608272 r2608529 208 208 } ) 209 209 210 window.addEventListener( "resize", function(e) { 211 applyMean() 212 } ) 213 210 214 applyMean() 211 215 } -
mean-menu-refueled/trunk/vendor/meanMenu/meanmenu.min.js
r2608272 r2608529 1 function MeanMenu(e,n={}){ var a;const c=Object.assign({},{meanMenuContainer:"body",meanBarColour:"#0c1923",meanNavColour:"inherit",meanMenuClose:"x",meanMenuOpen:"≡",meanRevealPosition:"right",meanRevealPositionDistance:"0",meanRevealColour:"none",meanScreenWidth:640,meanNavPush:!1,meanShowChildren:!0,meanExpandableChildren:!0,meanExpand:"+",meanContract:"-",meanRemoveAttrs:!1,onePage:!1,removeElements:null,meanDisplay:"block"},n),u=e instanceof Element?e:document.querySelector(e),d=document.querySelector(c.meanMenuContainer),v={menuOn:!1,menuOpen:!1};function t(){var e=d.querySelector(".mean-reveal"),n=e.classList.contains("mean-close")?c.meanMenuClose:c.meanMenuOpen;e.innerHTML=n}function l(){v.menuOn=!0;var e,n,a,t={backgroundColor:c.meanBarColour},l={backgroundColor:c.meanNavColour},o=Object.assign({},function(e){let n;switch(e){case"right":n={right:c.meanRevealPositionDistance,left:"auto"};break;case"left":n={left:c.meanRevealPositionDistance,right:"auto"};break;case"center":n={left:0,right:0,marginLeft:"auto",marginRight:"auto"}}return n}(c.meanRevealPosition),{backgroundColor:c.meanRevealColour});d.classList.add("mean-container");const r=document.createElement("div");for(e in r.classList.add("mean-bar"),t)r.style[e]=t[e];const i=document.createElement("a");for(n in i.setAttribute("href","#nav"),i.setAttribute("title","Toggle navigation"),i.className="mean-reveal",o)i.style[n]=o[n];const s=document.createElement("nav");for(a in s.className="mean-nav",l)s.style[a]=l[a];if(s.innerHTML=u.innerHTML,r.append(i,s),d.prepend(r),c.removeElements&&document.querySelectorAll(c.removeElements).forEach(function(e){e.classList.add("mean-remove")}),c.meanRemoveAttrs&&d.querySelectorAll("nav.mean-nav ul, nav.mean-nav ul *").each(function(e){e.removeAttribute("id"),e.className=""}),c.meanNavPush){const m=document.createElement("div");m.className="nav-push",m.style="height:"+c.meanNavPush,u.parentNode.insertBefore(m,u)}u.style.display="none",d.querySelectorAll(".mean-nav ul").forEach(function(e){e.style.display="none"}),d.querySelectorAll(".mean-nav ul ul").forEach(function(e){if(c.meanShowChildren&&c.meanExpandableChildren){if(e.hasChildNodes()){const n=document.createElement("a");n.setAttribute("href","#nav"),n.setAttribute("title","Toggle submenu"),n.className="mean-expand",n.innerHTML=c.meanExpand,e.parentNode.append(n)}}else e.style.display=c.meanShowChildren?"inline":"none"})}function o(){v.menuOpen=!1,d.querySelector(".mean-nav ul").style.display="none",d.querySelector(".mean-reveal").classList.toggle("mean-close"),t()}c.onePage&&d.querySelectorAll(".mean-nav ul > li > a:first-child").forEach(function(e){e.addEventListener("click",o)}),d.addEventListener("click",function(e){if(e.target.matches(".mean-reveal")){e.preventDefault(),v.menuOpen=!v.menuOpen;const n=d.querySelector(".mean-nav ul");e="block"===n.style.display?"none":"block";n.style.display=e,d.querySelector(".mean-reveal").classList.toggle("mean-close"),t()}}),d.addEventListener("click",function(e){var n,a;e.target.matches(".mean-expand")&&(e.preventDefault(),n=e.target.classList.contains("mean-clicked"),a=e.target.previousElementSibling.style.display,e.target.classList.toggle("mean-clicked"),e.target.innerHTML=n?c.meanExpand:c.meanContract,e.target.previousElementSibling.style.display="block"===a?"none":"block")}),(a=window.innerWidth||document.documentElement.clientWidth)<=c.meanScreenWidth&&!v.menuOn?(l(),t()):a>c.meanScreenWidth&&v.menuOn&&(v.menuOn=!1,u.style.display=c.meanDisplay,d.classList.remove("mean-container"),d.querySelectorAll(".mean-bar, .mean-push").forEach(function(e){e.parentNode.removeChild(e)}),c.removeElements&&document.querySelectorAll(c.removeElements).forEach(function(e){e.classList.remove("mean-remove")}))}1 function MeanMenu(e,n={}){const m=Object.assign({},{meanMenuContainer:"body",meanBarColour:"#0c1923",meanNavColour:"inherit",meanMenuClose:"x",meanMenuOpen:"≡",meanRevealPosition:"right",meanRevealPositionDistance:"0",meanRevealColour:"none",meanScreenWidth:640,meanNavPush:!1,meanShowChildren:!0,meanExpandableChildren:!0,meanExpand:"+",meanContract:"-",meanRemoveAttrs:!1,onePage:!1,removeElements:null,meanDisplay:"block"},n),u=e instanceof Element?e:document.querySelector(e),d=document.querySelector(m.meanMenuContainer),v={menuOn:!1,menuOpen:!1};function a(){var e=d.querySelector(".mean-reveal"),n=e.classList.contains("mean-close")?m.meanMenuClose:m.meanMenuOpen;e.innerHTML=n}function t(){v.menuOn=!0;var e,n,a,t={backgroundColor:m.meanBarColour},l={backgroundColor:m.meanNavColour},o=Object.assign({},function(e){let n;switch(e){case"right":n={right:m.meanRevealPositionDistance,left:"auto"};break;case"left":n={left:m.meanRevealPositionDistance,right:"auto"};break;case"center":n={left:0,right:0,marginLeft:"auto",marginRight:"auto"}}return n}(m.meanRevealPosition),{backgroundColor:m.meanRevealColour});d.classList.add("mean-container");const r=document.createElement("div");for(e in r.classList.add("mean-bar"),t)r.style[e]=t[e];const i=document.createElement("a");for(n in i.setAttribute("href","#nav"),i.setAttribute("title","Toggle navigation"),i.className="mean-reveal",o)i.style[n]=o[n];const s=document.createElement("nav");for(a in s.className="mean-nav",l)s.style[a]=l[a];if(s.innerHTML=u.innerHTML,r.append(i,s),d.prepend(r),m.removeElements&&document.querySelectorAll(m.removeElements).forEach(function(e){e.classList.add("mean-remove")}),m.meanRemoveAttrs&&d.querySelectorAll("nav.mean-nav ul, nav.mean-nav ul *").each(function(e){e.removeAttribute("id"),e.className=""}),m.meanNavPush){const c=document.createElement("div");c.className="nav-push",c.style="height:"+m.meanNavPush,u.parentNode.insertBefore(c,u)}u.style.display="none",d.querySelectorAll(".mean-nav ul").forEach(function(e){e.style.display="none"}),d.querySelectorAll(".mean-nav ul ul").forEach(function(e){if(m.meanShowChildren&&m.meanExpandableChildren){if(e.hasChildNodes()){const n=document.createElement("a");n.setAttribute("href","#nav"),n.setAttribute("title","Toggle submenu"),n.className="mean-expand",n.innerHTML=m.meanExpand,e.parentNode.append(n)}}else e.style.display=m.meanShowChildren?"inline":"none"})}function l(){var e=window.innerWidth||document.documentElement.clientWidth;e<=m.meanScreenWidth&&!v.menuOn?(t(),a()):e>m.meanScreenWidth&&v.menuOn&&(v.menuOn=!1,u.style.display=m.meanDisplay,d.classList.remove("mean-container"),d.querySelectorAll(".mean-bar, .mean-push").forEach(function(e){e.parentNode.removeChild(e)}),m.removeElements&&document.querySelectorAll(m.removeElements).forEach(function(e){e.classList.remove("mean-remove")}))}function o(){v.menuOpen=!1,d.querySelector(".mean-nav ul").style.display="none",d.querySelector(".mean-reveal").classList.toggle("mean-close"),a()}m.onePage&&d.querySelectorAll(".mean-nav ul > li > a:first-child").forEach(function(e){e.addEventListener("click",o)}),d.addEventListener("click",function(e){if(e.target.matches(".mean-reveal")){e.preventDefault(),v.menuOpen=!v.menuOpen;const n=d.querySelector(".mean-nav ul");e="block"===n.style.display?"none":"block";n.style.display=e,d.querySelector(".mean-reveal").classList.toggle("mean-close"),a()}}),d.addEventListener("click",function(e){var n,a;e.target.matches(".mean-expand")&&(e.preventDefault(),n=e.target.classList.contains("mean-clicked"),a=e.target.previousElementSibling.style.display,e.target.classList.toggle("mean-clicked"),e.target.innerHTML=n?m.meanExpand:m.meanContract,e.target.previousElementSibling.style.display="block"===a?"none":"block")}),window.addEventListener("resize",function(e){l()}),l()}
Note: See TracChangeset
for help on using the changeset viewer.