MINOR Disabled AssetAdmin form reload after uploading through iframe, relies on old tree.js library - UI will change anyway

This commit is contained in:
Ingo Schommer 2011-03-18 08:30:29 +13:00
parent 3b01a9af67
commit 91995ad73b
3 changed files with 8 additions and 45 deletions

View File

@ -281,13 +281,14 @@ JS
$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 File

@ -99,7 +99,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
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 File

@ -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);
}
};