Back with some Plone 5 JS pain...I need to include Codemirror in one template (no resource registries involved).
This fails:
<metal:main fill-slot="content-core">
<metal:content-core define-macro="content-core">
<link rel="stylesheet" type="text/css" tal:attributes="href string:$portal_url/++resource++xmldirector.plonecore/codemirror/lib/codemirror.css" />
<script type="text/javascript" charset="utf8" tal:attributes="src string:$portal_url/++resource++xmldirector.plonecore/codemirror/lib/codemirror.js"></script>
<script type="text/javascript" charset="utf8" tal:attributes="src string:$portal_url/++resource++xmldirector.plonecore/codemirror/mode/javascript/javascript.js"></script>
<script type="text/javascript">
CodeMirror(document.body);
</script>
</metal:content-core>
</metal:main>
with
demo2:465 Uncaught ReferenceError: CodeMirror is not defined(anonymous function) @ demo2:465
default.js:172 Uncaught Error: Mismatched anonymous define() module: function () {
"use strict";
while this works
<html>
<body>
<link rel="stylesheet" type="text/css" tal:attributes="href string:++resource++xmldirector.plonecore/codemirror/lib/codemirror.css" />
<script type="text/javascript" charset="utf8" tal:attributes="src string:++resource++xmldirector.plonecore/codemirror/lib/codemirror.js"></script>
<script type="text/javascript" charset="utf8" tal:attributes="src string:++resource++xmldirector.plonecore/codemirror/mode/javascript/javascript.js"></script>
<script type="text/javascript">
CodeMirror(document.body);
</script>
</body>
</html>
Another JS add-on like jsGrid works in variant #1.
Will this problem finally be solved with Plone 5.0.5 or 5.1? I am really looking for a clear defined and documented path for using arbitrary JS add-ons in Plone without having to check if an add-on requires requires.js or whatever...this is the integrator's hell.
-aj