uppdated modules
This commit is contained in:
Executable → Regular
@@ -1,16 +1,19 @@
|
||||
/* Import the Open Sans webfont from Google CDN */
|
||||
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/DXI1ORHCpsQm3Vp6mXoaTRsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/uYKcPVoh6c5R0NpdEY5A-Q.woff) format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
@@ -18,32 +21,86 @@
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/MTP_ySUJH_bn48VBG8sNShsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
|
||||
}
|
||||
|
||||
|
||||
/* Blink Animation */
|
||||
|
||||
@keyframes blink {
|
||||
0% {background-color: #f69231;}
|
||||
50% {background-color: #d94f13;}
|
||||
99% {background-color: #f69231;}
|
||||
0% {
|
||||
background-color: #f69231;
|
||||
color: #fff;
|
||||
}
|
||||
50% {
|
||||
background-color: #d94f13;
|
||||
color: #fff;
|
||||
}
|
||||
100% {
|
||||
background-color: #f69231;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes blink {
|
||||
0% {background-color: #f69231;}
|
||||
50% {background-color: #d94f13;}
|
||||
99% {background-color: #f69231;}
|
||||
0% {
|
||||
background-color: #f69231;
|
||||
color: #fff;
|
||||
}
|
||||
50% {
|
||||
background-color: #d94f13;
|
||||
color: #fff;
|
||||
}
|
||||
100% {
|
||||
background-color: #f69231;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes blink {
|
||||
0% {background-color: #f69231;}
|
||||
50% {background-color: #d94f13;}
|
||||
99% {background-color: #f69231;}
|
||||
0% {
|
||||
background-color: #f69231;
|
||||
color: #fff;
|
||||
}
|
||||
50% {
|
||||
background-color: #d94f13;
|
||||
color: #fff;
|
||||
}
|
||||
100% {
|
||||
background-color: #f69231;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes blink {
|
||||
0% {background-color: #f69231;}
|
||||
50% {background-color: #d94f13;}
|
||||
99% {background-color: #f69231;}
|
||||
0% {
|
||||
background-color: #f69231;
|
||||
color: #fff;
|
||||
}
|
||||
50% {
|
||||
background-color: #d94f13;
|
||||
color: #fff;
|
||||
}
|
||||
100% {
|
||||
background-color: #f69231;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
body.admin-menu.adminimal-menu #admin-menu *::-moz-focus-inner {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
body.admin-menu.adminimal-menu {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
body.admin-menu.adminimal-menu:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 29px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/* Admin menu */
|
||||
body.adminimal-menu div#admin-menu {
|
||||
background: #333;
|
||||
background: none repeat scroll 0 0 #202020;
|
||||
@@ -56,15 +113,11 @@ body.adminimal-menu div#admin-menu li.admin-menu-toolbar-home-menu {
|
||||
}
|
||||
|
||||
body.adminimal-menu div#admin-menu ul.dropdown span.admin-menu-home-icon {
|
||||
background: url("images/home.png") no-repeat scroll 0 2px transparent;
|
||||
background: url("images/home.svg") no-repeat scroll 0 0 transparent;
|
||||
display: block;
|
||||
margin: 5px 0 0;
|
||||
padding: 0;
|
||||
width: 13px;
|
||||
}
|
||||
|
||||
body.adminimal-menu div#admin-menu ul.dropdown span.admin-menu-home-icon:hover {
|
||||
background-position: 0px -86px;
|
||||
width: 15px;
|
||||
}
|
||||
|
||||
body.adminimal-menu div#admin-menu a,
|
||||
@@ -105,6 +158,10 @@ body.adminimal-menu #admin-menu .dropdown li.admin-menu-toolbar-category a {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .dropdown li.admin-menu-toolbar-category a:focus {
|
||||
background: #0074BD;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu #admin-menu-wrapper .dropdown li li {
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -123,14 +180,15 @@ body.adminimal-menu #admin-menu #admin-menu-wrapper .dropdown li li.expandable {
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu #admin-menu-wrapper .dropdown li li.expandable a {
|
||||
background: transparent !important;
|
||||
background: transparent;
|
||||
padding-right: 25px;
|
||||
width: 135px;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu #admin-menu-wrapper .dropdown li li.expandable:hover {
|
||||
background: url("images/square.png") no-repeat scroll 145px -83px #0074bd !important;
|
||||
}
|
||||
|
||||
|
||||
/* Shortcuts bar */
|
||||
|
||||
body.adminimal-menu div.toolbar-shortcuts {
|
||||
@@ -146,18 +204,37 @@ body.adminimal-menu div.shortcut-toolbar div#toolbar div.toolbar-shortcuts ul.me
|
||||
float: left;
|
||||
list-style: none outside none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body.adminimal-menu div.shortcut-toolbar div#toolbar a#edit-shortcuts {
|
||||
float: right;
|
||||
line-height: 18px;
|
||||
padding: 5px 10px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
body.adminimal-menu div.shortcut-toolbar div#toolbar a#edit-shortcuts:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
body.adminimal-menu div.shortcut-toolbar div#toolbar a#edit-shortcuts:focus {
|
||||
background: #0074BD;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .dropdown li ul {
|
||||
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .dropdown li ul {
|
||||
border-top: 3px solid #0074BD;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .admin-menu-toolbar-category.expandable .dropdown li ul,
|
||||
body.adminimal-menu #admin-menu .dropdown.admin-menu-search-results li ul {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .dropdown li.admin-menu-action a {
|
||||
border: none !important;
|
||||
}
|
||||
@@ -167,7 +244,8 @@ body.adminimal-menu #admin-menu .dropdown li.admin-menu-action:first-child a {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .dropdown li.admin-menu-action:first-child a:hover {
|
||||
body.adminimal-menu #admin-menu .dropdown li.admin-menu-action:first-child a:hover,
|
||||
body.adminimal-menu #admin-menu .dropdown li.admin-menu-action:first-child a:focus {
|
||||
background: #b73939;
|
||||
}
|
||||
|
||||
@@ -176,7 +254,7 @@ body.adminimal-menu #admin-menu .dropdown li.admin-menu-action.admin-menu-users
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .dropdown li.admin-menu-action.admin-menu-users a:hover {
|
||||
background: #0074BD;
|
||||
background: #0074BD;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .dropdown li.admin-menu-action.admin-menu-account a {
|
||||
@@ -204,107 +282,124 @@ body.adminimal-menu #admin-menu #admin-menu-wrapper div#toolbar div.toolbar-shor
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .admin-menu-search input {
|
||||
background: none no-repeat scroll right center #444;
|
||||
border: medium none;
|
||||
border-radius: 0 0 0 0;
|
||||
color: #999999;
|
||||
font-size: 12px;
|
||||
margin: 0 !important;
|
||||
outline: medium none;
|
||||
padding: 5px 22px 3px 8px;
|
||||
width: 110px;
|
||||
height: 20px;
|
||||
background: none no-repeat scroll right center #444;
|
||||
border: medium none;
|
||||
border-radius: 0 0 0 0;
|
||||
color: #999999;
|
||||
font-size: 12px;
|
||||
margin: 0 !important;
|
||||
outline: medium none;
|
||||
padding: 5px 22px 3px 8px;
|
||||
width: 110px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .admin-menu-search input:focus, #admin-menu .admin-menu-search input:hover, #admin-menu .admin-menu-search input:active {
|
||||
background: none no-repeat scroll right center #888;
|
||||
color: #eee;
|
||||
body.adminimal-menu #admin-menu .admin-menu-search input:focus,
|
||||
#admin-menu .admin-menu-search input:hover,
|
||||
#admin-menu .admin-menu-search input:active {
|
||||
background: none no-repeat scroll right center #888;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
body.adminimal-menu li.admin-menu-search:hover {
|
||||
background: transparent !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu li.highlight {
|
||||
background-color: #ef6114 !important;
|
||||
animation: blink 0.5s ease infinite;
|
||||
-moz-animation: blink 0.5s ease infinite;
|
||||
-webkit-animation: blink 0.5s ease infinite;
|
||||
-o-animation: blink 0.5s ease infinite;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu li.highlight > a {
|
||||
border-color: #ef6114 !important;
|
||||
body.adminimal-menu div#admin-menu li.highlight {
|
||||
background-color: #ef6114;
|
||||
animation: blink 1s ease both infinite;
|
||||
-moz-animation: blink 1s ease both infinite;
|
||||
-webkit-animation: blink 1s ease both infinite;
|
||||
-o-animation: blink 1s ease both infinite;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu li.highlight > a,
|
||||
body.adminimal-menu #admin-menu li.highlight > li {
|
||||
border-color: #ef6114;
|
||||
color: #fff !important;
|
||||
animation: blink 1s ease both infinite;
|
||||
-moz-animation: blink 1s ease both infinite;
|
||||
-webkit-animation: blink 1s ease both infinite;
|
||||
-o-animation: blink 1s ease both infinite;
|
||||
}
|
||||
|
||||
|
||||
/* Newline render mode */
|
||||
|
||||
body.adminimal-menu.admin-menu.menu-render-newline div#admin-menu div#admin-menu-wrapper div.shortcut-toolbar {
|
||||
clear: both;
|
||||
border-top: 1px solid #000;
|
||||
clear: both;
|
||||
border-top: 1px solid #000;
|
||||
}
|
||||
|
||||
body.adminimal-menu.admin-menu.menu-render-newline {
|
||||
margin-top: 56px !important;
|
||||
margin-top: 56px !important;
|
||||
}
|
||||
|
||||
body.adminimal-menu.admin-menu.menu-render-newline #overlay-container, body.adminimal-menu.admin-menu.newline .overlay-modal-background, body.adminimal-menu.admin-menu.newline .overlay-element, body.adminimal-menu.admin-menu.newline #overlay {
|
||||
padding-top: 30px !important;
|
||||
body.adminimal-menu.admin-menu.menu-render-newline #overlay-container,
|
||||
body.adminimal-menu.admin-menu.newline .overlay-modal-background,
|
||||
body.adminimal-menu.admin-menu.newline .overlay-element,
|
||||
body.adminimal-menu.admin-menu.newline #overlay {
|
||||
padding-top: 30px !important;
|
||||
}
|
||||
|
||||
|
||||
/* Collapsed render mode */
|
||||
|
||||
body.adminimal-menu.admin-menu.menu-render-collapsed div.shortcut-toolbar div#toolbar div.toolbar-shortcuts ul.menu {
|
||||
position: absolute;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
body.adminimal-menu.admin-menu.menu-render-collapsed div.shortcut-toolbar div#toolbar div.toolbar-shortcuts ul.menu li {
|
||||
float: none;
|
||||
display: none;
|
||||
border: none;
|
||||
float: none;
|
||||
display: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
body.adminimal-menu.admin-menu.menu-render-collapsed div.shortcut-toolbar div#toolbar div.toolbar-shortcuts ul.menu li.label {
|
||||
display: block;
|
||||
cursor: default;
|
||||
display: block;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
body.adminimal-menu.admin-menu.menu-render-collapsed div.shortcut-toolbar div#toolbar div.toolbar-shortcuts ul.menu li.label a:hover {
|
||||
background: url("images/shortcut.png") no-repeat scroll 7px 7px #202020 !important;
|
||||
color: #EEEEEE !important;
|
||||
background: url("images/shortcut.png") no-repeat scroll 7px 7px #202020 !important;
|
||||
color: #EEEEEE !important;
|
||||
}
|
||||
|
||||
body.adminimal-menu.admin-menu.menu-render-collapsed div.shortcut-toolbar div#toolbar div.toolbar-shortcuts ul.menu:hover li {
|
||||
display: block;
|
||||
background: #202020;
|
||||
display: block;
|
||||
background: #202020;
|
||||
}
|
||||
|
||||
|
||||
/* Dropdown render mode */
|
||||
|
||||
body.adminimal-menu.admin-menu.menu-render-dropdown .toolbar-shortcuts select#shortcut-menu {
|
||||
-webkit-appearance: none;
|
||||
background: url("images/shortcut.png") no-repeat scroll 7px 7px #222222;
|
||||
border: medium none;
|
||||
color: #EEEEEE;
|
||||
font-family: "Open Sans", "Segoe UI", "Helvetica", sans-serif;
|
||||
font-size: 12px;
|
||||
padding: 5px 4px 4px 24px;
|
||||
-webkit-appearance: none;
|
||||
background: url("images/shortcut.png") no-repeat scroll 7px 7px #222222;
|
||||
border: medium none;
|
||||
color: #EEEEEE;
|
||||
font-family: "Open Sans", "Segoe UI", "Helvetica", sans-serif;
|
||||
font-size: 12px;
|
||||
padding: 5px 4px 4px 24px;
|
||||
}
|
||||
|
||||
body.adminimal-menu.admin-menu.menu-render-dropdown .toolbar-shortcuts select#shortcut-menu option:hover {
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.adminimal-menu.admin-menu.menu-render-dropdown .toolbar-shortcuts select#shortcut-menu option:first-child {
|
||||
display: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .dropdown .admin-menu-tab {
|
||||
background: #444;
|
||||
padding-bottom: 2px;
|
||||
background: #444;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
|
||||
/* Environment indicator 2.x */
|
||||
|
||||
body.adminimal-menu #admin-menu #environment-indicator {
|
||||
text-shadow: none;
|
||||
}
|
||||
@@ -317,3 +412,29 @@ body.adminimal-menu #admin-menu #environment-indicator .environment-indicator-na
|
||||
line-height: 18px;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu #admin-menu-wrapper div#toolbar div.toolbar-shortcuts ul,
|
||||
body.adminimal-menu #admin-menu #admin-menu-wrapper div#toolbar div.toolbar-shortcuts ul li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body.adminimal-menu #admin-menu .admin-menu-search input {
|
||||
background: none no-repeat scroll right center #444;
|
||||
border: medium none;
|
||||
-webkit-border-radius: 0 0 0 0;
|
||||
-moz-border-radius: 0 0 0 0;
|
||||
border-radius: 0 0 0 0;
|
||||
color: #999999;
|
||||
font-size: 12px;
|
||||
margin: 0 !important;
|
||||
outline: medium none;
|
||||
padding: 5px 22px 3px 8px;
|
||||
width: 110px;
|
||||
line-height: 20px;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
height: 28px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ package = Administration
|
||||
core = 7.x
|
||||
dependencies[] = admin_menu
|
||||
|
||||
; Information added by Drupal.org packaging script on 2014-01-27
|
||||
version = "7.x-1.5"
|
||||
; Information added by Drupal.org packaging script on 2015-12-03
|
||||
version = "7.x-1.7"
|
||||
core = "7.x"
|
||||
project = "adminimal_admin_menu"
|
||||
datestamp = "1390792706"
|
||||
datestamp = "1449182323"
|
||||
|
||||
|
||||
@@ -78,3 +78,13 @@ function adminimal_admin_menu_uninstall() {
|
||||
variable_del('adminimal_admin_menu_render');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up some files that are no longer needed.
|
||||
*/
|
||||
function adminimal_admin_menu_update_7100() {
|
||||
|
||||
// Include the update file.
|
||||
include 'updates/update_7100.php';
|
||||
|
||||
}
|
||||
|
||||
@@ -31,10 +31,46 @@ function adminimal_admin_menu_page_build(&$page) {
|
||||
return;
|
||||
}
|
||||
$path = drupal_get_path('module', 'adminimal_admin_menu');
|
||||
$load_slicknav = variable_get('adminimal_admin_menu_slicknav', TRUE );
|
||||
$load_jQuery = variable_get('adminimal_admin_menu_jquery', TRUE );
|
||||
|
||||
// Attach the CSS and JavaScript assets.
|
||||
drupal_add_css($path . '/adminimal_admin_menu.css');
|
||||
drupal_add_js($path . '/adminimal_admin_menu.js', 'file');
|
||||
|
||||
// Support for the Environment Indicator module.
|
||||
if (module_exists('environment_indicator')) {
|
||||
$environment_info = environment_indicator_get_active();
|
||||
drupal_add_css('
|
||||
div.slicknav_menu a.slicknav_btn:after {
|
||||
content: "' . $environment_info['name']. '";
|
||||
margin-left: 1em;
|
||||
color: ' . $environment_info['text_color'] . ';
|
||||
font-size: 12px;
|
||||
background-color: ' . $environment_info['color'] . ';
|
||||
padding: 2px 5px;
|
||||
}
|
||||
#admin-menu-wrapper {background: #222 !important;}
|
||||
',
|
||||
array(
|
||||
'group' => CSS_DEFAULT,
|
||||
'type' => 'inline',
|
||||
'preprocess' => FALSE,
|
||||
'weight' => '100',
|
||||
));
|
||||
}
|
||||
|
||||
// Check if both slicknav and custom jQuery must be loaded.
|
||||
if ($load_slicknav and $load_jQuery) {
|
||||
drupal_add_js($path . '/js/jquery.min.js', array( 'type' => 'file', 'scope' => 'header', 'weight' => 888 ));
|
||||
drupal_add_js($path . '/js/slicknav/jquery-no-conflict.slicknav.js', array( 'type' => 'file', 'scope' => 'header', 'weight' => 888 ));
|
||||
drupal_add_css($path . '/js/slicknav/slicknav.css');
|
||||
}
|
||||
elseif ($load_slicknav and !$load_jQuery) {
|
||||
drupal_add_js($path . '/js/slicknav/jquery.slicknav.js', array( 'type' => 'file', 'scope' => 'header', 'weight' => 888 ));
|
||||
drupal_add_css($path . '/js/slicknav/slicknav.css');
|
||||
}
|
||||
|
||||
drupal_add_js($path . '/js/adminimal_admin_menu.js', array( 'type' => 'file', 'scope' => 'header', 'weight' => 888 ));
|
||||
|
||||
if (!isset($page['page_bottom']['admin_menu'])) {
|
||||
return;
|
||||
@@ -63,6 +99,7 @@ function adminimal_admin_menu_page_build(&$page) {
|
||||
'data' => array('admin_menu' => array('toolbar' => $settings)),
|
||||
'type' => 'setting',
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,6 +151,31 @@ function adminimal_admin_menu_admin_menu_output_alter(&$content) {
|
||||
unset($content['menu'][$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Create the responsive menu.
|
||||
if (variable_get('adminimal_admin_menu_slicknav', 'TRUE')) {
|
||||
// Prepare the responsive menu and Join the Icon menu with the administration menu.
|
||||
$responsivemenu = array_merge($content['icon'], $content['menu']);
|
||||
|
||||
// Give it ID to target it later with js and css.
|
||||
$responsivemenu['#wrapper_attributes']['id'] = 'admin-menu-menu-responsive';
|
||||
|
||||
// Move the icon menu to the top.
|
||||
$responsivemenu['icon']['#weight'] = '-100';
|
||||
|
||||
// Change the link title to Administration.
|
||||
$responsivemenu['admin/index']['#title'] = t('Administration');
|
||||
|
||||
// Bind the responsive menu the the content varable so it can be rendered.
|
||||
$content['responsive-menu'] = $responsivemenu;
|
||||
|
||||
// Create the responsive shortucts.
|
||||
$content['responsive']['shortcuts'] = array(
|
||||
'#prefix' => '<div id="admin-menu-shortcuts-responsive">',
|
||||
'#suffix' => '</div>',
|
||||
'#pre_render' => array('shortcut_toolbar_pre_render'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,8 +188,30 @@ function adminimal_admin_menu_preprocess_html(&$vars) {
|
||||
// Add the "adminimal" class to the body for better css selection.
|
||||
$vars['classes_array'][] = 'adminimal-menu';
|
||||
|
||||
// Add frontend and backend classes to the body.
|
||||
if (path_is_admin(current_path())) {
|
||||
$vars['classes_array'][] = 'adminimal-backend';
|
||||
}
|
||||
else {
|
||||
$vars['classes_array'][] = 'adminimal-frontend';
|
||||
}
|
||||
|
||||
// Add the shortcut render mode class.
|
||||
$vars['classes_array'][] = 'menu-render-'.variable_get('adminimal_admin_menu_render', 'collapsed');
|
||||
$vars['classes_array'][] = 'menu-render-' . variable_get('adminimal_admin_menu_render', 'collapsed');
|
||||
|
||||
// Fix the viewport, correcting the mobile device zoom.
|
||||
/** @todo - Mybre remove this and let the theme manage the view pont.
|
||||
* But i was suprised that only few "responsive" drupal themes were fixing
|
||||
* the viewport.
|
||||
*/
|
||||
$viewport = array(
|
||||
'#tag' => 'meta',
|
||||
'#attributes' => array(
|
||||
'name' => 'viewport',
|
||||
'content' => 'width=device-width, initial-scale=1, maximum-scale=1',
|
||||
),
|
||||
);
|
||||
drupal_add_html_head($viewport, 'viewport');
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,41 @@ function adminimal_admin_menu_settings($form, &$form_state) {
|
||||
'#required' => TRUE,
|
||||
);
|
||||
|
||||
// Create the shortcut category.
|
||||
$form['advanced_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Advanced Settings'),
|
||||
'#description' => '<div class="messages warning">WARNING: Do not change any of the advanced setting unless you know what you are doing!</div>',
|
||||
);
|
||||
|
||||
$form['advanced_settings']['adminimal_admin_menu_slicknav'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#default_value' => variable_get('adminimal_admin_menu_slicknav', 'TRUE'),
|
||||
'#title' => t('Enable Responsive Menu.'),
|
||||
'#description' => t('<strong>Default value => Checked</strong>.
|
||||
Enable this option if you want to have responsive menu and mobile device support.
|
||||
While disabling this option could save you few kilobytes (around 3KB), i will completely disable the responsive menu functionality.'),
|
||||
);
|
||||
|
||||
$form['advanced_settings']['adminimal_admin_menu_jquery'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#default_value' => variable_get('adminimal_admin_menu_jquery', 'TRUE'),
|
||||
'#title' => t('Load the requred jQuery 1.7 library automagically.'),
|
||||
'#description' => t('<strong>Default value => Checked</strong>. This will load the newer jQuery version 1.7 using
|
||||
the no-conflict method so it wont interfere with any existing jQuery or other java-script libraries.
|
||||
The only reason to uncheck this if you are already using a newer version of jQuery site-wide and its globally accessible by the "$" variable.
|
||||
Unchekig this option could save you 33KB, but it may also break your javasctipt if not used correctly.'),
|
||||
'#states' => array(
|
||||
// Hide the settings when the cancel notify checkbox is disabled.
|
||||
'visible' => array(
|
||||
':input[name="adminimal_admin_menu_slicknav"]' => array('checked' => TRUE),
|
||||
),
|
||||
'unchecked' => array(
|
||||
variable_get('adminimal_admin_menu_jquery', 'TRUE') => FALSE,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Create the submit button.
|
||||
$form['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Designed and developed by: ANDiTKO -> http://anditko.com
|
||||
Some of the Icons are from the Icons8 set -> http://icons8.com/ and -> http://VisualPharm.com
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">
|
||||
<g>
|
||||
</g>
|
||||
<path d="M10 20q-2.031 0-3.887-0.791t-3.193-2.129-2.129-3.193-0.791-3.887 0.791-3.887 2.129-3.193 3.193-2.129 3.887-0.791 3.887 0.791 3.193 2.129 2.129 3.193 0.791 3.887-0.791 3.887-2.129 3.193-3.193 2.129-3.887 0.791zM10 2.5q-2.031 0-3.76 1.006t-2.734 2.734-1.006 3.76 1.006 3.76 2.734 2.734 3.76 1.006 3.76-1.006 2.734-2.734 1.006-3.76-1.006-3.76-2.734-2.734-3.76-1.006zM11.211 12.891q-0.078 0.332-0.273 0.527-0.371 0.371-0.938 0.313-0.547 0.059-0.918-0.313-0.195-0.195-0.293-0.547l-3.457-3.457q-0.332-0.332-0.332-0.801t0.332-0.801 0.801-0.332 0.801 0.332l3.066 3.086 3.086-3.086q0.332-0.332 0.801-0.332t0.801 0.332 0.332 0.801-0.332 0.801z" fill="#ffffff" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 991 B |
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px"
|
||||
height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<g id="bg" display="none">
|
||||
<rect display="inline" fill="#3F3F3F" width="16" height="16"/>
|
||||
</g>
|
||||
<g id="Layer_3">
|
||||
<polygon id="Houde" fill="#FFFFFF" points="8,1.5 1.002,7.498 2.954,7.499 2.964,13.496 5.984,13.496 5.984,9.783 9.984,9.783
|
||||
9.984,13.496 12.999,13.496 12.999,7.498 14.967,7.498 "/>
|
||||
<rect x="10.313" y="1.871" fill="#FFFFFF" width="1.884" height="5"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 831 B |
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="20px" height="20px" viewBox="0 -2 20 20" enable-background="new 0 -2 20 20" xml:space="preserve">
|
||||
<polygon id="Houde" fill="#FFFFFF" points="10.022,-0.875 -0.076,8.494 2.739,8.495 2.755,17.861 7.113,17.861 7.113,12.063
|
||||
12.885,12.063 12.885,17.861 17.235,17.861 17.235,8.494 20.076,8.494 "/>
|
||||
<rect x="13.359" y="-0.339" fill="#FFFFFF" width="2.719" height="7.215"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 742 B |
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="47" height="16" viewBox="0 0 47 16">
|
||||
<g transform="translate(0 0)">
|
||||
<path d="M5.143 8q0 0.232-0.17 0.402l-4 4q-0.17 0.17-0.402 0.17t-0.402-0.17-0.17-0.402v-8q0-0.232 0.17-0.402t0.402-0.17 0.402 0.17l4 4q0.17 0.17 0.17 0.402z" fill="#ffffff" />
|
||||
</g>
|
||||
<g transform="translate(38 0)">
|
||||
<path d="M9.143 9.714q0 0.232-0.17 0.402l-4 4q-0.17 0.17-0.402 0.17t-0.402-0.17l-4-4q-0.17-0.17-0.17-0.402t0.17-0.402 0.402-0.17h8q0.232 0 0.402 0.17t0.17 0.402z" fill="#ffffff" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 751 B |
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg [
|
||||
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
|
||||
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
|
||||
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
|
||||
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
|
||||
]>
|
||||
<svg version="1.2" baseProfile="tiny" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
|
||||
x="0px" y="0px" width="20px" height="16px" viewBox="0 0 20 16" xml:space="preserve">
|
||||
<g id="Layer_2" display="none">
|
||||
<rect x="-3" y="-2" display="inline" fill="#1A1A1A" width="33" height="23"/>
|
||||
</g>
|
||||
<g id="Layer_1">
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="3" stroke-miterlimit="10" x1="3" y1="3.5" x2="17" y2="3.5"/>
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="3" stroke-miterlimit="10" x1="3" y1="8.5" x2="17" y2="8.5"/>
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="3" stroke-miterlimit="10" x1="3" y1="13.5" x2="17" y2="13.5"/>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="20px" height="16px" viewBox="0 0 20 16" enable-background="new 0 0 20 16" xml:space="preserve">
|
||||
<g id="Layer_2" display="none">
|
||||
<rect x="-3" y="-2" display="inline" fill="#1A1A1A" width="33" height="23"/>
|
||||
</g>
|
||||
<path fill="#FFFFFF" d="M15.795,6.872c-0.25-0.037-0.516-0.261-0.593-0.5l-0.37-0.901c-0.116-0.222-0.089-0.569,0.061-0.77
|
||||
L15.495,3.9c0.15-0.201,0.138-0.52-0.028-0.707l-0.66-0.661c-0.188-0.166-0.506-0.178-0.708-0.027l-0.802,0.601
|
||||
c-0.2,0.151-0.546,0.178-0.769,0.061l-0.901-0.37c-0.24-0.077-0.465-0.342-0.498-0.591l-0.143-0.991
|
||||
c-0.035-0.249-0.268-0.474-0.518-0.5c0,0-0.154-0.016-0.468-0.016c-0.313,0-0.469,0.016-0.469,0.016
|
||||
c-0.25,0.027-0.482,0.251-0.518,0.5L8.872,2.205c-0.036,0.25-0.26,0.515-0.499,0.591l-0.901,0.37
|
||||
C7.25,3.283,6.904,3.256,6.703,3.105L5.901,2.503C5.7,2.353,5.381,2.365,5.193,2.531l-0.66,0.661
|
||||
C4.368,3.38,4.354,3.698,4.506,3.899l0.601,0.802C5.258,4.902,5.285,5.248,5.169,5.47L4.797,6.372
|
||||
c-0.076,0.239-0.342,0.464-0.591,0.5l-0.991,0.14c-0.249,0.036-0.473,0.269-0.5,0.519c0,0-0.016,0.154-0.016,0.469
|
||||
s0.016,0.469,0.016,0.469c0.027,0.25,0.251,0.483,0.5,0.52l0.991,0.141c0.249,0.035,0.515,0.26,0.591,0.498l0.372,0.902
|
||||
c0.116,0.221,0.089,0.568-0.062,0.768L4.506,12.1c-0.151,0.201-0.188,0.475-0.081,0.605c0.106,0.131,0.412,0.457,0.413,0.459
|
||||
c0,0,0.104,0.096,0.228,0.209c0.125,0.113,0.634,0.273,0.835,0.123l0.802-0.602c0.201-0.15,0.546-0.18,0.77-0.061l0.9,0.369
|
||||
c0.239,0.076,0.464,0.342,0.499,0.592l0.142,0.992c0.035,0.248,0.268,0.473,0.519,0.5c0,0,0.155,0.016,0.468,0.016
|
||||
s0.469-0.016,0.469-0.016c0.248-0.027,0.482-0.252,0.518-0.5l0.143-0.992c0.033-0.248,0.258-0.516,0.498-0.592l0.9-0.371
|
||||
c0.223-0.117,0.568-0.09,0.77,0.063l0.802,0.602c0.202,0.15,0.521,0.139,0.708-0.027l0.659-0.66
|
||||
c0.166-0.189,0.178-0.508,0.028-0.709l-0.603-0.803c-0.149-0.199-0.177-0.547-0.061-0.768l0.371-0.902
|
||||
c0.077-0.238,0.342-0.463,0.592-0.498l0.99-0.141c0.249-0.037,0.474-0.27,0.5-0.52c0,0,0.017-0.154,0.017-0.469
|
||||
s-0.017-0.469-0.017-0.469c-0.026-0.249-0.251-0.483-0.5-0.519L15.795,6.872z M10,9.826C8.992,9.826,8.175,9.008,8.175,8
|
||||
c0-1.009,0.817-1.826,1.826-1.826c1.008,0,1.826,0.818,1.826,1.826C11.826,9.008,11.008,9.826,10,9.826z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
+12
-16
@@ -19,43 +19,39 @@ Drupal.admin.behaviors.toolbarActiveTrail = function (context, settings, $adminM
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @} End of "ingroup admin_behaviors".
|
||||
*/
|
||||
|
||||
Drupal.admin.behaviors.shorcutcollapsed = function (context, settings, $adminMenu) {
|
||||
|
||||
// Create the dropdown base
|
||||
$("<li class=\"label\"><a>"+Drupal.t('Shortcuts')+"</a></li>").prependTo("body.menu-render-collapsed div.toolbar-shortcuts ul");
|
||||
$("<li class=\"label\"><a>"+Drupal.t('Shortcuts')+"</a></li>").prependTo("body.menu-render-collapsed #toolbar div.toolbar-shortcuts ul");
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Drupal.admin.behaviors.shorcutselect = function (context, settings, $adminMenu) {
|
||||
|
||||
// Create the dropdown base
|
||||
$("<select id='shortcut-menu'/>").appendTo("body.menu-render-dropdown div.toolbar-shortcuts");
|
||||
|
||||
$("<select id='shortcut-menu'/>").appendTo("body.menu-render-dropdown #toolbar div.toolbar-shortcuts");
|
||||
|
||||
// Create default option "Select"
|
||||
$("<option />", {
|
||||
"selected" : "selected",
|
||||
"value" : "",
|
||||
"text" : Drupal.t('Shortcuts')
|
||||
}).appendTo("body.menu-render-dropdown div.toolbar-shortcuts select");
|
||||
|
||||
}).appendTo("body.menu-render-dropdown #toolbar div.toolbar-shortcuts select");
|
||||
|
||||
// Populate dropdown with menu items
|
||||
$("body.menu-render-dropdown div.toolbar-shortcuts a").each(function() {
|
||||
$("body.menu-render-dropdown #toolbar div.toolbar-shortcuts a").each(function() {
|
||||
var el = $(this);
|
||||
$("<option />", {
|
||||
"value" : el.attr("href"),
|
||||
"text" : el.text()
|
||||
}).appendTo("body.menu-render-dropdown div.toolbar-shortcuts select");
|
||||
}).appendTo("body.menu-render-dropdown #toolbar div.toolbar-shortcuts select");
|
||||
});
|
||||
|
||||
$("body.menu-render-dropdown div.toolbar-shortcuts select").change(function() {
|
||||
|
||||
$("body.menu-render-dropdown #toolbar div.toolbar-shortcuts select").change(function() {
|
||||
window.location = $(this).find("option:selected").val();
|
||||
});
|
||||
|
||||
$('body.menu-render-dropdown div.toolbar-shortcuts ul').remove();
|
||||
|
||||
$('body.menu-render-dropdown #toolbar div.toolbar-shortcuts ul').remove();
|
||||
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2014 Josh Cope
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,90 @@
|
||||
# SlickNav
|
||||
## Responsive Mobile Menu jQuery Plugin
|
||||
|
||||
###[SlickNav.com](http://slicknav.com)
|
||||
|
||||
### Features
|
||||
* Multi-level menu support
|
||||
* Flexible, simple markup
|
||||
* Cross-browser compatibility
|
||||
* Keyboard Accessible
|
||||
* Degrades gracefully without JavaScript
|
||||
* Creates ARIA compliant menu
|
||||
|
||||
* * *
|
||||
### Usage
|
||||
|
||||
####Include the CSS & JS
|
||||
slicknav.css can be modified to fit website design
|
||||
|
||||
<link rel="stylesheet" href="SlickNav/slicknav.css" />
|
||||
<script src="SlickNav/jquery.slicknav.min.js"></script>
|
||||
|
||||
####Menu Markup
|
||||
|
||||
<ul id="menu">
|
||||
<li><a href="#">item 1</a></li>
|
||||
<li><a href="#">item 2</a></li>
|
||||
<li><a href="#">item 3</a></li>
|
||||
<li><a href="#">item 4</a></li>
|
||||
</ul>
|
||||
####Initialize
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$('#menu').slicknav();
|
||||
});
|
||||
</script>
|
||||
|
||||
### Options
|
||||
'label' : 'MENU', // Label for menu button. Use an empty string for no label.
|
||||
'duplicate': true, // If true, the mobile menu is a copy of the original.
|
||||
'duration': true, // The duration of the sliding animation.
|
||||
'easingOpen': 'swing', // Easing used for open animations.
|
||||
'easingClose': 'swing' // Easing used for close animations.
|
||||
'closedSymbol': '►', // Character after collapsed parents.
|
||||
'openedSymbol': '▼', // Character after expanded parents.
|
||||
'prependTo': 'body', // Element, jQuery object, or jQuery selector string to prepend the mobile menu to.
|
||||
'parentTag': 'a', // Element type for parent menu items.
|
||||
'closeOnClick': false, // Close menu when a link is clicked.
|
||||
'allowParentLinks': false // Allow clickable links as parent elements.
|
||||
|
||||
### Callbacks
|
||||
'init': function(){}, // Called after SlickNav creation
|
||||
'open': function(trigger){}, // Called after menu or sub-menu opened.
|
||||
'close': function(trigger){} // Called after menu or sub-menu closed.
|
||||
|
||||
### Methods
|
||||
$('.menu').slicknav('toggle'); // Method to toggle the menu
|
||||
$('.menu').slicknav('open'); // Method to open the menu
|
||||
$('.menu').slicknav('close'); // Method to close the menu
|
||||
|
||||
Without any additional configuration, both the original and mobile menus will be displayed. It is recommended to use media queries to hide the original menu and display the mobile menu when appropriate. Modernizr or similar can be used for graceful degradation.
|
||||
|
||||
For example:
|
||||
|
||||
.slicknav_menu {
|
||||
display:none;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 40em) {
|
||||
/* #menu is the original menu */
|
||||
.js #menu {
|
||||
display:none;
|
||||
}
|
||||
|
||||
.js .slicknav_menu {
|
||||
display:block;
|
||||
}
|
||||
}
|
||||
|
||||
More examples at [SlickNav.com](http://slicknav.com)
|
||||
|
||||
### Browser Support
|
||||
* Chrome
|
||||
* Firefox
|
||||
* Safari
|
||||
* Opera
|
||||
* IE7+
|
||||
* Android Browser
|
||||
* iOS Safari
|
||||
+432
@@ -0,0 +1,432 @@
|
||||
/*!
|
||||
SlickNav Responsive Mobile Menu
|
||||
(c) 2014 Josh Cope
|
||||
licensed under MIT
|
||||
*/
|
||||
;(function ($, document, window) {
|
||||
var
|
||||
// default settings object.
|
||||
defaults = {
|
||||
label: 'MENU',
|
||||
duplicate: true,
|
||||
duration: 200,
|
||||
easingOpen: 'swing',
|
||||
easingClose: 'swing',
|
||||
closedSymbol: '►',
|
||||
openedSymbol: '▼',
|
||||
prependTo: 'body',
|
||||
parentTag: 'a',
|
||||
closeOnClick: false,
|
||||
allowParentLinks: false,
|
||||
init: function(){},
|
||||
open: function(){},
|
||||
close: function(){}
|
||||
},
|
||||
mobileMenu = 'slicknav',
|
||||
prefix = 'slicknav';
|
||||
|
||||
function Plugin( element, options ) {
|
||||
this.element = element;
|
||||
|
||||
// jQuery has an extend method which merges the contents of two or
|
||||
// more objects, storing the result in the first object. The first object
|
||||
// is generally empty as we don't want to alter the default options for
|
||||
// future instances of the plugin
|
||||
this.settings = $.extend( {}, defaults, options) ;
|
||||
|
||||
this._defaults = defaults;
|
||||
this._name = mobileMenu;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
Plugin.prototype.init = function () {
|
||||
var $this = this;
|
||||
var menu = $(this.element);
|
||||
var settings = this.settings;
|
||||
|
||||
// clone menu if needed
|
||||
if (settings.duplicate) {
|
||||
$this.mobileNav = menu.clone();
|
||||
//remove ids from clone to prevent css issues
|
||||
$this.mobileNav.removeAttr('id');
|
||||
$this.mobileNav.find('*').each(function(i,e){
|
||||
$(e).removeAttr('id');
|
||||
});
|
||||
}
|
||||
else
|
||||
$this.mobileNav = menu;
|
||||
|
||||
// styling class for the button
|
||||
var iconClass = prefix+'_icon';
|
||||
|
||||
if (settings.label == '') {
|
||||
iconClass += ' '+prefix+'_no-text';
|
||||
}
|
||||
|
||||
if (settings.parentTag == 'a') {
|
||||
settings.parentTag = 'a href="#"';
|
||||
}
|
||||
|
||||
// create menu bar
|
||||
$this.mobileNav.attr('class', prefix+'_nav');
|
||||
var menuBar = $('<div class="'+prefix+'_menu"></div>');
|
||||
$this.btn = $('<'+settings.parentTag+' aria-haspopup="true" tabindex="0" class="'+prefix+'_btn '+prefix+'_collapsed"><span class="'+prefix+'_menutxt">'+settings.label+'</span><span class="'+iconClass+'"><span class="'+prefix+'_icon-bar"></span><span class="'+prefix+'_icon-bar"></span><span class="'+prefix+'_icon-bar"></span></span></a>');
|
||||
$(menuBar).append($this.btn);
|
||||
$(settings.prependTo).prepend(menuBar);
|
||||
menuBar.append($this.mobileNav);
|
||||
|
||||
// iterate over structure adding additional structure
|
||||
var items = $this.mobileNav.find('li');
|
||||
$(items).each(function () {
|
||||
var item = $(this);
|
||||
data = {};
|
||||
data.children = item.children('ul').attr('role','menu');
|
||||
item.data("menu", data);
|
||||
|
||||
// if a list item has a nested menu
|
||||
if (data.children.length > 0) {
|
||||
|
||||
// select all text before the child menu
|
||||
var a = item.contents();
|
||||
var nodes = [];
|
||||
$(a).each(function(){
|
||||
if(!$(this).is("ul")) {
|
||||
nodes.push(this);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// wrap item text with tag and add classes
|
||||
var wrap = $(nodes).wrapAll('<'+settings.parentTag+' role="menuitem" aria-haspopup="true" tabindex="-1" class="'+prefix+'_item"/>').parent();
|
||||
|
||||
item.addClass(prefix+'_collapsed');
|
||||
item.addClass(prefix+'_parent');
|
||||
|
||||
// create parent arrow
|
||||
$(nodes).last().after('<span class="'+prefix+'_arrow">'+settings.closedSymbol+'</span>');
|
||||
|
||||
|
||||
} else if ( item.children().length == 0) {
|
||||
item.addClass(prefix+'_txtnode');
|
||||
}
|
||||
|
||||
// accessibility for links
|
||||
item.children('a').attr('role', 'menuitem').click(function(){
|
||||
//Emulate menu close if set
|
||||
if (settings.closeOnClick)
|
||||
$($this.btn).click();
|
||||
});
|
||||
});
|
||||
|
||||
// structure is in place, now hide appropriate items
|
||||
$(items).each(function () {
|
||||
var data = $(this).data("menu");
|
||||
$this._visibilityToggle(data.children, false, null, true);
|
||||
});
|
||||
|
||||
// finally toggle entire menu
|
||||
$this._visibilityToggle($this.mobileNav, false, 'init', true);
|
||||
|
||||
// accessibility for menu button
|
||||
$this.mobileNav.attr('role','menu');
|
||||
|
||||
// outline prevention when using mouse
|
||||
$(document).mousedown(function(){
|
||||
$this._outlines(false);
|
||||
});
|
||||
|
||||
$(document).keyup(function(){
|
||||
$this._outlines(true);
|
||||
});
|
||||
|
||||
// menu button click
|
||||
$($this.btn).click(function (e) {
|
||||
e.preventDefault();
|
||||
$this._menuToggle();
|
||||
});
|
||||
|
||||
// click on menu parent
|
||||
$this.mobileNav.on('click', '.'+prefix+'_item', function(e){
|
||||
e.preventDefault();
|
||||
$this._itemClick($(this));
|
||||
});
|
||||
|
||||
// check for enter key on menu button and menu parents
|
||||
$($this.btn).keydown(function (e) {
|
||||
var ev = e || event;
|
||||
if(ev.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
$this._menuToggle();
|
||||
}
|
||||
});
|
||||
|
||||
$this.mobileNav.on('keydown', '.'+prefix+'_item', function(e) {
|
||||
var ev = e || event;
|
||||
if(ev.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
$this._itemClick($(e.target));
|
||||
}
|
||||
});
|
||||
|
||||
// allow links clickable within parent tags if set
|
||||
if (settings.allowParentLinks) {
|
||||
$('.'+prefix+'_item a').click(function(e){
|
||||
e.stopImmediatePropagation();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//toggle menu
|
||||
Plugin.prototype._menuToggle = function(el){
|
||||
var $this = this;
|
||||
var btn = $this.btn;
|
||||
var mobileNav = $this.mobileNav;
|
||||
|
||||
if (btn.hasClass(prefix+'_collapsed')) {
|
||||
btn.removeClass(prefix+'_collapsed');
|
||||
btn.addClass(prefix+'_open');
|
||||
} else {
|
||||
btn.removeClass(prefix+'_open');
|
||||
btn.addClass(prefix+'_collapsed');
|
||||
}
|
||||
btn.addClass(prefix+'_animating');
|
||||
$this._visibilityToggle(mobileNav, true, btn);
|
||||
}
|
||||
|
||||
// toggle clicked items
|
||||
Plugin.prototype._itemClick = function(el) {
|
||||
var $this = this;
|
||||
var settings = $this.settings;
|
||||
var data = el.data("menu");
|
||||
if (!data) {
|
||||
data = {};
|
||||
data.arrow = el.children('.'+prefix+'_arrow');
|
||||
data.ul = el.next('ul');
|
||||
data.parent = el.parent();
|
||||
el.data("menu", data);
|
||||
}
|
||||
if (data.parent.hasClass(prefix+'_collapsed')) {
|
||||
data.arrow.html(settings.openedSymbol);
|
||||
data.parent.removeClass(prefix+'_collapsed');
|
||||
data.parent.addClass(prefix+'_open');
|
||||
data.parent.addClass(prefix+'_animating');
|
||||
$this._visibilityToggle(data.ul, true, el);
|
||||
} else {
|
||||
data.arrow.html(settings.closedSymbol);
|
||||
data.parent.addClass(prefix+'_collapsed');
|
||||
data.parent.removeClass(prefix+'_open');
|
||||
data.parent.addClass(prefix+'_animating');
|
||||
$this._visibilityToggle(data.ul, true, el);
|
||||
}
|
||||
}
|
||||
|
||||
// toggle actual visibility and accessibility tags
|
||||
Plugin.prototype._visibilityToggle = function(el, animate, trigger, init) {
|
||||
var $this = this;
|
||||
var settings = $this.settings;
|
||||
var items = $this._getActionItems(el);
|
||||
var duration = 0;
|
||||
if (animate)
|
||||
duration = settings.duration;
|
||||
|
||||
if (el.hasClass(prefix+'_hidden')) {
|
||||
el.removeClass(prefix+'_hidden');
|
||||
el.slideDown(duration, settings.easingOpen, function(){
|
||||
|
||||
$(trigger).removeClass(prefix+'_animating');
|
||||
$(trigger).parent().removeClass(prefix+'_animating');
|
||||
|
||||
//Fire open callback
|
||||
if (!init) {
|
||||
settings.open(trigger);
|
||||
}
|
||||
});
|
||||
el.attr('aria-hidden','false');
|
||||
items.attr('tabindex', '0');
|
||||
$this._setVisAttr(el, false);
|
||||
} else {
|
||||
el.addClass(prefix+'_hidden');
|
||||
el.slideUp(duration, this.settings.easingClose, function() {
|
||||
el.attr('aria-hidden','true');
|
||||
items.attr('tabindex', '-1');
|
||||
$this._setVisAttr(el, true);
|
||||
el.hide(); //jQuery 1.7 bug fix
|
||||
|
||||
$(trigger).removeClass(prefix+'_animating');
|
||||
$(trigger).parent().removeClass(prefix+'_animating');
|
||||
|
||||
//Fire init or close callback
|
||||
if (!init)
|
||||
settings.close(trigger);
|
||||
else if (trigger == 'init')
|
||||
settings.init();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// set attributes of element and children based on visibility
|
||||
Plugin.prototype._setVisAttr = function(el, hidden) {
|
||||
var $this = this;
|
||||
|
||||
// select all parents that aren't hidden
|
||||
var nonHidden = el.children('li').children('ul').not('.'+prefix+'_hidden');
|
||||
|
||||
// iterate over all items setting appropriate tags
|
||||
if (!hidden) {
|
||||
nonHidden.each(function(){
|
||||
var ul = $(this);
|
||||
ul.attr('aria-hidden','false');
|
||||
var items = $this._getActionItems(ul);
|
||||
items.attr('tabindex', '0');
|
||||
$this._setVisAttr(ul, hidden);
|
||||
});
|
||||
} else {
|
||||
nonHidden.each(function(){
|
||||
var ul = $(this);
|
||||
ul.attr('aria-hidden','true');
|
||||
var items = $this._getActionItems(ul);
|
||||
items.attr('tabindex', '-1');
|
||||
$this._setVisAttr(ul, hidden);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// get all 1st level items that are clickable
|
||||
Plugin.prototype._getActionItems = function(el) {
|
||||
var data = el.data("menu");
|
||||
if (!data) {
|
||||
data = {};
|
||||
var items = el.children('li');
|
||||
var anchors = items.children('a');
|
||||
data.links = anchors.add(items.children('.'+prefix+'_item'));
|
||||
el.data("menu", data);
|
||||
}
|
||||
return data.links;
|
||||
}
|
||||
|
||||
Plugin.prototype._outlines = function(state) {
|
||||
if (!state) {
|
||||
$('.'+prefix+'_item, .'+prefix+'_btn').css('outline','none');
|
||||
} else {
|
||||
$('.'+prefix+'_item, .'+prefix+'_btn').css('outline','');
|
||||
}
|
||||
}
|
||||
|
||||
Plugin.prototype.toggle = function(){
|
||||
$this._menuToggle();
|
||||
}
|
||||
|
||||
Plugin.prototype.open = function(){
|
||||
$this = this;
|
||||
if ($this.btn.hasClass(prefix+'_collapsed')) {
|
||||
$this._menuToggle();
|
||||
}
|
||||
}
|
||||
|
||||
Plugin.prototype.close = function(){
|
||||
$this = this;
|
||||
if ($this.btn.hasClass(prefix+'_open')) {
|
||||
$this._menuToggle();
|
||||
}
|
||||
}
|
||||
|
||||
$.fn[mobileMenu] = function ( options ) {
|
||||
var args = arguments;
|
||||
|
||||
// Is the first parameter an object (options), or was omitted, instantiate a new instance
|
||||
if (options === undefined || typeof options === 'object') {
|
||||
return this.each(function () {
|
||||
|
||||
// Only allow the plugin to be instantiated once due to methods
|
||||
if (!$.data(this, 'plugin_' + mobileMenu)) {
|
||||
|
||||
// if it has no instance, create a new one, pass options to our plugin constructor,
|
||||
// and store the plugin instance in the elements jQuery data object.
|
||||
$.data(this, 'plugin_' + mobileMenu, new Plugin( this, options ));
|
||||
}
|
||||
});
|
||||
|
||||
// If is a string and doesn't start with an underscore or 'init' function, treat this as a call to a public method.
|
||||
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
|
||||
|
||||
// Cache the method call to make it possible to return a value
|
||||
var returns;
|
||||
|
||||
this.each(function () {
|
||||
var instance = $.data(this, 'plugin_' + mobileMenu);
|
||||
|
||||
// Tests that there's already a plugin-instance and checks that the requested public method exists
|
||||
if (instance instanceof Plugin && typeof instance[options] === 'function') {
|
||||
|
||||
// Call the method of our plugin instance, and pass it the supplied arguments.
|
||||
returns = instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
|
||||
}
|
||||
});
|
||||
|
||||
// If the earlier cached method gives a value back return the value, otherwise return this to preserve chainability.
|
||||
return returns !== undefined ? returns : this;
|
||||
}
|
||||
};
|
||||
}($jQueryAdminimal, document, window));
|
||||
|
||||
(function($) {
|
||||
|
||||
// Create the responsive menu using SlickNav.
|
||||
Drupal.admin.behaviors.responsivemenu = function (context, settings, $adminMenu) {
|
||||
|
||||
$('#admin-menu-menu-responsive').slicknav({
|
||||
label: 'Menu',
|
||||
prependTo:'body',
|
||||
closedSymbol: "<i class=\"closed\"></i>",
|
||||
openedSymbol: "<i class=\"open\"></i>",
|
||||
allowParentLinks: true
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// Create the responsive shortcuts dropdown.
|
||||
Drupal.admin.behaviors.responsiveshortcuts = function (context, settings, $adminMenu) {
|
||||
|
||||
// Check if there are any shortucts to respondify.
|
||||
if(jQuery("div.toolbar-shortcuts ul.menu li").length){
|
||||
|
||||
// Create the dropdown base
|
||||
$("<select id='responsive-shortcuts-dropdown'/>").appendTo("#admin-menu-shortcuts-responsive div.toolbar-shortcuts");
|
||||
|
||||
// Create default option "Select"
|
||||
$("<option />", {
|
||||
"selected" : "selected",
|
||||
"class" : "hide",
|
||||
"value" : "",
|
||||
"text" : Drupal.t('Shortcuts')
|
||||
}).appendTo("#admin-menu-shortcuts-responsive div.toolbar-shortcuts select");
|
||||
|
||||
// Populate dropdown with menu items
|
||||
$("#admin-menu-shortcuts-responsive div.toolbar-shortcuts a").each(function() {
|
||||
var el = $(this);
|
||||
$("<option />", {
|
||||
"value" : el.attr("href"),
|
||||
"text" : el.text()
|
||||
}).appendTo("#admin-menu-shortcuts-responsive div.toolbar-shortcuts select");
|
||||
});
|
||||
|
||||
// Redirect the user when selecting an option.
|
||||
$("#admin-menu-shortcuts-responsive div.toolbar-shortcuts select").change(function() {
|
||||
window.location = $(this).find("option:selected").val();
|
||||
});
|
||||
|
||||
// Clean the mess.
|
||||
$('#admin-menu-shortcuts-responsive div.toolbar-shortcuts ul').remove();
|
||||
// Move the select box into the responsive menu.
|
||||
$("#admin-menu-shortcuts-responsive").prependTo(".slicknav_menu");
|
||||
|
||||
}
|
||||
|
||||
// Remove the edit shortcuts link from the DOM to avoid duble rendering.
|
||||
$('#admin-menu-shortcuts-responsive #edit-shortcuts').remove();
|
||||
|
||||
};
|
||||
})($jQueryAdminimal);
|
||||
@@ -0,0 +1,432 @@
|
||||
/*!
|
||||
SlickNav Responsive Mobile Menu
|
||||
(c) 2014 Josh Cope
|
||||
licensed under MIT
|
||||
*/
|
||||
;(function ($, document, window) {
|
||||
var
|
||||
// default settings object.
|
||||
defaults = {
|
||||
label: 'MENU',
|
||||
duplicate: true,
|
||||
duration: 200,
|
||||
easingOpen: 'swing',
|
||||
easingClose: 'swing',
|
||||
closedSymbol: '►',
|
||||
openedSymbol: '▼',
|
||||
prependTo: 'body',
|
||||
parentTag: 'a',
|
||||
closeOnClick: false,
|
||||
allowParentLinks: false,
|
||||
init: function(){},
|
||||
open: function(){},
|
||||
close: function(){}
|
||||
},
|
||||
mobileMenu = 'slicknav',
|
||||
prefix = 'slicknav';
|
||||
|
||||
function Plugin( element, options ) {
|
||||
this.element = element;
|
||||
|
||||
// jQuery has an extend method which merges the contents of two or
|
||||
// more objects, storing the result in the first object. The first object
|
||||
// is generally empty as we don't want to alter the default options for
|
||||
// future instances of the plugin
|
||||
this.settings = $.extend( {}, defaults, options) ;
|
||||
|
||||
this._defaults = defaults;
|
||||
this._name = mobileMenu;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
Plugin.prototype.init = function () {
|
||||
var $this = this;
|
||||
var menu = $(this.element);
|
||||
var settings = this.settings;
|
||||
|
||||
// clone menu if needed
|
||||
if (settings.duplicate) {
|
||||
$this.mobileNav = menu.clone();
|
||||
//remove ids from clone to prevent css issues
|
||||
$this.mobileNav.removeAttr('id');
|
||||
$this.mobileNav.find('*').each(function(i,e){
|
||||
$(e).removeAttr('id');
|
||||
});
|
||||
}
|
||||
else
|
||||
$this.mobileNav = menu;
|
||||
|
||||
// styling class for the button
|
||||
var iconClass = prefix+'_icon';
|
||||
|
||||
if (settings.label == '') {
|
||||
iconClass += ' '+prefix+'_no-text';
|
||||
}
|
||||
|
||||
if (settings.parentTag == 'a') {
|
||||
settings.parentTag = 'a href="#"';
|
||||
}
|
||||
|
||||
// create menu bar
|
||||
$this.mobileNav.attr('class', prefix+'_nav');
|
||||
var menuBar = $('<div class="'+prefix+'_menu"></div>');
|
||||
$this.btn = $('<'+settings.parentTag+' aria-haspopup="true" tabindex="0" class="'+prefix+'_btn '+prefix+'_collapsed"><span class="'+prefix+'_menutxt">'+settings.label+'</span><span class="'+iconClass+'"><span class="'+prefix+'_icon-bar"></span><span class="'+prefix+'_icon-bar"></span><span class="'+prefix+'_icon-bar"></span></span></a>');
|
||||
$(menuBar).append($this.btn);
|
||||
$(settings.prependTo).prepend(menuBar);
|
||||
menuBar.append($this.mobileNav);
|
||||
|
||||
// iterate over structure adding additional structure
|
||||
var items = $this.mobileNav.find('li');
|
||||
$(items).each(function () {
|
||||
var item = $(this);
|
||||
data = {};
|
||||
data.children = item.children('ul').attr('role','menu');
|
||||
item.data("menu", data);
|
||||
|
||||
// if a list item has a nested menu
|
||||
if (data.children.length > 0) {
|
||||
|
||||
// select all text before the child menu
|
||||
var a = item.contents();
|
||||
var nodes = [];
|
||||
$(a).each(function(){
|
||||
if(!$(this).is("ul")) {
|
||||
nodes.push(this);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// wrap item text with tag and add classes
|
||||
var wrap = $(nodes).wrapAll('<'+settings.parentTag+' role="menuitem" aria-haspopup="true" tabindex="-1" class="'+prefix+'_item"/>').parent();
|
||||
|
||||
item.addClass(prefix+'_collapsed');
|
||||
item.addClass(prefix+'_parent');
|
||||
|
||||
// create parent arrow
|
||||
$(nodes).last().after('<span class="'+prefix+'_arrow">'+settings.closedSymbol+'</span>');
|
||||
|
||||
|
||||
} else if ( item.children().length == 0) {
|
||||
item.addClass(prefix+'_txtnode');
|
||||
}
|
||||
|
||||
// accessibility for links
|
||||
item.children('a').attr('role', 'menuitem').click(function(){
|
||||
//Emulate menu close if set
|
||||
if (settings.closeOnClick)
|
||||
$($this.btn).click();
|
||||
});
|
||||
});
|
||||
|
||||
// structure is in place, now hide appropriate items
|
||||
$(items).each(function () {
|
||||
var data = $(this).data("menu");
|
||||
$this._visibilityToggle(data.children, false, null, true);
|
||||
});
|
||||
|
||||
// finally toggle entire menu
|
||||
$this._visibilityToggle($this.mobileNav, false, 'init', true);
|
||||
|
||||
// accessibility for menu button
|
||||
$this.mobileNav.attr('role','menu');
|
||||
|
||||
// outline prevention when using mouse
|
||||
$(document).mousedown(function(){
|
||||
$this._outlines(false);
|
||||
});
|
||||
|
||||
$(document).keyup(function(){
|
||||
$this._outlines(true);
|
||||
});
|
||||
|
||||
// menu button click
|
||||
$($this.btn).click(function (e) {
|
||||
e.preventDefault();
|
||||
$this._menuToggle();
|
||||
});
|
||||
|
||||
// click on menu parent
|
||||
$this.mobileNav.on('click', '.'+prefix+'_item', function(e){
|
||||
e.preventDefault();
|
||||
$this._itemClick($(this));
|
||||
});
|
||||
|
||||
// check for enter key on menu button and menu parents
|
||||
$($this.btn).keydown(function (e) {
|
||||
var ev = e || event;
|
||||
if(ev.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
$this._menuToggle();
|
||||
}
|
||||
});
|
||||
|
||||
$this.mobileNav.on('keydown', '.'+prefix+'_item', function(e) {
|
||||
var ev = e || event;
|
||||
if(ev.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
$this._itemClick($(e.target));
|
||||
}
|
||||
});
|
||||
|
||||
// allow links clickable within parent tags if set
|
||||
if (settings.allowParentLinks) {
|
||||
$('.'+prefix+'_item a').click(function(e){
|
||||
e.stopImmediatePropagation();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//toggle menu
|
||||
Plugin.prototype._menuToggle = function(el){
|
||||
var $this = this;
|
||||
var btn = $this.btn;
|
||||
var mobileNav = $this.mobileNav;
|
||||
|
||||
if (btn.hasClass(prefix+'_collapsed')) {
|
||||
btn.removeClass(prefix+'_collapsed');
|
||||
btn.addClass(prefix+'_open');
|
||||
} else {
|
||||
btn.removeClass(prefix+'_open');
|
||||
btn.addClass(prefix+'_collapsed');
|
||||
}
|
||||
btn.addClass(prefix+'_animating');
|
||||
$this._visibilityToggle(mobileNav, true, btn);
|
||||
}
|
||||
|
||||
// toggle clicked items
|
||||
Plugin.prototype._itemClick = function(el) {
|
||||
var $this = this;
|
||||
var settings = $this.settings;
|
||||
var data = el.data("menu");
|
||||
if (!data) {
|
||||
data = {};
|
||||
data.arrow = el.children('.'+prefix+'_arrow');
|
||||
data.ul = el.next('ul');
|
||||
data.parent = el.parent();
|
||||
el.data("menu", data);
|
||||
}
|
||||
if (data.parent.hasClass(prefix+'_collapsed')) {
|
||||
data.arrow.html(settings.openedSymbol);
|
||||
data.parent.removeClass(prefix+'_collapsed');
|
||||
data.parent.addClass(prefix+'_open');
|
||||
data.parent.addClass(prefix+'_animating');
|
||||
$this._visibilityToggle(data.ul, true, el);
|
||||
} else {
|
||||
data.arrow.html(settings.closedSymbol);
|
||||
data.parent.addClass(prefix+'_collapsed');
|
||||
data.parent.removeClass(prefix+'_open');
|
||||
data.parent.addClass(prefix+'_animating');
|
||||
$this._visibilityToggle(data.ul, true, el);
|
||||
}
|
||||
}
|
||||
|
||||
// toggle actual visibility and accessibility tags
|
||||
Plugin.prototype._visibilityToggle = function(el, animate, trigger, init) {
|
||||
var $this = this;
|
||||
var settings = $this.settings;
|
||||
var items = $this._getActionItems(el);
|
||||
var duration = 0;
|
||||
if (animate)
|
||||
duration = settings.duration;
|
||||
|
||||
if (el.hasClass(prefix+'_hidden')) {
|
||||
el.removeClass(prefix+'_hidden');
|
||||
el.slideDown(duration, settings.easingOpen, function(){
|
||||
|
||||
$(trigger).removeClass(prefix+'_animating');
|
||||
$(trigger).parent().removeClass(prefix+'_animating');
|
||||
|
||||
//Fire open callback
|
||||
if (!init) {
|
||||
settings.open(trigger);
|
||||
}
|
||||
});
|
||||
el.attr('aria-hidden','false');
|
||||
items.attr('tabindex', '0');
|
||||
$this._setVisAttr(el, false);
|
||||
} else {
|
||||
el.addClass(prefix+'_hidden');
|
||||
el.slideUp(duration, this.settings.easingClose, function() {
|
||||
el.attr('aria-hidden','true');
|
||||
items.attr('tabindex', '-1');
|
||||
$this._setVisAttr(el, true);
|
||||
el.hide(); //jQuery 1.7 bug fix
|
||||
|
||||
$(trigger).removeClass(prefix+'_animating');
|
||||
$(trigger).parent().removeClass(prefix+'_animating');
|
||||
|
||||
//Fire init or close callback
|
||||
if (!init)
|
||||
settings.close(trigger);
|
||||
else if (trigger == 'init')
|
||||
settings.init();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// set attributes of element and children based on visibility
|
||||
Plugin.prototype._setVisAttr = function(el, hidden) {
|
||||
var $this = this;
|
||||
|
||||
// select all parents that aren't hidden
|
||||
var nonHidden = el.children('li').children('ul').not('.'+prefix+'_hidden');
|
||||
|
||||
// iterate over all items setting appropriate tags
|
||||
if (!hidden) {
|
||||
nonHidden.each(function(){
|
||||
var ul = $(this);
|
||||
ul.attr('aria-hidden','false');
|
||||
var items = $this._getActionItems(ul);
|
||||
items.attr('tabindex', '0');
|
||||
$this._setVisAttr(ul, hidden);
|
||||
});
|
||||
} else {
|
||||
nonHidden.each(function(){
|
||||
var ul = $(this);
|
||||
ul.attr('aria-hidden','true');
|
||||
var items = $this._getActionItems(ul);
|
||||
items.attr('tabindex', '-1');
|
||||
$this._setVisAttr(ul, hidden);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// get all 1st level items that are clickable
|
||||
Plugin.prototype._getActionItems = function(el) {
|
||||
var data = el.data("menu");
|
||||
if (!data) {
|
||||
data = {};
|
||||
var items = el.children('li');
|
||||
var anchors = items.children('a');
|
||||
data.links = anchors.add(items.children('.'+prefix+'_item'));
|
||||
el.data("menu", data);
|
||||
}
|
||||
return data.links;
|
||||
}
|
||||
|
||||
Plugin.prototype._outlines = function(state) {
|
||||
if (!state) {
|
||||
$('.'+prefix+'_item, .'+prefix+'_btn').css('outline','none');
|
||||
} else {
|
||||
$('.'+prefix+'_item, .'+prefix+'_btn').css('outline','');
|
||||
}
|
||||
}
|
||||
|
||||
Plugin.prototype.toggle = function(){
|
||||
$this._menuToggle();
|
||||
}
|
||||
|
||||
Plugin.prototype.open = function(){
|
||||
$this = this;
|
||||
if ($this.btn.hasClass(prefix+'_collapsed')) {
|
||||
$this._menuToggle();
|
||||
}
|
||||
}
|
||||
|
||||
Plugin.prototype.close = function(){
|
||||
$this = this;
|
||||
if ($this.btn.hasClass(prefix+'_open')) {
|
||||
$this._menuToggle();
|
||||
}
|
||||
}
|
||||
|
||||
$.fn[mobileMenu] = function ( options ) {
|
||||
var args = arguments;
|
||||
|
||||
// Is the first parameter an object (options), or was omitted, instantiate a new instance
|
||||
if (options === undefined || typeof options === 'object') {
|
||||
return this.each(function () {
|
||||
|
||||
// Only allow the plugin to be instantiated once due to methods
|
||||
if (!$.data(this, 'plugin_' + mobileMenu)) {
|
||||
|
||||
// if it has no instance, create a new one, pass options to our plugin constructor,
|
||||
// and store the plugin instance in the elements jQuery data object.
|
||||
$.data(this, 'plugin_' + mobileMenu, new Plugin( this, options ));
|
||||
}
|
||||
});
|
||||
|
||||
// If is a string and doesn't start with an underscore or 'init' function, treat this as a call to a public method.
|
||||
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
|
||||
|
||||
// Cache the method call to make it possible to return a value
|
||||
var returns;
|
||||
|
||||
this.each(function () {
|
||||
var instance = $.data(this, 'plugin_' + mobileMenu);
|
||||
|
||||
// Tests that there's already a plugin-instance and checks that the requested public method exists
|
||||
if (instance instanceof Plugin && typeof instance[options] === 'function') {
|
||||
|
||||
// Call the method of our plugin instance, and pass it the supplied arguments.
|
||||
returns = instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
|
||||
}
|
||||
});
|
||||
|
||||
// If the earlier cached method gives a value back return the value, otherwise return this to preserve chainability.
|
||||
return returns !== undefined ? returns : this;
|
||||
}
|
||||
};
|
||||
}(jQuery, document, window));
|
||||
|
||||
(function($) {
|
||||
|
||||
// Create the responsive menu using SlickNav.
|
||||
Drupal.admin.behaviors.responsivemenu = function (context, settings, $adminMenu) {
|
||||
|
||||
$('#admin-menu-menu-responsive').slicknav({
|
||||
label: 'Menu',
|
||||
prependTo:'body',
|
||||
closedSymbol: "<i class=\"closed\"></i>",
|
||||
openedSymbol: "<i class=\"open\"></i>",
|
||||
allowParentLinks: true
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// Create the responsive shortcuts dropdown.
|
||||
Drupal.admin.behaviors.responsiveshortcuts = function (context, settings, $adminMenu) {
|
||||
|
||||
// Check if there are any shortucts to respondify.
|
||||
if(jQuery("div.toolbar-shortcuts ul.menu li").length){
|
||||
|
||||
// Create the dropdown base
|
||||
$("<select id='responsive-shortcuts-dropdown'/>").appendTo("#admin-menu-shortcuts-responsive div.toolbar-shortcuts");
|
||||
|
||||
// Create default option "Select"
|
||||
$("<option />", {
|
||||
"selected" : "selected",
|
||||
"class" : "hide",
|
||||
"value" : "",
|
||||
"text" : Drupal.t('Shortcuts')
|
||||
}).appendTo("#admin-menu-shortcuts-responsive div.toolbar-shortcuts select");
|
||||
|
||||
// Populate dropdown with menu items
|
||||
$("#admin-menu-shortcuts-responsive div.toolbar-shortcuts a").each(function() {
|
||||
var el = $(this);
|
||||
$("<option />", {
|
||||
"value" : el.attr("href"),
|
||||
"text" : el.text()
|
||||
}).appendTo("#admin-menu-shortcuts-responsive div.toolbar-shortcuts select");
|
||||
});
|
||||
|
||||
// Redirect the user when selecting an option.
|
||||
$("#admin-menu-shortcuts-responsive div.toolbar-shortcuts select").change(function() {
|
||||
window.location = $(this).find("option:selected").val();
|
||||
});
|
||||
|
||||
// Clean the mess.
|
||||
$('#admin-menu-shortcuts-responsive div.toolbar-shortcuts ul').remove();
|
||||
// Move the select box into the responsive menu.
|
||||
$("#admin-menu-shortcuts-responsive").prependTo(".slicknav_menu");
|
||||
|
||||
}
|
||||
|
||||
// Remove the edit shortcuts link from the DOM to avoid duble rendering.
|
||||
$('#admin-menu-shortcuts-responsive #edit-shortcuts').remove();
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
Mobile Menu Core Style
|
||||
*/
|
||||
|
||||
.slicknav_btn { position: relative; display: block; vertical-align: middle; float: right; padding: 0.438em 0.625em 0.438em 0.625em; line-height: 1.125em; cursor: pointer; }
|
||||
.slicknav_menu .slicknav_menutxt { display: block; line-height: 1.188em; float: left; }
|
||||
.slicknav_menu .slicknav_icon { float: left; margin: 0.188em 0 0 0.438em; }
|
||||
.slicknav_menu .slicknav_no-text { margin: 0 }
|
||||
.slicknav_menu .slicknav_icon-bar { display: block; width: 1.125em; height: 0.125em; -webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px; -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
|
||||
.slicknav_btn .slicknav_icon-bar + .slicknav_icon-bar { margin-top: 0.188em }
|
||||
.slicknav_nav { clear: both }
|
||||
.slicknav_nav ul,
|
||||
.slicknav_nav li { display: block }
|
||||
.slicknav_nav .slicknav_arrow { font-size: 0.8em; margin: 0 0 0 0.4em; }
|
||||
.slicknav_nav .slicknav_item { display: block; cursor: pointer; }
|
||||
.slicknav_nav a { display: block }
|
||||
.slicknav_nav .slicknav_item a { display: inline }
|
||||
.slicknav_menu:before,
|
||||
.slicknav_menu:after { content: " "; display: table; }
|
||||
.slicknav_menu:after { clear: both }
|
||||
/* IE6/7 support */
|
||||
.slicknav_menu { *zoom: 1 }
|
||||
|
||||
/*
|
||||
User Default Style
|
||||
Change the following styles to modify the appearance of the menu.
|
||||
*/
|
||||
|
||||
.slicknav_menu {
|
||||
font-size:16px;
|
||||
}
|
||||
/* Button */
|
||||
.slicknav_btn {
|
||||
margin: 5px 5px 6px;
|
||||
text-decoration:none;
|
||||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
background-color: #222222;
|
||||
}
|
||||
/* Button Text */
|
||||
.slicknav_menu .slicknav_menutxt {
|
||||
color: #FFF;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 1px 3px #000;
|
||||
}
|
||||
/* Button Lines */
|
||||
.slicknav_menu .slicknav_icon-bar {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.slicknav_menu {
|
||||
background:#4c4c4c;
|
||||
padding:5px;
|
||||
}
|
||||
.slicknav_nav {
|
||||
color:#fff;
|
||||
margin:0;
|
||||
padding:0;
|
||||
font-size:0.875em;
|
||||
}
|
||||
.slicknav_nav, .slicknav_nav ul {
|
||||
list-style: none;
|
||||
overflow:hidden;
|
||||
}
|
||||
.slicknav_nav ul {
|
||||
padding:0;
|
||||
margin:0 0 0 20px;
|
||||
}
|
||||
.slicknav_nav .slicknav_item {
|
||||
padding:5px 10px;
|
||||
margin:2px 5px;
|
||||
}
|
||||
.slicknav_nav a{
|
||||
padding:5px 10px;
|
||||
margin:2px 5px;
|
||||
text-decoration:none;
|
||||
color:#fff;
|
||||
}
|
||||
.slicknav_nav .slicknav_item a {
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
.slicknav_nav .slicknav_item:hover {
|
||||
-webkit-border-radius: 6px;
|
||||
-moz-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
background:#ccc;
|
||||
color:#fff;
|
||||
}
|
||||
.slicknav_nav a:hover{
|
||||
-webkit-border-radius: 6px;
|
||||
-moz-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
background:#ccc;
|
||||
color:#222;
|
||||
}
|
||||
.slicknav_nav .slicknav_txtnode {
|
||||
margin-left:15px;
|
||||
}
|
||||
|
||||
/* ADMiNiMAL MENU STYLING */
|
||||
.slicknav_menu {
|
||||
display:none;
|
||||
}
|
||||
|
||||
#admin-menu-menu-responsive {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
body.admin-menu.adminimal-menu:before {
|
||||
display: none;
|
||||
}
|
||||
#admin-menu-menu, a#edit-shortcuts, li.admin-menu-account, #admin-menu-search, #admin-menu-users, {
|
||||
display:none;
|
||||
}
|
||||
|
||||
#admin-menu {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
body.admin-menu, body.admin-menu.adminimal-menu.adminimal-backend, body.admin-menu.adminimal-menu.adminimal-frontend {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
.slicknav_menu {
|
||||
display:block;
|
||||
}
|
||||
|
||||
#admin-menu-shortcuts-responsive {
|
||||
background: url("../../images/circledown.svg") no-repeat scroll 16px 50% transparent;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#admin-menu-shortcuts-responsive select {
|
||||
-moz-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
text-indent: 0.01px;
|
||||
text-overflow: '';
|
||||
border: none;
|
||||
font-size: 0px;
|
||||
background: transparent;
|
||||
height: 46px;
|
||||
width: 46px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#admin-menu-shortcuts-responsive select option {
|
||||
font-size: 14px;
|
||||
background: #fff;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.slicknav_btn {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.slicknav_menu {
|
||||
background: none repeat scroll 0 0 #222222;
|
||||
padding: 0;
|
||||
font-family: Open Sans, "Segoe UI", "Helvetica", sans-serif;
|
||||
color: color: #FFFFFF;
|
||||
}
|
||||
|
||||
.slicknav_menu a, .slicknav_menu a:link, .slicknav_menu a:active {
|
||||
color: #fff !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.slicknav_menu:after {
|
||||
clear: none;
|
||||
}
|
||||
|
||||
.slicknav_btn {
|
||||
margin: 0;
|
||||
outline: medium none;
|
||||
padding: 5px 10px;
|
||||
text-shadow: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.slicknav_icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.slicknav_menu .slicknav_menutxt {
|
||||
text-shadow: none;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.slicknav_nav a:hover, .slicknav_nav .slicknav_item:hover {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.slicknav_nav li.expandable, #admin-menu .slicknav_nav .dropdown li {
|
||||
float: none !important;
|
||||
}
|
||||
|
||||
.slicknav_nav .slicknav_item {
|
||||
|
||||
}
|
||||
|
||||
.slicknav_btn {
|
||||
background: url("../../images/menu.svg") no-repeat scroll 8px 16px rgba(0, 0, 0, 0);
|
||||
font-size: 23px;
|
||||
padding: 10px 34px;
|
||||
}
|
||||
|
||||
.slicknav_menu:after {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.slicknav_nav .slicknav_item:hover, .slicknav_nav a:hover {
|
||||
background: none repeat scroll 0 0 #0074BD;
|
||||
border-radius: 0;
|
||||
color: #FFFFFF;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.slicknav_nav .slicknav_arrow i {
|
||||
display: inline-block;
|
||||
background: url("../../images/menu-arrows.svg") no-repeat scroll 0px 3px rgba(0, 0, 0, 0);
|
||||
font-size: 0.8em;
|
||||
height: 16px;
|
||||
margin: 0 0 0 0.4em;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
.slicknav_open .slicknav_arrow i.open {
|
||||
background: url("../../images/menu-arrows.svg") no-repeat scroll -37px 0 rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.slicknav_nav li.admin-menu-toolbar-home-menu {
|
||||
background-color: #333;
|
||||
}
|
||||
|
||||
li.admin-menu-icon.slicknav_parent > a {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
li.admin-menu-icon.slicknav_parent > a > span.slicknav_arrow {
|
||||
position: absolute;
|
||||
margin-top: 10px;
|
||||
margin-left: -5px;
|
||||
}
|
||||
|
||||
.slicknav_nav li.admin-menu-toolbar-home-menu span.admin-menu-home-icon {
|
||||
background: url("../../images/house.svg") no-repeat scroll 17px 10px rgba(0, 0, 0, 0);
|
||||
display: inline-block;
|
||||
height: 40px;
|
||||
width: 50px;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Adminimal Menu Update file 7100.
|
||||
*/
|
||||
|
||||
// Define Adminimal Menu path.
|
||||
$module_path = drupal_get_path('module', 'adminimal_admin_menu');
|
||||
|
||||
// Delete the "adminimal_admin_menu.js" file.
|
||||
file_unmanaged_delete($module_path . '/adminimal_admin_menu.js');
|
||||
|
||||
// Empty the "slicknav" folder.
|
||||
file_unmanaged_delete_recursive($module_path . '/slicknav');
|
||||
|
||||
// Delete the "slicknav" folder.
|
||||
drupal_rmdir($module_path . '/slicknav');
|
||||
Reference in New Issue
Block a user