@@ -9,9 +9,10 @@ import {
99 getFrontend ,
1010 getBackend ,
1111 IModel ,
12- Setting ,
13- fetchPost ,
14- Protyle , openWindow , IOperation
12+ Protyle ,
13+ openWindow ,
14+ IOperation ,
15+ Constants
1516} from "siyuan" ;
1617import "@/index.scss" ;
1718
@@ -120,6 +121,9 @@ export default class PluginSample extends Plugin {
120121 text : "This is my custom dock"
121122 } ,
122123 type : DOCK_TYPE ,
124+ resize ( ) {
125+ console . log ( DOCK_TYPE + " resize" ) ;
126+ } ,
123127 init ( ) {
124128 this . element . innerHTML = `<div class="fn__flex-1 fn__flex-column">
125129 <div class="block__icons">
@@ -308,7 +312,7 @@ export default class PluginSample extends Plugin {
308312
309313 private showDialog ( ) {
310314 let dialog = new Dialog ( {
311- title : "Hello World" ,
315+ title : `SiYuan ${ Constants . SIYUAN_VERSION } ` ,
312316 content : `<div id="helloPanel" class="b3-dialog__content"></div>` ,
313317 width : this . isMobile ? "92vw" : "720px" ,
314318 destroyCallback ( options ) {
@@ -528,6 +532,18 @@ export default class PluginSample extends Plugin {
528532 click : ( ) => {
529533 this . eventBus . off ( "loaded-protyle-dynamic" , this . eventBusLog ) ;
530534 }
535+ } , {
536+ icon : "iconSelect" ,
537+ label : "On switch-protyle" ,
538+ click : ( ) => {
539+ this . eventBus . on ( "switch-protyle" , this . eventBusLog ) ;
540+ }
541+ } , {
542+ icon : "iconClose" ,
543+ label : "Off switch-protyle" ,
544+ click : ( ) => {
545+ this . eventBus . off ( "switch-protyle" , this . eventBusLog ) ;
546+ }
531547 } , {
532548 icon : "iconSelect" ,
533549 label : "On destroy-protyle" ,
0 commit comments