Hello Adam,
The quickedit modules seems to be inserting all the javascripts as one block of code:
<!-- Start QuickEdit headers -->
<script type="text/javascript">
var modId = ’1’;
var managerPath = ’/netvider/rtsda/manager/’;
var modPath = ’assets/modules/quick_edit’;
</script>
<script src="assets/modules/quick_edit/javascript/cookies.js" type="text/javascript"></script>
<script src="assets/modules/quick_edit/javascript/output.js" type="text/javascript"></script>
<script type="text/javascript" src="manager/media/script/scriptaculous/prototype.js"></script>
<script type="text/javascript" src="manager/media/script/scriptaculous/scriptaculous.js"></script>
<link type="text/css" rel="stylesheet" href="assets/modules/quick_edit/styles/output.css" />
<!-- End QuickEdit headers -->
Inserting all the <script> tags at once will prevent the detecting duplicate script tags. For example the ticker.js now makes use of prototype.js. If it’s also included on a page will result in prototype.js being loaded twice.
It’s best to register your <script src=""> tags separately.
Something like:
$modx->regClientStartup('<script src="manager/media/script/scriptaculous/prototype.js"></script>');
$modx->regClientStartup('<script src="manager/media/script/scriptaculous/scriptaculous.js"></script>');
// etc
Ahhh, I see what you mean.
Are the regClient functions working post caching now? That was the reason I did not use them initially.
Do the recClient scripts actually check for duplicates? That would be a good idea. Of course that would be pretty difficult to figure out since absolute and relative URLs and all sorts of other things could easily throw it off.
it does in someways. We don’t want to get too complex in trying to find check for duplicates as it might slow down the parser if too much files are being registered