|
@@ -11,8 +11,8 @@
|
|
|
{% endblock %}
|
|
|
|
|
|
{% block head_additions %}
|
|
|
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/styles/monokai_sublime.min.css">
|
|
|
- <script type="text/javascript">
|
|
|
+ <link rel="stylesheet" href="{{ asset('libs/highlightjs-9.6.0/styles/monokai_sublime.min.css') }}">
|
|
|
+ <script>
|
|
|
WebFontConfig = {
|
|
|
google: { families: [ 'Source+Code+Pro::latin' ] }
|
|
|
};
|
|
@@ -24,8 +24,14 @@
|
|
|
var s = document.getElementsByTagName('script')[0];
|
|
|
s.parentNode.insertBefore(wf, s);
|
|
|
})();
|
|
|
- function highlight_code()
|
|
|
- {
|
|
|
+ </script>
|
|
|
+{% endblock %}
|
|
|
+
|
|
|
+{% block scripts %}
|
|
|
+ <script src="{{ asset('bundles/packagistweb/js/view.js')}}"></script>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ function highlight_code() {
|
|
|
if (typeof (Worker) === undefined) return false;
|
|
|
|
|
|
var workerFunction = new Blob(['(' + highlight_code_worker_function.toString() + ')()'], {type: "text/javascript"});
|
|
@@ -38,22 +44,19 @@
|
|
|
worker.postMessage(code.text()); // start worker
|
|
|
});
|
|
|
}
|
|
|
- function highlight_code_worker_function()
|
|
|
- {
|
|
|
+
|
|
|
+ function highlight_code_worker_function() {
|
|
|
onmessage = function(event) {
|
|
|
- importScripts('https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min.js');
|
|
|
+ importScripts({{ app.request.getSchemeAndHttpHost()|json_encode|raw }} + '/libs/highlightjs-9.6.0/highlight.min.js');
|
|
|
self.hljs.configure({tabReplace:4});
|
|
|
var result = self.hljs.highlightAuto(event.data);
|
|
|
postMessage(result.value);
|
|
|
close(); // close worker
|
|
|
}
|
|
|
}
|
|
|
- $(window).on('load', highlight_code);
|
|
|
- </script>
|
|
|
-{% endblock %}
|
|
|
|
|
|
-{% block scripts %}
|
|
|
- <script src="{{ asset('bundles/packagistweb/js/view.js')}}"></script>
|
|
|
+ highlight_code();
|
|
|
+ </script>
|
|
|
{% endblock %}
|
|
|
|
|
|
{% block description -%}
|