PHP Classes

File: public/js/tinymce/src/plugins/insertdatetime/src/main/js/ui/Buttons.js

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

Contents

Class file image Download
/** * Buttons.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.insertdatetime.ui.Buttons', [ 'tinymce.core.util.Tools', 'tinymce.plugins.insertdatetime.api.Settings', 'tinymce.plugins.insertdatetime.core.Actions' ], function (Tools, Settings, Actions) { var createMenuItems = function (editor, lastFormatState) { var formats = Settings.getFormats(editor); return Tools.map(formats, function (fmt) { return { text: Actions.getDateTime(editor, fmt), onclick: function () { lastFormatState.set(fmt); Actions.insertDateTime(editor, fmt); } }; }); }; var register = function (editor, lastFormatState) { var menuItems = createMenuItems(editor, lastFormatState); editor.addButton('insertdatetime', { type: 'splitbutton', title: 'Insert date/time', menu: menuItems, onclick: function () { var lastFormat = lastFormatState.get(); Actions.insertDateTime(editor, lastFormat ? lastFormat : Settings.getDefaultDateTime(editor)); } }); editor.addMenuItem('insertdatetime', { icon: 'date', text: 'Date/time', menu: menuItems, context: 'insert' }); }; return { register: register }; } );