designmode

Get parent element of caret in iframe design mode

≯℡__Kan透↙ 提交于 2019-12-25 02:27:07
问题 I want to know what is the parent element of caret in an iframe with designMode = 'on' . The reason is that want to know if currently user is typing in a p tag. 回答1: Here's a function to do this, adapted from an answer to a similar question: function getSelectionBoundaryElement(win, isStart) { var range, sel, container = null; var doc = win.document; if (doc.selection) { // IE branch range = doc.selection.createRange(); range.collapse(isStart); return range.parentElement(); } else if (win

Simplest way to edit a collection in DesignMode?

孤街浪徒 提交于 2019-12-22 10:34:24
问题 What is the easiest way to edit and persist a collection like decimal[] or List<string> in the WinForms designer? The first problem is that a parameterless constructor is needed. So I made a simple wrapper class: (at some point this was like MyObject<T> , but the WinForms designercode generator didn't know how to handle it) [Serializable()] public class MyObject { public MyObject() {} public decimal Value {get; set;} } In the container class we define a property and add the CollectionEditor

Disabling Firefox and Chrome spell checking in iframe-based text editors

ぃ、小莉子 提交于 2019-12-20 05:23:39
问题 There is a lot of info around about how to disable spell checking in html textarea element by using spellcheck='false' . However to have text area with more advanced capabilities, one must use iframe with designMode = "on" (see e.g. this page, this is a way that RichTextArea is implemented in GWT) and I couldn't find a single post on that topic. It turns out that Firefox detects such advanced text areas and enables its spell checking in them. You can see it live by visiting this page from

Possible to populate and save text entered from inside a iframe in designMode?

北慕城南 提交于 2019-12-20 04:23:05
问题 i am just about to start writing my own rich text editor but need to know if its possible to populate the text area and also how to save / use the data inside it. I am currently using ckEditor, but its too clunky and large for what i want. Ill be using this as a base: http://jsfiddle.net/Kxmaf/6/ I need to run certain checks on the data as well to check its length. Thanks. code if needed: HTML: <a id="bold" class="font-bold">B</a> <a id="italic" class="italic">I</a> <select id="fonts">

Force browser to insert <p> tag when pressing Enter in a designMode IFrame

我与影子孤独终老i 提交于 2019-12-11 04:32:42
问题 How can I make the browser insert <p> tags instead of <br> tags when I press enter in a designMode IFrame? I get inconsistent behavior across Firefox, Chrome and IE and was wondering if there was some way to normalize this. 回答1: It seems you can't. Behaviour is not standardized and control for this is rudimentary at best This is an interesting thread from May thie year on the matter: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-May/031577.html . It's discussing contenteditable

App Using WebBrowser.DocumentText And DomDocument.DesignMode Works In IE8 And Does Not Work In IE9

早过忘川 提交于 2019-12-11 00:44:31
问题 Yes my use of webBrowser control work fine in IE8 and not in IE9. It seems that setting the HTMLDocument from DesignMode = "On" to DesignMode = "Off" removes the document from the WebBrowser. I made this example that shows my problem. There are two buttons and one webBrowser on a form. One button does the webBrowser.DocumentText and the other button toggles between document.DesignMode = "On" and "Off". The DesignMode button uses "CheckOnClick". I hope that you can see what it does. Now if we

Alternatives to execCommand

你。 提交于 2019-12-10 23:50:45
问题 I'm looking to create a WYSIWYG editor, using jQuery as a framework from which I can use different methods to ease production. I do actually have a working editor at the moment, and it's working well. I use an iFrame, and set it's designMode to on and go from there. However there are a few things which are nagging me. Take as an example changing the font family of the selected text. At the moment I am using this: editorDoc.execCommand('fontname', false, 'verdana'); …now that works fine: it

Detecting Design Mode using WPF in a Static Method

穿精又带淫゛_ 提交于 2019-12-08 19:55:22
问题 I am using WPF. I have a static class that performs some setup not available during design mode. This constructor gets called by a window in design mode, which results in an exception being thrown. How do I detect design mode in a static method, so I can invoke the appropriate design mode behavior? The recommended approach does not work for static methods. Edit: The static constructor is called from xaml, so I can't conditionally call it (unless I move the call to code-behind, which I'd like

Visual Studio 2013 Browser Link - Enable CTRL to Edit in Browser

拟墨画扇 提交于 2019-12-06 03:59:42
问题 How do you enable CTRL key for the Visual Studio Browser Link integration? Scott Hanselman discusses it here around 1:06:00 during the VS 2013 Launch Event. I'm not sure how to activate or enable the realtime HTML Edit feature so I can edit in the browser and have the changes pushed back to Visual Studio. Has anyone tried this out yet or can provide clues? I have VS 2013 RTM - I can't seem to find any update for ASP.NET Web Tools that may have changed this behavior. Is this an IE only

Simplest way to edit a collection in DesignMode?

↘锁芯ラ 提交于 2019-12-05 22:40:03
What is the easiest way to edit and persist a collection like decimal[] or List<string> in the WinForms designer? The first problem is that a parameterless constructor is needed. So I made a simple wrapper class: (at some point this was like MyObject<T> , but the WinForms designercode generator didn't know how to handle it) [Serializable()] public class MyObject { public MyObject() {} public decimal Value {get; set;} } In the container class we define a property and add the CollectionEditor attribute to it: public class MyContainer { private List<MyObject> _col = new List<MyObject>(); [Editor