Current state

This commit is contained in:
2026-02-07 08:23:18 +01:00
commit 0a4372c40d
22479 changed files with 1553543 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
/*
* jQuery mmenu {ADDON} addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = '{ADDON}';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Extend shortcut options
// Extend shortcut configuration
// ...
// Add methods to api
// this._api = $.merge( this._api, [ 'fn1', 'fn2' ] );
// Bind functions to update
// this.bind( 'update', function() {} );
// this.bind( 'init', function() {} );
// this.bind( 'initPage', function() {} );
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
// ...Add classnames, data and events
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu )
{
// if ( $a.is( '.CLASSNAME' ) )
// {
// return true;
// }
// return false;
}
};
// Default options and configuration
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
// ...
};
$[ _PLUGIN_ ].configuration.classNames[ _ADDON_ ] = {
// ...
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,123 @@
/*
* jQuery mmenu autoHeight addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'autoHeight';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
if ( !this.opts.offCanvas )
{
return;
}
switch( this.opts.offCanvas.position )
{
case 'left':
case 'right':
return;
break;
}
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Extend shortcut options
if ( typeof opts == 'boolean' && opts )
{
opts = {
height: 'auto'
};
}
if ( typeof opts != 'object' )
{
opts = {};
}
opts = this.opts[ _ADDON_ ] = $.extend( true, {}, $[ _PLUGIN_ ].defaults[ _ADDON_ ], opts );
if ( opts.height != 'auto' )
{
return;
}
this.$menu.addClass( _c.autoheight );
// Update the height
var update = function( $panl )
{
var $p = this.$menu.children( '.' + _c.current );
_top = parseInt( $p.css( 'top' ) , 10 ) || 0;
_bot = parseInt( $p.css( 'bottom' ) , 10 ) || 0;
this.$menu.addClass( _c.measureheight );
$panl = $panl || this.$menu.children( '.' + _c.current );
if ( $panl.is( '.' + _c.vertical ) )
{
$panl = $panl
.parents( '.' + _c.panel )
.not( '.' + _c.vertical )
.first();
}
this.$menu
.height( $panl.outerHeight() + _top + _bot )
.removeClass( _c.measureheight );
};
this.bind( 'update', update );
this.bind( 'openPanel', update );
this.bind( 'closePanel', update );
this.bind( 'open', update );
glbl.$wndw
.off( _e.resize + '-autoheight' )
.on( _e.resize + '-autoheight',
function( e )
{
update.call( that );
}
);
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'autoheight measureheight' );
_e.add( 'resize' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu ) {}
};
// Default options and configuration
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
height: 'default' // 'auto'
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,106 @@
/*
* jQuery mmenu backButton addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'backButton';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
if ( !this.opts.offCanvas )
{
return;
}
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Extend shortcut options
if ( typeof opts == 'boolean' )
{
opts = {
close : opts
};
}
if ( typeof opts != 'object' )
{
opts = {};
}
opts = $.extend( true, {}, $[ _PLUGIN_ ].defaults[ _ADDON_ ], opts );
// Close menu
if ( opts.close )
{
var _hash = '#' + that.$menu.attr( 'id' );
this.bind( 'opened',
function( e )
{
if ( location.hash != _hash )
{
history.pushState( null, document.title, _hash );
}
}
);
$(window).on( 'popstate',
function( e )
{
if ( glbl.$html.hasClass( _c.opened ) )
{
e.stopPropagation();
that.close();
}
else if ( location.hash == _hash )
{
e.stopPropagation();
that.open();
}
}
);
}
},
// add: fired once per page load
add: function()
{
if ( !window.history || !window.history.pushState )
{
$[ _PLUGIN_ ].addons[ _ADDON_ ].setup = function() {};
return;
}
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu ) {}
};
// Default options and configuration
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
close: false
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,88 @@
/*
* jQuery mmenu buttonbars addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'buttonbars';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Bind functions to update
this.bind( 'init',
function( $panels )
{
// Refactor buttonbar class
this.__refactorClass( $('div', $panels), this.conf.classNames[ _ADDON_ ].buttonbar, 'buttonbar' );
// Add markup
$('.' + _c.buttonbar, $panels)
.each(
function()
{
var $bbar = $(this),
$btns = $bbar.children().not( 'input' ),
$inpt = $bbar.children().filter( 'input' );
$bbar.addClass( _c.buttonbar + '-' + $btns.length );
$inpt
.each(
function()
{
var $inp = $(this),
$lbl = $btns.filter( 'label[for="' + $inp.attr( 'id' ) + '"]' );
if ( $lbl.length )
{
$inp.insertBefore( $lbl );
}
}
);
}
);
}
);
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'buttonbar' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu ) {}
};
// Default options and configuration
$[ _PLUGIN_ ].configuration.classNames[ _ADDON_ ] = {
buttonbar: 'Buttonbar'
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,140 @@
/*
* jQuery mmenu counters addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'counters';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Extend shortcut options
if ( typeof opts == 'boolean' )
{
opts = {
add : opts,
update : opts
};
}
if ( typeof opts != 'object' )
{
opts = {};
}
opts = this.opts[ _ADDON_ ] = $.extend( true, {}, $[ _PLUGIN_ ].defaults[ _ADDON_ ], opts );
// Refactor counter class
this.bind( 'init',
function( $panels )
{
this.__refactorClass( $('em', $panels), this.conf.classNames[ _ADDON_ ].counter, 'counter' );
}
);
// Add the counters
if ( opts.add )
{
this.bind( 'init',
function( $panels )
{
$panels
.each(
function()
{
var $prnt = $(this).data( _d.parent );
if ( $prnt )
{
if ( !$prnt.children( 'em.' + _c.counter ).length )
{
$prnt.prepend( $( '<em class="' + _c.counter + '" />' ) );
}
}
}
);
}
);
}
if ( opts.update )
{
this.bind( 'update',
function()
{
this.$menu
.find( '.' + _c.panel )
.each(
function()
{
var $panl = $(this),
$prnt = $panl.data( _d.parent );
if ( !$prnt )
{
return;
}
var $cntr = $prnt.children( 'em.' + _c.counter );
if ( !$cntr.length )
{
return;
}
$panl = $panl.children( '.' + _c.listview );
if ( !$panl.length )
{
return;
}
$cntr.html( that.__filterListItems( $panl.children() ).length );
}
);
}
);
}
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'counter search noresultsmsg' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu ) {}
};
// Default options and configuration
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
add : false,
update : false
};
$[ _PLUGIN_ ].configuration.classNames[ _ADDON_ ] = {
counter: 'Counter'
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,237 @@
/*
* jQuery mmenu dividers addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'dividers';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Extend shortcut options
if ( typeof opts == 'boolean' )
{
opts = {
add : opts,
fixed : opts
};
}
if ( typeof opts != 'object' )
{
opts = {};
}
opts = this.opts[ _ADDON_ ] = $.extend( true, {}, $[ _PLUGIN_ ].defaults[ _ADDON_ ], opts );
// Refactor collapsed class
this.bind( 'init',
function( $panels )
{
this.__refactorClass( $('li', this.$menu), this.conf.classNames[ _ADDON_ ].collapsed, 'collapsed' );
}
);
// Add dividers
if ( opts.add )
{
this.bind( 'init',
function( $panels )
{
switch( opts.addTo )
{
case 'panels':
var $wrapper = $panels;
break;
default:
var $wrapper = $(opts.addTo, this.$menu).filter( '.' + _c.panel );
break;
}
$('.' + _c.divider, $wrapper).remove();
$wrapper
.find( '.' + _c.listview )
.not( '.' + _c.vertical )
.each(
function()
{
var last = '';
that.__filterListItems( $(this).children() )
.each(
function()
{
var crnt = $.trim( $(this).children( 'a, span' ).text() ).slice( 0, 1 ).toLowerCase();
if ( crnt != last && crnt.length )
{
last = crnt;
$( '<li class="' + _c.divider + '">' + crnt + '</li>' ).insertBefore( this );
}
}
);
}
);
}
);
}
// Toggle collapsed list items
if ( opts.collapse )
{
this.bind( 'init',
function( $panels )
{
$('.' + _c.divider, $panels )
.each(
function()
{
var $l = $(this),
$e = $l.nextUntil( '.' + _c.divider, '.' + _c.collapsed );
if ( $e.length )
{
if ( !$l.children( '.' + _c.subopen ).length )
{
$l.wrapInner( '<span />' );
$l.prepend( '<a href="#" class="' + _c.subopen + ' ' + _c.fullsubopen + '" />' );
}
}
}
);
}
);
}
// Fixed dividers
if ( opts.fixed )
{
var update = function( $panl )
{
$panl = $panl || this.$menu.children( '.' + _c.current );
var $dvdr = $panl
.find( '.' + _c.divider )
.not( '.' + _c.hidden );
if ( $dvdr.length )
{
this.$menu.addClass( _c.hasdividers );
var scrl = $panl.scrollTop() || 0,
text = '';
if ( $panl.is( ':visible' ) )
{
$panl
.find( '.' + _c.divider )
.not( '.' + _c.hidden )
.each(
function()
{
if ( $(this).position().top + scrl < scrl + 1 )
{
text = $(this).text();
}
}
);
}
this.$fixeddivider.text( text );
}
else
{
this.$menu.removeClass( _c.hasdividers );
}
};
// Add the fixed divider
this.$fixeddivider = $('<ul class="' + _c.listview + ' ' + _c.fixeddivider + '"><li class="' + _c.divider + '"></li></ul>')
.prependTo( this.$menu )
.children();
this.bind( 'openPanel', update );
// Set correct value onScroll
this.bind( 'init',
function( $panels )
{
$panels
.off( _e.scroll + '-dividers ' + _e.touchmove + '-dividers' )
.on( _e.scroll + '-dividers ' + _e.touchmove + '-dividers',
function( e )
{
update.call( that, $(this) );
}
)
}
);
}
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'collapsed uncollapsed fixeddivider hasdividers' );
_e.add( 'scroll' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu )
{
if ( this.opts[ _ADDON_ ].collapse && inMenu )
{
var $l = $a.parent();
if ( $l.is( '.' + _c.divider ) )
{
var $e = $l.nextUntil( '.' + _c.divider, '.' + _c.collapsed );
$l.toggleClass( _c.opened );
$e[ $l.hasClass( _c.opened ) ? 'addClass' : 'removeClass' ]( _c.uncollapsed );
return true;
}
}
return false;
}
};
// Default options and configuration
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
add : false,
addTo : 'panels',
fixed : false,
collapse : false
};
$[ _PLUGIN_ ].configuration.classNames[ _ADDON_ ] = {
collapsed: 'Collapsed'
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,309 @@
/*
* jQuery mmenu dragOpen addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'dragOpen';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
if ( !this.opts.offCanvas )
{
return;
}
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Extend shortcut options
if ( typeof opts == 'boolean' )
{
opts = {
open: opts
};
}
if ( typeof opts != 'object' )
{
opts = {};
}
opts = this.opts[ _ADDON_ ] = $.extend( true, {}, $[ _PLUGIN_ ].defaults[ _ADDON_ ], opts );
// Drag open
if ( opts.open )
{
// Set up variables
var drag = {},
_stage = 0,
_direction = false,
_dimension = false,
_distance = 0,
_maxDistance = 0;
var new_distance, drag_distance, css_value,
doPanstart, getSlideNodes;
switch( this.opts.offCanvas.position )
{
case 'left':
case 'right':
drag.events = 'panleft panright';
drag.typeLower = 'x';
drag.typeUpper = 'X';
_dimension = 'width';
break;
case 'top':
case 'bottom':
drag.events = 'panup pandown';
drag.typeLower = 'y';
drag.typeUpper = 'Y';
_dimension = 'height';
break;
}
switch( this.opts.offCanvas.position )
{
case 'right':
case 'bottom':
drag.negative = true;
doPanstart = function( pos )
{
if ( pos >= glbl.$wndw[ _dimension ]() - opts.maxStartPos )
{
_stage = 1;
}
};
break;
default:
drag.negative = false;
doPanstart = function( pos )
{
if ( pos <= opts.maxStartPos )
{
_stage = 1;
}
}
break;
}
switch( this.opts.offCanvas.position )
{
case 'left':
drag.open_dir = 'right';
drag.close_dir = 'left';
break;
case 'right':
drag.open_dir = 'left';
drag.close_dir = 'right';
break;
case 'top':
drag.open_dir = 'down';
drag.close_dir = 'up';
break;
case 'bottom':
drag.open_dir = 'up';
drag.close_dir = 'down';
break;
}
switch ( this.opts.offCanvas.zposition )
{
case 'front':
getSlideNodes = function()
{
return this.$menu;
};
break;
default:
getSlideNodes = function()
{
return $('.' + _c.slideout);
};
break;
};
var $dragNode = this.__valueOrFn( opts.pageNode, this.$menu, glbl.$page );
if ( typeof $dragNode == 'string' )
{
$dragNode = $($dragNode);
}
// Bind events
var _hammer = new Hammer( $dragNode[ 0 ], opts.vendors.hammer );
_hammer
.on( 'panstart',
function( e )
{
doPanstart( e.center[ drag.typeLower ] );
glbl.$slideOutNodes = getSlideNodes();
_direction = drag.open_dir;
}
)
.on( drag.events + ' panend',
function( e )
{
if ( _stage > 0 )
{
e.preventDefault();
}
}
)
.on( drag.events,
function( e )
{
new_distance = e[ 'delta' + drag.typeUpper ];
if ( drag.negative )
{
new_distance = -new_distance;
}
if ( new_distance != _distance )
{
_direction = ( new_distance >= _distance )
? drag.open_dir
: drag.close_dir;
}
_distance = new_distance;
if ( _distance > opts.threshold )
{
if ( _stage == 1 )
{
if ( glbl.$html.hasClass( _c.opened ) )
{
return;
}
_stage = 2;
that._openSetup();
that.trigger( 'opening' );
glbl.$html.addClass( _c.dragging );
_maxDistance = minMax(
glbl.$wndw[ _dimension ]() * conf[ _dimension ].perc,
conf[ _dimension ].min,
conf[ _dimension ].max
);
}
}
if ( _stage == 2 )
{
drag_distance = minMax( _distance, 10, _maxDistance ) - ( that.opts.offCanvas.zposition == 'front' ? _maxDistance : 0 );
if ( drag.negative )
{
drag_distance = -drag_distance;
}
css_value = 'translate' + drag.typeUpper + '(' + drag_distance + 'px )';
glbl.$slideOutNodes.css({
'-webkit-transform': '-webkit-' + css_value,
'transform': css_value
});
}
}
)
.on( 'panend',
function( e )
{
if ( _stage == 2 )
{
glbl.$html.removeClass( _c.dragging );
glbl.$slideOutNodes.css( 'transform', '' );
that[ _direction == drag.open_dir ? '_openFinish' : 'close' ]();
}
_stage = 0;
}
);
}
},
// add: fired once per page load
add: function()
{
if ( typeof Hammer != 'function' || Hammer.VERSION < 2 )
{
$[ _PLUGIN_ ].addons[ _ADDON_ ].setup = function() {};
return;
}
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'dragging' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu ) {}
};
// Default options and configuration
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
open : false,
// pageNode : null,
maxStartPos : 100,
threshold : 50,
vendors : {
hammer : {}
}
};
$[ _PLUGIN_ ].configuration[ _ADDON_ ] = {
width : {
perc : 0.8,
min : 140,
max : 440
},
height : {
perc : 0.8,
min : 140,
max : 880
}
};
var _c, _d, _e, glbl;
function minMax( val, min, max )
{
if ( val < min )
{
val = min;
}
if ( val > max )
{
val = max;
}
return val;
}
})( jQuery );

View File

@@ -0,0 +1,67 @@
/*
* jQuery mmenu fixedElements addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'fixedElements';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
if ( !this.opts.offCanvas )
{
return;
}
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
var setPage = function( $page )
{
// Refactor fixed classes
var _fixd = this.conf.classNames[ _ADDON_ ].fixed;
this.__refactorClass( $page.find( '.' + _fixd ), _fixd, 'fixed' )
.appendTo( glbl.$body )
.addClass( _c.slideout );
};
setPage.call( this, glbl.$page );
this.bind( 'setPage', setPage );
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'fixed' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu ) {}
};
// Default options and configuration
$[ _PLUGIN_ ].configuration.classNames[ _ADDON_ ] = {
fixed : 'Fixed'
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,109 @@
/*
* jQuery mmenu footer addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'footer';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Extend shortcut options
if ( typeof opts == 'boolean' )
{
opts = {
add : opts,
update : opts
};
}
if ( typeof opts != 'object' )
{
opts = {};
}
opts = this.opts[ _ADDON_ ] = $.extend( true, {}, $[ _PLUGIN_ ].defaults[ _ADDON_ ], opts );
// Add markup
if ( opts.add )
{
var content = opts.content
? opts.content
: opts.title;
$( '<div class="' + _c.footer + '" />' )
.appendTo( this.$menu )
.append( content );
this.$menu.addClass( _c.hasfooter );
}
this.$footer = this.$menu.children( '.' + _c.footer );
// Update content
if ( opts.update && this.$footer && this.$footer.length )
{
var update = function( $panl )
{
$panl = $panl || this.$menu.children( '.' + _c.current );
var _cnt = $('.' + this.conf.classNames[ _ADDON_ ].panelFooter, $panl).html() || opts.title;
this.$footer[ _cnt ? 'removeClass' : 'addClass' ]( _c.hidden );
this.$footer.html( _cnt );
};
this.bind( 'openPanel', update );
this.bind( 'init',
function()
{
update.call( this, this.$menu.children( '.' + _c.current ) );
}
);
}
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'footer hasfooter' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu ) {}
};
// Default options and configuration
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
add : false,
content : false,
title : '',
update : false
};
$[ _PLUGIN_ ].configuration.classNames[ _ADDON_ ] = {
panelFooter: 'Footer'
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,211 @@
/*
* jQuery mmenu header addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'header';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Extend shortcut options
if ( typeof opts == 'boolean' )
{
opts = {
add : opts,
update : opts
};
}
if ( typeof opts != 'object' )
{
opts = {};
}
if ( typeof opts.content == 'undefined' )
{
opts.content = [ 'prev', 'title', 'next' ];
}
opts = this.opts[ _ADDON_ ] = $.extend( true, {}, $[ _PLUGIN_ ].defaults[ _ADDON_ ], opts );
// Add markup
if ( opts.add )
{
if ( opts.content instanceof Array )
{
var $content = $( '<div />' );
for ( var c = 0, l = opts.content.length; c < l; c++ )
{
switch ( opts.content[ c ] )
{
case 'prev':
case 'next':
case 'close':
$content.append( '<a class="' + _c[ opts.content[ c ] ] + ' ' + _c.btn + '" href="#"></a>' );
break;
case 'title':
$content.append( '<a class="' + _c.title + '"></a>' );
break;
default:
$content.append( opts.content[ c ] );
break;
}
}
$content = $content.html();
}
else
{
var $content = opts.content;
}
$( '<div class="' + _c.header + '" />' )
.prependTo( this.$menu )
.append( $content );
this.$menu
.addClass( _c.hasheader );
this.bind( 'init',
function( $panel )
{
$panel.removeClass( _c.hasheader );
}
);
}
this.$header = this.$menu.children( '.' + _c.header );
// Update content
if ( opts.update && this.$header && this.$header.length )
{
var $titl = this.$header.find( '.' + _c.title ),
$prev = this.$header.find( '.' + _c.prev ),
$next = this.$header.find( '.' + _c.next ),
$clse = this.$header.find( '.' + _c.close );
var update = function( $panl )
{
$panl = $panl || this.$menu.children( '.' + _c.current );
// Find title, prev and next
var $ttl = $panl.find( '.' + this.conf.classNames[ _ADDON_ ].panelHeader ),
$prv = $panl.find( '.' + this.conf.classNames[ _ADDON_ ].panelPrev ),
$nxt = $panl.find( '.' + this.conf.classNames[ _ADDON_ ].panelNext ),
$prt = $panl.data( _d.parent );
var _ttl = $ttl.html(),
_prv = $prv.attr( 'href' ),
_nxt = $nxt.attr( 'href' ),
_prt = false;
var _prv_txt = $prv.html(),
_nxt_txt = $nxt.html();
if ( !_ttl )
{
_ttl = $panl.children( '.' + _c.header ).children( '.' + _c.title ).html();
}
if ( !_ttl )
{
_ttl = opts.title;
}
if ( !_prv )
{
_prv = $panl.children( '.' + _c.header ).children( '.' + _c.prev ).attr( 'href' );
}
switch ( opts.titleLink )
{
case 'anchor':
var _prt = ( $prt ) ? $prt.children( 'a' ).not( '.' + _c.next ).attr( 'href' ) : false;
break;
case 'panel':
var _prt = _prv;
break;
}
$titl[ _prt ? 'attr' : 'removeAttr' ]( 'href', _prt );
$titl[ _ttl ? 'removeClass' : 'addClass' ]( _c.hidden );
$titl.html( _ttl );
$prev[ _prv ? 'attr' : 'removeAttr' ]( 'href', _prv );
$prev[ _prv || _prv_txt ? 'removeClass' : 'addClass' ]( _c.hidden );
$prev.html( _prv_txt );
$next[ _nxt ? 'attr' : 'removeAttr' ]( 'href', _nxt );
$next[ _nxt || _nxt_txt ? 'removeClass' : 'addClass' ]( _c.hidden );
$next.html( _nxt_txt );
};
this.bind( 'openPanel', update );
this.bind( 'init',
function()
{
update.call( this, this.$menu.children( '.' + _c.current ) );
}
);
if ( this.opts.offCanvas )
{
var setPage = function( $page )
{
$clse.attr( 'href', '#' + $page.attr( 'id' ) );
};
setPage.call( this, glbl.$page );
this.bind( 'setPage', setPage );
}
}
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'close' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu ) {}
};
// Default options and configuration
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
add : false,
// content : [ 'prev', 'title', 'next' ],
title : 'Menu',
titleLink : 'panel',
update : false
};
$[ _PLUGIN_ ].configuration.classNames[ _ADDON_ ] = {
panelHeader : 'Header',
panelNext : 'Next',
panelPrev : 'Prev'
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,395 @@
/*
* jQuery mmenu offCanvas addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'offCanvas';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
if ( !this.opts[ _ADDON_ ] )
{
return;
}
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Add methods to api
this._api = $.merge( this._api, [ 'open', 'close', 'setPage' ] );
// Debug positioning
if ( opts.position == 'top' || opts.position == 'bottom' )
{
opts.zposition = 'front';
}
// Extend configuration
if ( typeof conf.pageSelector != 'string' )
{
conf.pageSelector = '> ' + conf.pageNodetype;
}
glbl.$allMenus = ( glbl.$allMenus || $() ).add( this.$menu );
// Setup the menu
this.vars.opened = false;
var clsn = [ _c.offcanvas ];
if ( opts.position != 'left' )
{
clsn.push( _c.mm( opts.position ) );
}
if ( opts.zposition != 'back' )
{
clsn.push( _c.mm( opts.zposition ) );
}
this.$menu
.addClass( clsn.join( ' ' ) )
.parent()
.removeClass( _c.wrapper );
// Setup the page
this.setPage( glbl.$page );
// Setup the UI blocker and the window
this._initBlocker();
this[ '_initWindow_' + _ADDON_ ]();
// Append to the body
this.$menu[ conf.menuInjectMethod + 'To' ]( conf.menuWrapperSelector );
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'offcanvas slideout modal background opening blocker page' );
_d.add( 'style' );
_e.add( 'resize' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu )
{
if ( !this.opts[ _ADDON_ ] )
{
return false;
}
// Open menu
var id = this.$menu.attr( 'id' );
if ( id && id.length )
{
if ( this.conf.clone )
{
id = _c.umm( id );
}
if ( $a.is( '[href="#' + id + '"]' ) )
{
this.open();
return true;
}
}
// Close menu
if ( !glbl.$page )
{
return;
}
var id = glbl.$page.attr( 'id' );
if ( id && id.length )
{
if ( $a.is( '[href="#' + id + '"]' ) )
{
this.close();
return true;
}
}
return false;
}
};
// Default options and configuration
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
position : 'left',
zposition : 'back',
modal : false,
moveBackground : true
};
$[ _PLUGIN_ ].configuration[ _ADDON_ ] = {
pageNodetype : 'div',
pageSelector : null,
menuWrapperSelector : 'body',
menuInjectMethod : 'prepend'
};
// Methods
$[ _PLUGIN_ ].prototype.open = function()
{
if ( this.vars.opened )
{
return;
}
var that = this;
this._openSetup();
// Without the timeout, the animation won't work because the element had display: none;
setTimeout(
function()
{
that._openFinish();
}, this.conf.openingInterval
);
this.trigger( 'open' );
};
$[ _PLUGIN_ ].prototype._openSetup = function()
{
var that = this;
// Close other menus
this.closeAllOthers();
// Store style and position
glbl.$page.data( _d.style, glbl.$page.attr( 'style' ) || '' );
// Trigger window-resize to measure height
glbl.$wndw.trigger( _e.resize + '-offcanvas', [ true ] );
var clsn = [ _c.opened ];
// Add options
if ( this.opts[ _ADDON_ ].modal )
{
clsn.push( _c.modal );
}
if ( this.opts[ _ADDON_ ].moveBackground )
{
clsn.push( _c.background );
}
if ( this.opts[ _ADDON_ ].position != 'left' )
{
clsn.push( _c.mm( this.opts[ _ADDON_ ].position ) );
}
if ( this.opts[ _ADDON_ ].zposition != 'back' )
{
clsn.push( _c.mm( this.opts[ _ADDON_ ].zposition ) );
}
if ( this.opts.extensions )
{
clsn.push( this.opts.extensions );
}
glbl.$html.addClass( clsn.join( ' ' ) );
// Open
setTimeout(function(){
that.vars.opened = true;
},this.conf.openingInterval);
this.$menu.addClass( _c.current + ' ' + _c.opened );
};
$[ _PLUGIN_ ].prototype._openFinish = function()
{
var that = this;
// Callback
this.__transitionend( glbl.$page,
function()
{
that.trigger( 'opened' );
}, this.conf.transitionDuration
);
// Opening
glbl.$html.addClass( _c.opening );
this.trigger( 'opening' );
};
$[ _PLUGIN_ ].prototype.close = function()
{
if ( !this.vars.opened )
{
return;
}
var that = this;
// Callback
this.__transitionend( glbl.$page,
function()
{
that.$menu
.removeClass( _c.current )
.removeClass( _c.opened );
glbl.$html
.removeClass( _c.opened )
.removeClass( _c.modal )
.removeClass( _c.background )
.removeClass( _c.mm( that.opts[ _ADDON_ ].position ) )
.removeClass( _c.mm( that.opts[ _ADDON_ ].zposition ) );
if ( that.opts.extensions )
{
glbl.$html.removeClass( that.opts.extensions );
}
// Restore style and position
glbl.$page.attr( 'style', glbl.$page.data( _d.style ) );
that.vars.opened = false;
that.trigger( 'closed' );
}, this.conf.transitionDuration
);
// Closing
glbl.$html.removeClass( _c.opening );
this.trigger( 'close' );
this.trigger( 'closing' );
};
$[ _PLUGIN_ ].prototype.closeAllOthers = function()
{
glbl.$allMenus
.not( this.$menu )
.each(
function()
{
var api = $(this).data( _PLUGIN_ );
if ( api && api.close )
{
api.close();
}
}
);
}
$[ _PLUGIN_ ].prototype.setPage = function( $page )
{
if ( !$page || !$page.length )
{
$page = $(this.conf[ _ADDON_ ].pageSelector, glbl.$body);
if ( $page.length > 1 )
{
$page = $page.wrapAll( '<' + this.conf[ _ADDON_ ].pageNodetype + ' />' ).parent();
}
}
$page.attr( 'id', $page.attr( 'id' ) || this.__getUniqueId() );
$page.addClass( _c.page + ' ' + _c.slideout );
glbl.$page = $page;
this.trigger( 'setPage', $page );
};
$[ _PLUGIN_ ].prototype[ '_initWindow_' + _ADDON_ ] = function()
{
// Prevent tabbing
glbl.$wndw
.off( _e.keydown + '-offcanvas' )
.on( _e.keydown + '-offcanvas',
function( e )
{
if ( glbl.$html.hasClass( _c.opened ) )
{
if ( e.keyCode == 9 )
{
e.preventDefault();
return false;
}
}
}
);
// Set page min-height to window height
var _h = 0;
glbl.$wndw
.off( _e.resize + '-offcanvas' )
.on( _e.resize + '-offcanvas',
function( e, force )
{
if ( force || glbl.$html.hasClass( _c.opened ) )
{
var nh = glbl.$wndw.height();
if ( force || nh != _h )
{
_h = nh;
glbl.$page.css( 'minHeight', nh );
}
}
}
);
};
$[ _PLUGIN_ ].prototype._initBlocker = function()
{
var that = this;
if ( !glbl.$blck )
{
glbl.$blck = $( '<div id="' + _c.blocker + '" class="' + _c.slideout + '" />' );
}
glbl.$blck
.appendTo( glbl.$body )
.off( _e.touchstart + '-offcanvas ' + _e.touchmove + '-offcanvas' )
.on( _e.touchstart + '-offcanvas ' + _e.touchmove + '-offcanvas',
function( e )
{
e.preventDefault();
e.stopPropagation();
glbl.$blck.trigger( _e.mousedown + '-offcanvas' );
}
)
.off( _e.mousedown + '-offcanvas' )
.on( _e.mousedown + '-offcanvas',
function( e )
{
e.preventDefault();
if ( !glbl.$html.hasClass( _c.modal ) )
{
that.closeAllOthers();
that.close();
}
}
);
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,337 @@
/*
* jQuery mmenu searchfield addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'searchfield';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Extend shortcut options
if ( typeof opts == 'boolean' )
{
opts = {
add : opts,
search : opts
};
}
if ( typeof opts != 'object' )
{
opts = {};
}
opts = this.opts[ _ADDON_ ] = $.extend( true, {}, $[ _PLUGIN_ ].defaults[ _ADDON_ ], opts );
// Bind functions to update
this.bind( 'init',
function( $panels )
{
// Add the searchfield(s)
if ( opts.add )
{
switch( opts.addTo )
{
case 'menu':
var $wrapper = this.$menu;
break;
case 'panels':
var $wrapper = $panels;
break;
default:
var $wrapper = $(opts.addTo, this.$menu).filter( '.' + _c.panel );
break;
}
$wrapper
.each(
function()
{
// Add the searchfield
var $panl = $(this);
if ( $panl.is( '.' + _c.panel ) && $panl.is( '.' + _c.vertical ) )
{
return;
}
if ( !$panl.children( '.' + _c.search ).length )
{
var _node = ( conf.form )
? 'form'
: 'div';
var $node = $( '<' + _node + ' class="' + _c.search + '" />' );
if ( conf.form && typeof conf.form == 'object' )
{
for ( var f in conf.form )
{
$node.attr( f, conf.form[ f ] );
}
}
$node.append( '<input placeholder="' + opts.placeholder + '" type="text" autocomplete="off" />' )
.prependTo( $panl );
$panl.addClass( _c.hassearch );
}
if ( opts.noResults )
{
if ( $panl.is( '.' + _c.menu ) )
{
$panl = $panl.children( '.' + _c.panel ).first();
}
if ( !$panl.children( '.' + _c.noresultsmsg ).length )
{
var $lst = $panl.children( '.' + _c.listview );
$( '<div class="' + _c.noresultsmsg + '" />' )
.append( opts.noResults )
[ $lst.length ? 'insertBefore' : 'prependTo' ]( $lst.length ? $lst : $panl );
}
}
}
);
}
/*
if ( this.$menu.children( '.' + _c.search ).length )
{
this.$menu.addClass( _c.hassearch );
}
*/
// Search through list items
if ( opts.search )
{
$('.' + _c.search, this.$menu)
.each(
function()
{
var $srch = $(this);
if ( opts.addTo == 'menu' )
{
var $pnls = $('.' + _c.panel, that.$menu),
$panl = that.$menu;
}
else
{
var $pnls = $srch.closest( '.' + _c.panel ),
$panl = $pnls;
}
var $inpt = $srch.children( 'input' ),
$itms = that.__findAddBack( $pnls, '.' + _c.listview ).children( 'li' ),
$dvdr = $itms.filter( '.' + _c.divider ),
$rslt = that.__filterListItems( $itms );
var _anchor = '> a',
_both = _anchor + ', > span';
var search = function()
{
var query = $inpt.val().toLowerCase();
// Scroll to top
$pnls.scrollTop( 0 );
// Search through items
$rslt
.add( $dvdr )
.addClass( _c.hidden )
.find( '.' + _c.fullsubopensearch )
.removeClass( _c.fullsubopen )
.removeClass( _c.fullsubopensearch );
$rslt
.each(
function()
{
var $item = $(this),
_search = _anchor;
if ( opts.showTextItems || ( opts.showSubPanels && $item.find( '.' + _c.next ) ) )
{
_search = _both;
}
if ( $(_search, $item).text().toLowerCase().indexOf( query ) > -1 )
{
$item.add( $item.prevAll( '.' + _c.divider ).first() ).removeClass( _c.hidden );
}
}
);
// Update sub items
if ( opts.showSubPanels )
{
$pnls.each(
function( i )
{
var $panl = $(this);
that.__filterListItems( $panl.find( '.' + _c.listview ).children() )
.each(
function()
{
var $li = $(this),
$su = $li.data( _d.sub );
$li.removeClass( _c.nosubresults );
if ( $su )
{
$su.find( '.' + _c.listview ).children().removeClass( _c.hidden );
}
}
);
}
);
}
// Update parent for submenus
$( $pnls.get().reverse() )
.each(
function( i )
{
var $panl = $(this),
$prnt = $panl.data( _d.parent );
if ( $prnt )
{
if ( that.__filterListItems( $panl.find( '.' + _c.listview ).children() ).length )
{
if ( $prnt.hasClass( _c.hidden ) )
{
$prnt.children( '.' + _c.next )
.not( '.' + _c.fullsubopen )
.addClass( _c.fullsubopen )
.addClass( _c.fullsubopensearch );
}
$prnt
.removeClass( _c.hidden )
.removeClass( _c.nosubresults )
.prevAll( '.' + _c.divider )
.first()
.removeClass( _c.hidden );
}
else if ( opts.addTo == 'menu' )
{
if ( $panl.hasClass( _c.opened ) )
{
// Compensate the timeout for the opening animation
setTimeout(
function()
{
that.openPanel( $prnt.closest( '.' + _c.panel ) );
}, ( i + 1 ) * ( that.conf.openingInterval * 1.5 )
);
}
$prnt.addClass( _c.nosubresults );
}
}
}
);
// Show/hide no results message
$panl[ $rslt.not( '.' + _c.hidden ).length ? 'removeClass' : 'addClass' ]( _c.noresults );
// Update for other addons
this.update();
}
$inpt
.off( _e.keyup + '-searchfield ' + _e.change + '-searchfield' )
.on( _e.keyup + '-searchfield',
function( e )
{
if ( !preventKeypressSearch( e.keyCode ) )
{
search.call( that );
}
}
)
.on( _e.change + '-searchfield',
function( e )
{
search.call( that );
}
);
}
);
}
}
);
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'search hassearch noresultsmsg noresults nosubresults fullsubopensearch' );
_e.add( 'change keyup' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu ) {}
};
// Default options and configuration
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
add : false,
addTo : 'menu',
search : false,
placeholder : 'Search',
noResults : 'No results found.',
showTextItems : false,
showSubPanels : true
};
$[ _PLUGIN_ ].configuration[ _ADDON_ ] = {
form : false
};
var _c, _d, _e, glbl;
function preventKeypressSearch( c )
{
switch( c )
{
case 9: // tab
case 16: // shift
case 17: // control
case 18: // alt
case 37: // left
case 38: // top
case 39: // right
case 40: // bottom
return true;
}
return false;
}
})( jQuery );

