uppdated modules
This commit is contained in:
@@ -1,22 +1,33 @@
|
||||
(function($) {
|
||||
'use strict';
|
||||
|
||||
// Define jRespond Media queries.
|
||||
var jRes = jRespond([
|
||||
{
|
||||
label: 'mobile',
|
||||
enter: 0,
|
||||
exit: 480
|
||||
},{
|
||||
label: 'tablet',
|
||||
enter: 481,
|
||||
exit: 979
|
||||
},{
|
||||
label: 'desktop',
|
||||
enter: 980,
|
||||
exit: 9999
|
||||
}
|
||||
{
|
||||
label: 'mobile',
|
||||
enter: 0,
|
||||
exit: 480
|
||||
},{
|
||||
label: 'tablet',
|
||||
enter: 481,
|
||||
exit: 979
|
||||
},{
|
||||
label: 'desktop',
|
||||
enter: 980,
|
||||
exit: 9999
|
||||
}
|
||||
]);
|
||||
|
||||
// Detect Operating system and add class to the body.
|
||||
Drupal.behaviors.adminimal_os_class = {
|
||||
attach: function (context, settings) {
|
||||
// Detect if OS is mac based.
|
||||
if (navigator.userAgent.indexOf('Mac OS X') != -1) {
|
||||
$("body").addClass("mac");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Modify the Search field for module filter.
|
||||
Drupal.behaviors.adminimal_module_filter_box = {
|
||||
attach: function (context, settings) {
|
||||
@@ -28,63 +39,63 @@ Drupal.behaviors.adminimal_module_filter_box = {
|
||||
// Fix some krumo styling.
|
||||
Drupal.behaviors.krumo_remove_class = {
|
||||
attach: function (context, settings) {
|
||||
// Find status messages that has krumo div inside them, and change the classes.
|
||||
// Find status messages that has krumo div inside them, and change the classes.
|
||||
$('#console .messages.status').has("div.krumo-root").removeClass().addClass( "krumo-wrapper" );
|
||||
}
|
||||
};
|
||||
|
||||
// Add media query classes to the body tag.
|
||||
Drupal.behaviors.adminimal_media_queries = {
|
||||
attach: function (context, settings) {
|
||||
jRes.addFunc([
|
||||
{
|
||||
breakpoint: 'mobile',
|
||||
enter: function() {
|
||||
$( "body" ).addClass( "mq-mobile" );
|
||||
},
|
||||
exit: function() {
|
||||
$( "body" ).removeClass( "mq-mobile" );
|
||||
}
|
||||
},{
|
||||
breakpoint: 'tablet',
|
||||
enter: function() {
|
||||
$( "body" ).addClass( "mq-tablet" );
|
||||
},
|
||||
exit: function() {
|
||||
$( "body" ).removeClass( "mq-tablet" );
|
||||
}
|
||||
},{
|
||||
breakpoint: 'desktop',
|
||||
enter: function() {
|
||||
$( "body" ).addClass( "mq-desktop" );
|
||||
},
|
||||
exit: function() {
|
||||
$( "body" ).removeClass( "mq-desktop" );
|
||||
}
|
||||
}
|
||||
]);
|
||||
}
|
||||
attach: function (context, settings) {
|
||||
jRes.addFunc([
|
||||
{
|
||||
breakpoint: 'mobile',
|
||||
enter: function() {
|
||||
$( "body" ).addClass( "mq-mobile" );
|
||||
},
|
||||
exit: function() {
|
||||
$( "body" ).removeClass( "mq-mobile" );
|
||||
}
|
||||
},{
|
||||
breakpoint: 'tablet',
|
||||
enter: function() {
|
||||
$( "body" ).addClass( "mq-tablet" );
|
||||
},
|
||||
exit: function() {
|
||||
$( "body" ).removeClass( "mq-tablet" );
|
||||
}
|
||||
},{
|
||||
breakpoint: 'desktop',
|
||||
enter: function() {
|
||||
$( "body" ).addClass( "mq-desktop" );
|
||||
},
|
||||
exit: function() {
|
||||
$( "body" ).removeClass( "mq-desktop" );
|
||||
}
|
||||
}
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
||||
// Move the active primary tab on mobile to be displayed last.
|
||||
// Move the active primary tab on mobile to be displayed last.
|
||||
Drupal.behaviors.adminimal_move_active_primary_tab = {
|
||||
attach: function (context, settings) {
|
||||
// Add primary tabs class to the branding div for the bottom border.
|
||||
attach: function (context, settings) {
|
||||
// Add primary tabs class to the branding div for the bottom border.
|
||||
$('#branding').has("ul.tabs.primary").addClass( "has-primary-tabs" );
|
||||
|
||||
// register enter and exit functions for a single breakpoint
|
||||
jRes.addFunc({
|
||||
breakpoint: 'mobile',
|
||||
enter: function() {
|
||||
$( "ul.tabs.primary li.active" ).clone().appendTo( "ul.tabs.primary" ).removeClass( "active" ).addClass( "current" );
|
||||
$( "ul.tabs.primary li.active" ).css("display", "none");
|
||||
},
|
||||
exit: function() {
|
||||
$( "ul.tabs.primary li.active" ).css("display", "table");
|
||||
$( "ul.tabs.primary li.current" ).css("display", "none");
|
||||
}
|
||||
});
|
||||
}
|
||||
// register enter and exit functions for a single breakpoint
|
||||
jRes.addFunc({
|
||||
breakpoint: 'mobile',
|
||||
enter: function() {
|
||||
$( "ul.tabs.primary li.active" ).clone().appendTo( "ul.tabs.primary" ).removeClass( "active" ).addClass( "current" );
|
||||
$( "ul.tabs.primary li.active" ).css("display", "none");
|
||||
},
|
||||
exit: function() {
|
||||
$( "ul.tabs.primary li.active" ).css("display", "table");
|
||||
$( "ul.tabs.primary li.current" ).css("display", "none");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
(function($) {
|
||||
|
||||
Drupal.behaviors.moduleFilterUpdateStatus = {
|
||||
attach: function(context) {
|
||||
$('#module-filter-update-status-form').once('update-status', function() {
|
||||
var filterInput = $('input[name="module_filter[name]"]', context);
|
||||
filterInput.moduleFilter('table.update > tbody > tr', {
|
||||
wrapper: $('table.update:first').parent(),
|
||||
delay: 300,
|
||||
childSelector: 'div.project a',
|
||||
rules: [
|
||||
function(moduleFilter, item) {
|
||||
switch (moduleFilter.options.show) {
|
||||
case 'all':
|
||||
return true;
|
||||
case 'updates':
|
||||
if (item.state == 'warning' || item.state == 'error') {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'security':
|
||||
if (item.state == 'error') {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'ignore':
|
||||
if (item.state == 'ignored') {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'unknown':
|
||||
if (item.state == 'unknown') {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
],
|
||||
buildIndex: [
|
||||
function(moduleFilter, item) {
|
||||
if ($('.version-status', item.element).text() == Drupal.t('Ignored from settings')) {
|
||||
item.state = 'ignored';
|
||||
return item;
|
||||
}
|
||||
if (item.element.is('.ok')) {
|
||||
item.state = 'ok';
|
||||
}
|
||||
else if (item.element.is('.warning')) {
|
||||
item.state = 'warning';
|
||||
}
|
||||
else if (item.element.is('.error')) {
|
||||
item.state = 'error';
|
||||
}
|
||||
else if (item.element.is('.unknown')) {
|
||||
item.state = 'unknown';
|
||||
}
|
||||
return item;
|
||||
}
|
||||
],
|
||||
show: $('#edit-module-filter-show input[name="module_filter[show]"]', context).val()
|
||||
});
|
||||
|
||||
var moduleFilter = filterInput.data('moduleFilter');
|
||||
|
||||
if (Drupal.settings.moduleFilter.rememberUpdateState) {
|
||||
var updateShow = Drupal.ModuleFilter.getState('updateShow');
|
||||
if (updateShow) {
|
||||
moduleFilter.options.show = updateShow;
|
||||
$('#edit-module-filter-show input[name="module_filter[show]"][value="' + updateShow + '"]', context).click();
|
||||
}
|
||||
}
|
||||
|
||||
$('#edit-module-filter-show input[name="module_filter[show]"]', context).change(function() {
|
||||
moduleFilter.options.show = $(this).val();
|
||||
Drupal.ModuleFilter.setState('updateShow', moduleFilter.options.show);
|
||||
moduleFilter.applyFilter();
|
||||
});
|
||||
|
||||
moduleFilter.element.bind('moduleFilter:start', function() {
|
||||
$('.overflow-fix').has('table.update').each(function() {
|
||||
$(this).show().prev('h3').show();
|
||||
});
|
||||
});
|
||||
|
||||
moduleFilter.element.bind('moduleFilter:finish', function(e, data) {
|
||||
$('.overflow-fix').has('table.update').each(function() {
|
||||
var $table = $(this);
|
||||
if ($('tbody tr', $(this)).filter(':visible').length == 0) {
|
||||
$table.hide().prev('h3').hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
moduleFilter.element.bind('moduleFilter:keyup', function() {
|
||||
if (moduleFilter.clearOffset == undefined) {
|
||||
moduleFilter.inputWidth = filterInput.width();
|
||||
moduleFilter.clearOffset = moduleFilter.element.parent().find('.module-filter-clear a').width();
|
||||
}
|
||||
if (moduleFilter.text) {
|
||||
filterInput.width(moduleFilter.inputWidth - moduleFilter.clearOffset - 5).parent().css('margin-right', moduleFilter.clearOffset + 5);
|
||||
}
|
||||
else {
|
||||
filterInput.width(moduleFilter.inputWidth).parent().css('margin-right', 0);
|
||||
}
|
||||
});
|
||||
|
||||
moduleFilter.element.parent().find('.module-filter-clear a').click(function() {
|
||||
filterInput.width(moduleFilter.inputWidth).parent().css('margin-right', 0);
|
||||
});
|
||||
|
||||
moduleFilter.applyFilter();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user