473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Textarea HTML editor compatible with Opera

Hi folks,

I am desperatly looking for a WYSIWYG HTML editor for a textarea, using JavaScript and that'll work
with Opera.
I want this editor to use for a webmail program in PHP, and allow users to send HTML email.
All HTML editors I found out on the web work for most browsers except Opera.
Does any of you guys know of an Opera-friendly editor?
That would be great...
Thanks,

--
Charles.
Jul 20 '05 #1
2 5191
Charles wrote:
I am desperatly looking for a WYSIWYG HTML editor for a textarea, using JavaScript and that'll work
with Opera.
Generally, two techniques can be used to design such editors:
- "design mode" model,
- selection/transformation model, using text ranges.

AFAIK, only IE supports these two methods (although Mozilla may have
included some, I'm late in my browser testing), so unfortunately I don't
think you'll find the kind of editor you're looking for working on Opera.
I want this editor to use for a webmail program in PHP, and allow users to send HTML email.


Well, you could let them write custom-HTML and offer them a preview area
(Opera 7+ does support innerHTML and DOM methods) eg something like
(slightly tested only, but you see the point):
<form action="foo" onsubmit="return false">
<textarea name="editArea"></textarea>
<input type="button"
onclick="p(this.form.elements['editArea'].value);"
value="Preview">
</form>

<div id="previewArea"></div>

<script type="text/javascript">
function p(s){
// we only accept B, I, A tags
// a tag is defined as [T]content[/T]
// or [A href="foo"]content[/A]
var re = /\[([abi])(\s+href="[^"]+")?\](.*?)\[\/\1\]/ig;
s=s.replace(/</g,"&lt;").replace(/>/g,"&gt;");
s=s.replace(re, function(a, b, c, d) {
c = c || "";
if (d) d = d.replace(re, arguments.callee);
return "<" + b + c + ">" + d +"<\/" + b + ">";
});
document.getElementById("previewArea").innerHTML=s ;
}
</script>
Good luck,
Yep.

Jul 20 '05 #2
Thanks ;-)

--
Charles.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hal Halloway | last post by:
I want a text editor inside a form's textarea, So I would see html markup and html entities - just like a text editor. I also would want to be able to edit it all just like a text editor - this...
4
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
2
by: Mark Szlazak | last post by:
The following code fails in Firefox to get at selected text in the right-side textarea. Any help would be appreciated. <html> <head> <script> var agt = navigator.userAgent.toLowerCase();...
1
by: Nic | last post by:
Hi - I am battling to find the a resource, so maybe some one in here can help The problem is as follows: I am trying to build a mod_perl source code editor for the web - to edit Perl source code...
3
by: Fluffy Convict | last post by:
I am trying to write a script that changes a textarea wrap realtime, basically like you can switch to and from "wordwrap" in Microsofts Notepad. Because of a bug...
5
by: bwucke | last post by:
Is there any way to scroll textarea (to the bottom row) from Javascript in Opera? The textarea.scrollTop=textarea.scrollHeight+textarea.scrollTop; approach doesn't work, and there's so many...
0
by: lawrenceS59 | last post by:
Hi all, I'm fairly new to web development so bare with me. The html page that i've created isn't working and i can't figure out why. I'm guessing there are some rules that need to be followed...
3
kendall
by: kendall | last post by:
I'm currently working on a PHP CMS for my school that uses simple forms to update the pages and database. To get it out in use, it will have to be usable by people who don't know that is bold, and...
2
by: olddocks | last post by:
i am planning on kind of editor by replacing the textarea with iframe so that i could edit the content with rich html. I am facing weird problem and i cannot set the value of iframe innerHTML with...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.