View Full Version : Help me test this please
beetle
03-17-2003, 08:02 PM
I'm creating a new widgety thing here (http://www.peterbailey.net/test/taeditor.htm)
It is intended for version 5+ browsers. I only have IE 5 and 6 and Mozilla 1.2.1, all on a Windows PC.
Now, I know the wrapping tags aren't working in Mozilla. I found this (http://www.massless.org/mozedit/) but I'm not really happy with it. I'm hoping to get some help from a DOM2 Range (http://www.mozilla.org/docs/dom/domref/dom_range_ref.html#998975) expert (jkd, this means you), however, I will be studying the spec myself in the meantime, as this is more than just a hobby project.
It's not nearly finished, but wanted to get some early impressions and do some preliminary testing.
Anyone else with different browser, (IE Mac, Safari, Opera, etc) please feel free to give this sucker a run for the money and let me know (be sure to say which browser AND version plz!).
Thanks.
Roy Sinclair
03-17-2003, 08:16 PM
When I hit the :) button in the html version it cleared everything else I'd put into the box.
Edit: Added per request below, IE 6 on W2K.
scroots
03-17-2003, 08:28 PM
it looks great in opera 6, nice job.
at the top there is
Testing the TAEditor class.
Purpose
Give web-developers an easy interface for creating textarea editing widgets for forums, CMSs, et al.
then a large textbox
a horizontal line
then another large textbox
scroots
brothercake
03-17-2003, 08:34 PM
Good stuff :)
But in Safari, all the buttons are text-boxes, and don't do anything when you click them ... except for the smiley
beetle
03-17-2003, 08:35 PM
would either of you fine chaps care to let me know which browser and version you are using? :rolleyes: (not you, brothercake)
BTW, all the widget buttons are added with javascript, which is object-detected by document.createElement. If the browser doesn't support that, then the script is aborted, degrading and leaving you with a plain, regular textarea.
beetle
03-17-2003, 08:40 PM
Originally posted by brothercake
Good stuff :)
But in Safari, all the buttons are text-boxes, and don't do anything when you click them ... except for the smiley Hmm, hopefully my forthcoming DOM2 Range solution will work with KHTML as well. I'll have to do some reading.
I wonder why the input types aren't being set as "button". Perhaps I need to use elem.setAttribute( "type", "button" ) instead of elem.type = "button" ??
brothercake
03-17-2003, 09:04 PM
Originally posted by beetle
Perhaps I need to use elem.setAttribute( "type", "button" ) instead of elem.type = "button" ??
Yeah I think so - I don't know this for a fact, but I always assume that created elements have no implicit attributes.
The last I tried it, this:
obj.setAttribute("attr","value");
doesn't work in IE; while this:
obj.setAttribute("attr");
obj.attr = "value";
throws an error in moz (as it should); so you have to go like this:
obj.setAttribute("attr","");
obj.attr = "value";
:rolleyes:
beetle
03-17-2003, 09:29 PM
Updated. Please check it again, brothercake =)
beetle
03-17-2003, 09:30 PM
Originally posted by Roy Sinclair
When I hit the :) button in the html version it cleared everything else I'd put into the box.
Edit: Added per request below, IE 6 on W2K. Okay I think I've fixed this. Check it again if you have time. Thx.
Roy Sinclair
03-17-2003, 09:35 PM
It works better, as long as it's not nested inside another tag it's fine but once it's nested it resets the form. This time I also noticed there's an extra line break added every time I close a <div>.
I was pleasantly surprised that you checked for invalid nesting of tags :thumbsup: .
beetle
03-17-2003, 09:44 PM
The DIV button is setup as a 'block' tag, so that it purposely creates those line breaks. I suppose I should have mentioned that :D
Sorry to bug you about this Roy, but I have IE6 as well, and I can't seem to duplicate that behavior. If you don't mind, could you give me a step-by-step of what you're doing to produce that error?
Such as
1) click on textarea
2) type 'hello '
3) click 'B' button to open bold
4) type 'world'
5) click smiley <-- this is where error occurs
I really don't get an error here, but I think you understand the specifity that I need to figure this out.
Thanks.
Roy Sinclair
03-17-2003, 10:03 PM
Steps:
1. Click on link
2. Click on Header button
3. Click on emoticon button
4. Click on Header button
5. Click on Header button
6. Click on emoticon button -- field clears
Does that help?
Additional info, in case it's relevant:
IE 6.0.2800.1106CO
Update Versions:; SP1; Q328970;Q324929;Q810847;Q813951
beetle
03-17-2003, 10:20 PM
Odd. Of course, I don't have SP1 installed ATM.
Can anyone else corroborate Roy's findings?
Thanks Roy :thumbsup:
brothercake
03-17-2003, 11:45 PM
Originally posted by beetle
Updated. Please check it again, brothercake =)
They're buttons now ... but they're all the same and take no value. So I changed this:
button.setAttribute( 'value', '' );
button.value = " " + ( label || txt ).toUpperCase() + " ";
But they still don't do anything when you push them.
The event is handled because this much gets a response:
if ( wrapper )
button.onclick = function() { alert(""); }
But it doesn't work after that.
I tried it in moz as well, and it's the same. Safari doesn't have a JS console, but moz has the error "document.selection has no properties"
I tested mac/ie5 as well; unfortunately it throws an error over button.setAttribute
Roy Sinclair
03-18-2003, 03:19 AM
Tested it at home too, it works properly there. XP and IE 6.0.2800.xpsp1.020828-1920
A1ien51
03-18-2003, 07:16 AM
I looked at it in IE5.5 and Netscape 6.01 and got no errors.
Just a suggestion or two, might want to make the buttons a set size so they do not jump around when clicked. Might want to put a close all tag button like the forum has too.
A1ien51
Roy Sinclair
03-18-2003, 02:18 PM
Congratulations, you must have found the problem, it's working for me today on the same system where it failed yesterday.
beetle
03-18-2003, 02:45 PM
Originally posted by Roy Sinclair
Congratulations, you must have found the problem, it's working for me today on the same system where it failed yesterday. Uhhh. ya. I sure did. ;)
*shrugs* :p
No W3C spec deals with obtaining user selections, and offsets of the selections.
Since it seems you are trying to simply wrap text in tags, you can only go a proprietary route.
See this for a Mozilla thing I did a while ago:
http://www.codingforums.com/showthread.php?s=&threadid=12235
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.