我正在使用TinyMCe-editor和knockout,使用这个处理程序:
ko.bindingHandlers.wysiwyg = {
init: function (element, valueAccessor, allBindingsAccessor, viewModel) {
var value = valueAccessor();
var valueUnwrapped = ko.unwrap(value);
var allBindings = allBindingsAccessor();
var $element = $(element);
$element.attr('id', 'wysiwyg_' + Date.now());
if (ko.isObservable(value)) {
var isSubscriberChange = false;
var isEditorChange = true;
$element.html(value());
var isEditorChange = false;
tinymce.init({
selector: '#' + $element.attr('id'),
inline: true,
plugins: [
"textcolor advlist autolink lists link image charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste"
],
toolbar: "insertfile undo redo | styleselect | bold italic underline | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
menubar: false,
setup: function (editor) {
editor.on('change', function () {
if (!isSubscriberChange) {
isEditorChange = true;
value($element.html());
isEditorChange = false;
}
});
}
});
value.subscribe(function (newValue) {
if (!isEditorChange) {
isSubscriberChange = true;
$element.html(newValue);
isSubscriberChange = false;
}
});
}
}
}
在我的页面上,我有som ui.icons,通常是:
<img id="btnMetatoggle" class="ui-icon ui-icon-arrow-4-diag" style="display: inline-block" />
然而,由于某些奇怪的原因,tinymce-init-function的“inline:true”选项会通过在其上方放置-moz-force-broken-image-icon来打扰hi-icons。
使用firebug进行调试我从文件(?)“内联”中看到了css,但是我没有这样的文件,所以我猜这是TinyMce-stuff。
有没有人能够摆脱这些-moz-force-broken-image-icon的好方法?
小提琴:http://jsfiddle.net/2xjKc/5/(尚未在线找到图像文件,因此图标为空)。