Permalink
Browse files

MINOR Disabled AssetAdmin form reload after uploading through iframe,…

… relies on old tree.js library - UI will change anyway
  • Loading branch information...
1 parent 3b01a9a commit 91995ad73bba46f84231ebcd958cc013b2764be9 @chillu chillu committed Mar 17, 2011
Showing with 8 additions and 45 deletions.
  1. +8 −7 code/AssetAdmin.php
  2. +0 −1 code/CMSMain.php
  3. +0 −37 javascript/CMSMain.Tree.js
View
@@ -281,13 +281,14 @@ function doUpload($data, $form) {
$sFileIDs = implode(',', $fileIDs);
$sFileNames = implode(',', $fileNames);
- echo <<<HTML
- <script type="text/javascript">
- var url = parent.document.getElementById('sitetree').getTreeNodeByIdx( "{$folder->ID}" ).getElementsByTagName('a')[0].href;
- parent.jQuery('#Form_EditForm').entwine('ss').loadForm(url);
- parent.statusMessage("{$statusMessage}","{$status}");
- </script>
-HTML;
+ // TODO Will be replaced by new upload mechanism, refresh disabled for now
+// echo <<<HTML
+// <script type="text/javascript">
+// var url = parent.document.getElementById('sitetree').getTreeNodeByIdx( "{$folder->ID}" ).getElementsByTagName('a')[0].href;
+// parent.jQuery('#Form_EditForm').entwine('ss').loadForm(url);
+// parent.statusMessage("{$statusMessage}","{$status}");
+// </script>
+// HTML;
}
/**
View
@@ -99,7 +99,6 @@ public function init() {
HtmlEditorConfig::get('cms')->setOption('spellchecker_languages', "+{$langName}={$this->Locale}");
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.js');
- Requirements::javascript(CMS_DIR . '/javascript/CMSMain.Tree.js');
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.EditForm.js');
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.Translatable.js');
View
@@ -1,37 +0,0 @@
-/**
- * File: CMSMain.Tree.js
- */
-if(typeof SiteTreeHandlers == 'undefined') SiteTreeHandlers = {};
-SiteTreeHandlers.parentChanged_url = 'admin/ajaxupdateparent';
-SiteTreeHandlers.orderChanged_url = 'admin/ajaxupdatesort';
-SiteTreeHandlers.loadPage_url = 'admin/getitem';
-SiteTreeHandlers.loadTree_url = 'admin/getsubtree';
-
-TreeContextMenu = {
- 'Edit this page' : function(treeNode) {
- treeNode.selectTreeNode();
- },
- 'Duplicate page and children' : function(treeNode) {
- // First save the page silently (without confirmation) and then duplicate the page.
- jQuery('#Form_EditForm').entwine('ss').ajaxSubmit(null, treeNode.duplicatePageWithChildren.bind(treeNode));
- },
- 'Duplicate just this page' : function(treeNode) {
- // First save the page silently (without confirmation) and then duplicate the page.
- jQuery('#Form_EditForm').entwine('ss').ajaxSubmit(null, treeNode.duplicatePageWithChildren.bind(treeNode));
- },
- 'Sort sub-pages' : function(treeNode) {
- var children = treeNode.treeNodeHolder().childTreeNodes();
- var sortedChildren = children.sort(function(a, b) {
- var titleA = a.aTag.innerHTML.replace(/<[^>]*>/g,'');
- var titleB = b.aTag.innerHTML.replace(/<[^>]*>/g,'');
- return titleA < titleB ? -1 : (titleA > titleB ? 1 : 0);
- });
-
- var i,child;
- for(i=0;child=sortedChildren[i];i++) {
- treeNode.appendTreeNode(child);
- }
-
- treeNode.onOrderChanged(sortedChildren,treeNode);
- }
-};

0 comments on commit 91995ad

Please sign in to comment.