diff --git a/code/AssetAdmin.php b/code/AssetAdmin.php index 783974fb..0bc88064 100755 --- a/code/AssetAdmin.php +++ b/code/AssetAdmin.php @@ -81,6 +81,7 @@ class AssetAdmin extends LeftAndMain { // needed for MemberTableField (Requirements not determined before Ajax-Call) Requirements::css(SAPPHIRE_DIR . "/css/ComplexTableField.css"); + Requirements::javascript(CMS_DIR . "/javascript/AssetAdmin.DragDrop.js"); Requirements::javascript(CMS_DIR . "/javascript/AssetAdmin.js"); Requirements::javascript(CMS_DIR . "/javascript/CMSMain_upload.js"); diff --git a/javascript/AssetAdmin.js b/javascript/AssetAdmin.js index ecdf3ca8..b0d62a90 100755 --- a/javascript/AssetAdmin.js +++ b/javascript/AssetAdmin.js @@ -15,223 +15,29 @@ var _HANDLER_FORMS = { sortitems : 'sortitems_options' }; -MarkingPropertiesButton = Class.create(); -MarkingPropertiesButton.applyTo('#Form_EditForm_deletemarked', "Please select some files to delete!", 'deletemarked', 'Do you really want to delete the marked files?'); +(function($) { + /** + * Overload the "Create" tab to execute action instead of + * opening the tab content. + */ + $('#TreeActions-create-btn').concrete('ss', function($) { + return { + onmatch: function() { + this.bind('click', function(e) { + var form = $('form#addpage_options'); + jQuery.post( + form.attr('action'), + form.serialize(), + function(data) { -MarkingPropertiesButton.prototype = { - initialize: function(noneCheckedError, action, confirmMessage) { - this.noneCheckedError = noneCheckedError; - this.action = action; - this.confirmMessage = confirmMessage; - }, - - onclick: function() { - var i, list = "", checkboxes = $('Form_EditForm').elements['Files[]']; - if(!checkboxes) checkboxes = []; - if(!checkboxes.length) checkboxes = [ checkboxes ]; - for(i=0;i would give a recordID of 6 - if(this.id && this.id.match(/-([^-]+)$/)) - this.recordID = RegExp.$1; - this.droppable = Droppables.add(this.id, {accept:'dragfile', hoverclass:'filefolderhover', - onDrop:function(droppedElement) { - // Get this.recordID from the last "-" separated chunk of the id HTML attribute - // eg:
  • would give a recordID of 6 - if(this.element.id && this.element.id.match(/-([^-]+)$/)) - this.recordID = RegExp.$1; - $('Form_EditForm').elements['DestFolderID'].value = this.recordID; - - // Add the dropped file to the list of files to move - var list = droppedElement.getElementsByTagName('img')[0].id.replace('drag-img-Files-',''); - var i, checkboxes = $('Form_EditForm').elements['Files[]']; - if(!checkboxes) checkboxes = []; - if(!checkboxes.length) checkboxes = [ checkboxes ]; - // Add each checked file to the list of ones to move - for(i=0;i
  • - + <% _t('CREATE','Create',PR_HIGH) %>
  • - + <% _t('DELETE','Delete',PR_HIGH) %>