Closed Bug 332588 Opened 14 years ago Closed 13 years ago
Dropping link in single line input opens multiline input
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.
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)
Waaa, that's horrible. What happens if you do data.getTransferData on the URL type? Does that give you anything?
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.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+
// 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
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.