| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <!-- draw.io -->
- {% if getConfig('crowi', 'app:drawioUri') %}
- <script type="text/javascript">
- // refs: https://github.com/jgraph/drawio/blob/v13.4.3/etc/build/build.xml#L35-L38
- let url = new URL("{{ getConfig('crowi', 'app:drawioUri') }}");
- let origin = url.origin;
- window.DRAWIO_BASE_URL = origin;
- window.DRAWIO_LIGHTBOX_URL = origin;
- window.STENCIL_PATH = [origin, 'stencils'].join('/');
- window.SHAPES_PATH = [origin, 'shapes'].join('/');
- window.mxBasePath = [origin, 'mxgraph'].join('/');
- </script>
- {% endif %}
- <script type="text/javascript">
- // define callback function invoked by viewer.min.js of draw.io
- // refs: https://github.com/jgraph/drawio/blob/v12.9.1/etc/build/build.xml#L219-L232
- window.onDrawioViewerLoad = function() {
- const DrawioViewer = window.GraphViewer;
- if (DrawioViewer != null) {
- // disable useResizeSensor and checkVisibleState
- // for preventing resize event by viewer.min.js
- DrawioViewer.useResizeSensor = false;
- DrawioViewer.prototype.checkVisibleState = false;
- // Set responsive option.
- // refs: https://github.com/jgraph/drawio/blob/v13.9.1/src/main/webapp/js/diagramly/GraphViewer.js#L89-L95
- DrawioViewer.prototype.responsive = true;
- // Set z-index ($zindex-dropdown + 200) for lightbox.
- // 'lightbox' is like a modal dialog that appears when click on a drawio diagram.
- // z-index refs: https://github.com/twbs/bootstrap/blob/v4.6.2/scss/_variables.scss#L681
- DrawioViewer.prototype.lightboxZIndex = 1200;
- DrawioViewer.prototype.toolbarZIndex = 1200;
- }
- };
- </script>
|