Load/Save Plugin for TinyMCE
This plugin will leverage jsfs to add load and save functionality to a TinyMCE instance. It assumes that both TinyMCE and jsfs have been loaded into the global namespace, so that it can access both.
To use this module in your page, you must:
- Include in your page an instance of the TinyMCE editor. You can do so with a script tag like this one:
<script src="https://cloud.tinymce.com/stable/tinymce.min.js"></script>
- Import the modules on which this one depends, including LZString for compression and jsfs for an in-browser filesystem. Like so:
<script language='javascript' src='https://cdn.jsdelivr.net/npm/[email protected]/libs/lz-string.min.js'></script>
<script src="https://cdn.jsdelivr.net/gh/nathancarter/jsfs@1/release/jsfs.min.js"></script>
- Copy into your page's folder all the files in
the example folder of this repository,
with the exception of
example.html
. - In your call to
tinymce.init
, be sure to include these options.plugins: "-loadsave"
- On the File menu, the items
newfile
,openfile
,savefile
,saveas
, andmanagefiles
To see all this in action, check out the example page.