Skip to content

Commit

Permalink
Issue backdrop#905: Put redirect module in core; basic functionality …
Browse files Browse the repository at this point in the history
…here still needs tests, replace redirect specific helper functions with core apis wehre appropriate, code clean up doc blocks and documentation in general.
  • Loading branch information
serundeputy committed Feb 21, 2016
1 parent b8cffe0 commit 5439cac
Show file tree
Hide file tree
Showing 20 changed files with 4,095 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/modules/redirect/config/redirect.settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"_config_name": "redirect.settings",
"_config_static": true,
"auto_redirect": true,
"passthrough_querystring": true,
"warning": false,
"default_status_code": "301",
"page_cache": false,
"purge_inactive": false,
"global_home": true,
"global_clean": true,
"global_canonical": true,
"global_deslash": false,
"global_admin_paths": false
}
28 changes: 28 additions & 0 deletions core/modules/redirect/js/redirect.admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

(function ($) {

Backdrop.behaviors.redirectAdmin = {
attach: function (context) {
$('table.redirect-list-tableselect tbody input:checkbox').bind('change', function(context) {
var checked = $('table.redirect-list-tableselect input:checkbox:checked').length;
if (checked) {
$('fieldset.redirect-list-operations').slideDown();
}
else {
$('fieldset.redirect-list-operations').slideUp();
}
});
$('table.redirect-list-tableselect th.select-all input:checkbox').bind('change', function(context) {
var checked = $(this, context).attr('checked');
if (checked) {
$('fieldset.redirect-list-operations').slideDown();
}
else {
$('fieldset.redirect-list-operations').slideUp();
}
});
$('fieldset.redirect-list-operations').hide();
}
};

})(jQuery);
18 changes: 18 additions & 0 deletions core/modules/redirect/js/redirect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

(function ($) {

Backdrop.behaviors.redirectFieldsetSummaries = {
attach: function (context) {
$('fieldset.redirect-list', context).backdropSetSummary(function (context) {
if ($('table.redirect-list tbody td.empty', context).length) {
return Backdrop.t('No redirects');
}
else {
var redirects = $('table.redirect-list tbody tr', context).length;
return Backdrop.formatPlural(redirects, '1 redirect', '@count redirects');
}
});
}
};

})(jQuery);

0 comments on commit 5439cac

Please sign in to comment.