File tree 1 file changed +22
-0
lines changed
django/applications/catmaid/static/libs/catmaid
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 80
80
) . join ( recordSep ) ;
81
81
} ;
82
82
83
+ /**
84
+ * A convenient function to invoke saveAs with the appropriate Blob
85
+ * and mimetype, for plain text.
86
+ * The filename is optional.
87
+ */
88
+ CATMAID . saveTextAs = function ( text , filename )
89
+ {
90
+ return saveAs ( new Blob ( [ text ] , { type : 'text/plain' } ) ,
91
+ undefined === filename ? "content.txt" : filename ) ;
92
+ } ;
93
+
94
+ /**
95
+ * A convenient function to invoke saveAs with the appropriate Blob
96
+ * and mimetype, for a javascript object (array, object, etc.)
97
+ * The filename is optional.
98
+ */
99
+ CATMAID . saveJSONAs = function ( ob , filename )
100
+ {
101
+ return saveAs ( new Blob ( [ JSON . stringify ( ob ) ] , { type : 'text/plain' } ) ,
102
+ undefined === filename ? "ob.json" : filename ) ;
103
+ } ;
104
+
83
105
} ) ( CATMAID ) ;
You can’t perform that action at this time.
0 commit comments