PHP Classes

File: WITheme/WICMS/admin/js/plugins/textEditor/tinymce_4.2.6_dev/tinymce/js/tinymce/classes/LegacyInput.js

Recommend this page to a friend!
  Classes of Jules Warner   WICMS   WITheme/WICMS/admin/js/plugins/textEditor/tinymce_4.2.6_dev/tinymce/js/tinymce/classes/LegacyInput.js   Download  
File: WITheme/WICMS/admin/js/plugins/textEditor/tinymce_4.2.6_dev/tinymce/js/tinymce/classes/LegacyInput.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WICMS
Database driven content management system with PDO
Author: By
Last change:
Date: 7 years ago
Size: 1,829 bytes
 

 

Contents

Class file image Download
/** * LegacyInput.js * * Released under LGPL License. * Copyright (c) 1999-2015 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ /** * Converts legacy input to modern HTML. * * @class tinymce.LegacyInput * @private */ define("tinymce/LegacyInput", [ "tinymce/EditorManager", "tinymce/util/Tools" ], function(EditorManager, Tools) { var each = Tools.each, explode = Tools.explode; EditorManager.on('AddEditor', function(e) { var editor = e.editor; editor.on('preInit', function() { var filters, fontSizes, dom, settings = editor.settings; function replaceWithSpan(node, styles) { each(styles, function(value, name) { if (value) { dom.setStyle(node, name, value); } }); dom.rename(node, 'span'); } function convert(e) { dom = editor.dom; if (settings.convert_fonts_to_spans) { each(dom.select('font,u,strike', e.node), function(node) { filters[node.nodeName.toLowerCase()](dom, node); }); } } if (settings.inline_styles) { fontSizes = explode(settings.font_size_legacy_values); filters = { font: function(dom, node) { replaceWithSpan(node, { backgroundColor: node.style.backgroundColor, color: node.color, fontFamily: node.face, fontSize: fontSizes[parseInt(node.size, 10) - 1] }); }, u: function(dom, node) { // HTML5 allows U element if (editor.settings.schema === "html4") { replaceWithSpan(node, { textDecoration: 'underline' }); } }, strike: function(dom, node) { replaceWithSpan(node, { textDecoration: 'line-through' }); } }; editor.on('PreProcess SetContent', convert); } }); }); });