|
@{
List<String> toolsList = new List<string>() { "customTools" };
}
<ej-rte id="myRTEtext" tools-list="toolsList" width="535px" height="340px"create="Oncreate">
<e-content-template>
Facebook is a social networking service headquartered in Menlo Park, California. Its website was launched on February 4, 2004, by Mark Zuckerberg with his Harvard College roommates and fellow students Eduardo, Andrew McCollum, Dustin and Chris Hughes. The fouders had initially limited the websites membrship to Harvard students, but later expanded it to collges in the Boston area, the Ivy League, and Stanford Univrsity. It graually added support for students at various other universities and later to high-school students.
</e-content-template>
<e-tools>
<e-custom-tools>
<e-custom-tool name="dialog" tooltip="Click to SpellCheck" css="e-rte-toolbar-icon e-spell" action="showDialog" />
</e-custom-tools>
</e-tools>
<e-paste-cleanup-settings clean-css="true" list-conversion="true" remove-styles="true"clean-elements="true" />
</ej-rte>
<script>
function showDialog() {
var spellObj = rteObj._rteIframe.data("ejSpellCheck");
spellObj.showInDialog();
}
function Oncreate() {
var css = "html,body{font-family:sans-serif;font-size:16px; }";
var editorDoc = $("#myRTEtext").ejRTE("instance").getDocument();
var styleTag = document.createElement("style");
rteObj = this;
styleTag.type = "text/css";
if (styleTag.styleSheet)
styleTag.styleSheet.cssText = css;
else
styleTag.appendChild(document.createTextNode(css));
editorDoc.head.appendChild(styleTag);
rteObj._rteIframe.ejSpellCheck({
dictionarySettings: {
},
contextMenuSettings: { enable: true },
enableValidateOnType: true,
enableAsync: false,
ajaxDataType: "json",
actionSuccess: function (args) {
if (args.requestType === "addToDictionary") {
rteObj.setHtml(args.resultHTML);
}
},
contextOpen: function (args) {
args.cancel = true;
},
dialogBeforeOpen: function (args) {
if (args.requestType === "alertBeforeOpen") {
args.cancel = true;
}
}
});
}
</script>
<style>
.e-rte-toolbar-icon.e-spell {
background:url("https://js.syncfusion.com/demos/web/content/images/rte/Icon_Spellchecker.svg")no-repeat; //add icon for custom tool
background-position: 3px 5px;
}
</style> |
|
function Oncreate() {
var css = "html,body{font-family:sans-serif;font-size:16px; }";
var editorDoc = $("#myRTEtext").ejRTE("instance").getDocument();
var styleTag = document.createElement("style");
rteObj = this;
styleTag.type = "text/css";
if (styleTag.styleSheet)
styleTag.styleSheet.cssText = css;
else
styleTag.appendChild(document.createTextNode(css));
editorDoc.head.appendChild(styleTag);
rteObj._rteIframe.ejSpellCheck({
dictionarySettings: {
dictionaryUrl: "http://js.syncfusion.com/ejServices/api/SpellCheck/CheckWords",
customDictionaryUrl: "http://js.syncfusion.com/ejServices/api/SpellCheck/AddToDictionary"
},
contextMenuSettings: { enable: true },
enableValidateOnType: true,
enableAsync: false,
ajaxDataType: "json",
actionSuccess: function (args) {
if (args.requestType === "addToDictionary") {
rteObj.setHtml(args.resultHTML);
}
},
contextOpen: function (args) {
args.cancel = true;
},
dialogBeforeOpen: function (args) {
if (args.requestType === "alertBeforeOpen") {
args.cancel = true;
}
}
});
} |