PHP Classes

File: public/js/tinymce/src/plugins/anchor/src/main/js/core/FilterContent.js

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

Contents

Class file image Download
/** * FilterContent.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.anchor.core.FilterContent', [ ], function () { var isAnchorNode = function (node) { return !node.attr('href') && (node.attr('id') || node.attr('name')) && !node.firstChild; }; var setContentEditable = function (state) { return function (nodes) { for (var i = 0; i < nodes.length; i++) { if (isAnchorNode(nodes[i])) { nodes[i].attr('contenteditable', state); } } }; }; var setup = function (editor) { editor.on('PreInit', function () { editor.parser.addNodeFilter('a', setContentEditable('false')); editor.serializer.addNodeFilter('a', setContentEditable(null)); }); }; return { setup: setup }; } );