GithubHelp home page GithubHelp logo

xpycts / tinymce-localautosave Goto Github PK

View Code? Open in Web Editor NEW

This project forked from valtlfelipe/tinymce-localautosave

0.0 1.0 0.0 83 KB

Local AutoSave plugin for TinyMCE 4.x

License: MIT License

JavaScript 100.00%

tinymce-localautosave's Introduction

Local AutoSave plugin for TinyMCE 4.x

Save the TinyMCE (v4.x) content to LocalStorage* or SessionStorage* in your Browser to avoid losing your content on a page refresh, etc.

*Only if Browser supports webstorage. See a list of Supported Browsers.

*Cookie support has been disabled for now.

Demo

Do you want to see it in action? Visit http://valtlfelipe.github.io/TinyMCE-LocalAutoSave/.

Quick start

Install with Bower:

bower install tinymce-localautosave

And use:

tinymce.init({
	plugins: "localautosave",
	toolbar1: "localautosave",
	external_plugins : {
		"localautosave" : "bower_components/tinymce-localautosave/localautosave/plugin.min.js"
	}
});

Or download it manually:

  1. Download a copy (.zip).

  2. Unzip the localautosave folder in your TinyMCE plugin folder tinymce/plugins/.

  3. Initialize plugin and add it to the toolbar. Example:

tinymce.init({
	plugins: "localautosave",
	toolbar1: "localautosave"
});

Translation

Currently available translations: de, en, es, fr, it, pt_BR, tr, zh_CN.

If you have translated this plugin, please create a pull request or send me a message so I can add your translation to this repository. Thanks!

Documentation

You can configure this plugin using the methods listed here (those configurations are optional):

  1. las_seconds => set the period to save the content in seconds (default 6).

  2. las_keyName => set the key name for the LocalStorage, SessionStorage.

  3. las_callback => fires an function with two variables in this object when content is saved successfully.

  4. las_nVersions => number of versions of content you want to store (default 15, set 0 to disable)

Example:

tinymce.init({
	plugins: "localautosave",
	toolbar1: "localautosave",
	las_seconds: 15,
	las_nVersions: 15,
	las_keyName: "LocalAutoSave",
	las_callback: function() {
		var content = this.content; //content saved
		var time = this.time; //time on save action
	}
});

License

View the License for this repository.

Contributors

Thank you to Valerio Gentile, gastonsanguinetti, Quentin Delettre, Burak Ozdemir, Zhiqian MA and Hubertus Becker for contributing.

Analytics

tinymce-localautosave's People

Contributors

bitdeli-chef avatar dvcama avatar gsanguinetti avatar horans avatar qdelettre avatar valtlfelipe avatar xpycts avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.