Closed Bug 953575 Opened 10 years ago Closed 10 years ago

Shift + Page up / Page down keys should scroll the conversation history.

Categories

(Instantbird Graveyard :: Conversation, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: romain, Assigned: romain)

Details

Attachments

(1 file, 1 obsolete file)

*** Original post on bio 129 at 2008-09-25 23:11:00 UTC ***

while the text area (where you type your messages) is focused, Page Up and Page Down should scroll the conversation above.
Attached patch patch (obsolete) — Splinter Review
*** Original post on bio 129 as attmnt 106 at 2008-09-28 00:00:00 UTC ***

Tested on a fresh build, work with Shift + Page_up, Shift + Page_down, it scrolls the browser without selecting anything (preventing default behavior).

I also changed the methods' name, because these methods are not designed to only send messages, but to handle keyPress in general.
Attachment #8351850 - Flags: review?
Assignee: nobody → romain
Status: NEW → ASSIGNED
*** Original post on bio 129 at 2008-09-28 09:43:09 UTC ***

Comment on attachment 8351850 [details] [diff] [review] (bio-attmnt 106)
patch

>diff -r 76b739e38df9 instantbird/base/content/instantbird/conversation.xml

>-     <method name="onSendMsg">
>+     <method name="inputKeyPress">
>       <parameter name="event"/>
>       <body>
>       <![CDATA[
>-        if (event.keyCode != 13)
>-          return;

Why did you have to move this?

>         /* "this" can point to the textbox when this method is used by an eventListener,
>-            get the conversation element */
>+        get the conversation element */

This was alright, you don't need to change it.

>+          let direction = (event.keyCode == KeyEvent.DOM_VK_PAGE_UP)?-1:1;
                                                                     ) ? -1 : 1;

>+          let browser = conv.browser;
>+          browser.docShell.QueryInterface(Components.interfaces.nsITextScroll)
>+                 .scrollByPages(direction);

If the 'browser' variable is used only once, you can do:

 conv.browser.docShell
     .QueryInterface(...)
     .scrollByPage(direction);
*** Original post on bio 129 at 2008-09-28 11:46:27 UTC ***

(In reply to comment #2)
> (From update of attachment 8351850 [details] [diff] [review] (bio-attmnt 106) [details])
> >diff -r 76b739e38df9 instantbird/base/content/instantbird/conversation.xml
> 
> >-     <method name="onSendMsg">
> >+     <method name="inputKeyPress">
> >       <parameter name="event"/>
> >       <body>
> >       <![CDATA[
> >-        if (event.keyCode != 13)
> >-          return;
> 
> Why did you have to move this?

Ok, ignore this comment. I read too quickly and didn't see the != operator :(.
Attached patch patch v2Splinter Review
*** Original post on bio 129 as attmnt 109 at 2008-09-28 13:31:00 UTC ***

Fixed that things.
Attachment #8351853 - Flags: review?
Comment on attachment 8351850 [details] [diff] [review]
patch

*** Original change on bio 129 attmnt 106 at 2008-09-28 13:31:55 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8351850 - Attachment is obsolete: true
Attachment #8351850 - Flags: review?
Comment on attachment 8351853 [details] [diff] [review]
patch v2

*** Original change on bio 129 attmnt 109 at 2008-09-28 22:22:51 UTC ***

Pushed as 370:6567b7f5f52d.

>diff -r 76b739e38df9 instantbird/base/content/instantbird/conversation.xml

>+          let direction = (event.keyCode == KeyEvent.DOM_VK_PAGE_UP) ? -1 : 1 ;

I removed the last space before ';' on this line before pushing the patch.
Attachment #8351853 - Flags: review? → review+
*** Original change on bio 129 at 2008-09-28 22:24:32 UTC was without comment, so any subsequent comment numbers will be shifted ***
Severity: minor → enhancement
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Summary: Page up and Page down keys should work on conversation → Shift + Page up / Page down keys should scroll the conversation history.
Target Milestone: --- → 0.1.3
You need to log in before you can comment on or make changes to this bug.