Ich bin neu in Dojo und versuche, dijit.Editor zu verwenden.Dijit.editor Filter ändern, um Tags zu ermöglichen
Ich bin in der Lage, meinen Editor erfolgreich zu erstellen und HTML Editor hinzuzufügen, wenn jemand eine Taste drückt. Zum Beispiel
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js" data-dojo-config="async: true,parseOnLoad: true"></script>
<style type="text/css">
/* bring in the claro theme */
@import "//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dijit/themes/claro/claro.css";
</style>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script>
function onDrag(event) {
event.dataTransfer.setData('Text', 'Some content');
}
</script>
</head>
<body>
<div class="row">
<div style="border:1px solid #000" id="myeditor" class="col-md-6 claro" data-dojo-type="dijit/Editor" data-dojo-props="extraPlugins:['foreColor','hiliteColor','|','createLink','insertImage','fullscreen','viewsource','newpage']">
This is the <strong>default</strong> content.
</div>
<div class="col-md-6" >
<div id="btn" >BLAST</div>
</div>
</div>
<script>
// Include the class
require([
"dijit/Editor",
"dojo/parser",
"dijit/_editor/plugins/ViewSource",
]);
require(["dijit/form/Button", "dijit/registry"], function(Button, dijitRegistry) {
var button = new Button({
label: "Click Me!",
onClick: function(){
var editor = dijitRegistry.byId("myeditor");
editor.execCommand("inserthtml","<div>Here</div>");
}
}, "btn");
button.startup();
});
</script>
</body>
</html>
jedoch wird der div-Tag abgestreift. Was muss ich tun, damit div-Tags mit dem Befehl inserthtml eingefügt werden können?