diff --git a/src/editor/index.js b/src/editor/index.js index 9aee8018c..8653d843b 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -439,12 +439,16 @@ export default (config = {}, opts = {}) => { }, /** - * Get the JSON data object, which could be stored and loaded back with `editor.loadData(json)` + * Get the JSON project data, which could be stored and loaded back with `editor.loadProject(json)` * @returns {Object} * @example - * console.log(editor.storeData()); + * console.log(editor.getProject()); * // { pages: [...], styles: [...], ... } */ + getProject() { + return em.storeData(); + }, + storeData() { return em.storeData(); }, @@ -459,12 +463,15 @@ export default (config = {}, opts = {}) => { }, /** - * Load data from the JSON data object - * @param {Object} data Data to load - * @return {Object} Loaded object + * Load data from the JSON project + * @param {Object} data Project to load * @example - * editor.loadData({ pages: [...], styles: [...], ... }) + * editor.loadProject({ pages: [...], styles: [...], ... }) */ + loadProject(data) { + return em.loadData(data); + }, + loadData(data) { return em.loadData(data); }, diff --git a/src/storage_manager/config/config.js b/src/storage_manager/config/config.js index 3f1ce08c2..8d2c43bba 100644 --- a/src/storage_manager/config/config.js +++ b/src/storage_manager/config/config.js @@ -3,10 +3,10 @@ export default { id: 'gjs-', // Enable/Disable autosaving - autosave: 1, + autosave: true, // Indicates if load data inside editor after init - autoload: 1, + autoload: true, // Indicates which storage to use. Available: local | remote type: 'local', @@ -16,20 +16,20 @@ export default { stepsBeforeSave: 1, //Enable/Disable components model (JSON format) - storeComponents: 1, + storeComponents: true, //Enable/Disable styles model (JSON format) - storeStyles: 1, + storeStyles: true, //Enable/Disable saving HTML template - storeHtml: 1, + storeHtml: true, //Enable/Disable saving CSS template - storeCss: 1, + storeCss: true, // ONLY FOR LOCAL STORAGE // If enabled, checks if browser supports Local Storage - checkLocal: 1, + checkLocal: true, // ONLY FOR REMOTE STORAGE // Custom parameters to pass with the remote storage request, eg. csrf token @@ -63,5 +63,5 @@ export default { // currentOpts => { // return currentOpts.method === 'post' ? { method: 'patch' } : {}; // } - fetchOptions: '' + fetchOptions: '', };