<!DOCTYPE html>
<!--
Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
-->
<html lang="en">
<head>
<meta charset="utf-8">
<title>Data Filtering — CKEditor Sample</title>
<script src="../../ckeditor.js"></script>
<link rel="stylesheet" href="sample.css">
<meta name="description" content="Try the latest sample of CKEditor 4 and learn more about customizing your WYSIWYG editor with endless possibilities.">
<script>
// Remove advanced tabs for all editors.
CKEDITOR.config.removeDialogTabs = 'image:advanced;link:advanced;flash:advanced;creatediv:advanced;editdiv:advanced';
</script>
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> » Data Filtering and Features Activation
</h1>
<div class="warning deprecated">
This sample is not maintained anymore. Check out its <a href="https://ckeditor.com/docs/ckeditor4/latest/examples/acf.html">brand new version in CKEditor Examples</a>.
</div>
<div class="description">
<p>
This sample page demonstrates the idea of Advanced Content Filter
(<abbr title="Advanced Content Filter">ACF</abbr>), a sophisticated
tool that takes control over what kind of data is accepted by the editor and what
kind of output is produced.
</p>
<h2>When and what is being filtered?</h2>
<p>
<abbr title="Advanced Content Filter">ACF</abbr> controls
<strong>every single source of data</strong> that comes to the editor.
It process both HTML that is inserted manually (i.e. pasted by the user)
and programmatically like:
</p>
<pre class="samples">
editor.setData( '<p>Hello world!</p>' );
</pre>
<p>
<abbr title="Advanced Content Filter">ACF</abbr> discards invalid,
useless HTML tags and attributes so the editor remains "clean" during
runtime. <abbr title="Advanced Content Filter">ACF</abbr> behaviour
can be configured and adjusted for a particular case to prevent the
output HTML (i.e. in CMS systems) from being polluted.
This kind of filtering is a first, client-side line of defense
against "<a href="http://en.wikipedia.org/wiki/Tag_soup">tag soups</a>",
the tool that precisely restricts which tags, attributes and styles
are allowed (desired). When properly configured, <abbr title="Advanced Content Filter">ACF</abbr>
is an easy and fast way to produce a high-quality, intentionally filtered HTML.
</p>
<h3>How to configure or disable ACF?</h3>
<p>
Advanced Content Filter is enabled by default, working in "automatic mode", yet
it provides a set of easy rules that allow adjusting filtering rules
and disabling the entire feature when necessary. The config property
responsible for this feature is <code><a class="samples"
href="https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-allowedContent">config.allowedContent</a></code>.
</p>
<p>
By "automatic mode" is meant that loaded plugins decide which kind
of content is enabled and which is not. For example, if the link
plugin is loaded it implies that <code><a></code> tag is
automatically allowed. Each plugin is given a set
of predefined <abbr title="Advanced Content Filter">ACF</abbr> rules
that control the editor until <code><a class="samples"
href="https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-allowedContent">
config.allowedContent</a></code>
is defined manually.
</p>
<p>
Let's assume our intention is to restrict the editor to accept (produce) <strong>paragraphs
only: no attributes, no styles, no other tags</strong>.
With <abbr title="Advanced Content Filter">ACF</abbr>
this is very simple. Basically set <code><a class="samples"
href="https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-allowedContent">
config.allowedContent</a></code> to <code>'p'</code>:
</p>
<pre class="samples">
var editor = CKEDITOR.replace( <em>textarea_id</em>, {
<strong>allowedContent: 'p'</strong>
} );
</pre>
<p>
Now try to play with allowed content:
</p>
<pre class="samples">
// Trying to insert disallowed tag and attribute.
editor.setData( '<p <strong>style="color: red"</strong>>Hello <strong><em>world</em></strong>!</p>' );
alert( editor.getData() );
// Filtered data is returned.
"<p>Hello world!</p>"
</pre>
<p>
What happened? Since <code>config.allowedContent: 'p'</code> is set the editor assumes
that only plain <code><p></code> are accepted. Nothing more. This is why
<code>style</code> attribute and <code><em></code> tag are gone. The same
filtering would happen if we pasted disallowed HTML into this editor.
</p>
<p>
This is just a small sample of what <abbr title="Advanced Content Filter">ACF</abbr>
can do. To know more, please refer to the sample section below and
<a href="https://ckeditor.com/docs/ckeditor4/latest/guide/dev_advanced_content_filter.html">the official Advanced Content Filter guide</a>.
</p>
<p>
You may, of course, want CKEditor to avoid filtering of any kind.
To get rid of <abbr title="Advanced Content Filter">ACF</abbr>,
basically set <code><a class="samples"
href="https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-allowedContent">
config.allowedContent</a></code> to <code>true</code> like this:
</p>
<pre class="samples">
CKEDITOR.replace( <em>textarea_id</em>, {
<strong>allowedContent: true</strong>
} );
</pre>
<h2>Beyond data flow: Features activation</h2>
<p>
<abbr title="Advanced Content Filter">ACF</abbr> is far more than
<abbr title="Input/Output">I/O</abbr> control: the entire
<abbr title="User Interface">UI</abbr> of the editor is adjusted to what
filters restrict. For example: if <code><a></code> tag is
<strong>disallowed</strong>
by <abbr title="Advanced Content Filter">ACF</abbr>,
then accordingly <code>link</code> command, toolbar button and link dialog
are also disabled. Editor is smart: it knows which features must be
removed from the interface to match filtering rules.
</p>
<p>
CKEditor can be far more specific. If <code><a></code> tag is
<strong>allowed</strong> by filtering rules to be used but it is restricted
to have only one attribute (<code>href</code>)
<code>config.allowedContent = 'a[!href]'</code>, then
"Target" tab of the link dialog is automatically disabled as <code>target</code>
attribute isn't included in <abbr title="Advanced Content Filter">ACF</abbr> rules
for <code><a></code>. This behaviour applies to dialog fields, context
menus and toolbar buttons.
</p>
<h2>Sample configurations</h2>
<p>
There are several editor instances below that present different
<abbr title="Advanced Content Filter">ACF</abbr> setups. <strong>All of them,
except the inline instance, share the same HTML content</strong> to visualize
how different filtering rules affect the same input data.
</p>
</div>
<div>
<label for="editor1">
Editor 1:
</label>
<div class="description">
<p>
This editor is using default configuration ("automatic mode"). It means that
<code><a class="samples"
href="https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-allowedContent">
config.allowedContent</a></code> is defined by loaded plugins.
Each plugin extends filtering rules to make it's own associated content
available for the user.
</p>
</div>
<textarea cols="80" id="editor1" name="editor1" rows="10">
<h1><img alt="Saturn V carrying Apollo 11" class="right" src="assets/sample.jpg"/> Apollo 11</h1> <p><b>Apollo 11</b> was t
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
玖逸云黑发卡源码无加密版本优势,拥有多年管理系统产品开发经验 1,源码可控,代码无后门,可放心使用源代码注释详细,便于阅读,提供丰富的配置接口,易于扩展。 2,功能完善,包含管理系统常用的基础功能,提供丰富的模板页面及功能案例,集成众多优秀插件及原创扩展组件。 3,多端支持,HTML5+CSS3响应式设计,支持主流的现代浏览器,兼容IE,支持手机、平板、常见APP内置浏览器。 4,上手容易,完善的产品开发文档,大量演示示例,组件式开发,提供授权用户专属技术解答服务群。 5,低成本,界面美观,免去设计工作,开箱即用,省去项目前期搭建时间。 安装部署 环境建议:Nginx1.19 PHP7.3(只推荐这个,因为我用其他版本发现有报错) MySQL7.2及以上 1.访问 http://你的域名/install 安装 2.默认后台地址 /Admin/ 3.后台用户名和密码为 admin 4.登录后请修改密码! 4.调用API接口 http://你的域名/Api/query.php?qq=
资源推荐
资源详情
资源评论
收起资源包目录
玖逸云黑无后门无加密发卡源码 (2000个子文件)
oneui.css 494KB
oneui.min.css 395KB
oneui.min.css 389KB
oneui.min.css 332KB
azzara.min.css 192KB
bootstrap.min.css 106KB
bootstrap.min.css 106KB
bootstrap.min.css 106KB
style.min.css 106KB
style.min.css 106KB
admin.css 96KB
materialdesignicons.min.css 85KB
materialdesignicons.min.css 85KB
layui.css 73KB
layui.css 73KB
animate.css 71KB
animate.css 71KB
samples.css 66KB
notice.css 61KB
skin.min.css 59KB
skin.min.css 59KB
editor_ie8.css 52KB
editor_iequirks.css 52KB
editor_ie.css 51KB
editor_gecko.css 50KB
editor.css 50KB
editor_ie7.css 49KB
editor_iequirks.css 48KB
editor_ie8.css 47KB
editor_ie.css 47KB
editor_gecko.css 46KB
editor.css 46KB
editor_iequirks.css 43KB
editor_ie7.css 42KB
editor_ie8.css 41KB
editor_ie8.css 41KB
editor_iequirks.css 41KB
editor_ie.css 41KB
editor_ie.css 40KB
style.tailwind.css 40KB
editor.css 40KB
smooth.css 39KB
amethyst.css 39KB
modern.css 39KB
flat.css 39KB
city.css 39KB
editor_gecko.css 39KB
editor.css 39KB
main.css 39KB
main.css 35KB
fullcalendar.css 33KB
components.css 33KB
smooth.min.css 33KB
amethyst.min.css 33KB
modern.min.css 33KB
flat.min.css 33KB
city.min.css 33KB
sweetalert2.css 31KB
summernote-lite.css 30KB
summernote-lite.min.css 30KB
main.css 28KB
style.min.css 26KB
main.min.css 24KB
sweetalert2.min.css 24KB
sweetalert.css 23KB
bootstrap-datepicker3.standalone.css 23KB
core.css 23KB
bootstrap-datepicker3.css 22KB
content.min.css 21KB
bootstrap-datepicker3.standalone.min.css 21KB
content.inline.min.css 21KB
content.inline.min.css 21KB
content.min.css 21KB
airbnb.css 21KB
bootstrap-datepicker3.min.css 21KB
skin.mobile.min.css 21KB
skin.mobile.min.css 21KB
summernote-bs4.css 19KB
summernote.css 19KB
summernote-bs4.min.css 19KB
summernote.min.css 19KB
material_green.css 19KB
material_red.css 19KB
material_blue.css 19KB
material_orange.css 19KB
confetti.css 19KB
light.css 19KB
dark.css 19KB
flatpickr.css 19KB
formSelects-v4.css 18KB
bootstrap-datepicker.standalone.css 18KB
select2.css 17KB
bootstrap-datepicker.css 17KB
sweetalert.min.css 16KB
bootstrap-datepicker.standalone.min.css 16KB
fullcalendar.min.css 16KB
flatpickr.min.css 16KB
bootstrap-datepicker.min.css 15KB
dialog_ie8.css 15KB
dialog_ie8.css 15KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
如鹿觅水
- 粉丝: 176
- 资源: 377
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功