Skip to content

Commit 4578eee

Browse files
committedFeb 25, 2022
fix
- 修复使用 `https` 协议时文件校验不通过问题 | Fixed an issue where file validation failed when using the `https` protocol. - 修复部分资源文件引用路径问题 | Fixed an issue with some resource file reference paths.
1 parent d14bb32 commit 4578eee

File tree

4 files changed

+176
-173
lines changed

4 files changed

+176
-173
lines changed
 

‎CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# 更改日志 | CHANGE LOG
22

3+
- 修复使用 `https` 协议时文件校验不通过问题 | Fixed an issue where file validation failed when using the `https` protocol.
4+
- 修复部分资源文件引用路径问题 | Fixed an issue with some resource file reference paths.
5+
36
## v0.1.0/2022-02-24
47

58
- 自动加载块属性 `custom-data-assets` 中设置的资源文件 | The resource file set in the block attribute `custom-data-assets` is automatically loaded.

‎index.html

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@
236236

237237
mxscript(drawDevUrl + './js/PreConfig.js');
238238
mxscript(drawDevUrl + './js/diagramly/Init.js');
239-
mxscript(geBasePath + './Init.js');
240-
mxscript(mxBasePath + './mxClient.js');
239+
mxscript(geBasePath + '/Init.js');
240+
mxscript(mxBasePath + '/mxClient.js');
241241

242242
// Adds all JS code that depends on mxClient. This indirection via Devel.js is
243243
// required in some browsers to make sure mxClient.js (and the files that it
@@ -441,51 +441,51 @@ <h2 id="geStatus">Loading...</h2>
441441

442442
<script type="module">
443443
import {
444-
getBlockAttrs,
445-
} from './siyuan/api.js';
446-
447-
async function open() {
448-
var urlParams = (() => {
449-
var result = new Object();
450-
var params = window.location.search.slice(1).split('&');
451-
for (var i = 0; i < params.length; i++) {
452-
let idx = params[i].indexOf('=');
453-
if (idx > 0) {
454-
result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
444+
getBlockAttrs,
445+
} from './siyuan/api.js';
446+
447+
async function open() {
448+
var urlParams = (() => {
449+
var result = new Object();
450+
var params = window.location.search.slice(1).split('&');
451+
for (var i = 0; i < params.length; i++) {
452+
let idx = params[i].indexOf('=');
453+
if (idx > 0) {
454+
result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
455+
}
455456
}
456-
}
457-
return result;
458-
})();
459-
// console.log(urlParams);
460-
// console.log(window.location);
457+
return result;
458+
})();
459+
// console.log(urlParams);
460+
// console.log(window.location);
461461

462-
var id = urlParams.id;
462+
var id = urlParams.id;
463463

464-
if (id == null) {
465-
let node = window.frameElement != null ? window.frameElement.parentElement.parentElement : null;
466-
if (node != null) {
467-
id = node.getAttribute('data-node-id');
468-
let asset = node.getAttribute('custom-data-assets');
464+
if (id == null) {
465+
let node = window.frameElement != null ? window.frameElement.parentElement.parentElement : null;
466+
if (node != null) {
467+
id = node.getAttribute('data-node-id');
468+
let asset = node.getAttribute('custom-data-assets');
469469

470-
let href = `${window.location.origin}${window.location.pathname}?dev=1&id=${id}#U${window.location.origin}/${asset}`;
471-
// console.log(href);
472-
window.location.href = href;
473-
}
474-
} else {
475-
if (window.location.hash == '') {
476-
let data = await getBlockAttrs(id);
477-
// console.log(data);
478-
let asset = data['custom-data-assets'];
479-
if (asset != null) {
480470
let href = `${window.location.origin}${window.location.pathname}?dev=1&id=${id}#U${window.location.origin}/${asset}`;
481471
// console.log(href);
482472
window.location.href = href;
483473
}
474+
} else {
475+
if (window.location.hash == '') {
476+
let data = await getBlockAttrs(id);
477+
// console.log(data);
478+
let asset = data['custom-data-assets'];
479+
if (asset != null) {
480+
let href = `${window.location.origin}${window.location.pathname}?dev=1&id=${id}#U${window.location.origin}/${asset}`;
481+
// console.log(href);
482+
window.location.href = href;
483+
}
484+
}
484485
}
485486
}
486-
}
487-
// console.log(window.location);
488-
setTimeout(open, 0);
487+
// console.log(window.location);
488+
setTimeout(open, 0);
489489
</script>
490490

491491
</html>

‎js/diagramly/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ App.main = function(callback, createUi)
643643
{
644644
var content = mxUtils.getTextContent(scripts[0]);
645645

646-
if (CryptoJS.MD5(content).toString() != '8445baab47ce600df0a216ded2e4ba30')
646+
if (CryptoJS.MD5(content).toString() != '8d30a606a5a4d5fb5186a4989593c4bd')
647647
{
648648
console.log('Change bootstrap script MD5 in the previous line:', CryptoJS.MD5(content).toString());
649649
alert('[Dev] Bootstrap script change requires update of CSP');

0 commit comments

Comments
 (0)