Skip to content

Commit

Permalink
改造100%
Browse files Browse the repository at this point in the history
  • Loading branch information
sasayw committed Jan 8, 2022
1 parent 26593c2 commit d4345df
Showing 11 changed files with 1,545 additions and 1,526 deletions.
12 changes: 6 additions & 6 deletions src/main/webapp/index.html
Original file line number Diff line number Diff line change
@@ -11,10 +11,10 @@
<meta itemprop="description" content="diagrams.net 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
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 name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- <meta itemprop="image" content="https://lh4.googleusercontent.com/-cLKEldMbT_E/Tx8qXDuw6eI/AAAAAAAAAAs/Ke0pnlk8Gpg/w500-h344-k/BPMN%2Bdiagram%2Brc2f.png"> -->
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> -->
<meta name="msapplication-config" content="images/browserconfig.xml">
<meta name="mobile-web-app-capable" content="yes">
<!-- <meta name="mobile-web-app-capable" content="false"> -->
<meta name="theme-color" content="#d89000">
<script type="text/javascript">
/**
@@ -347,15 +347,15 @@
}
};
</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="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="js/croppie/croppie.min.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="preconnect" href="https://storage.googleapis.com"> -->
<!-- <link rel="canonical" href="https://app.diagrams.net"> -->
<link rel="manifest" href="images/manifest.json">
<link rel="shortcut icon" href="favicon.ico">
<style type="text/css">
2,166 changes: 1,084 additions & 1,082 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

69 changes: 36 additions & 33 deletions src/main/webapp/js/diagramly/App.js
Original file line number Diff line number Diff line change
@@ -826,7 +826,7 @@ App.main = function(callback, createUi)
*/
if (urlParams['math'] != '0')
{
Editor.initMath();
//Editor.initMath();
}

function doLoad(bundle)
@@ -1022,8 +1022,11 @@ App.main = function(callback, createUi)

//sai
if(chrome.webview.hostObjects){
var articleContent = await App.requestAsync('Note', 'GetContent'); //chrome.webview.hostObjects.csharp.GetContent();
ui.openLocalFile(articleContent);
var result = await App.requestAsync('Note', 'GetContent');
if(result.data)
ui.openLocalFile(result.data);

App.requestAsync('Note', 'LoadComplete');
return;
}
};
@@ -2264,36 +2267,36 @@ App.prototype.resetRecent = function(entry)
/**
* Sets the onbeforeunload for the application
*/
App.prototype.onBeforeUnload = function()
{
if (urlParams['embed'] == '1' && this.editor.modified)
{
return mxResources.get('allChangesLost');
}
else
{
var file = this.getCurrentFile();

if (file != null)
{
// KNOWN: Message is ignored by most browsers
if (file.constructor == LocalFile && file.getHash() == '' && !file.isModified() &&
urlParams['nowarn'] != '1' && !this.isDiagramEmpty() && urlParams['url'] == null &&
!this.editor.isChromelessView() && file.fileHandle == null)
{
return mxResources.get('ensureDataSaved');
}
else if (file.isModified())
{
return mxResources.get('allChangesLost');
}
else
{
file.close(true);
}
}
}
};
// App.prototype.onBeforeUnload = function()
// {
// if (urlParams['embed'] == '1' && this.editor.modified)
// {
// return mxResources.get('allChangesLost');
// }
// else
// {
// var file = this.getCurrentFile();

// if (file != null)
// {
// // KNOWN: Message is ignored by most browsers
// if (file.constructor == LocalFile && file.getHash() == '' && !file.isModified() &&
// urlParams['nowarn'] != '1' && !this.isDiagramEmpty() && urlParams['url'] == null &&
// !this.editor.isChromelessView() && file.fileHandle == null)
// {
// return mxResources.get('ensureDataSaved');
// }
// else if (file.isModified())
// {
// return mxResources.get('allChangesLost');
// }
// else
// {
// file.close(true);
// }
// }
// }
// };

