PHP Classes

File: public/js/tinymce/src/plugins/table/src/main/js/actions/Styles.js

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

Contents

Class file image Download
/** * Styles.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.table.actions.Styles', [ 'tinymce.core.util.Tools' ], function (Tools) { var getTDTHOverallStyle = function (dom, elm, name) { var cells = dom.select("td,th", elm), firstChildStyle; var checkChildren = function (firstChildStyle, elms) { for (var i = 0; i < elms.length; i++) { var currentStyle = dom.getStyle(elms[i], name); if (typeof firstChildStyle === "undefined") { firstChildStyle = currentStyle; } if (firstChildStyle != currentStyle) { return ""; } } return firstChildStyle; }; firstChildStyle = checkChildren(firstChildStyle, cells); return firstChildStyle; }; var applyAlign = function (editor, elm, name) { if (name) { editor.formatter.apply('align' + name, {}, elm); } }; var applyVAlign = function (editor, elm, name) { if (name) { editor.formatter.apply('valign' + name, {}, elm); } }; var unApplyAlign = function (editor, elm) { Tools.each('left center right'.split(' '), function (name) { editor.formatter.remove('align' + name, {}, elm); }); }; var unApplyVAlign = function (editor, elm) { Tools.each('top middle bottom'.split(' '), function (name) { editor.formatter.remove('valign' + name, {}, elm); }); }; return { applyAlign: applyAlign, applyVAlign: applyVAlign, unApplyAlign: unApplyAlign, unApplyVAlign: unApplyVAlign, getTDTHOverallStyle: getTDTHOverallStyle }; } );