Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Removed deletefolder javascript in AssetAdmin.js, superseded by…

… LeftAndMain.BatchActions.js

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92807 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit f4e2dcb61a590695879acd7517021343b5b01398 1 parent 18f54bb
@chillu chillu authored
Showing with 0 additions and 127 deletions.
  1. +0 −127 javascript/AssetAdmin.js
View
127 javascript/AssetAdmin.js
@@ -136,120 +136,8 @@ var _HANDLER_FORMS = {
}
};
});
-
- $('#Form_DeleteItemsForm').concrete('ss', function($) {
- return {
- onmatch: function() {
- $('#TreeActions').bind('tabsselect', function(e, ui) {
- if($(ui.tab).attr('id') == 'TreeActions-delete-btn') {
-
- }
- });
- },
- /**
- * @param {Boolean}
- */
- toggleTree: function(bool) {
- if(bool) {
- deletefolder.o1 = $('sitetree').observeMethod('SelectionChanged', deletefolder.treeSelectionChanged);
- deletefolder.o2 = $('Form_DeleteItemsForm').observeMethod('Close', deletefolder.popupClosed);
-
- jQuery('#sitetree').addClass('multiselect');
-
- deletefolder.selectedNodes = { };
-
- var sel = $('sitetree').firstSelected()
- if(sel) {
- var selIdx = $('sitetree').getIdxOf(sel);
- deletefolder.selectedNodes[selIdx] = true;
- sel.removeNodeClass('current');
- sel.addNodeClass('selected');
- }
- }
- }
-
- };
- });
}(jQuery));
-/**
- * Delete folder action
- */
-deletefolder = {
- button_onclick : function() {
-
- return false;
- },
-
- treeSelectionChanged : function(selectedNode) {
- var idx = $('sitetree').getIdxOf(selectedNode);
-
- if(selectedNode.selected) {
- selectedNode.removeNodeClass('selected');
- selectedNode.selected = false;
- deletefolder.selectedNodes[idx] = false;
-
- } else {
- selectedNode.addNodeClass('selected');
- selectedNode.selected = true;
- deletefolder.selectedNodes[idx] = true;
- }
-
- return false;
- },
-
- popupClosed : function() {
- jQuery('#sitetree').removeClass('multiselect');
- $('sitetree').stopObserving(deletefolder.o1);
- $('Form_DeleteItemsForm').stopObserving(deletefolder.o2);
-
- for(var idx in deletefolder.selectedNodes) {
- if(deletefolder.selectedNodes[idx]) {
- node = $('sitetree').getTreeNodeByIdx(idx);
- if(node) {
- node.removeNodeClass('selected');
- node.selected = false;
- }
- }
- }
- },
-
- form_submit : function() {
- var csvIDs = "";
- for(var idx in deletefolder.selectedNodes) {
- var selectedNode = $('sitetree').getTreeNodeByIdx(idx);
- var link = selectedNode.getElementsByTagName('a')[0];
-
- if(deletefolder.selectedNodes[idx] && ( !Element.hasClassName( link, 'contents' ) || confirm( "'" + link.firstChild.nodeValue + "' contains files. Would you like to delete the files and folder?" ) ) )
- csvIDs += (csvIDs ? "," : "") + idx;
- }
-
- if(csvIDs) {
- $('Form_DeleteItemsForm').elements.csvIDs.value = csvIDs;
-
- statusMessage('deleting pages');
-
- Ajax.SubmitForm('Form_DeleteItemsForm', null, {
- onSuccess : deletefolder.submit_success,
- onFailure : function(response) {
- errorMessage('Error deleting pages', response);
- }
- });
-
- $('deletepage').getElementsByTagName('button')[0].onclick();
-
- } else {
- alert("Please select at least 1 page.");
- }
-
- return false;
- },
-
- submit_success: function(response) {
- Ajax.Evaluator(response);
- treeactions.closeSelection($('deletepage'));
- }
-}
Behaviour.register({
'#Form_EditForm_Files': {
@@ -297,18 +185,3 @@ Behaviour.register({
}
}
});
-
-/**
- * Initialisation function to set everything up
- */
-jQuery(document).ready(function() {
- // Set up delete page
- Observable.applyTo($('Form_DeleteItemsForm'));
- if($('deletepage')) {
- $('deletepage').onclick = deletefolder.button_onclick;
- $('deletepage').getElementsByTagName('button')[0].onclick = function() { return false; };
- $('Form_DeleteItemsForm').onsubmit = deletefolder.form_submit;
- Element.hide('Form_DeleteItemsForm');
- }
-
-});
Please sign in to comment.
Something went wrong with that request. Please try again.