MINOR Wrapped AssetAdmin.BatchActions javascript in document.load

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92818 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-11-21 03:19:41 +00:00
parent 90c6c088e1
commit 615494f123
2 changed files with 17 additions and 25 deletions

View File

@ -16,33 +16,25 @@ var _HANDLER_FORMS = {
}; };
(function($) { (function($) {
$('.AssetAdmin').concrete('ss', function($) {
return {
onmatch: function() {
this._super();
}
};
});
/** /**
* Delete selected folders through "batch actions" tab. * Delete selected folders through "batch actions" tab.
*/ */
$(function() {
$('#Form_BatchActionsForm').concrete('ss').register( $('#Form_BatchActionsForm').concrete('ss').register(
// TODO Hardcoding of base URL
'admin/assets/batchactions/delete', 'admin/assets/batchactions/delete',
function(ids) { function(ids) {
var confirmed = confirm( var confirmed = confirm(
ss.i18n.sprintf( ss.i18n.sprintf(
ss.i18n._t( ss.i18n._t('AssetAdmin.BATCHACTIONSDELETECONFIRM'),
'AssetAdmin.BATCHACTIONSDELETECONFIRM',
"Do you really want to delete %d folders?"
),
ids.length ids.length
) )
); );
return (confirmed) ? ids : false; return (confirmed) ? ids : false;
} }
); );
});
$('#Form_SyncForm').concrete('ss', function($) { $('#Form_SyncForm').concrete('ss', function($) {
return { return {

View File

@ -28,6 +28,6 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
'LeftAndMain.CONFIRMUNSAVEDSHORT': "WARNING: Your changes have not been saved.", 'LeftAndMain.CONFIRMUNSAVEDSHORT': "WARNING: Your changes have not been saved.",
'CMSMAIN.ALERTCLASSNAME': 'The page type will be updated after the page is saved', 'CMSMAIN.ALERTCLASSNAME': 'The page type will be updated after the page is saved',
'CMSMAIN.URLSEGMENTVALIDATION': 'URLs can only be made up of letters, digits and hyphens.', 'CMSMAIN.URLSEGMENTVALIDATION': 'URLs can only be made up of letters, digits and hyphens.',
'AssetAdmin.BATCHACTIONSDELETECONFIRM': "Do you really want to delete %d folders?" 'AssetAdmin.BATCHACTIONSDELETECONFIRM': "Do you really want to delete %s folders?"
}); });
} }