View File

@@ -0,0 +1,178 @@
/*
* jQuery mmenu sectionIndexer addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'sectionIndexer';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
// Extend shortcut options
if ( typeof opts == 'boolean' )
{
opts = {
add: opts
};
}
if ( typeof opts != 'object' )
{
opts = {};
}
opts = this.opts[ _ADDON_ ] = $.extend( true, {}, $[ _PLUGIN_ ].defaults[ _ADDON_ ], opts );
this.bind( 'init',
function( $panels )
{
// Set the panel(s)
if ( opts.add )
{
switch( opts.addTo )
{
case 'panels':
var $wrapper = $panels;
break;
default:
var $wrapper = $(opts.addTo, this.$menu).filter( '.' + _c.panel );
break;
}
$wrapper
.find( '.' + _c.divider )
.closest( '.' + _c.panel )
.addClass( _c.hasindexer );
}
// Add the indexer, only if it does not allready excists
if ( !this.$indexer &&
this.$menu.children( '.' + _c.hasindexer ).length
) {
this.$indexer = $( '<div class="' + _c.indexer + '" />' )
.prependTo( this.$menu )
.append(
'<a href="#a">a</a>' +
'<a href="#b">b</a>' +
'<a href="#c">c</a>' +
'<a href="#d">d</a>' +
'<a href="#e">e</a>' +
'<a href="#f">f</a>' +
'<a href="#g">g</a>' +
'<a href="#h">h</a>' +
'<a href="#i">i</a>' +
'<a href="#j">j</a>' +
'<a href="#k">k</a>' +
'<a href="#l">l</a>' +
'<a href="#m">m</a>' +
'<a href="#n">n</a>' +
'<a href="#o">o</a>' +
'<a href="#p">p</a>' +
'<a href="#q">q</a>' +
'<a href="#r">r</a>' +
'<a href="#s">s</a>' +
'<a href="#t">t</a>' +
'<a href="#u">u</a>' +
'<a href="#v">v</a>' +
'<a href="#w">w</a>' +
'<a href="#x">x</a>' +
'<a href="#y">y</a>' +
'<a href="#z">z</a>' +
'<a href="##">#</a>' );
// Scroll onMouseOver
this.$indexer
.children()
.on( _e.mouseover + '-searchfield ' + _c.touchmove + '-searchfield',
function( e )
{
var lttr = $(this).attr( 'href' ).slice( 1 ),
$panl = that.$menu.children( '.' + _c.current ),
$list = $panl.find( '.' + _c.listview );
var newTop = false,
oldTop = $panl.scrollTop(),
lstTop = $list.position().top + parseInt( $list.css( 'margin-top' ), 10 ) + parseInt( $list.css( 'padding-top' ), 10 ) + oldTop;
$panl.scrollTop( 0 );
$list
.children( '.' + _c.divider )
.not( '.' + _c.hidden )
.each(
function()
{
if ( newTop === false &&
lttr == $(this).text().slice( 0, 1 ).toLowerCase()
) {
newTop = $(this).position().top + lstTop;
}
}
);
$panl.scrollTop( newTop !== false ? newTop : oldTop );
}
);
// Show or hide the indexer
var update = function( $panl )
{
that.$menu[ ( $panl.hasClass( _c.hasindexer ) ? 'add' : 'remove' ) + 'Class' ]( _c.hasindexer );
};
this.bind( 'openPanel', update );
update.call( this, this.$menu.children( '.' + _c.current ) );
}
}
);
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'indexer hasindexer' );
_e.add( 'mouseover touchmove' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu )
{
if ( $a.parent().is( '.' + _c.indexer ) )
{
return true;
}
}
};
// Default options and configuration
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
add : false,
addTo : 'panels'
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,84 @@
/*
* jQuery mmenu toggles addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'toggles';
$[ _PLUGIN_ ].addons[ _ADDON_ ] = {
// setup: fired once per menu
setup: function()
{
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
glbl = $[ _PLUGIN_ ].glbl;
this.bind( 'init',
function( $panels )
{
// Refactor toggle classes
this.__refactorClass( $('input', $panels), this.conf.classNames[ _ADDON_ ].toggle, 'toggle' );
this.__refactorClass( $('input', $panels), this.conf.classNames[ _ADDON_ ].check, 'check' );
// Add markup
$('input.' + _c.toggle + ', input.' + _c.check, $panels)
.each(
function()
{
var $inpt = $(this),
$prnt = $inpt.closest( 'li' ),
cl = $inpt.hasClass( _c.toggle ) ? 'toggle' : 'check',
id = $inpt.attr( 'id' ) || that.__getUniqueId();
if ( !$prnt.children( 'label[for="' + id + '"]' ).length )
{
$inpt.attr( 'id', id );
$prnt.prepend( $inpt );
$('<label for="' + id + '" class="' + _c[ cl ] + '"></label>')
.insertBefore( $prnt.children( 'a, span' ).last() );
}
}
);
}
);
},
// add: fired once per page load
add: function()
{
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'toggle check' );
},
// clickAnchor: prevents default behavior when clicking an anchor
clickAnchor: function( $a, inMenu ) {}
};
// Default options and configuration
$[ _PLUGIN_ ].configuration.classNames[ _ADDON_ ] = {
toggle : 'Toggle',
check : 'Check'
};
var _c, _d, _e, glbl;
})( jQuery );

View File

@@ -0,0 +1,288 @@
/*
* Debugger for jQuery mmenu
* Include this file after including the jquery.mmenu plugin to debug your menu.
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu';
if ( typeof console == 'undefined' )
{
return false;
}
var _log = document[ _PLUGIN_ + '_debug_log' ] || console.log,
_warn = document[ _PLUGIN_ + '_debug_warn' ] || console.warn;
var glbl = $[ _PLUGIN_ ].glbl,
_c = $[ _PLUGIN_ ]._c,
_d = $[ _PLUGIN_ ]._d,
_e = $[ _PLUGIN_ ]._e;
function debug( msg )
{
_log( 'MMENU: ' + msg );
};
function deprecated( depr, repl, vers )
{
var msg = 'MMENU: ' + depr + 'is deprecated';
if ( vers )
{
msg += ' as of version ' + vers;
}
if ( repl )
{
msg += ', use ' + repl + ' instead.';
}
else
{
msg += '.';
}
_warn( msg );
};
$[ _PLUGIN_ ].prototype.___deprecated = function()
{
// Options 5.0
if ( typeof this.opts.labels != 'undefined' )
{
deprecated( 'The option "labels"', '"dividers"', '5.0' );
}
if ( typeof this.opts.classes != 'undefined' )
{
deprecated( 'The option "classes"', '"extensions"', '5.0' );
}
if ( typeof this.opts.searchfield != 'undefined' )
{
if ( typeof this.opts.searchfield.showLinksOnly != 'undefined' )
{
deprecated( 'The option "searchfield.showLinksOnly"', '"!searchfield.showTextItems"', '5.0' );
}
}
// Configuration 5.0
if ( typeof this.conf.classNames.label != 'undefined' )
{
deprecated( 'The configuration option "classNames.labels"', '"classNames.dividers"', '5.0' );
}
// HTML 5.0
if ( this.$menu.find( '.Label' ).length )
{
deprecated( 'The classname "Label"', '"Divider"', '5.0' );
}
if ( $( '.FixedTop' ).length )
{
deprecated( 'The classname "FixedTop"', '"Fixed"', '5.0' );
}
if ( $( '.FixedBottom' ).length )
{
deprecated( 'The classname "FixedBottom"', '"Fixed"', '5.0' );
}
// Custom events 5.0
this.$menu.on(
'setPage setPage.mm setSelected setSelected.mm open open.mm opening opening.mm opened opened.mm close close.mm closing closing.mm closed closed.mm toggle toggle.mm',
function( e )
{
deprecated( 'The custom event "' + e.type + '"', 'the API', '5.0' );
}
)
// Options 4.6
if ( this.opts.header )
{
if ( this.opts.header.add instanceof Array )
{
deprecated( 'An array for the "header.add" option', 'header.content', '4.6' );
}
}
// Vendors 4.4
if ( typeof 'Hammer' == 'function' && Hammer.VERSION < 2 )
{
deprecated( 'Older version of the Hammer library', 'version 2 or newer', '4.4' );
return;
}
// Options 4.3
for ( var a = [ 'position', 'zposition', 'modal', 'moveBackground' ], b = 0, l = a.length; b < l; b++ )
{
if ( typeof this.opts[ a[ b ] ] != 'undefined' )
{
deprecated( 'The option "' + a[ b ] + '"', 'offCanvas.' + a[ b ], '4.3' );
}
}
// Configuration 4.3
for ( var a = [ 'panel', 'list', 'selected', 'label', 'spacer' ], b = 0, l = a.length; b < l; b++ )
{
if ( typeof this.conf[ a[ b ] + 'Class' ] != 'undefined' )
{
deprecated( 'The configuration option "' + a[ b ] + 'Class"', 'classNames.' + a[ b ], '4.3' );
}
}
if ( typeof this.conf.counterClass != 'undefined' )
{
deprecated( 'The configuration option "counterClass"', 'classNames.counters.counter', '4.3' );
}
if ( typeof this.conf.collapsedClass != 'undefined' )
{
deprecated( 'The configuration option "collapsedClass"', 'classNames.labels.collapsed', '4,3' );
}
if ( typeof this.conf.header != 'undefined' )
{
for ( var a = [ 'panelHeader', 'panelNext', 'panelPrev' ], b = 0, l = a.length; b < l; b++ )
{
if ( typeof this.conf.header[ a[ b ] + 'Class' ] != 'undefined' )
{
deprecated( 'The configuration option "header.' + a[ b ] + 'Class"', 'classNames.header.' + a[ b ], '4.3' );
}
}
}
for ( var a = [ 'pageNodetype', 'pageSelector', 'menuWrapperSelector', 'menuInjectMethod' ], b = 0, l = a.length; b < l; b++ )
{
if ( typeof this.conf[ a[ b ] ] != 'undefined' )
{
deprecated( 'The configuration option "' + a[ b ] + '"', 'offCanvas.' + a[ b ], '4.3' );
}
}
// Options 4.2
if ( this.opts.offCanvas )
{
if ( this.opts.offCanvas.position == 'top' || this.opts.offCanvas.position == 'bottom' )
{
if ( this.opts.offCanvas.zposition == 'back' || this.opts.offCanvas.zposition == 'next' )
{
deprecated( 'Using offCanvas.position "' + this.opts.offCanvas.position + '" in combination with offCanvas.zposition "' + this.opts.offCanvas.zposition + '"', 'offCanvas.zposition "front"', '4.2' );
}
}
}
// Options 4.1
if ( this.opts.onClick && typeof this.opts.onClick.setLocationHref != 'undefined' )
{
deprecated( 'The option "onClick.setLocationHref"', '!onClick.preventDefault', '4.1' );
}
// Configuration 4.1
if ( typeof this.conf.panelNodeType != 'undefined' )
{
deprecated( 'panelNodeType configuration option', 'panelNodetype' );
}
};
$[ _PLUGIN_ ].prototype.___debug = function()
{
// non-available add-ons
var addons = [ 'autoHeight', 'backButton', 'buttonbars', 'counters', 'dividers', 'dragOpen', 'footer', 'header', 'offCanvas', 'searchfield', 'sectionIndexer', 'toggles' ];
for ( var a in addons )
{
if ( typeof this.opts[ addons[ a ] ] != 'undefined' )
{
if ( typeof $[ _PLUGIN_ ].addons[ addons[ a ] ] == 'undefined' )
{
debug( 'The "' + addons[ a ] + '" add-on is not available.' );
}
}
}
var position = false,
zposition = false;
if ( this.opts.offCanvas )
{
position = this.opts.offCanvas.position;
zposition = this.opts.offCanvas.zposition;
}
// background color
if ( zposition == 'back' )
{
var bg = $('body').css( 'background-color' );
if ( typeof bg == 'undefined' || bg == '' || bg == 'transparent' )
{
debug( 'Set a background-color for the <BODY />.' );
}
}
if ( position == 'left' || position == 'right' )
{
if ( this.opts.autoHeight && this.opts.autoHeight.height != 'default' )
{
debug( 'Don\'t use the "autoHeight" option with the "offCanvas.position" option set to "' + position + '".' );
}
}
// incompattible with iconbar
var fxSlide = ( this.opts.extensions.indexOf( 'mm-effect-slide' ) > -1 ),
fxZoom = ( this.opts.extensions.indexOf( 'mm-effect-zoom-menu' ) > -1 ),
fxZoomPnls = ( this.opts.extensions.indexOf( 'mm-effect-zoom-panels' ) > -1 ),
iconbar = ( $[ _PLUGIN_ ].glbl.$page && parseInt( $[ _PLUGIN_ ].glbl.$page.css( 'padding-right' ) ) > 0 );
if ( iconbar )
{
// iconbar + effects
if ( fxSlide || fxZoom )
{
debug( 'Don\'t use the "iconbar" extension in combination with the "' + ( fxSlide ? 'slide' : 'zoom-menu' ) + '" effect.' );
}
// iconbar + (z)position
if ( this.opts.offCanvas )
{
if ( position != 'left' )
{
debug( 'Don\'t use the "iconbar" extension in combination with the "offCanvas.position" option set to "' + position + '".' );
}
if ( zposition != 'back' )
{
debug( 'Don\'t use the "iconbar" extension in combination with the "offCanvas.zposition" option set to "' + zposition + '".' );
}
}
}
// effects + vertical submenus
if ( fxZoomPnls && !this.opts.slidingSubmenus )
{
debug( 'Don\'t use the "zoom-panels" effect in combination with the "slidingSubmenus" option set to "false".' );
}
// effects + onCanvas / (z)position
if ( fxSlide || fxZoom )
{
if ( this.opts.offCanvas )
{
if ( position == 'top' || position == 'bottom' )
{
debug( 'Don\'t use the "' + ( fxSlide ? 'slide' : 'zoom-menu' ) + '" effect in combination with the "offCanvas.position" option set to "' + position + '".' );
}
if ( zposition != 'back' )
{
debug( 'Don\'t use the "' + ( fxSlide ? 'slide' : 'zoom-menu' ) + '" effect in combination with the "offCanvas.zposition" option set to "' + zposition + '".' );
}
}
else
{
debug( 'Don\'t use the "' + ( fxSlide ? 'slide' : 'zoom-menu' ) + '" effect in combination with the "offCanvas" option set to "false".' );
}
}
};
})( jQuery );

View File

@@ -0,0 +1,5 @@
/*
This file does not excist.
If you are looking for the unminified version of jquery.mmenu.min.js,
hava a look at the files jquery.mmenu.oncanvas.js and jquery.mmenu.offcanvas.js
*/

