mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUGFIX Moving Requirements::combine_files() calls from cms/_config.php to LeftAndMain->init() to avoid side-effects in non-CMS contexts. Examples:
- including prototype.js in a website had caused jQuery to be loaded as well through base.js - including greybox.js had caused the screen to become unscrollable because of an (unrelated) inclusion of LeftAndMain.js which sets <body> to overflow:hidden on javascript page load git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@67401 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9baf35d500
commit
9c81737a57
58
_config.php
58
_config.php
@ -20,64 +20,6 @@ Director::addRules(50, array(
|
|||||||
|
|
||||||
CMSMenu::populate_menu();
|
CMSMenu::populate_menu();
|
||||||
|
|
||||||
// Javascript combined files
|
|
||||||
Requirements::combine_files(
|
|
||||||
'assets/base.js',
|
|
||||||
array(
|
|
||||||
'jsparty/prototype.js',
|
|
||||||
'jsparty/behaviour.js',
|
|
||||||
'jsparty/prototype_improvements.js',
|
|
||||||
'jsparty/jquery/jquery.js',
|
|
||||||
'jsparty/jquery/plugins/livequery/jquery.livequery.js',
|
|
||||||
'jsparty/jquery/plugins/effen/jquery.fn.js',
|
|
||||||
'sapphire/javascript/core/jquery.ondemand.js',
|
|
||||||
'jsparty/jquery/jquery_improvements.js',
|
|
||||||
'jsparty/firebug/firebugx.js',
|
|
||||||
'sapphire/javascript/i18n.js',
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Requirements::combine_files(
|
|
||||||
'assets/leftandmain.js',
|
|
||||||
array(
|
|
||||||
'jsparty/loader.js',
|
|
||||||
'jsparty/hover.js',
|
|
||||||
'jsparty/layout_helpers.js',
|
|
||||||
'jsparty/scriptaculous/effects.js',
|
|
||||||
'jsparty/scriptaculous/dragdrop.js',
|
|
||||||
'jsparty/scriptaculous/controls.js',
|
|
||||||
'jsparty/greybox/AmiJS.js',
|
|
||||||
'jsparty/greybox/greybox.js',
|
|
||||||
'cms/javascript/LeftAndMain.js',
|
|
||||||
'cms/javascript/LeftAndMain_left.js',
|
|
||||||
'cms/javascript/LeftAndMain_right.js',
|
|
||||||
//'jsparty/tiny_mce2/tiny_mce_src.js',
|
|
||||||
'jsparty/tree/tree.js',
|
|
||||||
'jsparty/tabstrip/tabstrip.js',
|
|
||||||
'cms/javascript/TinyMCEImageEnhancement.js',
|
|
||||||
'jsparty/SWFUpload/SWFUpload.js',
|
|
||||||
'cms/javascript/Upload.js',
|
|
||||||
'sapphire/javascript/TreeSelectorField.js',
|
|
||||||
'cms/javascript/ThumbnailStripField.js',
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Requirements::combine_files(
|
|
||||||
'assets/cmsmain.js',
|
|
||||||
array(
|
|
||||||
'cms/javascript/CMSMain.js',
|
|
||||||
'cms/javascript/CMSMain_left.js',
|
|
||||||
'cms/javascript/CMSMain_right.js',
|
|
||||||
'cms/javascript/SideTabs.js',
|
|
||||||
'cms/javascript/SideReports.js',
|
|
||||||
'cms/javascript/LangSelector.js',
|
|
||||||
'cms/javascript/TranslationTab.js',
|
|
||||||
'jsparty/calendar/calendar.js',
|
|
||||||
'jsparty/calendar/lang/calendar-en.js',
|
|
||||||
'jsparty/calendar/calendar-setup.js',
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
CMSMenu::add_link(
|
CMSMenu::add_link(
|
||||||
'Help',
|
'Help',
|
||||||
_t('LeftAndMain.HELP', 'Help', PR_HIGH, 'Menu title'),
|
_t('LeftAndMain.HELP', 'Help', PR_HIGH, 'Menu title'),
|
||||||
|
@ -183,6 +183,64 @@ class LeftAndMain extends Controller {
|
|||||||
|
|
||||||
Requirements::customScript('Behaviour.addLoader(hideLoading);');
|
Requirements::customScript('Behaviour.addLoader(hideLoading);');
|
||||||
|
|
||||||
|
// Javascript combined files
|
||||||
|
Requirements::combine_files(
|
||||||
|
'assets/base.js',
|
||||||
|
array(
|
||||||
|
'jsparty/prototype.js',
|
||||||
|
'jsparty/behaviour.js',
|
||||||
|
'jsparty/prototype_improvements.js',
|
||||||
|
'jsparty/jquery/jquery.js',
|
||||||
|
'jsparty/jquery/plugins/livequery/jquery.livequery.js',
|
||||||
|
'jsparty/jquery/plugins/effen/jquery.fn.js',
|
||||||
|
'sapphire/javascript/core/jquery.ondemand.js',
|
||||||
|
'jsparty/jquery/jquery_improvements.js',
|
||||||
|
'jsparty/firebug/firebugx.js',
|
||||||
|
'sapphire/javascript/i18n.js',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Requirements::combine_files(
|
||||||
|
'assets/leftandmain.js',
|
||||||
|
array(
|
||||||
|
'jsparty/loader.js',
|
||||||
|
'jsparty/hover.js',
|
||||||
|
'jsparty/layout_helpers.js',
|
||||||
|
'jsparty/scriptaculous/effects.js',
|
||||||
|
'jsparty/scriptaculous/dragdrop.js',
|
||||||
|
'jsparty/scriptaculous/controls.js',
|
||||||
|
'jsparty/greybox/AmiJS.js',
|
||||||
|
'jsparty/greybox/greybox.js',
|
||||||
|
'cms/javascript/LeftAndMain.js',
|
||||||
|
'cms/javascript/LeftAndMain_left.js',
|
||||||
|
'cms/javascript/LeftAndMain_right.js',
|
||||||
|
//'jsparty/tiny_mce2/tiny_mce_src.js',
|
||||||
|
'jsparty/tree/tree.js',
|
||||||
|
'jsparty/tabstrip/tabstrip.js',
|
||||||
|
'cms/javascript/TinyMCEImageEnhancement.js',
|
||||||
|
'jsparty/SWFUpload/SWFUpload.js',
|
||||||
|
'cms/javascript/Upload.js',
|
||||||
|
'sapphire/javascript/TreeSelectorField.js',
|
||||||
|
'cms/javascript/ThumbnailStripField.js',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Requirements::combine_files(
|
||||||
|
'assets/cmsmain.js',
|
||||||
|
array(
|
||||||
|
'cms/javascript/CMSMain.js',
|
||||||
|
'cms/javascript/CMSMain_left.js',
|
||||||
|
'cms/javascript/CMSMain_right.js',
|
||||||
|
'cms/javascript/SideTabs.js',
|
||||||
|
'cms/javascript/SideReports.js',
|
||||||
|
'cms/javascript/LangSelector.js',
|
||||||
|
'cms/javascript/TranslationTab.js',
|
||||||
|
'jsparty/calendar/calendar.js',
|
||||||
|
'jsparty/calendar/lang/calendar-en.js',
|
||||||
|
'jsparty/calendar/calendar-setup.js',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
// DEPRECATED 2.3: Use init()
|
// DEPRECATED 2.3: Use init()
|
||||||
$dummy = null;
|
$dummy = null;
|
||||||
$this->extend('augmentInit', $dummy);
|
$this->extend('augmentInit', $dummy);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user