PHP Classes

File: public/js/tinymce/src/plugins/save/src/main/js/core/Actions.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/plugins/save/src/main/js/core/Actions.js   Download  
File: public/js/tinymce/src/plugins/save/src/main/js/core/Actions.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,880 bytes
 

Contents

Class file image Download
/** * Actions.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.save.core.Actions', [ 'tinymce.core.dom.DOMUtils', 'tinymce.core.util.Tools', 'tinymce.plugins.save.api.Settings' ], function (DOMUtils, Tools, Settings) { var displayErrorMessage = function (editor, message) { editor.notificationManager.open({ text: editor.translate(message), type: 'error' }); }; var save = function (editor) { var formObj; formObj = DOMUtils.DOM.getParent(editor.id, 'form'); if (Settings.enableWhenDirty(editor) && !editor.isDirty()) { return; } editor.save(); // Use callback instead if (Settings.hasOnSaveCallback(editor)) { editor.execCallback('save_onsavecallback', editor); editor.nodeChanged(); return; } if (formObj) { editor.setDirty(false); if (!formObj.onsubmit || formObj.onsubmit()) { if (typeof formObj.submit === 'function') { formObj.submit(); } else { displayErrorMessage(editor, 'Error: Form submit field collision.'); } } editor.nodeChanged(); } else { displayErrorMessage(editor, 'Error: No form element found.'); } }; var cancel = function (editor) { var h = Tools.trim(editor.startContent); // Use callback instead if (Settings.hasOnCancelCallback(editor)) { editor.execCallback('save_oncancelcallback', editor); return; } editor.setContent(h); editor.undoManager.clear(); editor.nodeChanged(); }; return { save: save, cancel: cancel }; } );