View File

@@ -0,0 +1,761 @@
/*
* jQuery mmenu v5.0.4
* @requires jQuery 1.7.0 or later
*
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
* www.frebsite.nl
*
* Licensed under the MIT license:
* http://en.wikipedia.org/wiki/MIT_License
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_VERSION_ = '5.0.4';
// Plugin already excists
if ( $[ _PLUGIN_ ] )
{
return;
}
/*
Class
*/
$[ _PLUGIN_ ] = function( $menu, opts, conf )
{
this.$menu = $menu;
this._api = [ 'bind', 'init', 'update', 'setSelected', 'getInstance', 'openPanel', 'closePanel', 'closeAllPanels' ];
this.opts = opts;
this.conf = conf;
this.vars = {};
this.cbck = {};
if ( typeof this.___deprecated == 'function' )
{
this.___deprecated();
}
this._initMenu();
this._initAnchors();
var $panels = this.$menu.children( this.conf.panelNodetype );
this._initAddons();
this.init( $panels );
if ( typeof this.___debug == 'function' )
{
this.___debug();
}
return this;
};
$[ _PLUGIN_ ].version = _VERSION_;
$[ _PLUGIN_ ].addons = {};
$[ _PLUGIN_ ].uniqueId = 0;
$[ _PLUGIN_ ].defaults = {
extensions : [],
onClick : {
// close : true,
// blockUI : null,
// preventDefault : null,
setSelected : true
},
slidingSubmenus : true
};
$[ _PLUGIN_ ].configuration = {
classNames : {
panel : 'Panel',
vertical : 'Vertical',
selected : 'Selected',
divider : 'Divider',
spacer : 'Spacer'
},
clone : false,
openingInterval : 25,
panelNodetype : 'ul, ol, div',
transitionDuration : 400
};
$[ _PLUGIN_ ].prototype = {
init: function( $panels )
{
$panels = $panels.not( '.' + _c.nopanel );
$panels = this._initPanels( $panels );
this.trigger( 'init', $panels );
this.trigger( 'update' );
},
update: function()
{
this.trigger( 'update' );
},
setSelected: function( $i )
{
this.$menu.find( '.' + _c.listview ).children().removeClass( _c.selected );
$i.addClass( _c.selected );
this.trigger( 'setSelected', $i );
},
openPanel: function( $panel )
{
var $l = $panel.parent();
// Vertical
if ( $l.hasClass( _c.vertical ) )
{
var $sub = $l.parents( '.' + _c.subopened );
if ( $sub.length )
{
return this.openPanel( $sub.first() );
}
$l.addClass( _c.opened );
}
// Horizontal
else
{
if ( $panel.hasClass( _c.current ) )
{
return;
}
var $panels = $(this.$menu).children( '.' + _c.panel ),
$current = $panels.filter( '.' + _c.current );
$panels
.removeClass( _c.highest )
.removeClass( _c.current )
.not( $panel )
.not( $current )
.not( '.' + _c.vertical )
.addClass( _c.hidden );
if ( $panel.hasClass( _c.opened ) )
{
$current
.addClass( _c.highest )
.removeClass( _c.opened )
.removeClass( _c.subopened );
}
else
{
$panel.addClass( _c.highest );
$current.addClass( _c.subopened );
}
$panel
.removeClass( _c.hidden )
.addClass( _c.current );
// Without the timeout, the animation won't work because the element had display: none;
setTimeout(
function()
{
$panel
.removeClass( _c.subopened )
.addClass( _c.opened );
}, this.conf.openingInterval
);
}
this.trigger( 'openPanel', $panel );
},
closePanel: function( $panel )
{
var $l = $panel.parent();
// Vertical only
if ( $l.hasClass( _c.vertical ) )
{
$l.removeClass( _c.opened );
this.trigger( 'closePanel', $panel );
}
},
closeAllPanels: function()
{
// Vertical
this.$menu.find( '.' + _c.listview )
.children()
.removeClass( _c.selected )
.filter( '.' + _c.vertical )
.removeClass( _c.opened );
// Horizontal
var $pnls = this.$menu.children( '.' + _c.panel ),
$frst = $pnls.first();
this.$menu.children( '.' + _c.panel )
.not( $frst )
.removeClass( _c.subopened )
.removeClass( _c.opened )
.removeClass( _c.current )
.removeClass( _c.highest )
.addClass( _c.hidden );
this.openPanel( $frst );
},
togglePanel: function( $panel )
{
var $l = $panel.parent();
// Vertical only
if ( $l.hasClass( _c.vertical ) )
{
this[ $l.hasClass( _c.opened ) ? 'closePanel' : 'openPanel' ]( $panel );
}
},
getInstance: function()
{
return this;
},
bind: function( event, fn )
{
this.cbck[ event ] = this.cbck[ event ] || [];
this.cbck[ event ].push( fn );
},
trigger: function()
{
var that = this,
args = Array.prototype.slice.call( arguments ),
evnt = args.shift();
if ( this.cbck[ evnt ] )
{
for ( e in this.cbck[ evnt ] )
{
this.cbck[ evnt ][ e ].apply( that, args );
}
}
},
_initMenu: function()
{
var that = this;
// Clone if needed
if ( this.opts.offCanvas && this.conf.clone )
{
this.$menu = this.$menu.clone( true );
this.$menu.add( this.$menu.find( '*' ) )
.filter( '[id]' )
.each(
function()
{
$(this).attr( 'id', _c.mm( $(this).attr( 'id' ) ) );
}
);
}
// Strip whitespace
this.$menu.contents().each(
function()
{
if ( $(this)[ 0 ].nodeType == 3 )
{
$(this).remove();
}
}
);
this.$menu
.parent()
.addClass( _c.wrapper );
var clsn = [ _c.menu ];
// Add direction class
if ( !this.opts.slidingSubmenus )
{
clsn.push( _c.vertical );
}
// Add extensions
this.opts.extensions = ( this.opts.extensions.length )
? 'mm-' + this.opts.extensions.join( ' mm-' )
: '';
if ( this.opts.extensions )
{
clsn.push( this.opts.extensions );
}
this.$menu.addClass( clsn.join( ' ' ) );
},
_initPanels: function( $panels )
{
var that = this;
// Add List class
this.__findAddBack( $panels, 'ul, ol' )
.not( '.' + _c.nolistview )
.addClass( _c.listview );
var $lis = this.__findAddBack( $panels, '.' + _c.listview ).children();
// Refactor Selected class
this.__refactorClass( $lis, this.conf.classNames.selected, 'selected' );
// Refactor divider class
this.__refactorClass( $lis, this.conf.classNames.divider, 'divider' );
// Refactor Spacer class
this.__refactorClass( $lis, this.conf.classNames.spacer, 'spacer' );
// Refactor Panel class
this.__refactorClass( this.__findAddBack( $panels, '.' + this.conf.classNames.panel ), this.conf.classNames.panel, 'panel' );
// Create panels
var $curpanels = $(),
$oldpanels = $panels
.add( this.__findAddBack( $panels, '.' + _c.listview ).children().children( this.conf.panelNodetype ) )
.not( '.' + _c.nopanel );
this.__refactorClass( $oldpanels, this.conf.classNames.vertical, 'vertical' );
if ( !this.opts.slidingSubmenus )
{
$oldpanels.addClass( _c.vertical );
}
$oldpanels
.each(
function()
{
var $t = $(this),
$p = $t;
if ( $t.is( 'ul, ol' ) )
{
$t.wrap( '<div class="' + _c.panel + '" />' );
$p = $t.parent();
}
else
{
$p.addClass( _c.panel );
}
var id = $t.attr( 'id' );
$t.removeAttr( 'id' );
$p.attr( 'id', id || that.__getUniqueId() );
if ( $t.hasClass( _c.vertical ) )
{
$t.removeClass( that.conf.classNames.vertical );
$p.add( $p.parent() ).addClass( _c.vertical );
}
$curpanels = $curpanels.add( $p );
var $f = $p.children().first(),
$l = $p.children().last();
if ( $f.is( '.' + _c.listview ) )
{
$f.addClass( _c.first );
}
if ( $l.is( '.' + _c.listview ) )
{
$l.addClass( _c.last );
}
}
);
var $allpanels = $('.' + _c.panel, this.$menu);
// Add open and close links to menu items
$curpanels
.each(
function( i )
{
var $t = $(this),
$l = $t.parent(),
$a = $l.children( 'a, span' );
if ( !$l.is( '.' + _c.menu ) && !$t.data( _d.parent ) )
{
$l.data( _d.sub, $t );
$t.data( _d.parent, $l );
if ( $l.parent().is( '.' + _c.listview ) )
{
// Open link
var id = $t.attr( 'id' ),
$b = $( '<a class="' + _c.next + '" href="#' + id + '" data-target="#' + id + '" />' ).insertBefore( $a );
if ( !$a.is( 'a' ) )
{
$b.addClass( _c.fullsubopen );
}
}
// Close link
if ( !$l.hasClass( _c.vertical ) )
{
var $p = $l.closest( '.' + _c.panel );
if ( $p.length )
{
var id = $p.attr( 'id' );
$t.prepend( '<div class="' + _c.header + '"><a class="' + _c.btn + ' ' + _c.prev + '" href="#' + id + '" data-target="#' + id + '"></a><a class="' + _c.title + '">' + $a.text() + '</a></div>' );
$t.addClass( _c.hasheader );
}
}
}
}
);
// Add opened-classes to parents
var $s = this.__findAddBack( $panels, '.' + _c.listview )
.children( '.' + _c.selected )
.removeClass( _c.selected )
.last()
.addClass( _c.selected );
$s.add( $s.parentsUntil( '.' + _c.menu, 'li' ) )
.filter( '.' + _c.vertical )
.addClass( _c.opened )
.end()
.not( '.' + _c.vertical )
.each(
function()
{
$(this).parentsUntil( '.' + _c.menu, '.' + _c.panel )
.not( '.' + _c.vertical )
.first()
.addClass( _c.opened )
.parentsUntil( '.' + _c.menu, '.' + _c.panel )
.not( '.' + _c.vertical )
.first()
.addClass( _c.opened )
.addClass( _c.subopened );
}
);
// Add opened-classes to child
$s.children( '.' + _c.panel )
.not( '.' + _c.vertical )
.addClass( _c.opened )
.parentsUntil( '.' + _c.menu, '.' + _c.panel )
.not( '.' + _c.vertical )
.first()
.addClass( _c.opened )
.addClass( _c.subopened );
// Set current opened
var $current = $allpanels.filter( '.' + _c.opened );
if ( !$current.length )
{
$current = $curpanels.first();
}
$current
.addClass( _c.opened )
.last()
.addClass( _c.current );
// Rearrange markup
$curpanels
.not( '.' + _c.vertical )
.not( $current.last() )
.addClass( _c.hidden )
.end()
.appendTo( this.$menu );
return $curpanels;
},
_initAnchors: function()
{
var that = this;
glbl.$body
.on( _e.click + '-oncanvas',
'a[href]',
function( e )
{
var $t = $(this),
fired = false,
inMenu = that.$menu.find( $t ).length;
// Find behavior for addons
for ( var a in $[ _PLUGIN_ ].addons )
{
if ( fired = $[ _PLUGIN_ ].addons[ a ].clickAnchor.call( that, $t, inMenu ) )
{
break;
}
}
// Open/Close panel
if ( !fired && inMenu )
{
var _h = $t.attr( 'href' );
if ( _h.length > 1 && _h.slice( 0, 1 ) == '#' )
{
var $h = $(_h, that.$menu);
if ( $h.is( '.' + _c.panel ) )
{
fired = true;
that[ $t.parent().hasClass( _c.vertical ) ? 'togglePanel' : 'openPanel' ]( $h );
}
}
}
if ( fired )
{
e.preventDefault();
}
// All other anchors in lists
if ( !fired && inMenu )
{
if ( $t.is( '.' + _c.listview + ' > li > a' )
&& !$t.is( '[rel="external"]' )
&& !$t.is( '[target="_blank"]' ) )
{
// Set selected item
if ( that.__valueOrFn( that.opts.onClick.setSelected, $t ) )
{
that.setSelected( $(e.target).parent() );
}
// Prevent default / don't follow link. Default: false
var preventDefault = that.__valueOrFn( that.opts.onClick.preventDefault, $t, _h.slice( 0, 1 ) == '#' );
if ( preventDefault )
{
e.preventDefault();
}
// Block UI. Default: false if preventDefault, true otherwise
if ( that.__valueOrFn( that.opts.onClick.blockUI, $t, !preventDefault ) )
{
glbl.$html.addClass( _c.blocking );
}
// Close menu. Default: true if preventDefault, false otherwise
if ( that.__valueOrFn( that.opts.onClick.close, $t, preventDefault ) )
{
that.close();
}
}
}
}
);
},
_initAddons: function()
{
// Add add-ons to plugin
for ( var a in $[ _PLUGIN_ ].addons )
{
$[ _PLUGIN_ ].addons[ a ].add.call( this );
$[ _PLUGIN_ ].addons[ a ].add = function() {};
}
// Setup adds-on for menu
for ( var a in $[ _PLUGIN_ ].addons )
{
$[ _PLUGIN_ ].addons[ a ].setup.call( this );
}
},
__api: function()
{
var that = this,
api = {};
$.each( this._api,
function( i )
{
var fn = this;
api[ fn ] = function()
{
var re = that[ fn ].apply( that, arguments );
return ( typeof re == 'undefined' ) ? api : re;
}
}
);
return api;
},
__valueOrFn: function( o, $e, d )
{
if ( typeof o == 'function' )
{
return o.call( $e[ 0 ] );
}
if ( typeof o == 'undefined' && typeof d != 'undefined' )
{
return d;
}
return o;
},
__refactorClass: function( $e, o, c )
{
return $e.filter( '.' + o ).removeClass( o ).addClass( _c[ c ] );
},
__findAddBack: function( $e, s )
{
return $e.find( s ).add( $e.filter( s ) );
},
__filterListItems: function( $i )
{
return $i
.not( '.' + _c.divider )
.not( '.' + _c.hidden );
},
__transitionend: function( $e, fn, duration )
{
var _ended = false,
_fn = function()
{
if ( !_ended )
{
fn.call( $e[ 0 ] );
}
_ended = true;
};
$e.one( _e.transitionend, _fn );
$e.one( _e.webkitTransitionEnd, _fn );
setTimeout( _fn, duration * 1.1 );
},
__getUniqueId: function()
{
return _c.mm( $[ _PLUGIN_ ].uniqueId++ );
}
};
/*
jQuery plugin
*/
$.fn[ _PLUGIN_ ] = function( opts, conf )
{
// First time plugin is fired
initPlugin();
// Extend options
opts = $.extend( true, {}, $[ _PLUGIN_ ].defaults, opts );
conf = $.extend( true, {}, $[ _PLUGIN_ ].configuration, conf );
return this.each(
function()
{
var $menu = $(this);
if ( $menu.data( _PLUGIN_ ) )
{
return;
}
var _menu = new $[ _PLUGIN_ ]( $menu, opts, conf );
$menu.data( _PLUGIN_, _menu.__api() );
}
);
};
/*
SUPPORT
*/
$[ _PLUGIN_ ].support = {
touch: 'ontouchstart' in window || navigator.msMaxTouchPoints
};
// Global variables
var _c, _d, _e, glbl;
function initPlugin()
{
if ( $[ _PLUGIN_ ].glbl )
{
return;
}
glbl = {
$wndw : $(window),
$html : $('html'),
$body : $('body')
};
// Classnames, Datanames, Eventnames
_c = {};
_d = {};
_e = {};
$.each( [ _c, _d, _e ],
function( i, o )
{
o.add = function( c )
{
c = c.split( ' ' );
for ( var d in c )
{
o[ c[ d ] ] = o.mm( c[ d ] );
}
};
}
);
// Classnames
_c.mm = function( c ) { return 'mm-' + c; };
_c.add( 'wrapper menu vertical panel nopanel current highest opened subopened header hasheader title btn prev next first last listview nolistview selected divider spacer hidden fullsubopen' );
_c.umm = function( c )
{
if ( c.slice( 0, 3 ) == 'mm-' )
{
c = c.slice( 3 );
}
return c;
};
// Datanames
_d.mm = function( d ) { return 'mm-' + d; };
_d.add( 'parent sub' );
// Eventnames
_e.mm = function( e ) { return e + '.mm'; };
_e.add( 'transitionend webkitTransitionEnd mousedown mouseup touchstart touchmove touchend click keydown' );
$[ _PLUGIN_ ]._c = _c;
$[ _PLUGIN_ ]._d = _d;
$[ _PLUGIN_ ]._e = _e;
$[ _PLUGIN_ ].glbl = glbl;
}
})( jQuery );