/**
* Translates this point by the given vector.
8 changes: 4 additions & 4 deletions src/main/webapp/js/diagramly/EditorUi.js
Original file line number Diff line number Diff line change
@@ -5579,7 +5579,7 @@
var fetchParam = (publicUrl != null) ? '&fetch=' + encodeURIComponent(publicUrl) : '';
var s2 = (fetchParam.length > 0) ? (((urlParams['dev'] == '1') ?
'https://test.draw.io/embed2.js?dev=1' : EditorUi.lightboxHost + '/embed2.js?')) + fetchParam :
(((urlParams['dev'] == '1') ? 'https://test.draw.io/js/viewer-static.min.js' :
(((urlParams['dev'] == '1') ? './viewer-static.min.js' :
window.DRAWIO_VIEWER_URL ? window.DRAWIO_VIEWER_URL : EditorUi.lightboxHost + '/js/viewer-static.min.js'));
var src = '<script type="text/javascript" src="' + s2 + '"></script>';

@@ -5593,16 +5593,16 @@
try {
me.getImageDataUriAsync().then(function (imageData) {
if (!imageData)
App.requestAsync('Note', 'Article_Save', '', '');
App.requestAsync('Note', 'DrawioSave', '', '');
else {
me.getHtmlDataAsync().then(function (htmlData) {
App.requestAsync('Note', 'Article_Save', imageData, htmlData);
App.requestAsync('Note', 'DrawioSave', imageData, htmlData);
resolve();
});
}
});
} catch (e) {
App.requestAsync('Note', 'Article_Save', '', '');
App.requestAsync('Note', 'DrawioSave', '', '');
resolve();
}
});
2 changes: 1 addition & 1 deletion src/main/webapp/js/export.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ var GOOGLE_APPS_MAX_AREA = 25000000;
var GOOGLE_SHEET_MAX_AREA = 1048576; //1024x1024

//TODO Add support for loading math from a local folder
Editor.initMath((remoteMath? 'https://app.diagrams.net/' : '') + 'math/MathJax.js');
//Editor.initMath((remoteMath? 'https://app.diagrams.net/' : '') + 'math/MathJax.js');

function render(data)
{
6 changes: 4 additions & 2 deletions src/main/webapp/js/extensions.min.js

Large diffs are not rendered by default.

30 changes: 16 additions & 14 deletions src/main/webapp/js/grapheditor/EditorUi.js
Original file line number Diff line number Diff line change
@@ -3372,27 +3372,29 @@ EditorUi.prototype.isSelectionAllowed = function(evt)
*/
EditorUi.prototype.addBeforeUnloadListener = function()
{
//sai
// Installs dialog if browser window is closed without saving
// This must be disabled during save and image export
window.onbeforeunload = mxUtils.bind(this, function()
{
if (!this.editor.isChromelessView())
{
return this.onBeforeUnload();
}
});
// window.onbeforeunload = mxUtils.bind(this, function()
// {
// if (!this.editor.isChromelessView())
// {
// return this.onBeforeUnload();
// }
// });
};

/**
* Sets the onbeforeunload for the application
*/
EditorUi.prototype.onBeforeUnload = function()
{
if (this.editor.modified)
{
return mxResources.get('allChangesLost');
}
};
//sai
// EditorUi.prototype.onBeforeUnload = function()
// {
// if (this.editor.modified)
// {
// return mxResources.get('allChangesLost');
// }
// };

/**
* Opens the current diagram via the window.opener if one exists.
2 changes: 1 addition & 1 deletion src/main/webapp/js/orgchart.min.js

Large diffs are not rendered by default.

387 changes: 196 additions & 191 deletions src/main/webapp/js/viewer-static.min.js

Large diffs are not rendered by default.

385 changes: 195 additions & 190 deletions src/main/webapp/js/viewer.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/main/wpf/WebViewTest/WebViewTest/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -34,8 +34,8 @@ private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
await webView.EnsureCoreWebView2Async(await CommonConstant.GetWebView2EnvironmentAsync());
webView.CoreWebView2.AddHostObjectToScript("csharp", new CallbackObjectForJs());
//webView.Source = new Uri(@"file://D:\github\drawio\src\main\webapp\index.html?local=1&splash=0&math=0");
webView.Source = new Uri(@"file://D:\github\drawio\src\main\webapp\index.html?local=1&splash=0&dev=1&math=0");
//webView.Source = new Uri(@"file://D:\github\drawio\src\main\webapp\index.html?math=0");
//webView.Source = new Uri(@"file://D:\github\drawio\src\main\webapp\index.html?local=1&splash=0&dev=1&math=0&ui=atlas");
webView.Source = new Uri(@"file://D:\github\drawio\src\main\webapp\publish\index.html?local=1&splash=0&math=0&ui=atlas");

//webView.Source = new Uri(@"file:///D:/git/vctool/client/extjs670/resources/drawio-8.3.5/src/main/webapp/index.html?dev=1");
}

0 comments on commit d4345df

Please sign in to comment.