<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<title>Rich Text Editor</title>
<script
id="sap-ui-bootstrap"
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.m,sap.ui.commons,sap.ui.core"
data-sap-ui-compatVersion="edge"
data-sap-ui-preload="async"
data-sap-ui-resourceroots='{"rich.editor": "./"}'>
</script>
<script src='https://cloud.tinymce.com/stable/tinymce.min.js'></script>
<script>
tinymce.init({
selector: '#mytextarea',
schema: 'html5',
plugins: [
"advlist autolink lists link image charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste wordcount"
],
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright
alignjustify | bullist numlist outdent indent | link image",
statusbar: false,
browser_spellcheck: true
});
</script>
<script>
sap.ui.getCore().attachInit(function () {
t = new sap.ui.commons.TextArea('mytextarea').placeAt("content2");
h = new sap.ui.core.HTML('myhtml').placeAt("content3");
new sap.m.Button('button',
{text:'Insert',
press:function(){
var content = tinymce.get("mytextarea").getContent();
alert(content);
h.setContent(content);
}
}).placeAt("content2");
new sap.m.Button('button1',
{text:'Clear',
press:function(){
h.setContent("");
alert("data Destroyed");
}
}).placeAt("content2");
});
</script>
</head>
<body class="sapUiBody">
<div id = "content2"></div>
<div id = "content3"></div>
</body>
</html>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
19 | |
10 | |
8 | |
5 | |
4 | |
4 | |
3 | |
2 | |
2 | |
2 |