Merge pull request #1367 from open-sausages/pulls/4.0/module-loader

Implement RFC-7 JavaScript module loader
This commit is contained in:
Ingo Schommer 2016-01-26 16:45:08 +13:00
commit ddd6111755

View File

@ -65,20 +65,8 @@ class AssetAdmin extends LeftAndMain implements PermissionProvider{
Requirements::javascript(CMS_DIR . "/javascript/AssetAdmin.js");
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.GridField.js');
Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', false, true);
Requirements::css(CMS_DIR . "/css/screen.css");
$frameworkDir = FRAMEWORK_DIR;
Requirements::customScript(<<<JS
_TREE_ICONS = {};
_TREE_ICONS['Folder'] = {
fileIcon: '$frameworkDir/javascript/tree/images/page-closedfolder.gif',
openFolderIcon: '$frameworkDir/javascript/tree/images/page-openfolder.gif',
closedFolderIcon: '$frameworkDir/javascript/tree/images/page-closedfolder.gif'
};
JS
);
CMSBatchActionHandler::register('delete', 'AssetAdmin_DeleteBatchAction', 'Folder');
}
@ -147,7 +135,7 @@ JS
}
public function getEditForm($id = null, $fields = null) {
Requirements::javascript(FRAMEWORK_DIR . '/javascript/AssetUploadField.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/dist/AssetUploadField.js');
Requirements::css(FRAMEWORK_DIR . '/css/AssetUploadField.css');
$form = parent::getEditForm($id, $fields);