The whole point of having the directory is to have one single place for them and not all over the place and for every single style as it is now. The only way that multiple JavaScript file inclusion will be avoided is through a combination of hooks (which don't exist at the moment) and a change in our policies with regard to the adding of these to overall_header.html. This will not be fixable in the 3.0.x line I'm afraid.DavidIQ wrote:The JavaScript files would be organized and you would be able to tell which libraries are already present and not upload the same ones again into some other folder specified by the MOD. Of course this might be a moot point with the hooks present but nonetheless a good suggestion.
Code: Select all
<script type="text/javascript">
// <![CDATA[
!window.jQuery && document.write('<script type="text\/javascript" src="jquery-1.6.min.js"><\/script>');
// ]]>
</script>
Therein lies the reason why jQuery MUST be included with phpBB... There needs to be a standardized implementation of it so that MOD authors can take advantage of its features without having to worry about versioning and inclusion issues. Let phpBB dictate where it is included and what versions will be used.Paul wrote:That still will give issues, if your MOD requires a certian jQuery version, while the earlier included version is lower or something .
Code: Select all
<script type="text/javascript">
// <![CDATA[
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery-latest.min.js"><\/script>');
// ]]>
</script>
Good afternoon from Greece!VSE wrote:FWIW, I finally came across this method:What it seems to do is if jQuery is not already present, then it is dynamically added. The CDATA wrappers make it pass XHTML validation.Code: Select all
<script type="text/javascript"> // <![CDATA[ !window.jQuery && document.write('<script type="text\/javascript" src="jquery-1.6.min.js"><\/script>'); // ]]> </script>
If using the above code as the method for including jquery, instead of the default method were adopted by all MOD authors, then I think it could solve this issue, such that only 1 - the first encountered - link to the jQuery library will be loaded. Any other links from other MODs will be ignored. Thus, no more conflicts.
Code: Select all
// ]]>
Code: Select all
// ]]>
Code: Select all
</script>
Code: Select all
// ]]>