我正在为我的一个项目探索微小的mce编辑器,我发现工具栏中的图标并没有出现。它正在显示浏览器无法显示的某些unicode。以下是页面的html代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/ht/loose.dtd">
<html>
<head>
<title>HTML</title>
<script type="text/javascript" src="../js/tinymce/tinymce.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript">
tinymce.init({
selector: "textarea",
plugins: [
"advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"table contextmenu directionality emoticons template textcolor paste fullpage textcolor"
],
toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor",
toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",
menubar: false,
toolbar_items_size: 'small',
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
],
templates: [
{title: 'Test template 1', content: 'Test 1'},
{title: 'Test template 2', content: 'Test 2'}
]
});</script>
</head>
<body>
<form method="post" action="somepage">
<textarea name="content" style="width:100%"></textarea>
</form>
</body>
</html>另一方面,如果我用
<script type="text/javascript" src="http://tinymce.cachefly.net/4.0/tinymce.min.js"></script>我能完美地看到所有的图标。我已经将tinymce下载中的js的所有内容添加到js文件夹中的web项目中。有人对这个问题有线索吗?
发布于 2014-02-03 10:32:50
好的,我把这个弄好了。
在仔细分析控制台错误后,我发现这是一个没有下载的小字体问题。
这基本上是Mozilla的security.fileuri.strict_origin_policy属性的问题,需要将其更改为false,以放宽原产地限制。现在我能完美地看到那些图标了。
发布于 2020-07-19 23:51:10
如果您使用的是上面的TinyMCE 5.3,您需要导入默认图标如下所示。
import 'tinymce/icons/default';以下是参考资料:
发布于 2020-06-22 18:23:17
我的图标停止显示时,我升级到角9。我不知道它们以前为什么或如何起作用,但在我的情况下,修复方法很简单。我只需确保图标被从node_modules文件夹复制到angular.json文件的“资产”部分的输出中。

https://stackoverflow.com/questions/20971537
复制相似问题