@@ -9,23 +9,23 @@ const handleServiceMessages = function( event ) {
99 const { ns, id} = splitFullId ( fullId ) ;
1010
1111 const msg = JSON . parse ( event . originalEvent . data ) ;
12- const drawio = jQuery ( '#drawio -frame' ) [ 0 ] . contentWindow ;
12+ const diagrams = jQuery ( '#diagrams -frame' ) [ 0 ] . contentWindow ;
1313 if ( msg . event === 'init' ) {
1414 // try loading existing diagram file
1515 jQuery . get ( DOKU_BASE + 'lib/exe/fetch.php?media=' + fullId , function ( data ) {
16- drawio . postMessage ( JSON . stringify ( { action : 'load' , xml : data } ) , '*' ) ;
16+ diagrams . postMessage ( JSON . stringify ( { action : 'load' , xml : data } ) , '*' ) ;
1717 } , 'text' )
1818 . fail ( function ( ) { // catch 404, file does not yet exist locally
19- drawio . postMessage ( JSON . stringify ( { action : 'load' , xml : '' } ) , '*' ) ;
19+ diagrams . postMessage ( JSON . stringify ( { action : 'load' , xml : '' } ) , '*' ) ;
2020 } ) ;
2121 } else if ( msg . event === 'save' ) {
22- drawio . postMessage (
23- JSON . stringify ( { action : 'export' , format : 'xmlsvg' , spin : LANG . plugins . drawio . saving } ) ,
22+ diagrams . postMessage (
23+ JSON . stringify ( { action : 'export' , format : 'xmlsvg' , spin : LANG . plugins . diagrams . saving } ) ,
2424 '*'
2525 ) ;
2626 } else if ( msg . event === 'export' ) {
2727 if ( msg . format !== 'svg' ) {
28- alert ( LANG . plugins . drawio . errorUnsupportedFormat ) ;
28+ alert ( LANG . plugins . diagrams . errorUnsupportedFormat ) ;
2929 } else {
3030 const datastr = doctypeXML + '\n' +
3131 decodeURIComponent ( atob ( msg . data . split ( ',' ) [ 1 ] ) . split ( '' ) . map ( function ( c ) {
@@ -34,7 +34,7 @@ const handleServiceMessages = function( event ) {
3434 jQuery . post ( getLocalDiagramUrl ( ns , id ) , datastr )
3535 . done ( function ( ) {
3636 jQuery ( window ) . off ( 'message' , { fullId : fullId } , handleServiceMessages ) ;
37- jQuery ( '#drawio -frame' ) . remove ( ) ;
37+ jQuery ( '#diagrams -frame' ) . remove ( ) ;
3838 const url = new URL ( location . href ) ;
3939 // media manager window should show current namespace
4040 url . searchParams . set ( 'ns' , ns ) ;
@@ -43,11 +43,11 @@ const handleServiceMessages = function( event ) {
4343 } , 200 ) ;
4444 } )
4545 . fail ( function ( ) {
46- alert ( LANG . plugins . drawio . errorSaving ) ;
46+ alert ( LANG . plugins . diagrams . errorSaving ) ;
4747 } ) ;
4848 }
4949 } else if ( msg . event === 'exit' ) {
5050 jQuery ( window ) . off ( 'message' , { fullId : fullId } , handleServiceMessages ) ;
51- jQuery ( '#drawio -frame' ) . remove ( ) ;
51+ jQuery ( '#diagrams -frame' ) . remove ( ) ;
5252 }
5353} ;
0 commit comments