rich-text-editor

javascript contentEditable - wrap cross-tag selections

主宰稳场 提交于 2019-12-02 10:36:19
问题 I'm experimenting a bit with contentEditable and encountered this issue: I have the following js snippet var range = document.getSelection().getRangeAt(0); var newNode = document.createElement("span"); newNode.className = "customStyle"; range.surroundContents(newNode); and this HTML fragment: <ul> <li>the <b>only entry</b> of the list</li> </ul> <p>Some text here in paragraph</p> The js code allows to wrap the current selection with a <span> tag. It works perfectly when the selection includes

how to display rich content using jsf component?

旧巷老猫 提交于 2019-12-02 10:20:36
I used the rich: editor component to enter rich content and I save it in a database. When I tried to display it in outputText field , rich tags are not interpreted and are displayed as simple text. So my question is: how can I make the jsf component (or Richfaces) interpret this rich content and display it properly?? The h:outputText indeed by default escapes predefined XML/HTML entities to avoid XSS attacks . If you want to display user-controlled input unescaped, then just set the escape attribute to false . <h:outputText value="#{bean.text}" escape="false" /> However, keep potential XSS

How to get text from rich edit control as a CString

坚强是说给别人听的谎言 提交于 2019-12-02 09:38:17
I want to get the entire text in a rich edit control as a CString something like GetDlgItemText but this is for dialog boxes. The closest thing i can find from my research is: GetTextRange and get the range by using GetTextLength ....But I suspect there is a better way.... GetWindowText. GetDlgItemText works to, if you use the parent window and the ID of the RTF Control. WM_GETETXT. If you want to retrieve the complete RTF text you Need to use EM_STREAMOUT (enough samples in the net). 来源: https://stackoverflow.com/questions/20700343/how-to-get-text-from-rich-edit-control-as-a-cstring

javascript contentEditable - wrap cross-tag selections

杀马特。学长 韩版系。学妹 提交于 2019-12-02 06:16:26
I'm experimenting a bit with contentEditable and encountered this issue: I have the following js snippet var range = document.getSelection().getRangeAt(0); var newNode = document.createElement("span"); newNode.className = "customStyle"; range.surroundContents(newNode); and this HTML fragment: <ul> <li>the <b>only entry</b> of the list</li> </ul> <p>Some text here in paragraph</p> The js code allows to wrap the current selection with a <span> tag. It works perfectly when the selection includes whole HTML tags (e.g. selecting 'the only entry of') but not, of course, when the selection includes

Populate a QTextDocument from a .odt file

和自甴很熟 提交于 2019-12-02 02:10:27
I am writing a rich text editor using C++ and Qt. For now, I would like it to support (at least) the .odt format. I found QTextDocumentWriter for writing the contents of the QTextDocument to a file, but I can't seem to find anything to read that back into the QTextDocument, which obviously makes saving it sort of useless in the first place. So the question is, how do I load an .odt document into a QTextDocument? Qt does not currently support the ODT format. Okular has code that does parses ODT to a QTextDocument. Beware: Okular source code is released under GPL license. 来源: https:/

Submit the dijit editor contents

蓝咒 提交于 2019-12-01 17:37:52
I am trying to learn the dijit editor. I want to replace an existing text area with dijit editor widget.So I wrote 2 jsps - one using the dijit.Editor which feeds another jsp with the editor contents. When I click submit the second jsp "result " comes up empty contents for the editor no matter what is typed in text area editor. dijitEditor.jsp <script type="text/javascript"> dojo.require("dijit.Editor"); dojo.require("dijit._editor.plugins.LinkDialog"); dojo.require("dijit._editor.plugins.AlwaysShowToolbar"); </script> <script type="text/javascript"> dojo.addOnLoad(function(){ alert("addOnLoad

Submit the dijit editor contents

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 16:59:21
问题 I am trying to learn the dijit editor. I want to replace an existing text area with dijit editor widget.So I wrote 2 jsps - one using the dijit.Editor which feeds another jsp with the editor contents. When I click submit the second jsp "result " comes up empty contents for the editor no matter what is typed in text area editor. dijitEditor.jsp <script type="text/javascript"> dojo.require("dijit.Editor"); dojo.require("dijit._editor.plugins.LinkDialog"); dojo.require("dijit._editor.plugins

Use my existing Rich Text UI with CKEditor APIs

隐身守侯 提交于 2019-12-01 10:34:31
I have an existing Rich Text UI that I'd like to use with CKEditor. Basically, I want CKEditor to handle the complicated parts of applying styles, formats, filtering, and normalizing inserted content. My existing UI needs to drive the interaction and show state based on selection (ie. selecting bold text should be reflected in the state of my 'Bold' button in the UI. I have got the integration to a point where I can apply bold, italic, and underline formats, change font size, and add styles. For bold, italic, and underline: var editor = this.getEditor(); editor.execCommand('underline'); //

How do I get this HTML to display formatted, without tags?

て烟熏妆下的殇ゞ 提交于 2019-12-01 09:17:57
I created a blog (for coding practice). I use a Rich Text Editor (ckeditor) and save the post to a database. When I pull the post out to display in a Label.Text, it shows all the HTML tags: <p><strong>there was</strong> once a fox that lived</p> <p> in the<span style="color: #ff0000"> woods</span></p> How do I get the post to display, with the proper formatting (paragraph, color, etc.), but without the HTML tags? nanonerd FYI: The literal produced the same result as the Label ... but I got my answer, this works: string strHTML = "<p>Hello World!</p>"; Label.Text = Server.HtmlDecode(strHTML);

Rich-text editor in iOS [closed]

拥有回忆 提交于 2019-12-01 08:43:31
I am looking for a sample project which should have basic rich text editing features (Bold,Italic,Underline,Alignment,Attaching images). I went through Google search results there are several editors available for iOS but those all are developed by using UIWebView with HTML . I am looking for the one which developed by using UITextView along with new features in iOS 6 and 7 ( NSAttributedString , NSTextattAchment ) Can please guide me if you know any open source code or tutorial? Thanks in advance! There no sample project for rich text that available on iOS Dev website, However if you like a