升级 onlyoffice、php、fileview、drawio。(drawio 的 app.min.js、index.html 未完成)

This commit is contained in:
kuaifan 2023-02-13 07:26:10 +08:00
parent d5d9eb93a3
commit 472ece692d
14 changed files with 9297 additions and 8406 deletions

View File

@ -79,28 +79,28 @@ class IndexController extends InvokeController
} }
$array = [ $array = [
"office/web-apps/apps/api/documents/api.js?hash=" . Base::getVersion(), "office/web-apps/apps/api/documents/api.js?hash=" . Base::getVersion(),
"office/7.2.2-56/web-apps/vendor/requirejs/require.js", "office/7.3.0-184/web-apps/vendor/requirejs/require.js",
"office/7.2.2-56/web-apps/apps/api/documents/api.js", "office/7.3.0-184/web-apps/apps/api/documents/api.js",
"office/7.2.2-56/sdkjs/common/AllFonts.js", "office/7.3.0-184/sdkjs/common/AllFonts.js",
"office/7.2.2-56/web-apps/vendor/xregexp/xregexp-all-min.js", "office/7.3.0-184/web-apps/vendor/xregexp/xregexp-all-min.js",
"office/7.2.2-56/web-apps/vendor/sockjs/sockjs.min.js", "office/7.3.0-184/web-apps/vendor/sockjs/sockjs.min.js",
"office/7.2.2-56/web-apps/vendor/jszip/jszip.min.js", "office/7.3.0-184/web-apps/vendor/jszip/jszip.min.js",
"office/7.2.2-56/web-apps/vendor/jszip-utils/jszip-utils.min.js", "office/7.3.0-184/web-apps/vendor/jszip-utils/jszip-utils.min.js",
"office/7.2.2-56/sdkjs/common/libfont/wasm/fonts.js", "office/7.3.0-184/sdkjs/common/libfont/wasm/fonts.js",
"office/7.2.2-56/sdkjs/common/Charts/ChartStyles.js", "office/7.3.0-184/sdkjs/common/Charts/ChartStyles.js",
"office/7.2.2-56/sdkjs/slide/themes//themes.js", "office/7.3.0-184/sdkjs/slide/themes//themes.js",
"office/7.2.2-56/web-apps/apps/presentationeditor/main/app.js", "office/7.3.0-184/web-apps/apps/presentationeditor/main/app.js",
"office/7.2.2-56/sdkjs/slide/sdk-all-min.js", "office/7.3.0-184/sdkjs/slide/sdk-all-min.js",
"office/7.2.2-56/sdkjs/slide/sdk-all.js", "office/7.3.0-184/sdkjs/slide/sdk-all.js",
"office/7.2.2-56/web-apps/apps/documenteditor/main/app.js", "office/7.3.0-184/web-apps/apps/documenteditor/main/app.js",
"office/7.2.2-56/sdkjs/word/sdk-all-min.js", "office/7.3.0-184/sdkjs/word/sdk-all-min.js",
"office/7.2.2-56/sdkjs/word/sdk-all.js", "office/7.3.0-184/sdkjs/word/sdk-all.js",
"office/7.2.2-56/web-apps/apps/spreadsheeteditor/main/app.js", "office/7.3.0-184/web-apps/apps/spreadsheeteditor/main/app.js",
"office/7.2.2-56/sdkjs/cell/sdk-all-min.js", "office/7.3.0-184/sdkjs/cell/sdk-all-min.js",
"office/7.2.2-56/sdkjs/cell/sdk-all.js", "office/7.3.0-184/sdkjs/cell/sdk-all.js",
]; ];
foreach ($array as &$item) { foreach ($array as &$item) {
$item = url($item); $item = url($item);

25
cmd
View File

@ -84,6 +84,15 @@ docker_name() {
echo `$COMPOSE ps | awk '{print $1}' | grep "\-$1\-"` echo `$COMPOSE ps | awk '{print $1}' | grep "\-$1\-"`
} }
mix_manifest() {
local file=$1
if [[ `uname` == 'Linux' ]]; then
sed -i '/\"\/uploads/d' ${cur_path}/$file/mix-manifest.json
else
docker run -it --rm -v ${cur_path}/$file:/public alpine sh -c "sed -i '/\"\/uploads/d' /public/mix-manifest.json"
fi
}
run_compile() { run_compile() {
local type=$1 local type=$1
check_node check_node
@ -96,6 +105,7 @@ run_compile() {
if [ "$type" = "prod" ]; then if [ "$type" = "prod" ]; then
rm -rf "./public/js/build" rm -rf "./public/js/build"
npx mix --production npx mix --production
mix_manifest "public"
echo "$(rand_string 16)" > ./public/js/hash echo "$(rand_string 16)" > ./public/js/hash
else else
npx mix watch --hot npx mix watch --hot
@ -125,6 +135,7 @@ run_electron() {
# #
if [ "$argv" != "dev" ] && [ "$argv" != "--nobuild" ]; then if [ "$argv" != "dev" ] && [ "$argv" != "--nobuild" ]; then
npx mix --production -- --env --electron npx mix --production -- --env --electron
mix_manifest "electron/public"
fi fi
if [ "$argv" == "dev" ]; then if [ "$argv" == "dev" ]; then
run_exec php "php bin/run --mode=$argv" run_exec php "php bin/run --mode=$argv"
@ -243,15 +254,6 @@ arg_get() {
echo $value echo $value
} }
is_arm() {
local get_arch=`arch`
if [[ $get_arch =~ "aarch" ]] || [[ $get_arch =~ "arm" ]]; then
echo "yes"
else
echo "no"
fi
}
#################################################################################### ####################################################################################
#################################################################################### ####################################################################################
#################################################################################### ####################################################################################
@ -264,11 +266,6 @@ fi
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
if [[ "$1" == "init" ]] || [[ "$1" == "install" ]]; then if [[ "$1" == "init" ]] || [[ "$1" == "install" ]]; then
shift 1 shift 1
# 判断架构
if [[ "$(is_arm)" == "yes" ]] && [[ -z "$(arg_get force)" ]]; then
echo -e "${Error} ${RedBG}暂不支持arm架构强制安装请使用./cmd install --force${Font}"
exit 1
fi
# 初始化文件 # 初始化文件
if [[ -n "$(arg_get relock)" ]]; then if [[ -n "$(arg_get relock)" ]]; then
rm -rf node_modules rm -rf node_modules

View File

@ -3,7 +3,7 @@ version: '3'
services: services:
php: php:
container_name: "dootask-php-${APP_ID}" container_name: "dootask-php-${APP_ID}"
image: "kuaifan/php:swoole-8.0" image: "kuaifan/php:swoole-8.0.rc1"
shm_size: "1024m" shm_size: "1024m"
volumes: volumes:
- ./docker/crontab/crontab.conf:/etc/supervisor/conf.d/crontab.conf - ./docker/crontab/crontab.conf:/etc/supervisor/conf.d/crontab.conf
@ -82,7 +82,7 @@ services:
office: office:
container_name: "dootask-office-${APP_ID}" container_name: "dootask-office-${APP_ID}"
image: "onlyoffice/documentserver:7.2.2.56" image: "onlyoffice/documentserver:7.3.0.184"
volumes: volumes:
- ./docker/office/logs:/var/log/onlyoffice - ./docker/office/logs:/var/log/onlyoffice
- ./docker/office/data:/var/www/onlyoffice/Data - ./docker/office/data:/var/www/onlyoffice/Data
@ -103,7 +103,8 @@ services:
fileview: fileview:
container_name: "dootask-fileview-${APP_ID}" container_name: "dootask-fileview-${APP_ID}"
image: "kuaifan/fileview:4.1.0-SNAPSHOT-RC18" image: "kuaifan/fileview:4.1.0-SNAPSHOT-RC19"
platform: linux/amd64
environment: environment:
TZ: "Asia/Shanghai" TZ: "Asia/Shanghai"
KK_CONTEXT_PATH: "/fileview" KK_CONTEXT_PATH: "/fileview"
@ -117,7 +118,7 @@ services:
drawio-webapp: drawio-webapp:
container_name: "dootask-drawio-webapp-${APP_ID}" container_name: "dootask-drawio-webapp-${APP_ID}"
image: "jgraph/drawio:16.6.1" image: "jgraph/drawio:20.8.20"
volumes: volumes:
- ./docker/drawio/webapp/index.html:/usr/local/tomcat/webapps/draw/index.html - ./docker/drawio/webapp/index.html:/usr/local/tomcat/webapps/draw/index.html
- ./docker/drawio/webapp/stencils:/usr/local/tomcat/webapps/draw/stencils - ./docker/drawio/webapp/stencils:/usr/local/tomcat/webapps/draw/stencils
@ -136,6 +137,7 @@ services:
drawio-export: drawio-export:
container_name: "dootask-drawio-export-${APP_ID}" container_name: "dootask-drawio-export-${APP_ID}"
image: "jgraph/export-server" image: "jgraph/export-server"
platform: linux/amd64
networks: networks:
extnetwork: extnetwork:
ipv4_address: "${APP_IPPR}.9" ipv4_address: "${APP_IPPR}.9"

View File

@ -5,10 +5,10 @@
<title>Flowchart Maker &amp; Online Diagram Software</title> <title>Flowchart Maker &amp; Online Diagram Software</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Description" content="diagrams.net is free online diagram software for making flowcharts, process diagrams, org charts, UML, ER and network diagrams"> <meta name="Description" content="draw.io is free online diagram software for making flowcharts, process diagrams, org charts, UML, ER and network diagrams">
<meta name="Keywords" content="diagram, online, flow chart, flowchart maker, uml, erd"> <meta name="Keywords" content="drawio, diagram, online, flow chart, flowchart maker, uml, erd">
<meta itemprop="name" content="diagrams.net - free flowchart maker and diagrams online"> <meta itemprop="name" content="draw.io - free flowchart maker and diagrams online">
<meta itemprop="description" content="diagrams.net is a free online diagramming application and flowchart maker . You can use it to create UML, entity relationship, <meta itemprop="description" content="draw.io is a free online diagramming application and flowchart maker . You can use it to create UML, entity relationship,
org charts, BPMN and BPM, database schema and networks. Also possible are telecommunication network, workflow, flowcharts, maps overlays and GIS, electronic org charts, BPMN and BPM, database schema and networks. Also possible are telecommunication network, workflow, flowcharts, maps overlays and GIS, electronic
circuit and social network diagrams."> circuit and social network diagrams.">
<meta itemprop="image" content="https://lh4.googleusercontent.com/-cLKEldMbT_E/Tx8qXDuw6eI/AAAAAAAAAAs/Ke0pnlk8Gpg/w500-h344-k/BPMN%2Bdiagram%2Brc2f.png"> <meta itemprop="image" content="https://lh4.googleusercontent.com/-cLKEldMbT_E/Tx8qXDuw6eI/AAAAAAAAAAs/Ke0pnlk8Gpg/w500-h344-k/BPMN%2Bdiagram%2Brc2f.png">
@ -17,11 +17,6 @@
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#d89000"> <meta name="theme-color" content="#d89000">
<script type="text/javascript"> <script type="text/javascript">
window.SERVER_HOME_URL = window.location.origin + "/"
window.EXPORT_URL = window.SERVER_HOME_URL + "drawio/export/";
window.DRAWIO_LIGHTBOX_URL = window.SERVER_HOME_URL + "drawio/webapp";
setInterval(function() {window.ICONSEARCH_PATH = window.SERVER_HOME_URL + "drawio/iconsearch";}, 1000)
/** /**
* URL Parameters and protocol description are here: * URL Parameters and protocol description are here:
* *
@ -48,7 +43,7 @@
for (var i = 0; i < params.length; i++) for (var i = 0; i < params.length; i++)
{ {
idx = params[i].indexOf('='); var idx = params[i].indexOf('=');
if (idx > 0) if (idx > 0)
{ {
@ -143,7 +138,7 @@
/** /**
* Synchronously adds scripts to the page. * Synchronously adds scripts to the page.
*/ */
function mxscript(src, onLoad, id, dataAppKey, noWrite) function mxscript(src, onLoad, id, dataAppKey, noWrite, onError)
{ {
var defer = onLoad == null && !noWrite; var defer = onLoad == null && !noWrite;
@ -179,6 +174,14 @@
}; };
} }
if (onError != null)
{
s.onerror = function(e)
{
onError('Failed to load ' + src, e);
};
}
var t = document.getElementsByTagName('script')[0]; var t = document.getElementsByTagName('script')[0];
if (t != null) if (t != null)
@ -218,7 +221,7 @@
if (mxIsElectron) if (mxIsElectron)
{ {
// mxmeta(null, 'default-src \'self\' \'unsafe-inline\'; connect-src \'self\' https://*.draw.io https://fonts.googleapis.com https://fonts.gstatic.com; img-src * data:; media-src *; font-src *; style-src-elem \'self\' \'unsafe-inline\' https://fonts.googleapis.com', 'Content-Security-Policy'); mxmeta(null, 'default-src \'self\' \'unsafe-inline\'; connect-src \'self\' https://*.draw.io https://fonts.googleapis.com https://fonts.gstatic.com; img-src * data:; media-src *; font-src *; style-src-elem \'self\' \'unsafe-inline\' https://fonts.googleapis.com', 'Content-Security-Policy');
} }
})(); })();
@ -267,6 +270,8 @@
mxForceIncludes = true; mxForceIncludes = true;
} }
mxForceIncludes = false;
mxscript(drawDevUrl + 'js/PreConfig.js'); mxscript(drawDevUrl + 'js/PreConfig.js');
mxscript(drawDevUrl + 'js/diagramly/Init.js'); mxscript(drawDevUrl + 'js/diagramly/Init.js');
mxscript(geBasePath + '/Init.js'); mxscript(geBasePath + '/Init.js');
@ -353,11 +358,14 @@
}; };
</script> </script>
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/plgmlhohecdddhbmmkncjdmlhcmaachm"> <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/plgmlhohecdddhbmmkncjdmlhcmaachm">
<link rel="stylesheet" type="text/css" href="js/croppie/croppie.min.css"> <link rel="apple-touch-icon" sizes="180x180" href="images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">
<link rel="mask-icon" href="images/safari-pinned-tab.svg" color="#d89000">
<link rel="stylesheet" type="text/css" href="styles/grapheditor.css"> <link rel="stylesheet" type="text/css" href="styles/grapheditor.css">
<link rel="preconnect" href="https://storage.googleapis.com">
<link rel="canonical" href="https://app.diagrams.net"> <link rel="canonical" href="https://app.diagrams.net">
<link rel="manifest" href="images/manifest.json"> <link rel="manifest" href="images/manifest.json">
<link rel="shortcut icon" href="favicon.ico">
<style type="text/css"> <style type="text/css">
body { overflow:hidden; } body { overflow:hidden; }
div.picker { z-index: 10007; } div.picker { z-index: 10007; }
@ -366,7 +374,6 @@
color:#606060; color:#606060;
} }
.geBlock { .geBlock {
display: none;
z-index:-3; z-index:-3;
margin:100px; margin:100px;
margin-top:40px; margin-top:40px;
@ -380,8 +387,8 @@
padding-top:0px; padding-top:0px;
} }
.geEditor *:not(.geScrollable)::-webkit-scrollbar { .geEditor *:not(.geScrollable)::-webkit-scrollbar {
width:14px; width:10px;
height:14px; height:10px;
} }
.geEditor ::-webkit-scrollbar-track { .geEditor ::-webkit-scrollbar-track {
background-clip:padding-box; background-clip:padding-box;
@ -411,9 +418,6 @@
cursor:pointer; cursor:pointer;
margin:5px; margin:5px;
} }
.geDialog h2 {
line-height: 1.2;
}
</style> </style>
<!-- Workaround for binary XHR in IE 9/10, see App.loadUrl --> <!-- Workaround for binary XHR in IE 9/10, see App.loadUrl -->
<!--[if (IE 9)|(IE 10)]><!--> <!--[if (IE 9)|(IE 10)]><!-->
@ -434,7 +438,7 @@
<div class="geBlock"> <div class="geBlock">
<h1>Flowchart Maker and Online Diagram Software</h1> <h1>Flowchart Maker and Online Diagram Software</h1>
<p> <p>
diagrams.net (formerly draw.io) is free online diagram software. You can use it as a flowchart maker, network diagram software, to create UML online, as an ER diagram tool, draw.io is free online diagram software. You can use it as a flowchart maker, network diagram software, to create UML online, as an ER diagram tool,
to design database schema, to build BPMN online, as a circuit diagram maker, and more. draw.io can import .vsdx, Gliffy&trade; and Lucidchart&trade; files . to design database schema, to build BPMN online, as a circuit diagram maker, and more. draw.io can import .vsdx, Gliffy&trade; and Lucidchart&trade; files .
</p> </p>
<h2 id="geStatus">Loading...</h2> <h2 id="geStatus">Loading...</h2>
@ -447,32 +451,17 @@
/** /**
* Main * Main
*/ */
if (navigator.userAgent != null && navigator.userAgent.toLowerCase(). if (urlParams['dev'] != '1' && typeof document.createElement('canvas').getContext === "function")
indexOf(' electron/') >= 0 && typeof process !== 'undefined' && process.versions.electron < 5)
{ {
// Redirects old Electron app to latest version
var div = document.getElementById('geInfo');
if (div != null)
{
div.innerHTML = '<center><h2>You are using an out of date version of this app.<br>Please download the latest version ' +
'<a href="https://github.com/jgraph/drawio-desktop/releases/latest" target="_blank">here</a>.</h2></center>';
}
}
else
{
if (urlParams['dev'] != '1' && typeof document.createElement('canvas').getContext === "function")
{
window.addEventListener('load', function() window.addEventListener('load', function()
{ {
mxWinLoaded = true; mxWinLoaded = true;
checkAllLoaded(); checkAllLoaded();
}); });
} }
else else
{ {
App.main(); App.main();
}
} }
</script> </script>
</body> </body>

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
window.PLUGINS_BASE_PATH = '.'; window.PLUGINS_BASE_PATH = '.';
window.TEMPLATE_PATH = 'templates'; window.TEMPLATE_PATH = 'templates';
window.DRAW_MATH_URL = 'math'; window.DRAW_MATH_URL = 'math/es5';
window.DRAWIO_BASE_URL = '.'; //Prevent access to online website since it is not allowed window.DRAWIO_BASE_URL = '.'; //Prevent access to online website since it is not allowed
FeedbackDialog.feedbackUrl = 'https://log.draw.io/email'; FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
EditorUi.draftSaveDelay = 5000;
//Disables eval for JS (uses shapes-14-6-5.min.js) //Disables eval for JS (uses shapes-14-6-5.min.js)
mxStencilRegistry.allowEval = false; mxStencilRegistry.allowEval = false;
@ -60,10 +60,18 @@ mxStencilRegistry.allowEval = false;
if (file) if (file)
{ {
file.updateFileData(); file.updateFileData();
xml = file.getData(); xml = editorUi.getFileData(true, null, null, null, null, false,
null, null, null, false, true);
title = file.title; title = file.title;
} }
var extras = {globalVars: editorUi.editor.graph.getExportVariables()};
if (Graph.translateDiagram)
{
extras.diagramLanguage = Graph.diagramLanguage;
}
new mxElectronRequest('export', { new mxElectronRequest('export', {
print: true, print: true,
format: 'pdf', format: 'pdf',
@ -78,6 +86,7 @@ mxStencilRegistry.allowEval = false;
sheetsAcross: sheetsAcross, sheetsAcross: sheetsAcross,
sheetsDown: sheetsDown, sheetsDown: sheetsDown,
scale: zoom, scale: zoom,
extras: JSON.stringify(extras),
fileTitle: title fileTitle: title
}).send(function(){}, function(){}); }).send(function(){}, function(){});
}; };
@ -85,13 +94,15 @@ mxStencilRegistry.allowEval = false;
var oldWindowOpen = window.open; var oldWindowOpen = window.open;
window.open = async function(url) window.open = async function(url)
{ {
if (url != null && url.startsWith('http')) // Only open a native electron window when url is empty. We use this in our code in several places.
if (url == null)
{ {
await requestSync({action: 'openExternal', url: url}); return oldWindowOpen(url);
} }
else else
{ {
return oldWindowOpen(url); // Open external will filter urls based on their protocol
await requestSync({action: 'openExternal', url: url});
} }
} }
@ -99,17 +110,37 @@ mxStencilRegistry.allowEval = false;
App.main = async function() App.main = async function()
{ {
// Set AutoSave delay
var draftSaveDelay = mxSettings.getDraftSaveDelay();
if (draftSaveDelay != null)
{
EditorUi.draftSaveDelay = draftSaveDelay * 1000;
EditorUi.enableDrafts = draftSaveDelay > 0;
}
//Load desktop plugins //Load desktop plugins
var plugins = (mxSettings.settings != null) ? mxSettings.getPlugins() : null; var plugins = (mxSettings.settings != null) ? mxSettings.getPlugins() : null;
App.initPluginCallback(); App.initPluginCallback();
if (plugins != null && plugins.length > 0) if (plugins != null && plugins.length > 0)
{
// Workaround for body not defined if plugins are used in dev mode
if (urlParams['dev'] == '1')
{
EditorUi.debug('App.main', 'Skipped plugins', plugins);
}
else
{ {
for (var i = 0; i < plugins.length; i++) for (var i = 0; i < plugins.length; i++)
{ {
try try
{ {
if (plugins[i].startsWith('/plugins/')) if (plugins[i].indexOf('..') >= 0)
{
continue;
}
else if (plugins[i].startsWith('/plugins/'))
{ {
plugins[i] = '.' + plugins[i]; plugins[i] = '.' + plugins[i];
} }
@ -117,19 +148,16 @@ mxStencilRegistry.allowEval = false;
{ {
plugins[i] = './' + plugins[i]; plugins[i] = './' + plugins[i];
} }
//Support old plugins added using file:// workaround else
else if (!plugins[i].startsWith('file://'))
{ {
let appFolder = await requestSync('getAppDataFolder'); let pluginFile = await requestSync({
action: 'getPluginFile',
let pluginsFile = await requestSync({ plugin: plugins[i]
action: 'checkFileExists',
pathParts: [appFolder, '/plugins', plugins[i]]
}); });
if (pluginsFile.exists) if (pluginFile != null)
{ {
plugins[i] = 'file://' + pluginsFile.path; plugins[i] = 'file://' + pluginFile;
} }
else else
{ {
@ -137,6 +165,8 @@ mxStencilRegistry.allowEval = false;
} }
} }
try
{
mxscript(plugins[i]); mxscript(plugins[i]);
} }
catch (e) catch (e)
@ -144,7 +174,28 @@ mxStencilRegistry.allowEval = false;
// ignore // ignore
} }
} }
catch (e)
{
// ignore
} }
}
}
}
//Remove old relaxed CSP and add strict one
var allMeta = document.getElementsByTagName('meta');
for (var i = 0; i < allMeta.length; i++)
{
if (allMeta[i].getAttribute('http-equiv') == 'Content-Security-Policy')
{
allMeta[i].parentNode.removeChild(allMeta[i]);
}
break;
}
mxmeta(null, 'default-src \'self\'; connect-src \'self\' https://fonts.googleapis.com https://fonts.gstatic.com; img-src * data:; media-src *; font-src *; style-src \'self\' \'unsafe-inline\' https://fonts.googleapis.com', 'Content-Security-Policy');
//Disable web plugins loading //Disable web plugins loading
urlParams['plugins'] = '0'; urlParams['plugins'] = '0';
@ -267,25 +318,25 @@ mxStencilRegistry.allowEval = false;
var editorUi = this; var editorUi = this;
var graph = this.editor.graph; var graph = this.editor.graph;
window.__emt_isModified = function() electron.registerMsgListener('isModified', () =>
{ {
if (editorUi.getCurrentFile()) const currentFile = editorUi.getCurrentFile();
let reply = {isModified: false, draftPath: null};
if (currentFile != null)
{ {
return editorUi.getCurrentFile().isModified() reply.isModified = currentFile.isModified();
reply.draftPath = EditorUi.enableDrafts && currentFile.fileObject? currentFile.fileObject.draftFileName : null;
} }
return false electron.sendMessage('isModified-result', reply);
}; });
window.__emt_removeDraft = function() electron.registerMsgListener('removeDraft', () =>
{ {
var currentFile = editorUi.getCurrentFile(); editorUi.getCurrentFile().removeDraft();
electron.sendMessage('draftRemoved', {});
if (currentFile != null && EditorUi.enableDrafts) });
{
currentFile.removeDraft();
}
};
// Adds support for libraries // Adds support for libraries
this.actions.addAction('newLibrary...', mxUtils.bind(this, function() this.actions.addAction('newLibrary...', mxUtils.bind(this, function()
@ -588,7 +639,19 @@ mxStencilRegistry.allowEval = false;
editorUi.actions.addAction('plugins...', function() editorUi.actions.addAction('plugins...', function()
{ {
editorUi.showDialog(new PluginsDialog(editorUi, function(callback) var pluginsMap = {};
//Initialize it with plugins in settings
var plugins = (mxSettings.settings != null) ? mxSettings.getPlugins() : null;
if (plugins != null)
{
for (var i = 0; i < plugins.length; i++)
{
pluginsMap[plugins[i]] = true;
}
}
editorUi.showDialog(new PluginsDialog(editorUi, async function(callback)
{ {
var div = document.createElement('div'); var div = document.createElement('div');
@ -602,9 +665,13 @@ mxStencilRegistry.allowEval = false;
for (var i = 0; i < App.publicPlugin.length; i++) for (var i = 0; i < App.publicPlugin.length; i++)
{ {
var p = App.publicPlugin[i];
if (pluginsMap[App.pluginRegistry[p]]) continue;
var option = document.createElement('option'); var option = document.createElement('option');
mxUtils.write(option, App.publicPlugin[i]); mxUtils.write(option, p);
option.value = App.publicPlugin[i]; option.value = p;
pluginsSelect.appendChild(option); pluginsSelect.appendChild(option);
} }
@ -616,8 +683,23 @@ mxStencilRegistry.allowEval = false;
mxUtils.write(title, mxResources.get('extPlugins') + ': '); mxUtils.write(title, mxResources.get('extPlugins') + ': ');
div.appendChild(title); div.appendChild(title);
if (await requestSync('isPluginsEnabled'))
{
var extPluginsBtn = mxUtils.button(mxResources.get('selectFile') + '...', async function() var extPluginsBtn = mxUtils.button(mxResources.get('selectFile') + '...', async function()
{ {
var warningMsgs = mxResources.get('pluginWarning').split('\\n');
var warningMsg = warningMsgs.pop(); //Last line in the message
if (!warningMsg)
{
warningMsg = warningMsgs.pop();
}
if (!confirm(warningMsg))
{
return;
}
var lastDir = localStorage.getItem('.lastPluginDir'); var lastDir = localStorage.getItem('.lastPluginDir');
var paths = await requestSync({ var paths = await requestSync({
@ -659,20 +741,31 @@ mxStencilRegistry.allowEval = false;
extPluginsBtn.className = 'geBtn'; extPluginsBtn.className = 'geBtn';
div.appendChild(extPluginsBtn); div.appendChild(extPluginsBtn);
}
else
{
title = document.createElement('span');
mxUtils.write(title, mxResources.get('pluginsDisabled'));
div.appendChild(title);
}
var dlg = new CustomDialog(editorUi, div, mxUtils.bind(this, function() var dlg = new CustomDialog(editorUi, div, mxUtils.bind(this, function()
{ {
callback(App.pluginRegistry[pluginsSelect.value]); var newP = App.pluginRegistry[pluginsSelect.value];
pluginsMap[newP] = true;
callback(newP);
})); }));
editorUi.showDialog(dlg.container, 300, 125, true, true); editorUi.showDialog(dlg.container, 300, 125, true, true);
}, },
async function(plugin) async function(plugin)
{ {
delete pluginsMap[plugin];
await requestSync({ await requestSync({
action: 'uninstallPlugin', action: 'uninstallPlugin',
plugin: plugin plugin: plugin
}); });
}).container, 360, 225, true, false); }, true).container, 360, 225, true, false);
}); });
} }
@ -829,25 +922,24 @@ mxStencilRegistry.allowEval = false;
if (file.fileObject != null) if (file.fileObject != null)
{ {
var title = file.fileObject.path; file.addToRecent();
if (title.length > 100)
{
title = '...' + title.substr(title.length - 97);
}
this.addRecent({id: file.fileObject.path, title: title});
await requestSync({ await requestSync({
action: 'watchFile', action: 'watchFile',
path: file.fileObject.path, path: file.fileObject.path,
listener: mxUtils.bind(this, function(curr, prev) listener: mxUtils.bind(this, function(curr, prev)
{ {
EditorUi.debug('EditorUi.watchFile', [this],
'file', [file], 'stat', [file.stat],
'curr', [curr], 'prev', [prev],
'inConflictState', file.inConflictState,
'unwatchedSaves', file.unwatchedSaves);
//File is changed (not just accessed) && File is not already in a conflict state //File is changed (not just accessed) && File is not already in a conflict state
if (curr.mtimeMs != prev.mtimeMs && !file.inConflictState) if (curr.mtimeMs != prev.mtimeMs && !file.inConflictState)
{ {
//Ignore our own changes //Ignore our own changes
if (file.unwatchedSaves || (file.state != null && file.stat.mtimeMs == curr.mtimeMs)) if (file.unwatchedSaves || (file.stat != null && file.stat.mtimeMs == curr.mtimeMs))
{ {
file.unwatchedSaves = false; file.unwatchedSaves = false;
return; return;
@ -855,26 +947,18 @@ mxStencilRegistry.allowEval = false;
file.inConflictState = true; file.inConflictState = true;
this.showError(mxResources.get('externalChanges'), file.addConflictStatus(null, mxUtils.bind(this, function()
mxResources.get('fileChangedSyncDialog'),
mxResources.get('synchronize'), mxUtils.bind(this, function()
{
if (this.spinner.spin(document.body, mxResources.get('updatingDocument')))
{ {
file.ui.editor.setStatus(mxUtils.htmlEntities(
mxResources.get('updatingDocument')));
file.synchronizeFile(mxUtils.bind(this, function() file.synchronizeFile(mxUtils.bind(this, function()
{ {
this.spinner.stop(); file.handleFileSuccess(false);
}), mxUtils.bind(this, function(err) }), mxUtils.bind(this, function(err)
{ {
file.handleFileError(err, true); file.handleFileError(err, true);
})); }));
} }));
}), null, null, null,
mxResources.get('cancel'), mxUtils.bind(this, function()
{
this.hideDialog();
file.handleFileError(null, false);
}), 340, 150);
} }
}) })
}); });
@ -964,6 +1048,21 @@ mxStencilRegistry.allowEval = false;
} }
}; };
EditorUi.prototype.normalizeFilename = function(title, defaultExtension)
{
var tokens = title.split('.');
var ext = (tokens.length > 1) ? tokens[tokens.length - 1] : '';
defaultExtension = (defaultExtension != null) ? defaultExtension : 'drawio';
if (tokens.length == 1 || mxUtils.indexOf(['xml',
'html', 'drawio', 'png', 'svg'], ext) < 0)
{
tokens.push(defaultExtension);
}
return tokens.join('.');
};
//In order not to repeat the logic for opening a file, we collect files information here and use them in openLocalFile //In order not to repeat the logic for opening a file, we collect files information here and use them in openLocalFile
var origOpenFiles = EditorUi.prototype.openFiles; var origOpenFiles = EditorUi.prototype.openFiles;
var openFilesMap = {}; var openFilesMap = {};
@ -1160,7 +1259,7 @@ mxStencilRegistry.allowEval = false;
{ {
this.ui.readGraphFile(mxUtils.bind(this, function(fileEntry, data, stat, name, isModified) this.ui.readGraphFile(mxUtils.bind(this, function(fileEntry, data, stat, name, isModified)
{ {
var file = new LocalFile(this, data, ''); var file = new LocalFile(this.ui, data, '');
file.stat = stat; file.stat = stat;
file.setModified(isModified? true : false); file.setModified(isModified? true : false);
success(file); success(file);
@ -1276,6 +1375,12 @@ mxStencilRegistry.allowEval = false;
LocalFile.prototype.save = function(revision, success, error, unloading, overwrite) LocalFile.prototype.save = function(revision, success, error, unloading, overwrite)
{ {
if (!this.isEditable())
{
this.saveAs(this.title, success, error);
return;
}
DrawioFile.prototype.save.apply(this, [revision, mxUtils.bind(this, function() DrawioFile.prototype.save.apply(this, [revision, mxUtils.bind(this, function()
{ {
this.saveFile(revision, mxUtils.bind(this, function() this.saveFile(revision, mxUtils.bind(this, function()
@ -1307,23 +1412,6 @@ mxStencilRegistry.allowEval = false;
this.editable = editable; this.editable = editable;
}; };
LocalFile.prototype.getFilename = function()
{
var filename = this.title;
// Adds default extension
if (filename.length > 0 && (!/(\.xml)$/i.test(filename) && !/(\.html)$/i.test(filename) &&
!/(\.svg)$/i.test(filename) && !/(\.png)$/i.test(filename) && !/(\.drawio)$/i.test(filename)))
{
filename += '.drawio';
}
return filename;
};
// Prototype inheritance needs new functions to be added to subclasses
LocalLibrary.prototype.getFilename = LocalFile.prototype.getFilename;
LocalFile.prototype.saveFile = async function(revision, success, error, unloading, overwrite) LocalFile.prototype.saveFile = async function(revision, success, error, unloading, overwrite)
{ {
//Safeguard in case saveFile is called from online code in the future //Safeguard in case saveFile is called from online code in the future
@ -1420,10 +1508,13 @@ mxStencilRegistry.allowEval = false;
} }
}); });
try
{
if (this.fileObject == null) if (this.fileObject == null)
{ {
var lastDir = localStorage.getItem('.lastSaveDir'); var lastDir = localStorage.getItem('.lastSaveDir');
var name = this.getFilename(); var name = this.ui.normalizeFilename(this.getTitle(),
this.constructor == LocalLibrary ? 'xml' : null);
var ext = null; var ext = null;
if (name != null) if (name != null)
@ -1433,7 +1524,6 @@ mxStencilRegistry.allowEval = false;
if (idx > 0) if (idx > 0)
{ {
ext = name.substring(idx + 1); ext = name.substring(idx + 1);
name = name.substring(0, idx);
} }
} }
@ -1450,6 +1540,8 @@ mxStencilRegistry.allowEval = false;
this.fileObject.path = path; this.fileObject.path = path;
this.fileObject.name = path.replace(/^.*[\\\/]/, ''); this.fileObject.name = path.replace(/^.*[\\\/]/, '');
this.fileObject.type = 'utf-8'; this.fileObject.type = 'utf-8';
this.title = this.fileObject.name;
this.addToRecent();
fn(); fn();
} }
else else
@ -1462,23 +1554,43 @@ mxStencilRegistry.allowEval = false;
fn(); fn();
} }
} }
catch (e)
{
error(e);
}
}
};
LocalFile.prototype.addToRecent = function()
{
if (this.fileObject == null) return;
var title = this.fileObject.path;
if (title.length > 100)
{
title = '...' + title.substr(title.length - 97);
}
this.ui.addRecent({id: this.fileObject.path, title: title});
}; };
LocalFile.prototype.saveAs = async function(title, success, error) LocalFile.prototype.saveAs = async function(title, success, error)
{
try
{ {
var lastDir = localStorage.getItem('.lastSaveDir'); var lastDir = localStorage.getItem('.lastSaveDir');
var name = this.getFilename(); var name = this.ui.normalizeFilename(this.getTitle(),
this.constructor == LocalLibrary ? 'xml' : null);
var ext = null; var ext = null;
if (name == '' && this.fileObject != null && this.fileObject.name != null) if (name != null)
{ {
name = this.fileObject.name;
var idx = name.lastIndexOf('.'); var idx = name.lastIndexOf('.');
if (idx > 0) if (idx > 0)
{ {
ext = name.substring(idx + 1); ext = name.substring(idx + 1);
name = name.substring(0, idx);
} }
} }
@ -1495,9 +1607,16 @@ mxStencilRegistry.allowEval = false;
this.fileObject.path = path; this.fileObject.path = path;
this.fileObject.name = path.replace(/^.*[\\\/]/, ''); this.fileObject.name = path.replace(/^.*[\\\/]/, '');
this.fileObject.type = 'utf-8'; this.fileObject.type = 'utf-8';
this.title = this.fileObject.name;
this.addToRecent();
this.setEditable(true); //In case original file is read only this.setEditable(true); //In case original file is read only
this.save(false, success, error, null, true); this.save(false, success, error, null, true);
} }
}
catch (e)
{
error(e);
}
}; };
LocalFile.prototype.saveDraft = function() LocalFile.prototype.saveDraft = function()
@ -1543,6 +1662,11 @@ mxStencilRegistry.allowEval = false;
} }
}; };
LocalLibrary.prototype.addToRecent = function()
{
// do nothing
};
/** /**
* Loads the given file handle as a local file. * Loads the given file handle as a local file.
*/ */
@ -1710,155 +1834,16 @@ mxStencilRegistry.allowEval = false;
electron.sendMessage('toggleSpellCheck'); electron.sendMessage('toggleSpellCheck');
} }
var origUpdateHeader = App.prototype.updateHeader; App.prototype.toggleStoreBkp = function()
App.prototype.updateHeader = function()
{ {
origUpdateHeader.apply(this, arguments); electron.sendMessage('toggleStoreBkp');
}
if (urlParams['winCtrls'] != '1') App.prototype.openDevTools = function()
{ {
return; electron.sendMessage('openDevTools');
} }
document.querySelectorAll('.geStatus').forEach(i => i.style.webkitAppRegion = 'no-drag');
var menubarContainer = document.querySelector('.geMenubarContainer');
if (urlParams['sketch'] == '1')
{
menubarContainer = this.titlebar;
}
menubarContainer.style.webkitAppRegion = 'drag';
//Add window control buttons
this.windowControls = document.createElement('div');
this.windowControls.id = 'geWindow-controls';
this.windowControls.innerHTML =
'<div class="button" id="min-button">' +
' <svg width="10" height="1" viewBox="0 0 11 1">' +
' <path d="m11 0v1h-11v-1z" stroke-width=".26208"/>' +
' </svg>' +
'</div>' +
'<div class="button" id="max-button">' +
' <svg width="10" height="10" viewBox="0 0 10 10">' +
' <path d="m10-1.6667e-6v10h-10v-10zm-1.001 1.001h-7.998v7.998h7.998z" stroke-width=".25" />' +
' </svg>' +
'</div>' +
'<div class="button" id="restore-button">' +
' <svg width="10" height="10" viewBox="0 0 11 11">' +
' <path' +
' d="m11 8.7978h-2.2021v2.2022h-8.7979v-8.7978h2.2021v-2.2022h8.7979zm-3.2979-5.5h-6.6012v6.6011h6.6012zm2.1968-2.1968h-6.6012v1.1011h5.5v5.5h1.1011z"' +
' stroke-width=".275" />' +
' </svg>' +
'</div>' +
'<div class="button" id="close-button">' +
' <svg width="10" height="10" viewBox="0 0 12 12">' +
' <path' +
' d="m6.8496 6 5.1504 5.1504-0.84961 0.84961-5.1504-5.1504-5.1504 5.1504-0.84961-0.84961 5.1504-5.1504-5.1504-5.1504 0.84961-0.84961 5.1504 5.1504 5.1504-5.1504 0.84961 0.84961z"' +
' stroke-width=".3" />' +
' </svg>' +
'</div>';
if (uiTheme == 'atlas')
{
this.windowControls.style.top = '9px';
}
else if (urlParams['sketch'] == '1')
{
this.windowControls.style.top = '-1px';
}
menubarContainer.appendChild(this.windowControls);
var handleDarkModeChange = mxUtils.bind(this, function ()
{
if (uiTheme == 'atlas' || Editor.isDarkMode())
{
this.windowControls.style.fill = 'white';
document.querySelectorAll('#geWindow-controls .button').forEach(b => b.className = 'button dark');
}
else
{
this.windowControls.style.fill = '#999';
document.querySelectorAll('#geWindow-controls .button').forEach(b => b.className = 'button white');
}
});
handleDarkModeChange();
this.addListener('darkModeChanged', handleDarkModeChange);
if (this.appIcon != null)
{
this.appIcon.style.webkitAppRegion = 'no-drag';
}
if (this.menubar != null)
{
this.menubar.container.style.webkitAppRegion = 'no-drag';
if (uiTheme == 'atlas')
{
this.menubar.container.style.width = 'fit-content';
}
if (this.menubar.langIcon != null)
{
this.menubar.langIcon.parentNode.removeChild(this.menubar.langIcon);
menubarContainer.appendChild(this.menubar.langIcon);
}
}
window.onbeforeunload = async (event) => {
/* If window is reloaded, remove win event listeners
(DOM element listeners get auto garbage collected but not
Electron win listeners as the win is not dereferenced unless closed) */
await requestSync({action: 'windowAction', method: 'removeAllListeners'});
}
// Make minimise/maximise/restore/close buttons work when they are clicked
document.getElementById('min-button').addEventListener("click", async event => {
await requestSync({action: 'windowAction', method: 'minimize'});
});
document.getElementById('max-button').addEventListener("click", async event => {
await requestSync({action: 'windowAction', method: 'maximize'});
});
document.getElementById('restore-button').addEventListener("click", async event => {
await requestSync({action: 'windowAction', method: 'unmaximize'});
});
document.getElementById('close-button').addEventListener("click", async event => {
await requestSync({action: 'windowAction', method: 'close'});
});
// Toggle maximise/restore buttons when maximisation/unmaximisation occurs
toggleMaxRestoreButtons();
electron.registerMsgListener('maximize', toggleMaxRestoreButtons)
electron.registerMsgListener('unmaximize', toggleMaxRestoreButtons)
electron.registerMsgListener('resize', toggleMaxRestoreButtons)
async function toggleMaxRestoreButtons() {
if (await requestSync({action: 'windowAction', method: 'isMaximized'})) {
document.body.classList.add('geMaximized');
} else {
document.body.classList.remove('geMaximized');
}
}
}
var origUpdateDocumentTitle = App.prototype.updateDocumentTitle;
App.prototype.updateDocumentTitle = function()
{
origUpdateDocumentTitle.apply(this, arguments);
if (this.titlebar != null && this.titlebar.firstChild != null)
{
this.titlebar.firstChild.innerHTML = mxUtils.htmlEntities(document.title);
}
};
/** /**
* Copies the given cells and XML to the clipboard as an embedded image. * Copies the given cells and XML to the clipboard as an embedded image.
*/ */
@ -1961,80 +1946,13 @@ mxStencilRegistry.allowEval = false;
} }
//Direct export to pdf //Direct export to pdf
EditorUi.prototype.createDownloadRequest = function(filename, format, ignoreSelection, base64, transparent, EditorUi.prototype.createDownloadRequest = function(filename, format, ignoreSelection,
currentPage, scale, border, grid, includeXml) base64, transparent, currentPage, scale, border, grid, includeXml, pageRange, w, h)
{ {
var graph = this.editor.graph; var params = this.downloadRequestBuilder(filename, format, ignoreSelection,
var bounds = graph.getGraphBounds(); base64, transparent, currentPage, scale, border, grid, includeXml, pageRange, w, h);
// Exports only current page for images that does not contain file data, but for return new mxElectronRequest('export', params);
// the other formats with XML included or pdf with all pages, we need to send the complete data and use
// the from/to URL parameters to specify the page to be exported.
var data = this.getFileData(true, null, null, null, ignoreSelection, currentPage == false? false : format != 'xmlpng');
var range = null;
var allPages = null;
var embed = (includeXml) ? '1' : '0';
if (format == 'pdf' && currentPage == false)
{
allPages = '1';
}
if (format == 'xmlpng')
{
embed = '1';
format = 'png';
// Finds the current page number
if (this.pages != null && this.currentPage != null)
{
for (var i = 0; i < this.pages.length; i++)
{
if (this.pages[i] == this.currentPage)
{
range = i;
break;
}
}
}
}
var bg = graph.background;
if (format == 'png' && transparent)
{
bg = mxConstants.NONE;
}
else if (!transparent && (bg == null || bg == mxConstants.NONE))
{
bg = '#ffffff';
}
var extras = {globalVars: graph.getExportVariables()};
if (grid)
{
extras.grid = {
size: graph.gridSize,
steps: graph.view.gridSteps,
color: graph.view.gridColor
};
}
return new mxElectronRequest('export', {
format: format,
xml: data,
from: range,
bg: (bg != null) ? bg : mxConstants.NONE,
filename: (filename != null) ? filename : null,
allPages: allPages,
base64: base64,
embedXml: embed,
extras: encodeURIComponent(JSON.stringify(extras)),
scale: scale,
border: border
});
}; };
var origSetAutosave = Editor.prototype.setAutosave; var origSetAutosave = Editor.prototype.setAutosave;
@ -2082,6 +2000,11 @@ mxStencilRegistry.allowEval = false;
{ {
var extras = {globalVars: graph.getExportVariables()}; var extras = {globalVars: graph.getExportVariables()};
if (Graph.translateDiagram)
{
extras.diagramLanguage = Graph.diagramLanguage;
}
editorUi.saveRequest(name, format, editorUi.saveRequest(name, format,
function(newTitle, base64) function(newTitle, base64)
{ {

View File

@ -1,9 +1,9 @@
/*! /*!
* Copyright (c) Ascensio System SIA 2022. All rights reserved * Copyright (c) Ascensio System SIA 2023. All rights reserved
* *
* http://www.onlyoffice.com * http://www.onlyoffice.com
* *
* Version: 7.2.2 (build:56) * Version: 7.3.0 (build:184)
*/ */
;(function(window) { ;(function(window) {
@ -66,6 +66,7 @@
options: <advanced options>, options: <advanced options>,
key: 'key', key: 'key',
vkey: 'vkey', vkey: 'vkey',
referenceData: 'data for external paste',
info: { info: {
owner: 'owner name', owner: 'owner name',
folder: 'path to document', folder: 'path to document',
@ -217,9 +218,12 @@
}, },
leftMenu: { leftMenu: {
navigation: false/true, navigation: false/true,
spellcheck: false/true // spellcheck button in sse spellcheck: false/true // spellcheck button in sse,
mode: false/true // init value for left panel, true - is visible, false - is hidden, used for option "Left panel" on the View Tab
} / false / true, // use instead of customization.leftMenu } / false / true, // use instead of customization.leftMenu
rightMenu: false/true, // use instead of customization.rightMenu rightMenu: {
mode: false/true // init value for right panel, true - is visible, false - is hidden, used for option "Right panel" on the View Tab
} / false/true, // use instead of customization.rightMenu
statusBar: { statusBar: {
textLang: false/true // text language button in de/pe textLang: false/true // text language button in de/pe
docLang: false/true // document language button in de/pe docLang: false/true // document language button in de/pe
@ -232,6 +236,9 @@
change: false/true // hide/show feature in de/pe/sse change: false/true // hide/show feature in de/pe/sse
} / false / true // if false/true - use as init value in de/pe. use instead of customization.spellcheck parameter } / false / true // if false/true - use as init value in de/pe. use instead of customization.spellcheck parameter
}, },
font: {
name: "Arial",
},
chat: true, chat: true,
comments: true, comments: true,
zoom: 100, zoom: 100,
@ -307,6 +314,7 @@
'onRequestCompareFile': <request file to compare>,// must call setRevisedFile method 'onRequestCompareFile': <request file to compare>,// must call setRevisedFile method
'onRequestSharingSettings': <request sharing settings>,// must call setSharingSettings method 'onRequestSharingSettings': <request sharing settings>,// must call setSharingSettings method
'onRequestCreateNew': <try to create document>, 'onRequestCreateNew': <try to create document>,
'onRequestReferenceData': <try to refresh external data>,
} }
} }
@ -370,6 +378,7 @@
_config.editorConfig.canRequestCompareFile = _config.events && !!_config.events.onRequestCompareFile; _config.editorConfig.canRequestCompareFile = _config.events && !!_config.events.onRequestCompareFile;
_config.editorConfig.canRequestSharingSettings = _config.events && !!_config.events.onRequestSharingSettings; _config.editorConfig.canRequestSharingSettings = _config.events && !!_config.events.onRequestSharingSettings;
_config.editorConfig.canRequestCreateNew = _config.events && !!_config.events.onRequestCreateNew; _config.editorConfig.canRequestCreateNew = _config.events && !!_config.events.onRequestCreateNew;
_config.editorConfig.canRequestReferenceData = _config.events && !!_config.events.onRequestReferenceData;
_config.frameEditorId = placeholderId; _config.frameEditorId = placeholderId;
_config.parentOrigin = window.location.origin; _config.parentOrigin = window.location.origin;
@ -783,6 +792,13 @@ b.prototype.lockWithTimeout=function(a){this.lockCounter++;var c=this;setTimeout
}); });
}; };
var _setReferenceData = function(data) {
_sendCommand({
command: 'setReferenceData',
data: data
});
};
var _serviceCommand = function(command, data) { var _serviceCommand = function(command, data) {
_sendCommand({ _sendCommand({
command: 'internalCommand', command: 'internalCommand',
@ -820,7 +836,8 @@ b.prototype.lockWithTimeout=function(a){this.lockCounter++;var c=this;setTimeout
setFavorite : _setFavorite, setFavorite : _setFavorite,
requestClose : _requestClose, requestClose : _requestClose,
grabFocus : _grabFocus, grabFocus : _grabFocus,
blurFocus : _blurFocus blurFocus : _blurFocus,
setReferenceData : _setReferenceData
} }
}; };
@ -840,7 +857,7 @@ b.prototype.lockWithTimeout=function(a){this.lockCounter++;var c=this;setTimeout
}; };
DocsAPI.DocEditor.version = function() { DocsAPI.DocEditor.version = function() {
return '7.2.2'; return '7.3.0';
}; };
MessageDispatcher = function(fn, scope) { MessageDispatcher = function(fn, scope) {
@ -978,7 +995,7 @@ b.prototype.lockWithTimeout=function(a){this.lockCounter++;var c=this;setTimeout
} }
function getAppParameters(config) { function getAppParameters(config) {
var params = "?_dc=7.2.2-56"; var params = "?_dc=7.3.0-184";
if (config.editorConfig && config.editorConfig.lang) if (config.editorConfig && config.editorConfig.lang)
params += "&lang=" + config.editorConfig.lang; params += "&lang=" + config.editorConfig.lang;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
Subproject commit d1e210ce4ba5cced90a56866036e888795792d59 Subproject commit 1a858166fb4f1330cf23e58941e3fbec1dcd16f8