PHP Classes

File: public/js/tinymce/src/plugins/autosave/src/main/js/api/Settings.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/plugins/autosave/src/main/js/api/Settings.js   Download  
File: public/js/tinymce/src/plugins/autosave/src/main/js/api/Settings.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: GoLavaCMS
Publish content on Web pages with SEO support
Author: By
Last change:
Date: 6 years ago
Size: 1,595 bytes
 

Contents

Class file image Download
/** * Settings.js * * Released under LGPL License. * Copyright (c) 1999-2017 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ define( 'tinymce.plugins.autosave.api.Settings', [ 'global!document', 'tinymce.plugins.autosave.core.Time' ], function (document, Time) { var shouldAskBeforeUnload = function (editor) { return editor.getParam("autosave_ask_before_unload", true); }; var getAutoSavePrefix = function (editor) { var prefix = editor.getParam('autosave_prefix', 'tinymce-autosave-{path}{query}{hash}-{id}-'); prefix = prefix.replace(/\{path\}/g, document.location.pathname); prefix = prefix.replace(/\{query\}/g, document.location.search); prefix = prefix.replace(/\{hash\}/g, document.location.hash); prefix = prefix.replace(/\{id\}/g, editor.id); return prefix; }; var shouldRestoreWhenEmpty = function (editor) { return editor.getParam('autosave_restore_when_empty', false); }; var getAutoSaveInterval = function (editor) { return Time.parse(editor.settings.autosave_interval, '30s'); }; var getAutoSaveRetention = function (editor) { return Time.parse(editor.settings.autosave_retention, '20m'); }; return { shouldAskBeforeUnload: shouldAskBeforeUnload, getAutoSavePrefix: getAutoSavePrefix, shouldRestoreWhenEmpty: shouldRestoreWhenEmpty, getAutoSaveInterval: getAutoSaveInterval, getAutoSaveRetention: getAutoSaveRetention }; } );