View File

@@ -0,0 +1,217 @@
@mixin mm_colors( $cls: "",
$baseBg: $mm_backgroundColor,
$color: $mm_textColor, $dimmedColor: $mm_dimmedTextColor,
$emphasizedBg: $mm_emphasizedBackgroundColor, $highlightedBg: $mm_highlightedBackgroundColor,
$borderColor: $mm_borderColor
) {
.mm-menu#{$cls}
{
background: $baseBg;
color: $color;
.mm-header
{
border-color: $borderColor;
> a
{
color: $dimmedColor;
}
.mm-btn:before,
.mm-btn:after
{
border-color: $dimmedColor;
}
}
.mm-listview
{
> li:after
{
border-color: $borderColor;
}
> li
{
> a
{
&.mm-prev,
&.mm-next
{
color: $dimmedColor;
}
&.mm-prev:before,
&.mm-next:after
{
border-color: $dimmedColor;
}
&.mm-prev:after,
&.mm-next:before
{
border-color: $borderColor;
}
}
}
> li.mm-selected
{
> a:not(.mm-next),
> span
{
background: $emphasizedBg;
}
}
}
&.mm-vertical .mm-listview li.mm-opened,
.mm-listview li.mm-opened.mm-vertical
{
> a.mm-next,
> .mm-panel
{
background: $highlightedBg;
}
}
.mm-divider
{
background: $highlightedBg;
}
}
}
@mixin mm_colors_buttonbars( $cls: "",
$baseBg: $mm_backgroundColor,
$color: $mm_textColor
) {
.mm-menu#{$cls}
{
.mm-buttonbar
{
border-color: $color;
background: $baseBg;
> *
{
border-color: $color;
}
> input:checked + label
{
background: $color;
color: $baseBg;
}
}
}
}
@mixin mm_colors_checks( $cls: "",
$color: $mm_textColor
) {
.mm-menu#{$cls} label.mm-check:before
{
border-color: $color;
}
}
@mixin mm_colors_counters( $cls: "",
$dimmedColor: $mm_dimmedTextColor
) {
.mm-menu#{$cls} em.mm-counter
{
color: $dimmedColor;
}
}
@mixin mm_colors_dividers( $cls: "",
$highlightedBg: $mm_highlightedBackgroundColor
) {
.mm-menu#{$cls}
{
.mm-fixeddivider span
{
background: $highlightedBg;
}
}
}
@mixin mm_colors_footer( $cls: "",
$dimmedColor: $mm_dimmedTextColor,
$borderColor: $mm_borderColor
) {
.mm-menu#{$cls}
{
.mm-footer
{
border-color: $borderColor;
color: $dimmedColor;
}
}
}
@mixin mm_colors_pageshadow( $cls: "",
$pageShadow: $mm_pageShadow
) {
.mm-menu.mm-pageshadow#{$cls}
{
&:after
{
@if ( $pageShadow )
{
box-shadow: $pageShadow;
}
@else
{
content: none;
display: none;
}
}
}
}
@mixin mm_colors_searchfield( $cls: "",
$inputBg: $mm_inputBackgroundColor, $color: $mm_textColor,
$dimmedColor: $mm_dimmedTextColor
) {
.mm-menu#{$cls}
{
.mm-search input
{
background: $inputBg;
color: $color;
}
.mm-noresultsmsg
{
color: $dimmedColor;
}
}
}
@mixin mm_colors_sectionindexer( $cls: "",
$color: $mm_dimmedTextColor
) {
.mm-menu#{$cls} .mm-indexer a
{
color: $color;
}
}
@mixin mm_colors_toggles( $cls: "",
$buttonBg: $mm_backgroundColor,
$offBg: $mm_borderColor, $onBg: $mm_toggleCheckedColor
) {
.mm-menu#{$cls}
{
label.mm-toggle
{
background: $offBg;
&:before
{
background: $buttonBg;
}
}
input.mm-toggle:checked ~ label.mm-toggle
{
background: $onBg;
}
}
}

