|
236 | 236 |
|
237 | 237 | mxscript(drawDevUrl + './js/PreConfig.js');
|
238 | 238 | 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'); |
241 | 241 |
|
242 | 242 | // Adds all JS code that depends on mxClient. This indirection via Devel.js is
|
243 | 243 | // required in some browsers to make sure mxClient.js (and the files that it
|
@@ -441,51 +441,51 @@ <h2 id="geStatus">Loading...</h2>
|
441 | 441 |
|
442 | 442 | <script type="module">
|
443 | 443 | 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 | + } |
455 | 456 | }
|
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); |
461 | 461 |
|
462 |
| - var id = urlParams.id; |
| 462 | + var id = urlParams.id; |
463 | 463 |
|
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'); |
469 | 469 |
|
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) { |
480 | 470 | let href = `${window.location.origin}${window.location.pathname}?dev=1&id=${id}#U${window.location.origin}/${asset}`;
|
481 | 471 | // console.log(href);
|
482 | 472 | window.location.href = href;
|
483 | 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) { |
| 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 | + } |
484 | 485 | }
|
485 | 486 | }
|
486 |
| -} |
487 |
| -// console.log(window.location); |
488 |
| -setTimeout(open, 0); |
| 487 | + // console.log(window.location); |
| 488 | + setTimeout(open, 0); |
489 | 489 | </script>
|
490 | 490 |
|
491 | 491 | </html>
|
0 commit comments