Support customHTML/customJS (#380)

* nodebb/nodebb#5980

- Introduced customHTML field
- Moved customJS to footer

* switched to using defer only for scripts in footer, nodebb/nodebb#5980
main
Julian Lam 7 years ago committed by GitHub
parent 47429db8a6
commit c62aedbaf6

@ -16,15 +16,19 @@
</div> </div>
</div> </div>
<script async src="{relative_path}/assets/nodebb.min.js?{config.cache-buster}"></script> <script defer src="{relative_path}/assets/nodebb.min.js?{config.cache-buster}"></script>
<!-- BEGIN scripts --> <!-- BEGIN scripts -->
<script async defer type="text/javascript" src="{scripts.src}"></script> <script defer type="text/javascript" src="{scripts.src}"></script>
<!-- END scripts --> <!-- END scripts -->
<script> <script>
window.addEventListener('load', function () { window.addEventListener('load', function () {
require(['forum/footer']); require(['forum/footer']);
<!-- IF useCustomJS -->
{{customJS}}
<!-- ENDIF useCustomJS -->
}); });
</script> </script>

@ -16,12 +16,12 @@
}; };
</script> </script>
<!-- IF useCustomJS --> <!-- IF useCustomHTML -->
{{customJS}} {{customHTML}}
<!-- ENDIF useCustomJS --> <!-- END -->
<!-- IF useCustomCSS --> <!-- IF useCustomCSS -->
<style type="text/css">{{customCSS}}</style> <style type="text/css">{{customCSS}}</style>
<!-- ENDIF useCustomCSS --> <!-- END -->
</head> </head>
<body class="{bodyClass} skin-{config.bootswatchSkin}"> <body class="{bodyClass} skin-{config.bootswatchSkin}">

Loading…
Cancel
Save