Closed Bug 953580 Opened 8 years ago Closed 8 years ago

[chat] Handle double click on someone in the nicklist

Categories

(Instantbird :: Conversation, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: romain, Assigned: bugzilla)

Details

Attachments

(1 file, 2 obsolete files)

*** Original post on bio 133 at 2008-09-29 00:59:00 UTC ***

Double click on someone on the nicklist (IRC, Jabber ...) should open a new tab and a conversation with that person.

Maybe the same thing for MSN chat (how does is it handled in Instantbird ?)
*** Original post on bio 133 as attmnt 114 by goulagman AT instantbird.org at 2008-10-08 10:34:00 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8351858 - Flags: review?
Assignee: nobody → bugzilla
Status: NEW → ASSIGNED
Comment on attachment 8351858 [details] [diff] [review]
Handle double click on nicklist to open a new conversation. Handle also return keypress.

*** Original change on bio 133 attmnt 114 at 2008-10-08 11:24:59 UTC ***

>diff -r a0daff44a06f instantbird/base/content/instantbird/conversation.xml

>-            <xul:listbox flex="1" anonid="nicklist"/>
>+            <xul:listbox flex="1" anonid="nicklist" ondblclick="onNickActivate(event);" onkeypress="onNickActivate(event);"/>

Please wrap this long line.

>+
>+       var nicklist = document.getAnonymousElementByAttribute(this, "anonid", "nicklist");
>+       nicklist.setAttribute("seltype", "multiple"); // FIXME : do we really want that?

This sounds like you wanted to write the attribute directly on the XML tag ;)

>+     <method name="onNickActivate">
>+      <parameter name="event"/>
>+      <body>
>+      <![CDATA[
>+        if (event.keyCode) {
>+          if (event.keyCode != 13)
>+            return;
>+
>+          // Return is pressed
>+
>+          var conv = this;
>+          if (this.localName != "conversation")
>+            conv = document.getBindingParent(this);
>+          listbox = event.originalTarget;
>+          for (var i = 0; i < listbox.selectedCount; ++i)
>+            conv._conv.account.createConversation(listbox.getSelectedItem(i).label);
>+          }
>+        else {
>+          // This is a double click
>+          var nick = event.originalTarget.label;
>+          this._conv.account.createConversation(nick);
>+        }
>+      ]]>
>+      </body>
>+     </method>
>+

Why not creating another method, rather than putting 2 different methods in the same one with a test at the begining to separate them...
Attachment #8351858 - Flags: review? → review-
Attached patch Patch V2 (obsolete) — Splinter Review
*** Original post on bio 133 as attmnt 115 by goulagman AT instantbird.org at 2008-10-08 11:29:00 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8351859 - Flags: review?
Comment on attachment 8351859 [details] [diff] [review]
Patch V2

*** Original change on bio 133 attmnt 115 at 2008-10-08 11:30:01 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8351859 - Attachment is patch: true
Attachment #8351859 - Attachment mime type: application/octet-stream → text/plain
Attached patch patch V3Splinter Review
*** Original post on bio 133 as attmnt 116 by goulagman AT instantbird.org at 2008-10-08 12:52:00 UTC was without comment, so any subsequent comment numbers will be shifted ***
Comment on attachment 8351858 [details] [diff] [review]
Handle double click on nicklist to open a new conversation. Handle also return keypress.

*** Original change on bio 133 attmnt 114 by goulagman AT instantbird.org at 2008-10-08 12:52:54 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8351858 - Attachment is obsolete: true
Comment on attachment 8351859 [details] [diff] [review]
Patch V2

*** Original change on bio 133 attmnt 115 by goulagman AT instantbird.org at 2008-10-08 12:52:54 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8351859 - Attachment is obsolete: true
Attachment #8351859 - Flags: review?
Comment on attachment 8351860 [details] [diff] [review]
patch V3

*** Original change on bio 133 attmnt 116 at 2008-10-08 13:44:19 UTC ***

r=me, pushed as 400:347ada91717b.
Attachment #8351860 - Flags: review+
*** Original change on bio 133 at 2008-10-08 13:45:01 UTC was without comment, so any subsequent comment numbers will be shifted ***
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
*** Original post on bio 133 at 2008-10-09 12:53:19 UTC ***

Comment on attachment 8351860 [details] [diff] [review] (bio-attmnt 116)
patch V3

>diff -r 860848d976e0 instantbird/base/content/instantbird/conversation.xml

>-            <xul:listbox flex="1" class="conv-nicklist" anonid="nicklist"/>
>+            <xul:listbox flex="1" anonid="nicklist" seltype="multiple"
>+                         ondblclick="onNickDblClick(event);"
>+                         onkeypress="onNicklistKeyPress(event);"/>

Ahem... where did class="conv-nicklist" go? :-(
You need to log in before you can comment on or make changes to this bug.