first import
This commit is contained in:
54
sites/all/modules/admin/includes/admin.devel.css
Normal file
54
sites/all/modules/admin/includes/admin.devel.css
Normal file
@@ -0,0 +1,54 @@
|
||||
div.dev-query,
|
||||
div.dev-timer,
|
||||
div.dev-memory-usage,
|
||||
div.devel-querylog { display:none; }
|
||||
|
||||
.devel-hide { display:none !important; }
|
||||
|
||||
/**
|
||||
* Admin devel block ==================================================
|
||||
*/
|
||||
#block-admin-devel div.dev-info strong {
|
||||
color:#fff;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
#block-admin-devel input.dev-querylog-show,
|
||||
#block-admin-devel input.dev-querylog-hide { margin-top:5px; }
|
||||
#block-admin-devel input.dev-querylog-hide { display:none; }
|
||||
|
||||
#block-admin-devel .marker {
|
||||
color:#f40;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
/* Override menu styling */
|
||||
#admin-toolbar #block-admin-devel { padding-bottom:10px; }
|
||||
|
||||
/**
|
||||
* Query list =========================================================
|
||||
*/
|
||||
div.devel-querylog {
|
||||
border-bottom:1px solid #181818;
|
||||
background:#080808;
|
||||
color:#999;
|
||||
font-size:11px;
|
||||
line-height:15px;
|
||||
position:relative;
|
||||
display:none;
|
||||
}
|
||||
|
||||
div.devel-querylog-header {
|
||||
border:0px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
div.devel-querylog .marker {
|
||||
color:#f40;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.devel-querylog a { color:#fff; }
|
||||
|
||||
div.devel-querylog-even { background:#0c0c0c; }
|
||||
div.devel-querylog-odd { background:#101010; }
|
79
sites/all/modules/admin/includes/admin.devel.inc
Normal file
79
sites/all/modules/admin/includes/admin.devel.inc
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Devel admin block.
|
||||
*/
|
||||
function admin_block_devel() {
|
||||
if (module_exists('devel') && (user_access('access devel information') || user_access('switch users') || user_access('execute php code'))) {
|
||||
drupal_add_css(drupal_get_path('module', 'admin') . '/includes/admin.devel.css');
|
||||
drupal_add_js(drupal_get_path('module', 'admin') . '/includes/admin.devel.js');
|
||||
return array('subject' => t('Devel'), 'content' => drupal_get_form('admin_block_devel_form'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Devel admin block form.
|
||||
*/
|
||||
function admin_block_devel_form($form, $form_state) {
|
||||
$panes = array();
|
||||
if (user_access('access devel information')) {
|
||||
$panes['performance'] = admin_devel_performance_form();
|
||||
}
|
||||
if (user_access('switch users')) {
|
||||
$panes['switch_user'] = array(
|
||||
'#title' => t('Switch user'),
|
||||
'list' => array('#markup' => theme('links', array(
|
||||
'links' => devel_switch_user_list(),
|
||||
'attributes' => array('class' => 'links clearfix'),
|
||||
))),
|
||||
'user' => devel_switch_user_form(),
|
||||
);
|
||||
$panes['switch_user']['user']['#submit'] = array('devel_switch_user_form_submit');
|
||||
}
|
||||
if (user_access('execute php code')) {
|
||||
$panes['execute'] = devel_execute_form() + array('#title' => t('Execute PHP'));
|
||||
$panes['execute']['op']['#submit'] = array('devel_execute_form_submit');
|
||||
}
|
||||
if (user_access('access devel information')) {
|
||||
$panes['menu'] = menu_tree_output(menu_tree_all_data('devel'));
|
||||
$panes['menu']['#title'] = t('Other tools');
|
||||
}
|
||||
if (!empty($panes)) {
|
||||
$panes['#type'] = 'admin_panes';
|
||||
return array('panes' => $panes);
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Performance "form". Actually renders placeholders that are populated post-exit via javascript.
|
||||
*/
|
||||
function admin_devel_performance_form() {
|
||||
$items = array();
|
||||
if (variable_get('dev_timer', 0) && !variable_get('devel_query_display', FALSE)) {
|
||||
$items[] = array(
|
||||
'data' => "<div class='dev-info'></div>",
|
||||
'class' => array('dev-timer'),
|
||||
);
|
||||
}
|
||||
if (variable_get('dev_mem', FALSE) && function_exists('memory_get_usage')) {
|
||||
$items[] = array(
|
||||
'data' => "<div class='dev-info'></div>",
|
||||
'class' => array('dev-memory-usage'),
|
||||
);
|
||||
}
|
||||
if (variable_get('devel_query_display', FALSE)) {
|
||||
$show = "<input type='button' class='form-submit dev-querylog-show' value='" . t('Show querylog') . "'/>";
|
||||
$hide = "<input type='button' class='form-submit dev-querylog-hide' value='" . t('Hide querylog') . "'/>";
|
||||
$items[] = array(
|
||||
'data' => "<div class='dev-info'></div>{$show}{$hide}",
|
||||
'class' => array('dev-query'),
|
||||
);
|
||||
}
|
||||
if ($items) {
|
||||
return array(
|
||||
'#title' => t('Performance'),
|
||||
'#markup' => theme('item_list', array('items' => $items)),
|
||||
);
|
||||
}
|
||||
}
|
36
sites/all/modules/admin/includes/admin.devel.js
Normal file
36
sites/all/modules/admin/includes/admin.devel.js
Normal file
@@ -0,0 +1,36 @@
|
||||
(function($) {
|
||||
|
||||
Drupal.behaviors.adminDevel = {};
|
||||
Drupal.behaviors.adminDevel.attach = function(context) {
|
||||
$('#block-admin-devel:not(.admin-processed)').each(function() {
|
||||
var devel = $(this);
|
||||
devel.addClass('admin-processed');
|
||||
|
||||
// Pull logged values from footer output into the block.
|
||||
$('li', devel).each(function() {
|
||||
var key = $(this).attr('class').split(' ')[0];
|
||||
if (key && $('body > .'+key).size() > 0) {
|
||||
var value = $('body > .'+key).html();
|
||||
$('div.dev-info', this).html(value);
|
||||
}
|
||||
});
|
||||
|
||||
// Query list show handler.
|
||||
$('input.dev-querylog-show', devel).click(function() {
|
||||
$(this).hide().siblings('input.dev-querylog-hide').show();
|
||||
$('body > *:not(#admin-toolbar, .region-page-bottom, .devel-querylog)').addClass('devel-hide');
|
||||
$('body > .devel-querylog').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
// Query list hide handler.
|
||||
$('input.dev-querylog-hide').click(function() {
|
||||
$(this).hide().siblings('input.dev-querylog-show').show();
|
||||
$('body > *:not(#admin-toolbar, .region-page-bottom, .devel-querylog)').removeClass('devel-hide');
|
||||
$('body > .devel-querylog').hide();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
})(jQuery);
|
38
sites/all/modules/admin/includes/admin.menu-rtl.css
Normal file
38
sites/all/modules/admin/includes/admin.menu-rtl.css
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Breadcrumb
|
||||
*/
|
||||
|
||||
div#admin-toolbar div.admin-tab.admin-menu a {
|
||||
background-image:url(../images/sprite-rtl.png);
|
||||
background-position:0% -70px;
|
||||
padding-left:20px;
|
||||
padding-right:0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tooltips
|
||||
*/
|
||||
div#admin-toolbar.horizontal span.menu-description {
|
||||
left:auto;
|
||||
right:60%;
|
||||
padding-left:0;
|
||||
padding-right:20px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu
|
||||
*/
|
||||
#admin-toolbar ul.drilldown-active-menu li {
|
||||
background-image:url(../images/sprite-rtl.png);
|
||||
background-position:100% -85px;
|
||||
}
|
||||
|
||||
#admin-toolbar ul.drilldown-active-menu li.leaf { background-position:100% -110px; }
|
||||
|
||||
#admin-toolbar ul.menu li a {
|
||||
margin-left:0;
|
||||
margin-right:25px;
|
||||
}
|
||||
|
||||
#admin-toolbar.horizontal ul.drilldown-active-menu { float:right; }
|
||||
#admin-toolbar.horizontal ul.drilldown-active-menu li { float:right; }
|
127
sites/all/modules/admin/includes/admin.menu.css
Normal file
127
sites/all/modules/admin/includes/admin.menu.css
Normal file
@@ -0,0 +1,127 @@
|
||||
/**
|
||||
* Breadcrumb
|
||||
*/
|
||||
div#admin-toolbar div.admin-tab.admin-menu #admin-tab-admin-menu {
|
||||
display:block;
|
||||
height:20px;
|
||||
overflow:hidden;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
div#admin-toolbar div.admin-tab a {
|
||||
background:url(../images/sprite.png) 100% -70px no-repeat;
|
||||
padding-right:20px;
|
||||
}
|
||||
|
||||
div#admin-toolbar div.admin-tab a:last-child {
|
||||
background:transparent;
|
||||
padding:0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tooltips
|
||||
*/
|
||||
div#admin-toolbar.vertical div.admin-toolbar-menu-hover div.block-content { bottom:100px; }
|
||||
|
||||
div#admin-toolbar span.menu-description { display:none; }
|
||||
|
||||
div#admin-toolbar a.menu-hover span.menu-description {
|
||||
color:#ccc;
|
||||
display:block;
|
||||
}
|
||||
|
||||
div#admin-toolbar.vertical a.menu-hover span.menu-description {
|
||||
position:absolute;
|
||||
overflow:hidden;
|
||||
left:0px;
|
||||
right:0px;
|
||||
bottom:0px;
|
||||
padding:0px 20px;
|
||||
height:90px;
|
||||
}
|
||||
|
||||
div#admin-toolbar.horizontal a.menu-hover span.menu-description {
|
||||
position:absolute;
|
||||
top:0px;
|
||||
left:60%;
|
||||
width:35%;
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu
|
||||
*/
|
||||
#admin-toolbar ul.menu,
|
||||
#admin-toolbar ul.menu ul,
|
||||
#admin-toolbar ul.menu li,
|
||||
#admin-toolbar ul.menu li a {
|
||||
list-style:none;
|
||||
background:transparent;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
border:0px;
|
||||
}
|
||||
|
||||
/* IE7 */
|
||||
*:first-child+html #admin-toolbar ul.menu,
|
||||
*:first-child+html #admin-toolbar ul.menu ul,
|
||||
*:first-child+html #admin-toolbar ul.menu li,
|
||||
*:first-child+html #admin-toolbar ul.menu li a { overflow:hidden; }
|
||||
|
||||
#admin-toolbar.horizontal ul.drilldown-active-menu {
|
||||
float:left;
|
||||
width:60%;
|
||||
}
|
||||
|
||||
#admin-toolbar.horizontal div.admin-pane ul.drilldown-active-menu {
|
||||
float:none;
|
||||
width:auto;
|
||||
}
|
||||
|
||||
#admin-toolbar.horizontal ul.drilldown-active-menu li {
|
||||
float:left;
|
||||
width:49.9%;
|
||||
}
|
||||
|
||||
#admin-toolbar ul.drilldown-active-menu li { background:url(../images/sprite.png) 0% -85px no-repeat; }
|
||||
|
||||
#admin-toolbar ul.menu li.leaf,
|
||||
#admin-toolbar ul.drilldown-active-menu li.leaf { background:url(../images/sprite.png) 0% -110px no-repeat; }
|
||||
|
||||
#admin-toolbar ul.menu li a {
|
||||
-moz-border-radius:5px;
|
||||
-webkit-border-radius:5px;
|
||||
|
||||
display:block;
|
||||
margin-left:25px;
|
||||
height:15px;
|
||||
padding:5px 10px 4px;
|
||||
border-bottom:1px solid #222;
|
||||
|
||||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
#admin-toolbar ul.menu li a span.menu-description { white-space:normal; }
|
||||
|
||||
/* IE7 requires height to be explicitly set. */
|
||||
#admin-toolbar ul.menu li.leaf,
|
||||
#admin-toolbar ul.drilldown-active-menu li { height:25px; }
|
||||
|
||||
#admin-toolbar ul.menu li a.active { background:#222; }
|
||||
#admin-toolbar ul.menu li a:hover {
|
||||
color:#000;
|
||||
background:url(../images/bleeds.png) 0px -30px repeat-x;
|
||||
}
|
||||
|
||||
/* Drilldown generic styles */
|
||||
.drilldown ul.menu li { display:none !important; }
|
||||
.drilldown ul.menu li a { display:none !important; }
|
||||
.drilldown ul.menu li.drilldown-active-trail { display:block !important; }
|
||||
|
||||
.drilldown ul.drilldown-active-menu li { display:block !important; }
|
||||
.drilldown ul.drilldown-active-menu li a { display:block !important; }
|
||||
.drilldown ul.drilldown-active-menu li ul { display:none !important; }
|
||||
|
||||
.drilldown ul.drilldown-active-menu li.expanded { cursor:pointer; }
|
||||
.drilldown ul.drilldown-active-menu ul.menu li a { display:none !important; }
|
65
sites/all/modules/admin/includes/admin.menu.js
Normal file
65
sites/all/modules/admin/includes/admin.menu.js
Normal file
@@ -0,0 +1,65 @@
|
||||
(function($) {
|
||||
|
||||
Drupal.behaviors.adminToolbarMenu = {};
|
||||
Drupal.behaviors.adminToolbarMenu.attach = function(context) {
|
||||
if (jQuery().drilldown) {
|
||||
$('#admin-toolbar div.admin-block:has(ul.menu):not(.admin-toolbar-menu)')
|
||||
.addClass('admin-toolbar-menu')
|
||||
.each(function() {
|
||||
var menu = $(this);
|
||||
var trail = '#admin-toolbar div.admin-tab.' + $(this).attr('id').split('block-')[1] + ' span';
|
||||
var rootTitle = $(trail).text();
|
||||
|
||||
if ($('a:has(span.menu-description)', menu).size() > 0) {
|
||||
menu.addClass('admin-toolbar-menu-hover');
|
||||
$('a:has(span.menu-description)', menu).hover(
|
||||
function() {
|
||||
$('<a></a>')
|
||||
.attr('class', $(this).attr('class'))
|
||||
.addClass('menu-hover')
|
||||
.addClass('overlay-exclude')
|
||||
.append($('span.menu-description', this).clone())
|
||||
.appendTo(menu)
|
||||
.show();
|
||||
},
|
||||
function() {
|
||||
$(menu)
|
||||
.children('a.menu-hover')
|
||||
.remove();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Replace the standard trail click handler with one that only
|
||||
// adjusts menu if the admin tab is active. Otherwise, switch
|
||||
// to that admin tab.
|
||||
menu.bind('refresh.drilldown', function() {
|
||||
$(trail + ' a').unbind('click').click(function() {
|
||||
if ($(this).parents('div.admin-tab').is('.admin-tab-active')) {
|
||||
var settings = {'activeLink': $(this).data('original'), 'trail': trail};
|
||||
|
||||
// If the clicked link does not reference the current
|
||||
// active menu, set it to be active.
|
||||
if (settings.activeLink.siblings('ul.drilldown-active-menu').size() === 0) {
|
||||
menu.drilldown('setActive', settings);
|
||||
return false;
|
||||
}
|
||||
// Otherwise, pass-through and allow the link to be clicked.
|
||||
return menu.drilldown('goTo', settings);
|
||||
}
|
||||
$(this).parents('div.admin-tab').click();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
// Init drilldown plugin.
|
||||
menu.drilldown('init', {
|
||||
activePath: Drupal.settings.activePath,
|
||||
trail: trail,
|
||||
rootTitle: rootTitle
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
38
sites/all/modules/admin/includes/admin.theme.inc
Normal file
38
sites/all/modules/admin/includes/admin.theme.inc
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Theme switcher admin block.
|
||||
*/
|
||||
function admin_block_theme() {
|
||||
$themes = list_themes();
|
||||
if (count($themes) > 2) {
|
||||
return array(
|
||||
'subject' => t('Switch theme'),
|
||||
'content' => drupal_get_form('admin_block_theme_form', $themes),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Devel admin block form.
|
||||
*/
|
||||
function admin_block_theme_form($form, $form_state, $themes) {
|
||||
$options = array();
|
||||
foreach ($themes as $theme) {
|
||||
if ($theme->status) {
|
||||
$options[$theme->name] = isset($theme->info['name']) ? check_plain($theme->info['name']) : $theme->name;
|
||||
}
|
||||
}
|
||||
$form = array();
|
||||
$form['theme_default'] = array(
|
||||
'#type' => 'radios',
|
||||
'#options' => $options,
|
||||
'#default_value' => variable_get('theme_default', 'garland'),
|
||||
);
|
||||
$form['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Save configuration'),
|
||||
);
|
||||
$form['#submit'] = array('system_settings_form_submit');
|
||||
return $form;
|
||||
}
|
3
sites/all/modules/admin/includes/admin.toolbar-rtl.css
Normal file
3
sites/all/modules/admin/includes/admin.toolbar-rtl.css
Normal file
@@ -0,0 +1,3 @@
|
||||
/**
|
||||
* @TODO: Update RTL support.
|
||||
*/
|
35
sites/all/modules/admin/includes/admin.toolbar.base-rtl.css
Normal file
35
sites/all/modules/admin/includes/admin.toolbar.base-rtl.css
Normal file
@@ -0,0 +1,35 @@
|
||||
div#admin-toolbar.horizontal div.admin-tab {
|
||||
float:right;
|
||||
margin-left:5px;
|
||||
margin-right:0;
|
||||
}
|
||||
|
||||
div#admin-toolbar div.admin-tab-active {
|
||||
-moz-border-radius:5px 0px 0px 5px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Horizontal layout.
|
||||
*/
|
||||
#admin-toolbar.horizontal div.admin-panes {
|
||||
padding-left:0;
|
||||
padding-right:25%;
|
||||
}
|
||||
|
||||
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs {
|
||||
left:auto;
|
||||
right:0px;
|
||||
}
|
||||
|
||||
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a {
|
||||
-moz-border-radius:3px 3px 0px 0px;
|
||||
-webkit-border-top-right-radius:3px;
|
||||
-webkit-border-bottom-right-radius:3px;
|
||||
}
|
||||
|
||||
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a.admin-pane-active {
|
||||
border-width:1px 1px 1px 0px;
|
||||
margin-left:-1px;
|
||||
margin-right:0;
|
||||
}
|
||||
|
472
sites/all/modules/admin/includes/admin.toolbar.base.css
Normal file
472
sites/all/modules/admin/includes/admin.toolbar.base.css
Normal file
@@ -0,0 +1,472 @@
|
||||
|
||||
/**
|
||||
* Admin toolbar CSS resets ===========================================
|
||||
*/
|
||||
|
||||
/* Text */
|
||||
#admin-toolbar,
|
||||
#admin-toolbar h1,
|
||||
#admin-toolbar h2,
|
||||
#admin-toolbar h3,
|
||||
#admin-toolbar h4,
|
||||
#admin-toolbar h5,
|
||||
#admin-toolbar h6,
|
||||
#admin-toolbar p,
|
||||
#admin-toolbar blockquote,
|
||||
#admin-toolbar pre,
|
||||
#admin-toolbar a,
|
||||
#admin-toolbar abbr,
|
||||
#admin-toolbar acronym,
|
||||
#admin-toolbar address,
|
||||
#admin-toolbar big,
|
||||
#admin-toolbar cite,
|
||||
#admin-toolbar code,
|
||||
#admin-toolbar del,
|
||||
#admin-toolbar dfn,
|
||||
#admin-toolbar em,
|
||||
#admin-toolbar font,
|
||||
#admin-toolbar img,
|
||||
#admin-toolbar ins,
|
||||
#admin-toolbar kbd,
|
||||
#admin-toolbar q,
|
||||
#admin-toolbar s,
|
||||
#admin-toolbar samp,
|
||||
#admin-toolbar small,
|
||||
#admin-toolbar strike,
|
||||
#admin-toolbar strong,
|
||||
#admin-toolbar sub,
|
||||
#admin-toolbar sup,
|
||||
#admin-toolbar tt,
|
||||
#admin-toolbar var,
|
||||
#admin-toolbar b,
|
||||
#admin-toolbar u,
|
||||
#admin-toolbar i,
|
||||
#admin-toolbar center,
|
||||
/* Common classes */
|
||||
#admin-toolbar .buttons,
|
||||
/* Lists */
|
||||
#admin-toolbar dl,
|
||||
#admin-toolbar dt,
|
||||
#admin-toolbar dd,
|
||||
#admin-toolbar ol,
|
||||
#admin-toolbar ul,
|
||||
#admin-toolbar li,
|
||||
/* Forms */
|
||||
#admin-toolbar fieldset,
|
||||
#admin-toolbar form,
|
||||
#admin-toolbar input,
|
||||
#admin-toolbar select,
|
||||
#admin-toolbar textarea,
|
||||
#admin-toolbar label,
|
||||
#admin-toolbar legend,
|
||||
/* Tables */
|
||||
#admin-toolbar table,
|
||||
#admin-toolbar caption,
|
||||
#admin-toolbar tbody,
|
||||
#admin-toolbar tfoot,
|
||||
#admin-toolbar thead,
|
||||
#admin-toolbar tr,
|
||||
#admin-toolbar th,
|
||||
#admin-toolbar td,
|
||||
/* Drupal: system.css */
|
||||
#admin-toolbar tr.even,
|
||||
#admin-toolbar tr.odd,
|
||||
#admin-toolbar tr.drag,
|
||||
#admin-toolbar tbody,
|
||||
#admin-toolbar tbody th,
|
||||
#admin-toolbar thead th,
|
||||
#admin-toolbar .breadcrumb,
|
||||
#admin-toolbar .error,
|
||||
#admin-toolbar div.error,
|
||||
#admin-toolbar tr.error,
|
||||
#admin-toolbar .warning,
|
||||
#admin-toolbar div.warning,
|
||||
#admin-toolbar tr.warning,
|
||||
#admin-toolbar .ok,
|
||||
#admin-toolbar div.ok,
|
||||
#admin-toolbar tr.ok,
|
||||
#admin-toolbar .item-list,
|
||||
#admin-toolbar .item-list .icon,
|
||||
#admin-toolbar .item-list .title,
|
||||
#admin-toolbar .item-list ul,
|
||||
#admin-toolbar .item-list ul li,
|
||||
#admin-toolbar ol.task-list li.active,
|
||||
#admin-toolbar .form-item,
|
||||
#admin-toolbar tr.odd .form-item,
|
||||
#admin-toolbar tr.even .form-item,
|
||||
#admin-toolbar tr.merge-down,
|
||||
#admin-toolbar tr.merge-up,
|
||||
#admin-toolbar .form-item .description,
|
||||
#admin-toolbar .form-item label,
|
||||
#admin-toolbar .form-item label.option,
|
||||
#admin-toolbar .form-checkboxes,
|
||||
#admin-toolbar .form-radios,
|
||||
#admin-toolbar .form-checkboxes .form-item,
|
||||
#admin-toolbar .form-radios .form-item,
|
||||
#admin-toolbar .marker,
|
||||
#admin-toolbar .form-required,
|
||||
#admin-toolbar .more-link,
|
||||
#admin-toolbar .more-help-link,
|
||||
#admin-toolbar .item-list .pager,
|
||||
#admin-toolbar .item-list .pager li,
|
||||
#admin-toolbar .pager-current,
|
||||
#admin-toolbar .tips,
|
||||
#admin-toolbar html.js fieldset.collapsible legend a,
|
||||
#admin-toolbar html.js fieldset.collapsed legend a,
|
||||
#admin-toolbar .resizable-textarea {
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
border:0px;
|
||||
outline:0px;
|
||||
font-size:100%;
|
||||
vertical-align:baseline;
|
||||
background:transparent;
|
||||
line-height:inherit;
|
||||
position:static;
|
||||
|
||||
-moz-box-shadow:none;
|
||||
-webkit-box-shadow:none;
|
||||
-moz-border-radius:none;
|
||||
-webkit-border-radius:none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Base styles ========================================================
|
||||
*/
|
||||
div#admin-toolbar {
|
||||
z-index:100;
|
||||
position:fixed;
|
||||
}
|
||||
|
||||
html.overlay-open div#admin-toolbar { z-index:600; }
|
||||
|
||||
/**
|
||||
* Toggling ===========================================================
|
||||
*/
|
||||
div#admin-toolbar div.admin-blocks {
|
||||
overflow:hidden;
|
||||
display:none;
|
||||
}
|
||||
|
||||
body.admin-expanded div#admin-toolbar div.admin-blocks { display:block; }
|
||||
|
||||
div#admin-toolbar.ne,
|
||||
div#admin-toolbar.nw { top:0px; }
|
||||
|
||||
div#admin-toolbar.se,
|
||||
div#admin-toolbar.sw { bottom:0px; }
|
||||
|
||||
div#admin-toolbar.nw,
|
||||
div#admin-toolbar.sw,
|
||||
div#admin-toolbar.nw span.admin-toggle,
|
||||
div#admin-toolbar.sw span.admin-toggle { left:0px; }
|
||||
|
||||
div#admin-toolbar.ne,
|
||||
div#admin-toolbar.se,
|
||||
div#admin-toolbar.ne span.admin-toggle,
|
||||
div#admin-toolbar.se span.admin-toggle { right:0px; }
|
||||
|
||||
/**
|
||||
* Vertical =========================================================
|
||||
*/
|
||||
div#admin-toolbar.vertical {
|
||||
position:fixed;
|
||||
bottom:0px;
|
||||
top:0px;
|
||||
}
|
||||
|
||||
div#admin-toolbar.vertical div.admin-blocks { width:0px; }
|
||||
body.admin-expanded div#admin-toolbar.vertical div.admin-blocks { width:260px; }
|
||||
div#admin-toolbar.vertical div.admin-block { width:240px; }
|
||||
div#admin-toolbar.vertical div.admin-tabs { width:215px; }
|
||||
|
||||
body div#admin-toolbar.vertical div.admin-blocks { position:absolute; top:0px; bottom:0px; }
|
||||
|
||||
body.admin-expanded div#admin-toolbar.vertical.ne div.admin-blocks,
|
||||
body.admin-expanded div#admin-toolbar.vertical.se div.admin-blocks { right:0px; }
|
||||
|
||||
body.admin-expanded div#admin-toolbar.vertical.nw div.admin-blocks,
|
||||
body.admin-expanded div#admin-toolbar.vertical.sw div.admin-blocks { left:0px; }
|
||||
|
||||
body.admin-expanded.admin-vertical.admin-ne,
|
||||
body.admin-expanded.admin-vertical.admin-se { margin-right:260px; }
|
||||
|
||||
body.admin-expanded.admin-vertical.admin-nw,
|
||||
body.admin-expanded.admin-vertical.admin-sw { margin-left:260px; }
|
||||
|
||||
/**
|
||||
* Horizontal =======================================================
|
||||
*/
|
||||
div#admin-toolbar.horizontal { left:0px; right:0px; }
|
||||
body.admin-expanded div#admin-toolbar.horizontal div.admin-blocks { height:260px; }
|
||||
|
||||
body.admin-expanded.admin-horizontal.admin-ne,
|
||||
body.admin-expanded.admin-horizontal.admin-nw { margin-top:260px; }
|
||||
|
||||
body.admin-expanded.admin-horizontal.admin-sw,
|
||||
body.admin-expanded.admin-horizontal.admin-se { margin-bottom:260px; }
|
||||
|
||||
/**
|
||||
* Toggler ============================================================
|
||||
*/
|
||||
div#admin-toolbar span.admin-toggle {
|
||||
display:block;
|
||||
width:35px;
|
||||
height:35px;
|
||||
|
||||
cursor:pointer;
|
||||
overflow:hidden;
|
||||
text-indent:-999px;
|
||||
|
||||
position:absolute;
|
||||
top:0px;
|
||||
z-index:1000;
|
||||
}
|
||||
|
||||
div#admin-toolbar.se span.admin-toggle,
|
||||
div#admin-toolbar.sw span.admin-toggle {
|
||||
position:fixed;
|
||||
bottom:0px;
|
||||
top:auto;
|
||||
}
|
||||
|
||||
body.admin-expanded div#admin-toolbar span.admin-toggle {
|
||||
position:absolute;
|
||||
top:0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin tabs =========================================================
|
||||
*/
|
||||
div#admin-toolbar.horizontal div.admin-tabs {
|
||||
height:30px;
|
||||
padding:5px 10px 0px;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
div#admin-toolbar.vertical div.admin-tabs {
|
||||
position:relative;
|
||||
padding:5px 10px 25px;
|
||||
}
|
||||
|
||||
div#admin-toolbar.ne div.admin-tabs,
|
||||
div#admin-toolbar.se div.admin-tabs { padding-right:35px !important; }
|
||||
|
||||
div#admin-toolbar.nw div.admin-tabs,
|
||||
div#admin-toolbar.sw div.admin-tabs { padding-left:35px !important; }
|
||||
|
||||
div#admin-toolbar div.admin-tab,
|
||||
div#admin-toolbar div.admin-tab span,
|
||||
div#admin-toolbar div.admin-tab a {
|
||||
list-style:none;
|
||||
background:transparent;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
div#admin-toolbar div.admin-tab {
|
||||
cursor:pointer;
|
||||
padding:4px 19px;
|
||||
height:15px;
|
||||
border-width:1px;
|
||||
border-style:solid;
|
||||
}
|
||||
|
||||
div#admin-toolbar.vertical div.admin-tab {
|
||||
overflow:hidden;
|
||||
white-space:nowrap;
|
||||
|
||||
margin-bottom:5px;
|
||||
padding-left:9px;
|
||||
padding-right:9px;
|
||||
width:195px;
|
||||
}
|
||||
|
||||
div#admin-toolbar.horizontal div.admin-tab {
|
||||
float:left;
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
div#admin-toolbar div.admin-tab-active {
|
||||
border-width:1px 1px 0px;
|
||||
padding-bottom:10px;
|
||||
}
|
||||
|
||||
div#admin-toolbar.vertical div.admin-tab-active {
|
||||
padding-bottom:5px;
|
||||
position:absolute;
|
||||
bottom:0px;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin blocks =======================================================
|
||||
*/
|
||||
div#admin-toolbar div.admin-block {
|
||||
position:relative;
|
||||
padding:10px;
|
||||
display:none;
|
||||
}
|
||||
|
||||
div#admin-toolbar div.block-content {
|
||||
overflow-x:hidden;
|
||||
overflow-y:auto;
|
||||
position:absolute;
|
||||
top:10px;
|
||||
left:10px;
|
||||
right:10px;
|
||||
bottom:10px;
|
||||
}
|
||||
|
||||
div#admin-toolbar div.admin-active { display:block; }
|
||||
|
||||
/**
|
||||
* Horizontal =======================================================
|
||||
*/
|
||||
div#admin-toolbar.horizontal div.block-content { height:200px; }
|
||||
|
||||
/**
|
||||
* Vertical =========================================================
|
||||
*/
|
||||
div#admin-toolbar.vertical div.admin-block { position:absolute; bottom:0px; left:0px; right:0px; }
|
||||
div#admin-toolbar.vertical div.admin-blocks-1 div.admin-block { top:30px; }
|
||||
div#admin-toolbar.vertical div.admin-blocks-2 div.admin-block { top:60px; }
|
||||
div#admin-toolbar.vertical div.admin-blocks-3 div.admin-block { top:90px; }
|
||||
div#admin-toolbar.vertical div.admin-blocks-4 div.admin-block { top:120px; }
|
||||
div#admin-toolbar.vertical div.admin-blocks-5 div.admin-block { top:150px; }
|
||||
div#admin-toolbar.vertical div.admin-blocks-6 div.admin-block { top:180px; }
|
||||
div#admin-toolbar.vertical div.admin-blocks-7 div.admin-block { top:210px; }
|
||||
div#admin-toolbar.vertical div.admin-blocks-8 div.admin-block { top:240px; }
|
||||
div#admin-toolbar.vertical div.admin-blocks-9 div.admin-block { top:270px; }
|
||||
div#admin-toolbar.vertical div.admin-blocks-10 div.admin-block { top:300px; }
|
||||
|
||||
/**
|
||||
* Lists ==============================================================
|
||||
*/
|
||||
#admin-toolbar div.item-list li {
|
||||
padding:5px 0px 4px;
|
||||
border-style:solid;
|
||||
border-width:0px 0px 1px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reasonable inline links
|
||||
*/
|
||||
#admin-toolbar ul.links {
|
||||
-moz-border-radius:5px;
|
||||
-webkit-border-radius:5px;
|
||||
padding:5px;
|
||||
}
|
||||
|
||||
#admin-toolbar ul.links li a { padding:2px 10px; }
|
||||
|
||||
/**
|
||||
* Form elements ======================================================
|
||||
*/
|
||||
#admin-toolbar input.form-autocomplete,
|
||||
#admin-toolbar input.form-text,
|
||||
#admin-toolbar textarea.form-textarea,
|
||||
#admin-toolbar select.form-select {
|
||||
padding:2px;
|
||||
border-width:2px;
|
||||
border-style:solid;
|
||||
width:90%;
|
||||
}
|
||||
|
||||
#admin-toolbar input.form-submit {
|
||||
cursor:pointer;
|
||||
padding:2px 5px;
|
||||
text-align:center;
|
||||
font-weight:normal;
|
||||
border-width:1px;
|
||||
border-style:solid;
|
||||
}
|
||||
|
||||
#admin-toolbar.vertical div.admin-panes div.admin-pane,
|
||||
#admin-toolbar div.admin-panes div.admin-pane-active,
|
||||
#admin-toolbar div.fieldset,
|
||||
#admin-toolbar div.form-item {
|
||||
position:relative;
|
||||
margin:0px 0px 5px;
|
||||
border-width:1px;
|
||||
border-style:solid;
|
||||
}
|
||||
|
||||
#admin-toolbar div.form-item { padding:4px; }
|
||||
|
||||
#admin-toolbar div.form-item label {
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
font-weight:bold;
|
||||
font-size:10px;
|
||||
text-transform:uppercase;
|
||||
}
|
||||
|
||||
#admin-toolbar div.form-item label.option {
|
||||
text-transform:none;
|
||||
font-size:11px;
|
||||
}
|
||||
|
||||
#admin-toolbar div.form-item label.option input { vertical-align:middle; }
|
||||
|
||||
#admin-toolbar.vertical div.form-item div.description { font-size:10px; }
|
||||
|
||||
/**
|
||||
* Admin panes ========================================================
|
||||
*/
|
||||
#admin-toolbar div.admin-panes h2.admin-pane-title a {
|
||||
display:block;
|
||||
padding:4px;
|
||||
}
|
||||
|
||||
#admin-toolbar div.admin-panes div.admin-pane-content {
|
||||
padding:4px;
|
||||
display:none;
|
||||
}
|
||||
|
||||
#admin-toolbar div.admin-panes div.admin-pane-active div.admin-pane-content { display:block; }
|
||||
|
||||
#admin-toolbar div.admin-pane div.form-item {
|
||||
border:0px;
|
||||
-moz-border-radius:0px;
|
||||
-webkit-border-radius:0px;
|
||||
padding:5px 0px;
|
||||
margin:0px;
|
||||
background:transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Horizontal layout.
|
||||
*/
|
||||
#admin-toolbar.horizontal div.admin-panes {
|
||||
position:relative;
|
||||
padding-left:200px;
|
||||
}
|
||||
|
||||
#admin-toolbar.horizontal div.admin-panes div.admin-pane {
|
||||
-moz-border-radius:0px;
|
||||
-webkit-border-radius:0px;
|
||||
}
|
||||
|
||||
#admin-toolbar.horizontal div.admin-panes div.admin-pane-content { padding:4px 9px; }
|
||||
|
||||
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs {
|
||||
z-index:500;
|
||||
position:absolute;
|
||||
left:0px;
|
||||
width:200px;
|
||||
}
|
||||
|
||||
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a { padding:5px; }
|
||||
|
||||
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a.admin-pane-active {
|
||||
padding:4px;
|
||||
border-width:1px 0px 1px 1px;
|
||||
border-style:solid;
|
||||
margin-right:-1px;
|
||||
}
|
||||
|
||||
body.toolbar.admin-nw #admin-toolbar,
|
||||
body.toolbar.admin-ne #admin-toolbar {
|
||||
margin-top: 65px;
|
||||
}
|
188
sites/all/modules/admin/includes/admin.toolbar.css
Normal file
188
sites/all/modules/admin/includes/admin.toolbar.css
Normal file
@@ -0,0 +1,188 @@
|
||||
|
||||
/**
|
||||
* Base styles ========================================================
|
||||
*/
|
||||
div#admin-toolbar,
|
||||
div#admin-toolbar * {
|
||||
font:normal 11px/15px "Lucida Grande",Tahoma,Verdana,sans-serif;
|
||||
color:#ccc;
|
||||
}
|
||||
|
||||
div#admin-toolbar a {
|
||||
text-decoration:none;
|
||||
color:#fff;
|
||||
font-weight:normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toolbar background =================================================
|
||||
*/
|
||||
div#admin-toolbar div.admin-blocks { background:url(../images/black.png) 0px 35px repeat-x; }
|
||||
div#admin-toolbar.vertical div.admin-blocks { background-color:#000; }
|
||||
|
||||
/**
|
||||
* Toggle =============================================================
|
||||
*/
|
||||
div#admin-toolbar span.admin-toggle { background:url(../images/sprite.png) 0px 0px no-repeat; }
|
||||
|
||||
/* Positions */
|
||||
div#admin-toolbar.nw span.admin-toggle { background-position:0px 0px; }
|
||||
div#admin-toolbar.ne span.admin-toggle { background-position:-35px 0px; }
|
||||
div#admin-toolbar.se span.admin-toggle { background-position:-70px 0px; }
|
||||
div#admin-toolbar.sw span.admin-toggle { background-position:-105px 0px; }
|
||||
|
||||
/* Expanded */
|
||||
body.admin-expanded div#admin-toolbar span.admin-toggle { background-position:0px -35px; }
|
||||
|
||||
/**
|
||||
* Tabs ===============================================================
|
||||
*/
|
||||
div#admin-toolbar div.admin-tabs { background:#222 url(../images/bleeds.png) 0px 100% repeat-x; }
|
||||
|
||||
div#admin-toolbar div.admin-tab {
|
||||
-moz-border-radius:5px;
|
||||
-moz-box-shadow: #333 0px 1px 0px;
|
||||
-webkit-border-radius:5px;
|
||||
-webkit-box-shadow: #333 0px 1px 0px;
|
||||
text-shadow: #222 0px 1px 0px;
|
||||
|
||||
background:url(../images/bleeds.png) 0px 0px repeat-x;
|
||||
cursor:pointer;
|
||||
border-color:#111;
|
||||
}
|
||||
|
||||
div#admin-toolbar div.admin-tab,
|
||||
div#admin-toolbar div.admin-tab a { color:#999; }
|
||||
|
||||
div#admin-toolbar div.admin-tab-active {
|
||||
-moz-border-radius:5px 5px 0px 0px;
|
||||
-moz-box-shadow: none;
|
||||
|
||||
-webkit-border-radius:0px;
|
||||
-webkit-border-top-left-radius:5px;
|
||||
-webkit-border-top-right-radius:5px;
|
||||
-webkit-box-shadow: none;
|
||||
|
||||
background:#000;
|
||||
border-color:#555 #333;
|
||||
}
|
||||
|
||||
div#admin-toolbar div.admin-tab:hover,
|
||||
div#admin-toolbar div.admin-tab-active,
|
||||
div#admin-toolbar div.admin-tab-active a { color:#fff; }
|
||||
|
||||
/**
|
||||
* Drupal elements ====================================================
|
||||
*/
|
||||
|
||||
/* Lists */
|
||||
#admin-toolbar div.item-list li { border-color:#222; }
|
||||
|
||||
/* Links */
|
||||
#admin-toolbar ul.links { background:#111; }
|
||||
|
||||
#admin-toolbar ul.links li a {
|
||||
-moz-border-radius:3px;
|
||||
-webkit-border-radius:3px;
|
||||
background:#333;
|
||||
}
|
||||
|
||||
#admin-toolbar ul.links li a:hover {
|
||||
background:#eee;
|
||||
color:#333;
|
||||
}
|
||||
|
||||
/**
|
||||
* Form elements ======================================================
|
||||
*/
|
||||
#admin-toolbar input.form-autocomplete,
|
||||
#admin-toolbar input.form-text,
|
||||
#admin-toolbar textarea.form-textarea,
|
||||
#admin-toolbar select.form-select {
|
||||
border-color:#000;
|
||||
background:#000;
|
||||
color:#999;
|
||||
}
|
||||
|
||||
#admin-toolbar input.form-autocomplete:hover,
|
||||
#admin-toolbar input.form-text:hover,
|
||||
#admin-toolbar textarea.form-textarea:hover,
|
||||
#admin-toolbar select.form-select:hover,
|
||||
#admin-toolbar div.form-item:hover input.form-autocomplete,
|
||||
#admin-toolbar div.form-item:hover input.form-text,
|
||||
#admin-toolbar div.form-item:hover textarea.form-textarea,
|
||||
#admin-toolbar div.form-item:hover select.form-select,
|
||||
#admin-toolbar input.form-autocomplete:focus,
|
||||
#admin-toolbar input.form-text:focus,
|
||||
#admin-toolbar textarea.form-textarea:focus,
|
||||
#admin-toolbar select.form-select:focus {
|
||||
color:#fff;
|
||||
border-color:#333;
|
||||
}
|
||||
|
||||
#admin-toolbar input.form-submit {
|
||||
color:#999;
|
||||
border-color:#555 #444 #333;
|
||||
background:#222 url(../images/bleeds.png) 0px 100% repeat-x;
|
||||
-moz-border-radius:3px;
|
||||
-webkit-border-radius:3px;
|
||||
}
|
||||
|
||||
#admin-toolbar input.form-submit:hover {
|
||||
border-color:#aaa #888 #666;
|
||||
background:#444 url(../images/bleeds.png) 0px 0px repeat-x;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
#admin-toolbar input.form-submit:active {
|
||||
border-color:#333;
|
||||
background:#111;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
#admin-toolbar.vertical div.admin-panes div.admin-pane,
|
||||
#admin-toolbar div.admin-panes div.admin-pane-active,
|
||||
#admin-toolbar div.fieldset,
|
||||
#admin-toolbar div.form-item {
|
||||
background:#111;
|
||||
border-color:#222;
|
||||
-moz-border-radius:3px;
|
||||
-webkit-border-radius:3px;
|
||||
}
|
||||
|
||||
#admin-toolbar div.form-item { padding:4px; }
|
||||
|
||||
#admin-toolbar div.form-item div.description,
|
||||
#admin-toolbar div.form-item label { color:#999; }
|
||||
|
||||
/**
|
||||
* Admin panes ========================================================
|
||||
*/
|
||||
#admin-toolbar div.admin-panes div.admin-pane:hover,
|
||||
#admin-toolbar div.admin-panes div.admin-pane-active,
|
||||
#admin-toolbar.vertical div.admin-panes div.admin-pane-active {
|
||||
background:#222;
|
||||
border-color:#333;
|
||||
}
|
||||
|
||||
#admin-toolbar div.admin-panes h2.admin-pane-title a { color:#666; }
|
||||
#admin-toolbar div.admin-panes h2.admin-pane-title a:hover,
|
||||
#admin-toolbar div.admin-panes h2.admin-pane-title a.admin-pane-active { color:#fff; }
|
||||
|
||||
#admin-toolbar div.admin-pane div.item-list li { border-color:#333; }
|
||||
|
||||
/* Horizontal */
|
||||
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a {
|
||||
-moz-border-radius:3px 0px 0px 3px;
|
||||
-webkit-border-top-left-radius:3px;
|
||||
-webkit-border-bottom-left-radius:3px;
|
||||
}
|
||||
|
||||
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a.admin-pane-active {
|
||||
background:#222;
|
||||
border-color:#333;
|
||||
}
|
||||
|
||||
body.toolbar #admin-toolbar.vertical {
|
||||
margin-top: 65px;
|
||||
}
|
257
sites/all/modules/admin/includes/admin.toolbar.js
Normal file
257
sites/all/modules/admin/includes/admin.toolbar.js
Normal file
@@ -0,0 +1,257 @@
|
||||
(function($) {
|
||||
|
||||
Drupal.behaviors.adminToolbar = {};
|
||||
Drupal.behaviors.adminToolbar.attach = function(context) {
|
||||
$('#admin-toolbar:not(.processed)').each(function() {
|
||||
var toolbar = $(this);
|
||||
toolbar.addClass('processed');
|
||||
|
||||
// Set initial toolbar state.
|
||||
Drupal.adminToolbar.init(toolbar);
|
||||
|
||||
// Admin toggle.
|
||||
$('.admin-toggle', this).click(function() { Drupal.adminToolbar.toggle(toolbar); });
|
||||
|
||||
// Admin tabs.
|
||||
$('div.admin-tab', this).click(function() { Drupal.adminToolbar.tab(toolbar, $(this), true); });
|
||||
|
||||
$(document).bind('drupalOverlayLoad', {adminToolbar: Drupal.adminToolbar, toolbar: toolbar}, function(event) {
|
||||
var body = $(document.body);
|
||||
var adminToolbar = event.data.adminToolbar;
|
||||
var expand = parseInt(adminToolbar.getState('expanded'));
|
||||
if (!expand) {
|
||||
return;
|
||||
}
|
||||
var toolbar = event.data.toolbar;
|
||||
var size = adminToolbar.SIZE + 'px';
|
||||
adminToolbar.setOverlayState(toolbar, toolbar.is('.vertical'), expand);
|
||||
});
|
||||
});
|
||||
$('div.admin-panes:not(.processed)').each(function() {
|
||||
var panes = $(this);
|
||||
panes.addClass('processed');
|
||||
|
||||
$('h2.admin-pane-title a').click(function() {
|
||||
var target = $(this).attr('href').split('#')[1];
|
||||
var panes = $(this).parents('div.admin-panes')[0];
|
||||
$('.admin-pane-active', panes).removeClass('admin-pane-active');
|
||||
$('div.admin-pane.' + target, panes).addClass('admin-pane-active');
|
||||
$(this).addClass('admin-pane-active');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Admin toolbar methods.
|
||||
*/
|
||||
Drupal.adminToolbar = {};
|
||||
|
||||
/**
|
||||
* The width or height of the toolbar, depending on orientation.
|
||||
*/
|
||||
Drupal.adminToolbar.SIZE = 260;
|
||||
|
||||
/**
|
||||
* Set the initial state of the toolbar.
|
||||
*/
|
||||
Drupal.adminToolbar.init = function (toolbar) {
|
||||
// Set expanded state.
|
||||
var expanded = this.getState('expanded');
|
||||
if (!$(document.body).hasClass('admin-ah')) {
|
||||
if (expanded == 1) {
|
||||
$(document.body).addClass('admin-expanded');
|
||||
}
|
||||
}
|
||||
|
||||
// Set default tab state.
|
||||
var target = this.getState('activeTab');
|
||||
if (target) {
|
||||
if ($('div.admin-tab.'+target).size() > 0) {
|
||||
var tab = $('div.admin-tab.'+target);
|
||||
this.tab(toolbar, tab, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Add layout class to body.
|
||||
var classes = toolbar.attr('class').split(' ');
|
||||
if (classes[0] === 'nw' || classes[0] === 'ne' || classes[0] === 'se' || classes[0] === 'sw' ) {
|
||||
$(document.body).addClass('admin-'+classes[0]);
|
||||
}
|
||||
if (classes[1] === 'horizontal' || classes[1] === 'vertical') {
|
||||
$(document.body).addClass('admin-'+classes[1]);
|
||||
}
|
||||
if (classes[2] === 'df' || classes[2] === 'ah') {
|
||||
$(document.body).addClass('admin-'+classes[2]);
|
||||
}
|
||||
|
||||
var vertical = true;
|
||||
if(classes[1] === 'horizontal') {
|
||||
vertical = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the active tab.
|
||||
*/
|
||||
Drupal.adminToolbar.tab = function(toolbar, tab, animate) {
|
||||
if (!tab.is('.admin-tab-active')) {
|
||||
var target = $('span', tab).attr('id').split('admin-tab-')[1];
|
||||
|
||||
// Vertical
|
||||
// Use animations to make the vertical tab transition a bit smoother.
|
||||
if (toolbar.is('.vertical') && animate) {
|
||||
$('.admin-tab-active', toolbar).fadeOut('fast');
|
||||
$(tab).fadeOut('fast', function() {
|
||||
$('.admin-tab-active', toolbar).fadeIn('fast').removeClass('admin-tab-active');
|
||||
$(tab).slideDown('fast').addClass('admin-tab-active');
|
||||
Drupal.adminToolbar.setState('activeTab', target);
|
||||
});
|
||||
}
|
||||
// Horizontal
|
||||
// Tabs don't need animation assistance.
|
||||
else {
|
||||
$('div.admin-tab', toolbar).removeClass('admin-tab-active');
|
||||
$(tab, toolbar).addClass('admin-tab-active');
|
||||
Drupal.adminToolbar.setState('activeTab', target);
|
||||
}
|
||||
|
||||
// Blocks
|
||||
$('div.admin-block.admin-active', toolbar).removeClass('admin-active');
|
||||
$('#block-'+target, toolbar).addClass('admin-active');
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the width/height of the of the overlay body based on the state admin toolbar.
|
||||
*
|
||||
* @param vertical
|
||||
* A boolean indicating if the toolbar is vertical.
|
||||
* @param expanded
|
||||
* A boolean indicating if the toolbar is expanded.
|
||||
*/
|
||||
Drupal.adminToolbar.setOverlayState = function(toolbar, vertical, expanded) {
|
||||
var margin,
|
||||
size = this.SIZE + 65;
|
||||
if (!expanded) {
|
||||
size = 0;
|
||||
}
|
||||
|
||||
margin = {marginLeft: size+'px'};
|
||||
if (vertical) {
|
||||
if (toolbar.is('.ne') || toolbar.is('.se')) {
|
||||
margin = {marginRight: size+'px'}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (toolbar.is('.ne') || toolbar.is('.nw')) {
|
||||
margin = {marginTop: size+'px'};
|
||||
}
|
||||
else {
|
||||
margin = {marginBottom: size+'px'};
|
||||
}
|
||||
}
|
||||
$('iframe.overlay-element').contents().find('body').animate(margin, 'fast');
|
||||
};
|
||||
|
||||
/**
|
||||
* Toggle the toolbar open or closed.
|
||||
*/
|
||||
Drupal.adminToolbar.toggle = function (toolbar) {
|
||||
var size = '0px';
|
||||
if ($(document.body).is('.admin-expanded')) {
|
||||
if ($(toolbar).is('.vertical')) {
|
||||
$('div.admin-blocks', toolbar).animate({width:size}, 'fast');
|
||||
if ($(toolbar).is('.nw') || $(toolbar).is('.sw')) {
|
||||
$(document.body).animate({marginLeft:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
|
||||
}
|
||||
else {
|
||||
$(document.body).animate({marginRight:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
|
||||
}
|
||||
this.setOverlayState(toolbar, true, false);
|
||||
}
|
||||
else {
|
||||
$('div.admin-blocks', toolbar).animate({height:size}, 'fast');
|
||||
if ($(toolbar).is('.nw') || $(toolbar).is('.ne')) {
|
||||
$(document.body).animate({marginTop:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
|
||||
}
|
||||
else {
|
||||
$(document.body).animate({marginBottom:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
|
||||
}
|
||||
this.setOverlayState(toolbar, false, false);
|
||||
}
|
||||
this.setState('expanded', 0);
|
||||
}
|
||||
else {
|
||||
size = this.SIZE + 'px';
|
||||
if ($(toolbar).is('.vertical')) {
|
||||
$('div.admin-blocks', toolbar).animate({width:size}, 'fast');
|
||||
if ($(toolbar).is('.nw') || $(toolbar).is('.sw')) {
|
||||
$(document.body).animate({marginLeft:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
|
||||
}
|
||||
else {
|
||||
$(document.body).animate({marginRight:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
|
||||
}
|
||||
this.setOverlayState(toolbar, true, true);
|
||||
}
|
||||
else {
|
||||
$('div.admin-blocks', toolbar).animate({height:size}, 'fast');
|
||||
if ($(toolbar).is('.nw') || $(toolbar).is('.ne')) {
|
||||
$(document.body).animate({marginTop:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
|
||||
}
|
||||
else {
|
||||
$(document.body).animate({marginBottom:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
|
||||
}
|
||||
this.setOverlayState(toolbar, false, true);
|
||||
}
|
||||
if ($(document.body).hasClass('admin-ah')) {
|
||||
this.setState('expanded', 0);
|
||||
}
|
||||
else {
|
||||
this.setState('expanded', 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the value of a cookie variable.
|
||||
*/
|
||||
Drupal.adminToolbar.getState = function(key) {
|
||||
if (!Drupal.adminToolbar.state) {
|
||||
Drupal.adminToolbar.state = {};
|
||||
var cookie = $.cookie('DrupalAdminToolbar');
|
||||
var query = cookie ? cookie.split('&') : [];
|
||||
if (query) {
|
||||
for (var i in query) {
|
||||
// Extra check to avoid js errors in Chrome, IE and Safari when
|
||||
// combined with JS like twitter's widget.js.
|
||||
// See http://drupal.org/node/798764.
|
||||
if (typeof(query[i]) == 'string' && query[i].indexOf('=') != -1) {
|
||||
var values = query[i].split('=');
|
||||
if (values.length === 2) {
|
||||
Drupal.adminToolbar.state[values[0]] = values[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Drupal.adminToolbar.state[key] ? Drupal.adminToolbar.state[key] : false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the value of a cookie variable.
|
||||
*/
|
||||
Drupal.adminToolbar.setState = function(key, value) {
|
||||
var existing = Drupal.adminToolbar.getState(key);
|
||||
if (existing != value) {
|
||||
Drupal.adminToolbar.state[key] = value;
|
||||
var query = [];
|
||||
for (var i in Drupal.adminToolbar.state) {
|
||||
query.push(i + '=' + Drupal.adminToolbar.state[i]);
|
||||
}
|
||||
$.cookie('DrupalAdminToolbar', query.join('&'), {expires: 7, path: '/'});
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
165
sites/all/modules/admin/includes/jquery.drilldown.js
Normal file
165
sites/all/modules/admin/includes/jquery.drilldown.js
Normal file
@@ -0,0 +1,165 @@
|
||||
|
||||
/**
|
||||
* Generic menu drilldown plugin for standard Drupal menu tree markup.
|
||||
* The plugin should be inited against a DOM element that *contains*
|
||||
* a Drupal ul.menu tree. Example:
|
||||
*
|
||||
* $('div.block-menu').drilldown('init', params);
|
||||
*
|
||||
* You must provide the following parameters as settings:
|
||||
*
|
||||
* var params = {
|
||||
* activePath : A drupal menu path that is currently active including the basePath e.g. "/mysite/node"
|
||||
* trail : A jquery selector to the DOM element that should act as the trail container, e.g. "div.my-menu-breadcrumb-trail"
|
||||
* rootTitle : The title to use for the root menu item if the menu does not already possess one. Optional.
|
||||
* }
|
||||
*
|
||||
*/
|
||||
(function($) {
|
||||
$.fn.drilldown = function(method, settings) {
|
||||
var menu = this;
|
||||
var activePath;
|
||||
var rootTitle = settings.rootTitle || 'Home';
|
||||
|
||||
switch (method) {
|
||||
case 'goTo':
|
||||
// If the passed link refers to the current page, don't follow through
|
||||
// the link.
|
||||
if (this.activePath && this.activePath === $(settings.activeLink).attr('href')) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case 'setActive':
|
||||
var breadcrumb = [];
|
||||
var activeMenu;
|
||||
|
||||
$(settings.activeLink).each(function() {
|
||||
// Traverse backwards through menu parents and build breadcrumb array.
|
||||
$(this).parents('ul.menu').each(function() {
|
||||
if ($(this).parents('ul.menu').size() > 0) {
|
||||
$(this).siblings('a').each(function() {
|
||||
breadcrumb.unshift($(this));
|
||||
});
|
||||
}
|
||||
// If this is a root menu with no root link to accompany it,
|
||||
// generate one such that the breadcrumb may reference it.
|
||||
else if ($(this).children('li').size() > 1) {
|
||||
var root;
|
||||
if ($(this).siblings('a.drilldown-root').size() > 0) {
|
||||
root = $(this).siblings('a.drilldown-root');
|
||||
}
|
||||
else {
|
||||
root = $('<a href="#" class="drilldown-root" style="display:none">'+rootTitle+'</a>');
|
||||
$(this).before(root);
|
||||
}
|
||||
breadcrumb.unshift(root);
|
||||
}
|
||||
});
|
||||
|
||||
// If we have a child menu (actually a sibling in the DOM), use it
|
||||
// as the active menu. Otherwise treat our direct parent as the
|
||||
// active menu.
|
||||
if ($(this).next().is('ul.menu')) {
|
||||
activeMenu = $(this).next();
|
||||
breadcrumb.push($(this));
|
||||
}
|
||||
else {
|
||||
activeMenu = $(this).parents('ul.menu').eq(0);
|
||||
}
|
||||
if (activeMenu) {
|
||||
$('.drilldown-active-trail', menu).removeClass('drilldown-active-trail');
|
||||
$('ul.menu', menu).removeClass('drilldown-active-menu').removeClass('clearfix');
|
||||
$(activeMenu)
|
||||
.addClass('drilldown-active-menu').addClass('clearfix')
|
||||
.parents('li').addClass('drilldown-active-trail').show();
|
||||
}
|
||||
});
|
||||
|
||||
// Render the breadcrumb to the target DOM object
|
||||
if (breadcrumb.length > 0) {
|
||||
var trail = $(settings.trail);
|
||||
trail.empty();
|
||||
for (var key in breadcrumb) {
|
||||
if (breadcrumb[key]) {
|
||||
// We don't use the $().clone() method here because of an
|
||||
// IE & jQuery 1.2 bug.
|
||||
var clone = $('<a></a>')
|
||||
.attr('href', $(breadcrumb[key]).attr('href'))
|
||||
.attr('class', $(breadcrumb[key]).attr('class'))
|
||||
.html($(breadcrumb[key]).html())
|
||||
.addClass('depth-'+key)
|
||||
.appendTo(trail);
|
||||
|
||||
// We add a reference to the original link and a click handler
|
||||
// that traces back to that instance to set as the active link.
|
||||
$('a.depth-'+key, trail)
|
||||
.data('original', $(breadcrumb[key]))
|
||||
.click(function() {
|
||||
settings.activeLink = $(this).data('original');
|
||||
// If the clicked link does not reference the current
|
||||
// active menu, set it to be active.
|
||||
if (settings.activeLink.siblings('ul.drilldown-active-menu').size() === 0) {
|
||||
menu.drilldown('setActive', settings);
|
||||
return false;
|
||||
}
|
||||
// Otherwise, pass-through and allow the link to be clicked.
|
||||
return menu.drilldown('goTo', settings);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Event in case others need to update themselves when a new active
|
||||
// link is set.
|
||||
$(menu).trigger('refresh.drilldown');
|
||||
break;
|
||||
case 'init':
|
||||
if ($('ul.menu ul.menu', menu).size() > 0) {
|
||||
$(menu).addClass('drilldown');
|
||||
$(settings.trail).addClass('drilldown-trail');
|
||||
|
||||
// Set initial active menu state.
|
||||
var activeLink;
|
||||
$('ul.menu a', menu).removeClass('active');
|
||||
if (settings.activePath && $('ul.menu a[href="'+settings.activePath+'"]', menu).size() > 0) {
|
||||
this.activePath = settings.activePath;
|
||||
activeLink = $('ul.menu a[href="'+settings.activePath+'"]', menu).addClass('active');
|
||||
}
|
||||
if (!activeLink) {
|
||||
activeLink = $('ul.menu a.active', menu).size() ? $('ul.menu a.active', menu) : $('ul.menu > li > a', menu);
|
||||
}
|
||||
if (activeLink) {
|
||||
menu.drilldown('setActive', {
|
||||
activeLink: $(activeLink[0]),
|
||||
trail: settings.trail,
|
||||
rootTitle: rootTitle
|
||||
});
|
||||
}
|
||||
|
||||
// Attach click handlers to menu items
|
||||
$('ul.menu li:has(ul.menu)', this).click(function() {
|
||||
if ($(this).parent().is('.drilldown-active-menu')) {
|
||||
if (menu.data('disableMenu')) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
var url = $(this).children('a').attr('href');
|
||||
var activeLink = $('ul.menu a[href="'+url+'"]', menu);
|
||||
menu.drilldown('setActive', {
|
||||
activeLink: activeLink,
|
||||
trail: settings.trail,
|
||||
rootTitle: rootTitle
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
$('ul.menu li:has(ul.menu) a', menu).click(function() {
|
||||
menu.data('disableMenu', true);
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
})(jQuery);
|
Reference in New Issue
Block a user