ckeditor

html encode/decode - ckeditor

此生再无相见时 提交于 2020-01-04 15:33:51
问题 I am using ckeditor in a cshtml page to input content into my database that will later be displayed on a page with html tags to make the text easier to read. Since I am inputting the content through a textarea, I am getting a an error stating that the html tags that I am inputting <h1><p> are potentially dangerous. To bypass this without turning RequestValidation to false, in my cinfig.js file I have set: config.htmlEncodeOutput = true; I am decoding the data from the database when displaying

html encode/decode - ckeditor

做~自己de王妃 提交于 2020-01-04 15:32:33
问题 I am using ckeditor in a cshtml page to input content into my database that will later be displayed on a page with html tags to make the text easier to read. Since I am inputting the content through a textarea, I am getting a an error stating that the html tags that I am inputting <h1><p> are potentially dangerous. To bypass this without turning RequestValidation to false, in my cinfig.js file I have set: config.htmlEncodeOutput = true; I am decoding the data from the database when displaying

Scroll to the bottom of ckeditor

做~自己de王妃 提交于 2020-01-04 13:58:10
问题 any ideas on how to scroll to bottom of a ckeditor editor using javascript / jQuery? I cant find anything. All my search shows is: document.getElementById("ID").contentWindow.scrollTo(0,3); Which gives me an error of contentWindow is undefined. The class of the ckeditor text part appears to be "cke_editable". Any help on scrolling to the bottom of the editor? 回答1: Access the editor and get the editable area via that instead of getting the DOM element directly. Like so: var editor = CKEDITOR

Display alert when a button is clicked in CK Editor

六月ゝ 毕业季﹏ 提交于 2020-01-04 06:31:11
问题 How can I display an alert with ckeditor if a button is pressed? Here's the code: $(document).ready(function () { $(".cke_button__bold").click(function () { editor.on("CKEDITOR.cke_button__bold",CKEDITOR.cke_button_on); function handleAfterCommandExec(evt){ var commandName = CKEDITOR.command.cke_button__bold; // For 'bold' commmand if (commandName == 'cke_button__on') { alert("Bold button pressed!"); } } }); }); 回答1: event delegation Event delegation allows us to attach a single event

Apply custom table styles from CSS to CKEditor view

一曲冷凌霜 提交于 2020-01-04 05:16:10
问题 I'm trying to integrate CKEditor 4.1.1 in my site. So far, I've mostly got it working, except some of the specific table styles that I have in my site CSS doesn't get applied in the editor. I've already tried setting up config.contentsCss to point to my site-wide stylesheet, and that helps for most of my other contents, but it doesn't seem to apply the table styles. Here's the CSS I'm working with: table#availability { width: 90%; border-collapse: collapse; } table#availability td, table

Client-side Javascript code to strip bogus HTML from CKEditor

筅森魡賤 提交于 2020-01-04 01:28:05
问题 I believe this may be related to Need Pure/jQuery Javascript Solution For Cleaning Word HTML From Text Area But in my case I am using CKEditor; however, before sending the data to the server (or after receiving it back) I'd like to strip out "junk" HTML tags and comments such as those that appear when pasting from recent (2007 or later) versions of Microsoft Office. Because the server-side here is a third-party application, I'd prefer to do this client side if I can. Yes, I am aware of the

CkEditor and Angular Material 2 Tabs

*爱你&永不变心* 提交于 2020-01-04 01:21:49
问题 I use angular-cli, angular-material 2 and I try to use the CKEditor (ng2-ckeditor). When I insert the CkEditor directly in the HTML (inside one div) there is no issue everything works. But when I move the CkEditor code under the following structure: <md-tab-group> <md-tab label="Another label description"> Contents 1 </md-tab> <md-tab label="Label description"> <div> <md-card> <md-card-header> <md-card-title> This is a title </md-card-title> </md-card-header> <md-card-content> <ckeditor name=

How to Remove ContextMenu in CKEditor 4.3

谁都会走 提交于 2020-01-03 20:03:52
问题 I am having a hard time trying to disable the context menu from the editor. For instance when a user clicks on a image I don't want to show that context menu but the browser context. I tried to add to remove plugins configuration setting "contextmenu" but that did nothing. From the posts I seen here the soultion to get rid of the context menu seems to change every version. 回答1: Tested in Ckeditor 4.7.1 , works for me: CKEDITOR.editorConfig = function (config) { config.language = 'en'; config

How to Remove ContextMenu in CKEditor 4.3

99封情书 提交于 2020-01-03 20:01:41
问题 I am having a hard time trying to disable the context menu from the editor. For instance when a user clicks on a image I don't want to show that context menu but the browser context. I tried to add to remove plugins configuration setting "contextmenu" but that did nothing. From the posts I seen here the soultion to get rid of the context menu seems to change every version. 回答1: Tested in Ckeditor 4.7.1 , works for me: CKEDITOR.editorConfig = function (config) { config.language = 'en'; config

Save Data From Multiple CKEditor Inline Editor Fields Like A Template

瘦欲@ 提交于 2020-01-03 17:26:10
问题 I'm setting up a template system where designers can submit HTML5 designs and allow users to add their own content. I'm using CKEditor 4.2 and Rails 3 for the app. I would like users to be able to load the template page and then edit the various inline editors directly, then save via JS and Ajax. I had everything working but when adding iFrame plugin I ran into some formatting issues because I was simply saving the raw HTML from the inline editors to my templates. See this question for more