View File

@@ -0,0 +1,93 @@
// Arrows
@mixin mm_arrow
{
content: '';
border: 2px solid transparent;
display: inline-block;
width: 8px;
height: 8px;
margin: auto;
position: absolute;
top: 0;
bottom: 0;
@include mm_webkit_prefix( "transform", rotate( -45deg ) );
}
@mixin mm_arrow_prev
{
border-right: none;
border-bottom: none;
left: $mm_listitemIndent;
}
@mixin mm_arrow_next
{
border-top: none;
border-left: none;
right: $mm_listitemIndent;
}
// Borders
@mixin mm_border( $border, $pseudo, $pos1, $pos2, $pos3 )
{
&:#{$pseudo}
{
content: '';
border-#{$border}-width: 1px;
border-#{$border}-style: solid;
display: block;
position: absolute;
#{$pos1}: 0;
#{$pos2}: 0;
#{$pos3}: 0;
}
}
@mixin mm_border_top
{
@include mm_border( "top", "before", "left", "right", "top" );
}
@mixin mm_border_right
{
@include mm_border( "right", "after", "top", "bottom", "right" );
}
@mixin mm_border_bottom
{
@include mm_border( "bottom", "after", "left", "right", "bottom" );
}
@mixin mm_border_left
{
@include mm_border( "left", "before", "top", "bottom", "left" );
}
// Misc
@mixin mm_vendor_prefix( $prop, $val )
{
-webkit-#{$prop}: $val;
-moz-#{$prop}: $val;
-ms-#{$prop}: $val;
-o-#{$prop}: $val;
#{$prop}: $val;
}
@mixin mm_webkit_prefix( $prop, $val )
{
// we're not yet ready to drop vendor prefixes due to IE9 and older versions of FF
@include mm_vendor_prefix( $prop, $val );
// -webkit-#{$prop}: $val;
// #{$prop}: $val;
}
@mixin mm_ellipsis()
{
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
@mixin mm_clearfix()
{
&:after
{
content: '';
display: block;
clear: both;
}
}

View File

@@ -0,0 +1,86 @@
// Sizing left (default)
@mixin mm_sizing( $cls: "",
$width: $mm_menuWidth, $minWidth: $mm_menuMinWidth, $maxWidth: $mm_menuMaxWidth
) {
.mm-menu#{$cls}
{
width: percentage( $width );
min-width: $minWidth;
max-width: $maxWidth;
}
html.mm-opening#{$cls}
{
.mm-slideout
{
@include mm-webkit-prefix( 'transform', translate( percentage( $width ), 0 ) );
}
}
@media all and (max-width: $minWidth / $width ) {
html.mm-opening#{$cls}
{
.mm-slideout
{
@include mm-webkit-prefix( 'transform', translate( $minWidth, 0 ) );
}
}
}
@media all and (min-width: $maxWidth / $width ) {
html.mm-opening#{$cls}
{
.mm-slideout
{
@include mm-webkit-prefix( 'transform', translate( $maxWidth, 0 ) );
}
}
}
}
// Sizing right
@mixin mm_sizing_right( $cls: "",
$width: $mm_menuWidth, $minWidth: $mm_menuMinWidth, $maxWidth: $mm_menuMaxWidth
) {
html.mm-right.mm-opening#{$cls}
{
.mm-slideout
{
@include mm-webkit-prefix( 'transform', translate( -( percentage( $width ) ), 0 ) );
}
}
@media all and ( max-width: $minWidth / $width ) {
html.mm-right.mm-opening#{$cls}
{
.mm-slideout
{
@include mm-webkit-prefix( 'transform', translate( -$minWidth, 0 ) );
}
}
}
@media all and ( min-width: $maxWidth / $width ) {
html.mm-right.mm-opening#{$cls}
{
.mm-slideout
{
@include mm-webkit-prefix( 'transform', translate( -$maxWidth, 0 ) );
}
}
}
}
// Sizing z-position
@mixin mm_sizing_zposition( $cls: "",
$height: $mm_menuHeight, $minHeight: $mm_menuMinHeight, $maxHeight: $mm_menuMaxHeight
) {
// top
// bottom
.mm-menu#{$cls}
{
&.mm-top,
&.mm-bottom
{
height: percentage( $height );
min-height: $minHeight;
max-height: $maxHeight;
}
}
}

View File

@@ -0,0 +1,68 @@
// Animations
$mm_transitionDuration: 0.4s !default;
$mm_transitionFunction: ease !default;
// Colors
$mm_backgroundColor : #f3f3f3 !default;
$mm_borderColor : rgba( #000, 0.1 ) !default;
$mm_dimmedTextColor : rgba( #000, 0.3 ) !default;
$mm_emphasizedBackgroundColor : rgba( #fff, 0.5 ) !default;
$mm_highlightedBackgroundColor : rgba( #000, 0.05 ) !default;
$mm_textColor : rgba( #000, 0.7 ) !default;
// Sizes
$mm_padding : 10px !default;
$mm_btnSize : 40px !default;
$mm_fontSize : 14px !default;
$mm_listitemIndent : $mm_padding * 2 !default;
$mm_listitemPadding : $mm_padding !default;
$mm_panelPadding : $mm_padding * 2 !default;
$mm_subopenWidth : $mm_btnSize + $mm_padding !default;
$mm_subpanelOffset : 30% !default;
// Addon/Extension colors
$mm_toggleCheckedColor : #4bd963 !default;
$mm_inputBackgroundColor : rgba( #000, 0.05 ) !default;
$mm_pageShadow : 0 0 10px rgba( #000, 0.3 ) !default;
// Addon/Extension sizes
$mm_menuWidth : 0.8 !default;
$mm_menuMinWidth : 140px !default;
$mm_menuMaxWidth : 440px !default;
$mm_menuHeight : 0.8 !default;
$mm_menuMinHeight : 140px !default;
$mm_menuMaxHeight : 880px !default;
$mm_buttonbarHeight : $mm_btnSize - ( $mm_padding * 2 ) !default;
$mm_checkHeight : $mm_btnSize - $mm_padding !default;
$mm_checkWidth : $mm_btnSize - $mm_padding !default;
$mm_counterWidth : $mm_btnSize !default;
$mm_dividerFontSize : 10px !default;
$mm_dividerHeight : ( $mm_btnSize / 2 ) + ( $mm_padding / 2 ) !default;
$mm_footerHeight : $mm_btnSize !default;
$mm_headerHeight : $mm_btnSize !default;
$mm_iconbarWidth : $mm_btnSize + ( $mm_padding * 2 ) !default;
$mm_searchHeight : $mm_btnSize !default;
$mm_sectionIndexerWidth : $mm_padding * 2 !default;
$mm_toggleHeight : $mm_btnSize - $mm_padding !default;
$mm_toggleWidth : ( $mm_toggleHeight * 2 ) - $mm_padding !default;
$mm_zoomScaleDown : 0.7 !default;
$mm_zoomScaleUp : 1.5 !default;
@import "mixins";
@import "sizing";
@import "colors";

View File

@@ -0,0 +1,28 @@
/*
jQuery.mmenu autoHeight addon CSS
*/
@import "../_inc/variables";
.mm-menu
{
&.mm-top,
&.mm-bottom
{
&.mm-autoheight
{
max-height: percentage( $mm_menuHeight );
&.mm-fullscreen
{
max-height: 100%;
}
}
}
&.mm-measureheight > .mm-panel
{
bottom: auto !important;
height: auto !important;
}
}

View File

@@ -0,0 +1,99 @@
/*
jQuery.mmenu buttonbars addon CSS
*/
@import "../_inc/variables";
.mm-buttonbar
{
border: 1px solid transparent;
border-radius: $mm_padding / 2;
text-align: center;
line-height: $mm_buttonbarHeight;
overflow: hidden;
display: block;
padding: 0;
margin: 0;
position: relative;
@include mm_clearfix;
> *
{
border-left: 1px solid transparent;
box-sizing: border-box;
display: block;
width: 100%;
height: 100%;
float: left;
@include mm_ellipsis;
}
> a
{
text-decoration: none;
}
> input
{
position: absolute;
left: -1000px;
top: -1000px;
}
> input:checked + label
{
border-color: transparent !important;
}
> *:first-child,
> input:first-child + *
{
border-left: none;
}
&.mm-buttonbar-2 > *
{
width: 50%;
}
&.mm-buttonbar-3 > *
{
width: 33.33%;
}
&.mm-buttonbar-4 > *
{
width: 25%;
}
&.mm-buttonbar-5 > *
{
width: 20%;
}
}
.mm-header .mm-buttonbar
{
margin-top: $mm_headerHeight - ( $mm_buttonbarHeight * 2 );
margin-left: -( $mm_btnSize - $mm_padding );
margin-right: -( $mm_btnSize - $mm_padding );
}
.mm-footer .mm-buttonbar
{
border: none;
border-radius: none;
line-height: $mm_footerHeight;
margin: ( -$mm_padding ) ( -$mm_padding ) 0 ( -( $mm_padding * 2 ) );
> *
{
border-left: none;
}
}
.mm-listview > li > .mm-buttonbar
{
margin: $mm_padding ( $mm_padding * 2 );
}
@include mm_colors_buttonbars;

View File

@@ -0,0 +1,57 @@
/*
jQuery.mmenu counters addon CSS
*/
@import "../_inc/variables";
em.mm-counter
{
font: inherit;
font-size: $mm_fontSize;
font-style: normal;
text-indent: 0;
line-height: $mm_btnSize / 2;
display: block;
margin-top: -( $mm_btnSize / 4 );
position: absolute;
right: $mm_subopenWidth;
top: 50%;
+ a.mm-next
{
padding-left: $mm_counterWidth;
+ a,
+ span
{
margin-right: $mm_counterWidth + $mm_subopenWidth;
}
}
+ a.mm-fullsubopen
{
padding-left: 0;
}
}
// Removed support for counters in vertical submenus
.mm-vertical
{
> .mm-counter
{
top: ( $mm_btnSize / 4 ) + 2;
margin-top: 0;
}
&.mm-spacer > .mm-counter
{
margin-top: $mm_btnSize;
}
}
// Search
.mm-nosubresults > .mm-counter
{
display: none;
}
@include mm_colors_counters;

View File

@@ -0,0 +1,65 @@
/*
jQuery.mmenu dividers addon CSS
*/
@import "../_inc/variables";
// Collapsed
.mm-divider
{
> span
{
@include mm_ellipsis;
padding: 0;
line-height: $mm_dividerHeight;
}
&.mm-opened a.mm-next:after
{
@include mm_webkit_prefix( "transform", rotate( 45deg ) );
}
}
.mm-collapsed:not( .mm-uncollapsed )
{
display: none;
}
// Removed support for dividers in vertical submenus
//.mm-menu.mm-vertical .mm-divider
//{
// > a.mm-next:after
// {
// top: ( $mm_dividerHeight / 2 ) - 4;
// }
//}
// Fixed
.mm-fixeddivider
{
background: inherit;
display: none;
position: absolute;
top: 0;
left: 0;
right: 0;
z-index: 2;
// Bugfix
@include mm_webkit_prefix( 'transform', translate3d( 0, 0, 0 ) );
&:after
{
content: none !important;
display: none !important;
}
}
.mm-hasdividers .mm-fixeddivider
{
display: block;
}
@include mm_colors_dividers;

View File

@@ -0,0 +1,17 @@
/*
jQuery.mmenu dragOpen addon CSS
*/
@import "../_inc/variables";
html.mm-opened.mm-dragging
{
.mm-menu,
.mm-page,
.mm-fixed-top,
.mm-fixed-bottom,
#mm-blocker
{
@include mm_webkit_prefix( "transition-duration", 0s );
}
}

View File

@@ -0,0 +1,37 @@
/*
jQuery.mmenu footer addon CSS
*/
@import "../_inc/variables";
.mm-footer
{
background: inherit;
border-top: 1px solid transparent;
text-align: center;
line-height: $mm_footerHeight - ( $mm_padding * 2 );
box-sizing: border-box;
width: 100%;
height: $mm_footerHeight;
padding: $mm_padding $mm_panelPadding;
position: absolute;
z-index: 3;
bottom: 0;
left: 0;
// Bugfix
@include mm_webkit_prefix( 'transform', translate3d( 0, 0, 0 ) );
}
.mm-menu.mm-hasfooter
{
> .mm-panel
{
bottom: $mm_footerHeight;
}
}
@include mm_colors_footer;

View File

@@ -0,0 +1,50 @@
/*
jQuery.mmenu header addon CSS
*/
@import "../_inc/variables";
.mm-menu > .mm-header
{
background: inherit;
z-index: 3;
// Bugfix
@include mm_webkit_prefix( 'transform', translate3d( 0, 0, 0 ) );
.mm-close:after
{
content: 'x';
}
}
.mm-menu.mm-hassearch > .mm-header
{
top: $mm_searchHeight;
}
.mm-menu.mm-hasheader
{
.mm-panel
{
.mm-header
{
display: none;
}
}
.mm-panel,
.mm-fixeddivider
{
top: $mm_headerHeight;
}
&.mm-hassearch
{
.mm-panel,
.mm-fixeddivider
{
top: $mm_headerHeight + $mm_searchHeight;
}
}
}

View File

@@ -0,0 +1,77 @@
/*
jQuery.mmenu offcanvas addon CSS
*/
@import "../_inc/variables";
// Animations
.mm-page
{
box-sizing: border-box;
position: relative;
}
.mm-slideout
{
-webkit-transition: -webkit-transform $mm_transitionDuration $mm_transitionFunction;
-ms-transition: -ms-transform $mm_transitionDuration $mm_transitionFunction;
transition: transform $mm_transitionDuration $mm_transitionFunction;
}
// Container, Page, Blocker
html.mm-opened
{
overflow: hidden;
position: relative;
body
{
overflow: hidden;
}
.mm-page
{
min-height: 100vh; // Unfortunately there are still too many Android devices that don't support viewport units,
// therefore there still is some JS in jquery.mmenu.offcanvas.js that measures the window height onWindowResize.
}
}
html.mm-background .mm-page
{
background: inherit;
}
#mm-blocker
{
background: rgba( 3, 2, 1, 0 );
display: none;
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 999999;
}
html.mm-opened,
html.mm-blocking
{
#mm-blocker
{
display: block;
}
}
// Menu
.mm-menu
{
&.mm-offcanvas
{
display: none;
position: fixed;
}
&.mm-current
{
display: block;
}
}
@include mm_sizing;

View File

@@ -0,0 +1,115 @@
/*
jQuery.mmenu searchfield addon CSS
*/
@import "../_inc/variables";
$mm_searchfieldHeight: $mm_searchHeight - ( $mm_padding * 1.5 ) !default;
.mm-search,
.mm-search input
{
box-sizing: border-box;
}
.mm-search
{
}
.mm-menu > .mm-search
{
background: inherit;
z-index: 3;
// Bugfix
@include mm_webkit_prefix( 'transform', translate3d( 0, 0, 0 ) );
}
.mm-search
{
height: $mm_searchHeight;
width: 100%;
padding: $mm_padding $mm_padding 0 $mm_padding;
position: absolute;
top: 0;
left: 0;
input
{
border: none;
border-radius: $mm_searchfieldHeight;
font: inherit;
font-size: $mm_fontSize;
line-height: $mm_searchfieldHeight;
outline: none;
display: block;
width: 100%;
height: $mm_searchfieldHeight;
margin: 0;
padding: 0 $mm_padding;
}
input::-ms-clear
{
display: none;
}
}
.mm-panel
{
&.mm-hassearch
{
padding-top: $mm_searchHeight;
&.mm-hasheader
{
padding-top: $mm_searchHeight + $mm_headerHeight;
.mm-search
{
top: $mm_headerHeight;
}
}
}
}
.mm-noresultsmsg
{
text-align: center;
font-size: round( $mm_fontSize * 1.5 );
display: none;
padding: $mm_btnSize 0;
}
.mm-noresults
{
.mm-noresultsmsg
{
display: block;
}
.mm-indexer
{
display: none !important;
}
}
.mm-menu
{
li.mm-nosubresults > a.mm-next
{
display: none;
+ a,
+ span
{
padding-right: $mm_padding;
}
}
&.mm-hassearch
{
.mm-panel,
.mm-fixeddivider
{
top: $mm_searchHeight;
}
}
}
@include mm_colors_searchfield;

View File

@@ -0,0 +1,69 @@
/*
jQuery.mmenu sectionIndexer addon CSS
*/
@import "../_inc/variables";
.mm-indexer
{
background: inherit;
text-align: center;
font-size: 12px;
box-sizing: border-box;
width: $mm_sectionIndexerWidth;
position: absolute;
top: $mm_padding;
bottom: $mm_padding;
right: -( $mm_sectionIndexerWidth * 5 );
z-index: 3;
@include mm_webkit_prefix( 'transition', right $mm_transitionDuration $mm_transitionFunction );
// Bugfix
@include mm_webkit_prefix( 'transform', translate3d( 0, 0, 0 ) );
a
{
text-decoration: none;
display: block;
height: 3.71%;
}
~ .mm-panel.mm-hasindexer
{
padding-right: $mm_panelPadding + $mm_sectionIndexerWidth;
}
}
.mm-hasindexer
{
.mm-indexer
{
right: 0;
}
.mm-fixeddivider
{
right: $mm_sectionIndexerWidth;
}
}
.mm-hasheader .mm-indexer
{
top: $mm_headerHeight + $mm_padding;
}
.mm-hasfooter .mm-indexer
{
bottom: $mm_footerHeight + $mm_padding;
}
.mm-hassearch .mm-indexer
{
top: $mm_searchHeight + $mm_padding;
}
.mm-hassearch.mm-hasheader .mm-indexer
{
top: $mm_searchHeight + $mm_headerHeight + $mm_padding;
}
@include mm_colors_sectionindexer;

View File

@@ -0,0 +1,175 @@
/*
jQuery.mmenu toggles addon CSS
*/
@import "../_inc/variables";
input.mm-toggle,
input.mm-check
{
position: absolute;
left: -10000px;
}
label.mm-toggle,
label.mm-check
{
margin: 0;
position: absolute;
bottom: 50%;
z-index: 2;
&:before
{
content: '';
display: block;
}
}
// styling
label.mm-toggle
{
border-radius: $mm_toggleHeight;
width: $mm_toggleWidth;
height: $mm_toggleHeight;
margin-bottom: -( $mm_toggleHeight / 2 );
&:before
{
border-radius: $mm_toggleHeight;
width: $mm_toggleHeight - 2;
height: $mm_toggleHeight - 2;
margin: 1px;
}
}
input.mm-toggle:checked ~ label.mm-toggle:before
{
float: right;
}
label.mm-check
{
width: $mm_checkWidth;
height: $mm_checkHeight;
margin-bottom: -( $mm_checkHeight / 2 );
&:before
{
border-left: 3px solid;
border-bottom: 3px solid;
width: 40%;
height: 20%;
margin: 25% 0 0 20%;
opacity: 0.1;
@include mm-webkit-prefix( 'transform', rotate( -45deg ) );
}
}
input.mm-check:checked ~ label.mm-check:before
{
opacity: 1;
}
// Removed support for toggles and checks in vertical submenus
//.mm-menu.mm-vertical .mm-listview
//{
// > li label
// {
// &.mm-toggle,
// &.mm-check
// {
// bottom: auto;
// margin-bottom: 0;
// }
// &.mm-toggle
// {
// top: ( $mm_btnSize - $mm_toggleHeight ) / 2;
// }
// &.mm-check
// {
// top: ( $mm_btnSize - $mm_checkHeight ) / 2;
// }
// }
//}
// positioning
label
{
&.mm-toggle,
&.mm-check
{
right: $mm_padding * 2;
}
&.mm-toggle
{
+ a,
+ span
{
padding-right: $mm_toggleWidth + ( $mm_padding * 3 );
}
}
&.mm-check
{
+ a,
+ span
{
padding-right: $mm_checkWidth + ( $mm_padding * 3 );
}
}
}
// positioning with subopen
a.mm-next + label
{
&.mm-toggle,
&.mm-check
{
right: $mm_subopenWidth + $mm_padding;
+ a,
+ span
{
margin-right: $mm_subopenWidth;
}
}
&.mm-toggle
{
+ a,
+ span
{
padding-right: $mm_toggleWidth + ( $mm_padding * 2 );
}
}
&.mm-check
{
+ a,
+ span
{
padding-right: $mm_checkWidth + ( $mm_padding * 2 );
}
}
}
// positioning with counter
em.mm-counter + a.mm-next + label
{
&.mm-toggle,
&.mm-check
{
right: $mm_counterWidth + $mm_subopenWidth + $mm_padding;
+ a,
+ span
{
margin-right: $mm_counterWidth + $mm_subopenWidth;
}
}
}
@include mm_colors_toggles;
@include mm_colors_checks;

View File

@@ -0,0 +1,23 @@
/*
jQuery.mmenu borderstyle extension CSS
*/
@import "../_inc/variables";
.mm-menu.mm-border-none .mm-listview > li,
.mm-listview.mm-border-none > li
{
&:after
{
content: none;
}
}
.mm-menu.mm-border-full .mm-listview > li,
.mm-listview.mm-border-full > li
{
&:after
{
left: 0 !important;
}
}

View File

@@ -0,0 +1,102 @@
/*
jQuery.mmenu effects extension CSS
*/
@import "../_inc/variables";
// Slide
html.mm-effect-slide
{
.mm-menu.mm-offcanvas
{
-webkit-transition: -webkit-transform $mm_transitionDuration $mm_transitionFunction;
transition: transform $mm_transitionDuration $mm_transitionFunction;
}
// Left
&.mm-opened .mm-menu.mm-offcanvas
{
@include mm_webkit_prefix( 'transform', translate3d( -$mm_subpanelOffset, 0, 0 ) );
}
&.mm-opening .mm-menu.mm-offcanvas
{
@include mm_webkit_prefix( 'transform', translate3d( 0%, 0, 0 ) );
}
// Right
&.mm-right
{
&.mm-opened .mm-menu.mm-offcanvas
{
@include mm_webkit_prefix( 'transform', translate3d( $mm_subpanelOffset, 0, 0 ) );
}
&.mm-opening .mm-menu.mm-offcanvas
{
@include mm_webkit_prefix( 'transform', translate3d( 0%, 0, 0 ) );
}
}
}
// Zoom menu
html.mm-effect-zoom-menu
{
.mm-menu.mm-offcanvas
{
-webkit-transition: -webkit-transform $mm_transitionDuration $mm_transitionFunction;
-moz-transition: -moz-transform $mm_transitionDuration $mm_transitionFunction;
-ms-transition: -ms-transform $mm_transitionDuration $mm_transitionFunction;
-o-transition: -o-transform $mm_transitionDuration $mm_transitionFunction;
transition: transform $mm_transitionDuration $mm_transitionFunction;
}
// Left
&.mm-opened .mm-menu.mm-offcanvas
{
@include mm_webkit_prefix( 'transform', scale( $mm_zoomScaleDown, $mm_zoomScaleDown ) translate3d( -$mm_subpanelOffset, 0, 0 ) );
@include mm_webkit_prefix( 'transform-origin', left center );
}
&.mm-opening .mm-menu.mm-offcanvas
{
@include mm_webkit_prefix( 'transform', scale( 1, 1 ) translate3d( 0%, 0, 0 ) );
}
// Right
&.mm-right
{
&.mm-opened .mm-menu.mm-offcanvas
{
@include mm_webkit_prefix( 'transform', scale( $mm_zoomScaleDown, $mm_zoomScaleDown) translate3d( $mm_subpanelOffset, 0, 0 ) );
@include mm_webkit_prefix( 'transform-origin', right center );
}
&.mm-opening .mm-menu.mm-offcanvas
{
@include mm_webkit_prefix( 'transform', scale( 1, 1 ) translate3d( 0%, 0, 0 ) );
}
}
}
// Zoom panels
html.mm-effect-zoom-panels .mm-menu .mm-panel
{
@include mm_webkit_prefix( 'transform', scale( $mm_zoomScaleUp, $mm_zoomScaleUp ) translate3d( 100%, 0, 0 ) );
@include mm_webkit_prefix( 'transform-origin', left center );
-webkit-transition-property: -webkit-transform, left;
-moz-transition-property: -moz-transform, left;
-ms-transition-property: -ms-transform, left;
-o-transition-property: -o-transform, left;
transition-property: transform, left;
&.mm-opened
{
@include mm_webkit_prefix( 'transform', scale( 1, 1 ) translate3d( 0%, 0, 0 ) );
&.mm-subopened
{
@include mm_webkit_prefix( 'transform', scale( $mm_zoomScaleDown, $mm_zoomScaleDown ) translate3d( -$mm_subpanelOffset, 0, 0 ) );
}
}
}

View File

@@ -0,0 +1,24 @@
/*
jQuery.mmenu fullscreen extension CSS
*/
@import "../_inc/variables";
$mm_fs_class : ".mm-fullscreen";
$mm_fs_full : 1 !default;
$mm_fs_min : 140px !default;
$mm_fs_max : 10000px !default;
@include mm_sizing( $mm_fs_class,
$mm_fs_full, $mm_fs_min, $mm_fs_max );
@include mm_sizing_right( $mm_fs_class,
$mm_fs_full, $mm_fs_min, $mm_fs_max);
@include mm_sizing_zposition( $mm_fs_class,
$mm_fs_full, $mm_fs_min, $mm_fs_max );
html.mm-opened#{$mm_fs_class} .mm-page
{
box-shadow: none !important;
}

View File

@@ -0,0 +1,26 @@
/*
jQuery.mmenu iconbar extension CSS
*/
@import "../_inc/variables";
body
{
overflow-x: hidden;
}
.mm-menu.mm-iconbar
{
display: block;
}
.mm-page
{
background: inherit;
min-height: 100vh;
}
.mm-slideout
{
box-sizing: border-box;
padding-right: $mm_iconbarWidth;
@include mm-webkit-prefix( 'transform', translate3d( $mm_iconbarWidth, 0, 0 ) );
}

View File

@@ -0,0 +1,18 @@
/*
jQuery.mmenu multiline extension CSS
*/
@import "../_inc/variables";
.mm-menu.mm-multiline .mm-listview > li,
.mm-listview.mm-multiline > li
.mm-listview > li.mm-multiline
{
> a,
> span
{
text-overflow: clip;
white-space: normal;
}
}

View File

@@ -0,0 +1,36 @@
/*
jQuery.mmenu pageshadow extension CSS
*/
@import "../_inc/variables";
.mm-menu.mm-pageshadow
{
&:after
{
content: "";
display: block;
width: 20px;
height: 120%;
position: absolute;
left: 100%;
top: -10%;
z-index: 99;
}
&.mm-right:after
{
left: auto;
right: 100%;
}
&.mm-next:after,
&.mm-front:after
{
content: none;
display: none;
}
}
@include mm_colors_pageshadow();

View File

@@ -0,0 +1,87 @@
/*
jQuery.mmenu position extension CSS
*/
@import "../_inc/variables";
.mm-menu.mm-top,
.mm-menu.mm-bottom
{
width: 100%;
min-width: 100%;
max-width: 100%;
}
.mm-menu.mm-right
{
left: auto;
right: 0;
}
.mm-menu.mm-bottom
{
top: auto;
bottom: 0;
}
@include mm_sizing_right;
/*
jQuery.mmenu z-position extension CSS
*/
// reset defaults
html.mm-front
{
.mm-slideout
{
@include mm-webkit-prefix( 'transform', none !important );
z-index: 0 !important;
}
}
// styling
.mm-menu.mm-front
{
z-index: 1;
}
// animations
.mm-menu
{
&.mm-front,
&.mm-next
{
-webkit-transition: -webkit-transform $mm_transitionDuration $mm_transitionFunction;
-ms-transition: -ms-transform $mm_transitionDuration $mm_transitionFunction;
transition: transform $mm_transitionDuration $mm_transitionFunction;
@include mm-webkit-prefix( 'transform', translate3d( -100%, 0, 0 ) );
&.mm-right
{
@include mm-webkit-prefix( 'transform', translate3d( 100%, 0, 0 ) );
}
}
&.mm-top
{
@include mm-webkit-prefix( 'transform', translate3d( 0, -100%, 0 ) );
}
&.mm-bottom
{
@include mm-webkit-prefix( 'transform', translate3d( 0, 100%, 0 ) );
}
}
html.mm-opening .mm-menu
{
&.mm-front,
&.mm-next
{
@include mm-webkit-prefix( 'transform', translate3d( 0, 0, 0 ) );
}
}
@include mm_sizing_zposition;

View File

@@ -0,0 +1,84 @@
/*
jQuery.mmenu themes extension CSS
*/
@import "../_inc/variables";
@mixin mm_apply_theme()
{
@include mm_colors( $mm_t_cls,
$mm_t_backgroundColor,
$mm_t_textColor, $mm_t_dimmedTextColor,
$mm_t_emphasizedBackgroundColor, $mm_t_highlightedBackgroundColor,
$mm_t_borderColor );
@include mm_colors_buttonbars( $mm_t_cls,
$mm_t_backgroundColor,
$mm_t_textColor );
@include mm_colors_checks( $mm_t_cls,
$mm_t_textColor );
@include mm_colors_counters( $mm_t_cls,
$mm_t_dimmedTextColor );
@include mm_colors_footer( $mm_t_cls,
$mm_t_dimmedTextColor,
$mm_t_borderColor );
@include mm_colors_dividers( $mm_t_cls,
$mm_t_highlightedBackgroundColor );
@include mm_colors_pageshadow( $mm_t_cls,
$mm_t_pageShadow );
@include mm_colors_searchfield( $mm_t_cls,
$mm_t_inputBackgroundColor, $mm_t_textColor,
$mm_t_dimmedTextColor );
@include mm_colors_sectionindexer( $mm_t_cls,
$mm_t_dimmedTextColor );
@include mm_colors_toggles( $mm_t_cls,
$mm_t_backgroundColor,
$mm_t_borderColor );
}
// Dark
$mm_t_cls : ".mm-theme-dark";
$mm_t_borderColor : rgba( #000, 0.15 );
$mm_t_backgroundColor : #333;
$mm_t_emphasizedBackgroundColor : rgba( #000, 0.1 );
$mm_t_highlightedBackgroundColor: rgba( #fff, 0.05 );
$mm_t_textColor : rgba( #fff, 0.8 );
$mm_t_dimmedTextColor : rgba( #fff, 0.4 );
$mm_t_inputBackgroundColor : rgba( #fff, 0.3 );
$mm_t_pageShadow : 0 0 20px rgba( #000, 0.5 );
@include mm_apply_theme;
// White
$mm_t_cls : ".mm-theme-white";
$mm_t_borderColor : rgba( #000, 0.1 );
$mm_t_backgroundColor : #fff;
$mm_t_emphasizedBackgroundColor : rgba( #000, 0.05 );
$mm_t_highlightedBackgroundColor: rgba( #000, 0.03 );
$mm_t_textColor : rgba( #000, 0.6 );
$mm_t_dimmedTextColor : rgba( #000, 0.3 );
$mm_t_inputBackgroundColor : rgba( #000, 0.05 );
$mm_t_pageShadow : 0 0 10px rgba( #000, 0.2 );
@include mm_apply_theme;
// Black
$mm_t_cls : ".mm-theme-black";
$mm_t_borderColor : rgba( #fff, 0.2 );
$mm_t_backgroundColor : #000;
$mm_t_emphasizedBackgroundColor : rgba( #fff, 0.3 );
$mm_t_highlightedBackgroundColor: rgba( #fff, 0.2 );
$mm_t_textColor : rgba( #fff, 0.6 );
$mm_t_dimmedTextColor : rgba( #fff, 0.4 );
$mm_t_inputBackgroundColor : rgba( #fff, 0.3 );
$mm_t_pageShadow : false;
@include mm_apply_theme;

View File

@@ -0,0 +1,49 @@
/*
jQuery.mmenu widescreen extension CSS
To use on widescreens only, include it using a mediaquery:
<link type="text/css" href="mmenu-widescreen.css" media="all and (min-width: 900px)"/>
*/
@import "../_inc/variables";
$mm_ws_menuWidth: 30% !default;
// Positioning and sizing
html,
body
{
overflow: auto !important;
}
body
{
position: relative;
}
#mm-blocker
{
display: none !important;
}
.mm-slideout
{
@include mm-webkit-prefix( 'transform', none !important );
width: 100 - $mm_ws_menuWidth !important;
margin-left: $mm_ws_menuWidth !important;
}
.mm-page
{
background: inherit;
box-sizing: border-box;
min-height: 100vh;
}
.mm-menu.mm-widescreen
{
display: block;
width: $mm_ws_menuWidth !important;
min-width: none !important;
max-width: none !important;
z-index: 0;
}

View File

@@ -0,0 +1,20 @@
@import "jquery.mmenu";
@import "addons/jquery.mmenu.autoheight";
@import "addons/jquery.mmenu.buttonbars";
@import "addons/jquery.mmenu.counters";
@import "addons/jquery.mmenu.dragopen";
@import "addons/jquery.mmenu.footer";
@import "addons/jquery.mmenu.header";
@import "addons/jquery.mmenu.dividers";
@import "addons/jquery.mmenu.searchfield";
@import "addons/jquery.mmenu.sectionindexer";
@import "addons/jquery.mmenu.toggles";
@import "extensions/jquery.mmenu.borderstyle";
@import "extensions/jquery.mmenu.effects";
@import "extensions/jquery.mmenu.fullscreen";
@import "extensions/jquery.mmenu.multiline";
@import "extensions/jquery.mmenu.pageshadow";
@import "extensions/jquery.mmenu.positioning";
@import "extensions/jquery.mmenu.themes";

View File

@@ -0,0 +1,341 @@
/*
jQuery.mmenu oncanvas CSS
*/
@import "_inc/variables";
// Generic classes
.mm-hidden
{
display: none !important;
}
// Container
.mm-wrapper
{
overflow-x: hidden;
position: relative;
}
// Menu
.mm-menu,
.mm-menu > .mm-panel
{
margin: 0;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 0;
}
.mm-menu
{
background: inherit;
display: block;
overflow: hidden;
padding: 0;
}
// Panels
.mm-panel
{
-webkit-transition: -webkit-transform $mm_transitionDuration $mm_transitionFunction;
-moz-transition: -moz-transform $mm_transitionDuration $mm_transitionFunction;
-ms-transition: -ms-transform $mm_transitionDuration $mm_transitionFunction;
-o-transition: -o-transform $mm_transitionDuration $mm_transitionFunction;
transition: transform $mm_transitionDuration $mm_transitionFunction;
@include mm_webkit_prefix( 'transform', translate3d( 100%, 0, 0 ) );
&.mm-opened
{
@include mm_webkit_prefix( 'transform', translate3d( 0%, 0, 0 ) );
}
&.mm-subopened
{
@include mm_webkit_prefix( 'transform', translate3d( -$mm_subpanelOffset, 0, 0 ) );
}
&.mm-highest
{
z-index: 1;
}
}
.mm-menu > .mm-panel
{
background: inherit;
-webkit-overflow-scrolling: touch;
overflow: scroll;
overflow-x: hidden;
overflow-y: auto;
box-sizing: border-box;
padding: 0 $mm_panelPadding;
&.mm-hasheader
{
padding-top: $mm_headerHeight;
}
// Because padding-bottom in some browsers is ignored when a DIV is scrollable
&:before,
&:after
{
content: '';
display: block;
height: $mm_panelPadding;
}
}
// Vertical
.mm-vertical .mm-panel
{
@include mm_webkit_prefix( 'transform', none !important );
}
.mm-vertical .mm-listview .mm-panel,
.mm-listview .mm-vertical .mm-panel
{
display: none;
padding: $mm_padding 0 $mm_padding $mm_padding;
.mm-listview > li:last-child:after
{
border-color: transparent;
}
}
.mm-vertical li.mm-opened > .mm-panel,
li.mm-vertical.mm-opened > .mm-panel
{
display: block;
}
.mm-vertical .mm-listview > li,
.mm-listview > li.mm-vertical
{
> .mm-next
{
height: $mm_btnSize;
bottom: auto;
&:after
{
top: ( $mm_btnSize / 2 ) - 4;
bottom: auto;
}
}
&.mm-opened
{
> .mm-next:after
{
@include mm_webkit_prefix( "transform", rotate( 45deg ) );
}
}
}
.mm-header
{
border-bottom: 1px solid transparent;
text-align: center;
line-height: $mm_btnSize / 2;
height: $mm_headerHeight;
padding: 0 $mm_btnSize;
margin: 0;
position: absolute;
top: 0;
left: 0;
right: 0;
> a
{
text-decoration: none;
display: block;
padding: ( $mm_btnSize / 4 ) 0;
}
.mm-title
{
@include mm_ellipsis;
}
.mm-btn
{
box-sizing: border-box;
width: $mm_btnSize;
height: $mm_btnSize;
position: absolute;
top: 0;
z-index: 1;
&:first-child
{
padding-left: $mm_panelPadding;
left: 0;
}
&:last-child
{
padding-right: $mm_panelPadding;
right: 0;
}
}
}
// Listviews
.mm-listview,
.mm-listview > li
{
list-style: none;
display: block;
padding: 0;
margin: 0;
}
.mm-listview
{
font: inherit;
font-size: $mm_fontSize;
a,
a:hover
{
text-decoration: none;
}
> li
{
position: relative;
> a,
> span
{
@include mm_ellipsis;
color: inherit;
line-height: $mm_btnSize - ( $mm_padding * 2 );
display: block;
padding: $mm_listitemPadding $mm_listitemPadding $mm_listitemPadding $mm_listitemIndent;
margin: 0;
}
&:not(.mm-divider)
{
@include mm_border_bottom;
&:after
{
left: $mm_listitemIndent;
}
}
}
// subopen
.mm-next
{
@include mm_border_left;
background: rgba( 3, 2, 1, 0 );
width: $mm_subopenWidth;
padding: 0;
position: absolute;
right: 0;
top: 0;
bottom: 0;
z-index: 2;
+ a,
+ span
{
margin-right: $mm_subopenWidth;
}
&.mm-fullsubopen
{
width: 100%;
&:before
{
border-left: none;
}
+ a,
+ span
{
padding-right: $mm_subopenWidth;
margin-right: 0;
}
}
}
}
.mm-menu > .mm-panel
{
> .mm-listview
{
margin-left: -$mm_panelPadding;
margin-right: -$mm_panelPadding;
&.mm-first
{
margin-top: -$mm_panelPadding;
}
&.mm-last
{
padding-bottom: $mm_panelPadding;
}
}
}
// Arrows
.mm-prev:before,
.mm-next:after
{
@include mm_arrow;
}
.mm-prev:before
{
@include mm_arrow_prev;
}
.mm-next:after
{
@include mm_arrow_next;
}
// Dividers
.mm-divider
{
@include mm_ellipsis;
font-size: $mm_dividerFontSize;
text-transform: uppercase;
text-indent: $mm_listitemIndent;
line-height: $mm_dividerHeight;
}
// Spacers
.mm-listview > li
{
&.mm-spacer
{
padding-top: $mm_btnSize;
> .mm-next
{
top: $mm_btnSize;
}
&.mm-divider
{
padding-top: $mm_dividerHeight;
}
}
}
@include mm_colors;

View File

@@ -0,0 +1,6 @@
/*
jQuery.mmenu CSS
*/
@import "jquery.mmenu.oncanvas";
@import "addons/jquery.mmenu.offcanvas";