wysiwyg

How to force <br> line break in Firefox ContentEditable

戏子无情 提交于 2019-11-29 17:19:15
问题 I have a JavaScript WYSIWYG editor (not unlike CKEditor) running on a site. It has a setting that makes IE create <br> line breaks when you press Enter in the editor. That works great, but unfortunately, Firefox (I've tested with 5 and 7) will still generate <p> elements, and generate <br> s only if you use Shift + Enter . Is there a way to make Firefox always generate <br> elements in a contentEditable? 回答1: From looking at the standards, it looks like this action is the way it is supposed

Sitecore Rich Text Html Editor Profile - set global default

我怕爱的太早我们不能终老 提交于 2019-11-29 16:57:24
问题 OK I can't believe this can't be found anywhere so I'm asking the question. Is there a way to set the default Html Editor Profile in Sitecore so I don't have the override the Source field on each individual Rich Text field? e.g. I want to make this the default option for the Html editor: /sitecore/system/Settings/Html Editor Profiles/Rich Text Medium 回答1: Its an old question but here is the solution I found in Sitecore 6.5 - I was looking to do the same thing in 6.5: You can change the value

Tinymce Image drag and drop issue on Internet Explorer?

假如想象 提交于 2019-11-29 16:48:41
i have html page where i am using tinymce editor. when i open the mockup in firefox browser and now drag/drop an jpg image at any position in tinymce editor, it gets inserted correctly. But when i do the same process in IE/Chrome browser, the moment i dropped an image, it does not place the image inside tinymce editor instead the whole browser relocates to the url of the image. I am not able to understand why image is not placed inside tinymce editor when html page is opened up in IE and chrome browser(though it is placed correctly in IE/Chrome)? What is the workaround to place the jpg image

Node.js (sails.js) wysiwyg editor - images

旧街凉风 提交于 2019-11-29 15:04:12
问题 Is there a way to use any WYSIWYG/html editor in the sails app? I can't find any manuals to do that. Seems like Mercury is well-supported in Node but I can't find a way to adapt sails for it either. :( Please guide me OK now, it turned up to be easy to connect TinyMCE (just as easy as described on http://www.tinymce.com/wiki.php/Installation ). So now another major question comes out: is there any Node.js connector to any editor for uploading images and stuff? Or just how can I allow user to

Javascript - Change font color of certain text in textarea

拜拜、爱过 提交于 2019-11-29 14:19:08
问题 Is there any JS function that can change the color of certain text in a textarea? For example, blar blar {blar} blar, {blar}, including { }, will be in blue. Other words will be in blank. In other words, all I need is a function that can change color of all text in { }. I've done some studies and it seems that most people say it can't be done. But I'm seeing rich text editors or those wysiwyg editors having the ability to bold or underline words. There must be a way to do it. Any suggestion

Add linebreak to textContent or innerText only - in Chrome

戏子无情 提交于 2019-11-29 13:54:18
问题 This is a complicated one! Im working with contentEditable in Chrome and I'm experiencing a head melting problem. When I press the return key, Chrome inserts a new div into the innerHTML. This is fine and dandy. The problem is that the line break is nowhere to be found in the div's textContent. I really need to figure out a way to add the line break to the textContent in the same place as the div break in the innerHTML. Any Ideas? UPDATE: I can use innerText but then line breaks that are

How to get number of rows in ContentEditable area and current caret line position?

北慕城南 提交于 2019-11-29 10:50:11
my question has two parts, but they are related. Firstly - I have Contenteditable DIV with some text and I need to get total number of rows (lines) of this DIV. Is it possible ? Secondly - I need to get caret row position, if it is on row number 1, 2, 3, etc.... Can anybody help ? The direct answer is that there is no method that actually gets you those numbers. However, there are a number of different work arounds which you can apply to estimate (I use estimate , because I don't think they can be made 100% accurate) those values. To answer your first question, how to get the number of lines

Contenteditable paragraph tag on enter

大憨熊 提交于 2019-11-29 07:21:32
问题 I was wondering if there is an acceptable way to force all major browsers to insert paragraph tag instead of the default tag that they insert on pressing enter key when contentEditable is true. As far as I know IE inserts p automatically. But Google Chrome inserts div tag and Firefox inserts br (WTF?!). Thanks in advance! 回答1: you can use document.execCommand('formatBlock', false, 'p'); in event like keypress or keydown , etc. to use paragraphs after enter press. For example: element

load wordpress wp_editor dynamically (ajax)

岁酱吖の 提交于 2019-11-29 02:38:05
This is an answer/solution rather than a question, still there maybe some bugs, even I tried on my dev env. I recently try to use wp_editor in widget/menu, after some search, I did not find a complete solution as I want. I would share my solution in below after I dig into wp's code by hours: There maybe hacking involved, however, I tried to minimize them. To make wp_editor can work in dynamic html (which means without reload page, js changes the page structure), there are two major issues need to take care: tinymce qucik-tags For [tinymce]: a. need reset UI properly solution is [remove mce

WYSIWYG image uploads in Rails App

两盒软妹~` 提交于 2019-11-28 23:45:58
Can anyone recommend a way of creating a view where users can upload images to my app through a WYSIWYG editor? I've tried solving this using CK Editor and Paperclip but am having lots of trouble... Maybe I'm going about this the wrong way. If someone's done this before I'd really like to know how! I don't have a editor or file storage mechanism preference so fire away... This is all dependent on the WYSIWYG's file upload API. From there, just build an ImagesController to handle requests from that API, use whatever system (Paperclip is good) to handle those files internally, and you should be