Dropping link in single line input opens multiline input

RESOLVED FIXED

Status

Other Applications
ChatZilla
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Rob Marshall [tH], Assigned: Gijs)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [cz-0.9.78])

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
text/x-moz-url data (URL\nTitle) dropped into the single line input box used to just lose the title, which was okay. The drop handler (bug 307774) handles both lines as-is, which is annoying.

It should either discard the title, or arrange the URL and title on one line to avoid opening the multiline box.
(Assignee)

Comment 1

11 years ago
Created attachment 246029 [details] [diff] [review]
Hacky patch

I don't like this patch very much. I don't think we can do anything better, because the transferrable is sucky that way and will not tell us it also supports x-moz-url. That is, if you ask it to enumerate all the flavours, it magically forgot about x-moz-url, at least in my testing. In other words, we're kind of screwed, hence the hack. Fortunately this also seems to work just fine :-)
Assignee: rdmsoft → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Attachment #246029 - Flags: review?(silver)

Comment 2

11 years ago
Waaa, that's horrible. What happens if you do data.getTransferData on the URL type? Does that give you anything?

Comment 3

11 years ago
Comment on attachment 246029 [details] [diff] [review]
Hacky patch

>Index: mozilla/extensions/irc/xul/content/handlers.js
>+    var lines = str.value.data.split("\n");
>+    var m = lines[0].match(client.linkRE);

Please add a giant XXX comment here about the transferable not having the special URL type and that this is a hack.

r=silver with that added.
Attachment #246029 - Flags: review?(silver) → review+
(Assignee)

Comment 4

11 years ago
    // XXX part of what follows is a very ugly hack to make links (with a title)
    // not open the multiline box. We 'should' be able to ask the transferable
    // what flavours it supports, but testing showed that by the time we can ask
    // for that info, it's forgotten about everything apart from text/unicode.

Checking in mozilla/extensions/irc/xul/content/handlers.js;
/cvsroot/mozilla/extensions/irc/xul/content/handlers.js,v  <--  handlers.js
new revision: 1.140; previous revision: 1.139
done
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED

Updated

11 years ago
Whiteboard: [cz-0.9.78]
You need to log in before you can comment on or make changes to this bug.