Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2006-03-14 14:37:35

WebPrgmer
New member
Registered: 2006-03-14
Posts: 8

Buttons Drag and Drop

Hi

I just installed Xinha and it is working perfectly fine.

However, when I click on a button, say the Bold button, and drag and drop it on the textarea, I can see a grid of all the images appear on the textarea. Is there anyway I can prevent this from happening? You can see this happening on the demo page too..

Any input is really appreciated,
Thanks a lot
WebPrgmer.

Last edited by WebPrgmer (2006-03-14 14:44:42)

Offline

#2 2006-03-14 15:01:57

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Buttons Drag and Drop

If that's your biggest problem, congratulations!

Offline

#3 2006-03-14 15:19:16

WebPrgmer
New member
Registered: 2006-03-14
Posts: 8

Re: Buttons Drag and Drop

smile Is there a way to prevent that from happening?

Offline

#4 2006-03-15 10:59:02

mokhet
Xinha Authority
From: Paris, France
Registered: 2005-04-03
Posts: 105
Website

Re: Buttons Drag and Drop

Prevent what to happen ?

Prevent the whole image to appear and have only the image of the button ?

I'm afraid i dont think you can prevent it.

Prevent the drag & drop from the toolbar ?

That can be done i think by tweaking a bit the mousedown, mousemove and mouseup events on the icons.

What do you want to prevent ?

Offline

#5 2006-03-15 14:09:19

WebPrgmer
New member
Registered: 2006-03-14
Posts: 8

Re: Buttons Drag and Drop

Hi mokhet,

Heres wht I meant:

When I click on a button, say the Bold or the Italic button, and drag and drop it on the textarea (i.e. click from toolbar - drag - drop to textarea),  I can see a grid of all the images appear on the textarea. Is there anyway I can prevent this from happening? You can see this happening on the demo page too..

Thanks,
WebPrgmer.

Offline

#6 2006-03-15 21:21:07

mokhet
Xinha Authority
From: Paris, France
Registered: 2005-04-03
Posts: 105
Website

Re: Buttons Drag and Drop

Lol, a cut and paste of your first post doesnt help to understand what you want to prevent happening.

So I ask again... What do you want to prevent ? Please dont cut/paste again.

In your question, try to not use the word "this", please explain !!!

Is there anyway I can prevent this from happening?

What is "this" ? What do you think should happen when you drag & drop an icon from the toolbar ? Why the hell would someone drag & drop thoses icons anyway. What do you want to be accomplished while drag & dropping ?

Your next message will be my last attempt to understand your problem. Please explain !

Offline

#7 2006-03-16 17:39:08

WebPrgmer
New member
Registered: 2006-03-14
Posts: 8

Re: Buttons Drag and Drop

Hey Moket,

I am so sorry for makin it so confusing...

Well I want to prevent the image grid from being shown on the textarea when we do a drag and drop. I do not want anything to show when someone does a drag and drop from the toolbar to the textarea. In other words, I do not want anything to be accomplished while dragging and dropping the icons.

And you are right, I dont think anyone would drag and drop those icons anyway. I never did it myself till one of the users pointed it out to me.

I sure hope I was more clear this time,

Thanks again
WebPrgmer.

Offline

#8 2006-03-17 02:24:11

mokhet
Xinha Authority
From: Paris, France
Registered: 2005-04-03
Posts: 105
Website

Re: Buttons Drag and Drop

Ah, thank for explaining what was "this" big_smile

I cant reproduce the issue with Firefox 1.5, but I of course see the problem with IE6.

Try this patch, it solves the problem on my side.

Index: htmlarea.js
===================================================================
--- htmlarea.js    (revision 471)
+++ htmlarea.js    (working copy)
@@ -1031,6 +1031,13 @@
         }
       });
 
+      // when we drag the icon, cancel the ondrag event
+      // IE only
+      if (HTMLArea.is_ie)
+      {
+        el.ondrag = function() { return false; };
+      }
+
       var i_contain = HTMLArea.makeBtnImg(btn[1]);
       var img = i_contain.firstChild;
       el.appendChild(i_contain);

Offline

#9 2006-03-17 02:55:54

mokhet
Xinha Authority
From: Paris, France
Registered: 2005-04-03
Posts: 105
Website

Re: Buttons Drag and Drop

Wonder if I should commit this patch. Seems like something that's need to be in official release imo.

Offline

#10 2006-03-17 12:21:40

WebPrgmer
New member
Registered: 2006-03-14
Posts: 8

Re: Buttons Drag and Drop

Hi Mokhet

Thanks a lot for the patch. "That" sure solved the problems with "This".. big_smile

Offline

#11 2006-03-18 07:35:31

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Buttons Drag and Drop

That looks to me like something that really should be committed.

You could think of the user's ability to drag the toolbar main image into the editor along the lines of say, clicking outside the editor and then pasting HTML above the editor when a plugin hasn't implemented a line that focuses the editor first. For plugins this very undesirable result should be prevented by editor.focusEditor(), even though it is caused by the user clicking the page outside the editor after launching a plugin but before using the plugin. A simple line of code saves the users from themselves, and they can't point to their inserted content on the page above the editor and say "Hah! I broke it!" or "Oh crap, why did it do that? What a piece of junk. Ethel, come over here and look at what this silly thing just did!"

Likewise, Xinha currently allows the user to preform the goofy action of dragging the toolbar main image into the editor. Certainly it might be desirable that someone be able to drag an image from a webpage into the editor, but the toolbar image is part of the "software" and you should theoretically not be able to drag it into the editor any more than you can drag the Microsoft Word toolbar into a Word doc. I guess that at some point, unfortunately, not preventing the user from being able to do something like this is "bad GUI usability"  if there is indeed a simple known way to prevent it from happening (i.e. prevent the user from being able to turn the XINHA GUI into content in the editor itself).

The difference of course between this and inserting content above the editor is that I can't imagine someone doing this by accident. This patch would make the editor be more bullet-proof against anyone evaluating if their users would have problems using XINHA.

Offline

#12 2006-03-19 21:33:32

mokhet
Xinha Authority
From: Paris, France
Registered: 2005-04-03
Posts: 105
Website

Re: Buttons Drag and Drop

patch commited in changeset :474

Offline

Board footer

Powered by FluxBB