2010-05-08 04:45:05 +02:00
|
|
|
/**
|
|
|
|
* File: AssetAdmin.js
|
|
|
|
*/
|
|
|
|
|
2009-11-21 04:18:25 +01:00
|
|
|
(function($) {
|
2009-11-21 04:19:14 +01:00
|
|
|
/**
|
|
|
|
* Delete selected folders through "batch actions" tab.
|
|
|
|
*/
|
2009-11-21 04:19:59 +01:00
|
|
|
$(document).ready(function() {
|
2010-04-13 07:55:56 +02:00
|
|
|
$('#Form_BatchActionsForm').entwine('ss').register(
|
2009-11-21 04:19:41 +01:00
|
|
|
// TODO Hardcoding of base URL
|
|
|
|
'admin/assets/batchactions/delete',
|
|
|
|
function(ids) {
|
|
|
|
var confirmed = confirm(
|
|
|
|
ss.i18n.sprintf(
|
|
|
|
ss.i18n._t('AssetAdmin.BATCHACTIONSDELETECONFIRM'),
|
|
|
|
ids.length
|
|
|
|
)
|
|
|
|
);
|
|
|
|
return (confirmed) ? ids : false;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
2009-11-21 04:19:14 +01:00
|
|
|
|
2010-04-13 07:55:56 +02:00
|
|
|
$.entwine('ss', function($){
|
2010-05-08 04:45:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class: #Form_SyncForm
|
|
|
|
*/
|
2010-04-13 07:55:56 +02:00
|
|
|
$('#Form_SyncForm').entwine({
|
2010-05-08 04:45:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function: onsubmit
|
|
|
|
*
|
|
|
|
* Parameters:
|
|
|
|
* (Event) e
|
|
|
|
*/
|
2009-11-21 04:19:59 +01:00
|
|
|
onsubmit: function(e) {
|
2009-11-21 04:19:05 +01:00
|
|
|
var button = jQuery(this).find(':submit:first');
|
|
|
|
button.addClass('loading');
|
2011-03-15 22:13:49 +01:00
|
|
|
$.ajax({
|
|
|
|
url: jQuery(this).attr('action'),
|
|
|
|
data: this.serializeArray(),
|
|
|
|
success: function() {
|
2009-11-21 04:19:05 +01:00
|
|
|
button.removeClass('loading');
|
2009-11-21 04:21:03 +01:00
|
|
|
// reload current form and tree
|
2011-04-17 10:04:46 +02:00
|
|
|
var currNode = $('.cms-tree')[0].firstSelected();
|
2009-11-21 04:19:43 +01:00
|
|
|
if(currNode) {
|
|
|
|
var url = $(currNode).find('a').attr('href');
|
2011-06-08 01:30:54 +02:00
|
|
|
$('.cms-content').loadForm(url);
|
2009-11-21 04:19:43 +01:00
|
|
|
}
|
2011-04-17 10:04:46 +02:00
|
|
|
$('.cms-tree')[0].setCustomURL('admin/assets/getsubtree');
|
|
|
|
$('.cms-tree')[0].reload({onSuccess: function() {
|
2009-11-21 04:21:03 +01:00
|
|
|
// TODO Reset current tree node
|
|
|
|
}});
|
2009-11-21 04:19:05 +01:00
|
|
|
}
|
2011-03-15 22:13:49 +01:00
|
|
|
});
|
2009-11-21 04:19:05 +01:00
|
|
|
|
|
|
|
return false;
|
2007-07-19 12:40:05 +02:00
|
|
|
}
|
2009-11-21 04:19:59 +01:00
|
|
|
});
|
2009-11-21 04:19:05 +01:00
|
|
|
});
|
2009-11-21 04:19:18 +01:00
|
|
|
}(jQuery));
|