File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 "js-url" : " ~2.0.2" ,
3131 "socket.io-client" : " ~1.3.7" ,
3232 "viz.js" : " ~1.3.0" ,
33- "js-yaml" : " ~3.4.6"
33+ "js-yaml" : " ~3.4.6" ,
34+ "to-markdown" : " ~1.3.0"
3435 }
3536}
Original file line number Diff line number Diff line change @@ -985,13 +985,17 @@ $('#refreshModalRefresh').click(function () {
985985function parseToEditor ( data ) {
986986 var parsed = toMarkdown ( data ) ;
987987 if ( parsed )
988- editor . replaceRange ( parsed , {
989- line : 0 ,
990- ch : 0
991- } , {
992- line : editor . lastLine ( ) ,
993- ch : editor . lastLine ( ) . length
994- } , '+input' ) ;
988+ replaceAll ( parsed ) ;
989+ }
990+
991+ function replaceAll ( data ) {
992+ editor . replaceRange ( data , {
993+ line : 0 ,
994+ ch : 0
995+ } , {
996+ line : editor . lastLine ( ) ,
997+ ch : editor . lastLine ( ) . length
998+ } , '+input' ) ;
995999}
9961000
9971001function importFromUrl ( url ) {
@@ -1005,7 +1009,11 @@ function importFromUrl(url) {
10051009 method : "GET" ,
10061010 url : url ,
10071011 success : function ( data ) {
1008- parseToEditor ( data ) ;
1012+ var extension = url . split ( '.' ) . pop ( ) ;
1013+ if ( extension == 'html' )
1014+ parseToEditor ( data ) ;
1015+ else
1016+ replaceAll ( data ) ;
10091017 } ,
10101018 error : function ( ) {
10111019 alert ( 'Import failed :(' ) ;
You can’t perform that action at this time.
0 commit comments