/
githubmirror
/
drawio
Обзор
Документация
Войти
/
githubmirror
/
drawio
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/main/webapp/js/grapheditor/Init.js
47 строк
2 KB
David Benson
31.1.2 release
26 июл 2026, 19:41
26 июл 2026, 19:41
acc5082
Код
Авторство
О чём код?
/** * Copyright (c) 2006-2021, JGraph Holdings Ltd * Copyright (c) 2006-2021, draw.io AG */ // urlParams is null when used for embedding window.urlParams = window.urlParams || {}; // Public global variables // data-icon and data-icon-content are written by the SVG export on the icon // wrappers it creates, and the script it injects binds to them to show the // tooltip and note popups. DOMPurify allows data attributes by default, so a // label could otherwise carry one into the exported file and have its value // written to innerHTML when the reader hovers the shape. window.DOM_PURIFY_CONFIG = window.DOM_PURIFY_CONFIG || {ADD_TAGS: ['use', 'foreignObject'], FORBID_TAGS: ['form'], FORBID_ATTR: ['data-icon', 'data-icon-content'], ALLOWED_URI_REGEXP: /^((?!javascript:).)*$/i, HTML_INTEGRATION_POINTS: {'foreignobject': true}, ADD_ATTR: ['target', 'content', 'pointer-events', 'requiredFeatures']}; window.MAX_REQUEST_SIZE = window.MAX_REQUEST_SIZE || 10485760; window.MAX_AREA = window.MAX_AREA || 15000 * 15000; // URLs for save and export window.EXPORT_URL = window.EXPORT_URL || '/export'; window.SAVE_URL = window.SAVE_URL || '/save'; window.OPEN_URL = window.OPEN_URL || '/open'; window.RESOURCES_PATH = window.RESOURCES_PATH || 'resources'; window.RESOURCE_BASE = window.RESOURCE_BASE || window.RESOURCES_PATH + '/grapheditor'; window.STENCIL_PATH = window.STENCIL_PATH || 'stencils'; window.IMAGE_PATH = window.IMAGE_PATH || 'images'; window.STYLE_PATH = window.STYLE_PATH || 'styles'; window.CSS_PATH = window.CSS_PATH || 'styles'; window.OPEN_FORM = window.OPEN_FORM || 'open.html'; // Sets the base path, the UI language via URL param and configures the // supported languages to avoid 404s. The loading of all core language // resources is disabled as all required resources are in grapheditor. // properties. Note that in this example the loading of two resource // files (the special bundle and the default bundle) is disabled to // save a GET request. This requires that all resources be present in // each properties file since only one file is loaded. window.mxBasePath = window.mxBasePath || 'mxgraph'; window.mxImageBasePath = window.mxImageBasePath || 'mxgraph/images'; window.mxLanguage = window.mxLanguage || urlParams['lang']; window.mxLanguages = window.mxLanguages || ['de', 'se'];